swoft-cloud / swoft-cli

🛠️ Command line tool for quick use swoft. Support create new application, generate class, hot reload server and more.
https://www.swoft.org/docs
Apache License 2.0
47 stars 17 forks source link

[Semantical Error] Annotation was never imported #23

Open Ahmard opened 3 years ago

Ahmard commented 3 years ago

Doctrine\Common\Annotations\AnnotationException(code:0) [Semantical Error] The annotation "@AnnotationParser" in class Swoft\Validator\Annotation\Parser\AfterDateParser was never imported. Did you maybe forget to add a "use" statement for this annotation?

Screenshot from 2020-12-06 02-31-58

Ahmard commented 3 years ago

I am using PHP 8.0

digloong commented 2 years ago

Did this issue solved? I got the same issue.

msankhala commented 2 years ago

This issue is with php 8. Switching to PHP7.4 resolves this issue.

nullllll1 commented 1 year ago

same issue: Doctrine\Common\Annotations\AnnotationException(code:0) [Semantical Error] The annotation "@AnnotationParser" in class Swoft\Validator\Annotation\Parser\AfterDateParser was never imported env: php8.1.7 SERVER INFORMATION(v2.0.11)

solution: git clone https://github.com/swoft-cloud/swoft-cli cd swoft-cli composer install

构建

php -d phar.readonly=0 ./bin/swoftcli phar:pack -o=swoftcli.phar

build swoftcli.phar version: 0.1.6 (maybe others better)

git branch: master, commited: bfd4cfb6dd40bb4a2c65ee7e7e5223dec253e9a4

compatibility:It works,But some errors

截屏2023-02-24 17 05 35的副本