Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

在swoft使用方式3来验证会出现报错。 #5

Closed
phper666 opened this issue Jan 9, 2019 · 2 comments · Fixed by #6
Closed

在swoft使用方式3来验证会出现报错。 #5

phper666 opened this issue Jan 9, 2019 · 2 comments · Fixed by #6
Labels

Comments

@phper666
Copy link

phper666 commented Jan 9, 2019

PHP Fatal error: Uncaught Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@Date" in method Inhere\Validate\AbstractValidation::getMessage() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54
Stack trace:
#0 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(727): Doctrine\Common\Annotations\AnnotationException::semanticalError('The annotation ...')
#1 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(663): Doctrine\Common\Annotations\DocParser->Annotation()
#2 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(354): Doctrine\Common\Annotations\DocParser->Annotations()
#3 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(286): Doctrine\ in /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php on line 54

PHP Fatal error: Uncaught Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@from" in method Inhere\Validate\AbstractValidation::requiredIf() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54
Stack trace:
#0 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(727): Doctrine\Common\Annotations\AnnotationException::semanticalError('The annotation ...')
#1 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(663): Doctrine\Common\Annotations\DocParser->Annotation()
#2 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(354): Doctrine\Common\Annotations\DocParser->Annotations()
#3 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(286): Doctrine\ in /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php on line 54

PHP Fatal error: Uncaught Doctrine\Common\Annotations\AnnotationException: [Semantical Error] The annotation "@from" in method Inhere\Validate\AbstractValidation::requiredWithoutAll() was never imported. Did you maybe forget to add a "use" statement for this annotation? in /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php:54
Stack trace:
#0 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(727): Doctrine\Common\Annotations\AnnotationException::semanticalError('The annotation ...')
#1 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(663): Doctrine\Common\Annotations\DocParser->Annotation()
#2 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/DocParser.php(354): Doctrine\Common\Annotations\DocParser->Annotations()
#3 /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationReader.php(286): D in /usr/local/src/swoft-admin/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationException.php on line 54

以上报错是因为注解的原因。
在php-validate/src/Utils/ErrorMessageTrait.php 的379行代码 @Date 有问题。目前我删除了@就不会报错
在php-validate/src/Utils/UserAndContextValidatorsTrait.php 的159、267行代码@from有问题。删除@就不会报错。
这个是否已经跟注解的关键字有冲突,希望能排查下

@inhere inhere added the question label Jan 9, 2019
@inhere
Copy link
Owner

inhere commented Jan 9, 2019

好的 我看下, 我去除这两个注释

@phper666
Copy link
Author

phper666 commented Jan 9, 2019

好的

@phper666 phper666 closed this as completed Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants