think-annotation icon indicating copy to clipboard operation
think-annotation copied to clipboard

ThinkPHP6注解

Results 10 think-annotation issues
Sort by recently updated
recently updated
newest added

![image](https://github.com/top-think/think-annotation/assets/16585169/ee3d440b-4123-4021-aa71-b64a22aca295) ![image](https://github.com/top-think/think-annotation/assets/16585169/b07a2eb5-19c4-4865-aa0f-5b61c5a5ca14)

https://github.com/top-think/think-annotation/blob/293dae6f2d7bdb6fed1a89babe176f6059738ccf/src/InteractsWithInject.php#L51 需要注意的是,如果两个数组中存在相同的键名,那么“+”符号运算符会忽略掉第二个数组中的元素 在config中新增的配置是无法生效的

#[Inject] protected Cache $cache; public function index() { //... } 这一块在tp8使用会报错 ![image](https://github.com/top-think/think-annotation/assets/17736664/d9e9e027-3380-4c35-a07d-0f1ba9307b23) ![image](https://github.com/top-think/think-annotation/assets/17736664/2b8f2d75-6b6d-4c8e-a9d1-e3ccbf04d85c)

![1681876854064](https://user-images.githubusercontent.com/48248080/232963774-d04b50f4-7404-419b-81ee-cf0772320adf.png) InteractsWithRoute.php文件第91行在路径中只替换了/,在windows系统中文件分隔符是\,因而导致无法在windows上使用注解路由 解决方案: `str_replace('/', '.', $filename)` 替换为 `str_replace(DIRECTORY_SEPARATOR, '.', $filename)`

如题,如果项目全部用注解,其中一个地方注解出错就会影响整个项目,排错工作量大,可否完善错误提示或者忽略错误

Typed property app\internal\controller\HomeController::$homeService must not be accessed before initialization

![Image](https://github.com/user-attachments/assets/b29f2b33-0ee6-442e-b942-09af4803d6d7) ![Image](https://github.com/user-attachments/assets/14129fcc-171e-431a-bef9-114b1e24962c) 路由映射为 /core/System/userInfo时 可以使用 ![Image](https://github.com/user-attachments/assets/e93f3591-a5be-40f4-b19f-453e35dcdd55) 这个位置可能需要兼容下windows场景

//控制器 $filename = Str::substr($filename, strlen($this->controllerDir) + 1); $prefix = str_replace($this->controllerSuffix . '.php', '', str_replace(DIRECTORY_SEPARATOR, '.', $filename));

return [ 'inject' => [ 'enable' => true, 'namespaces' => [], ], 'route' => [ 'enable' => true, 'cache' => !extension_loaded('swoole'), // Swoole环境下禁用缓存 'controllers' => [ app_path('controller/api') => [ 'name'...