-
-
Notifications
You must be signed in to change notification settings - Fork 177
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
TypeError with Slevomat Coding Standard version 8.11.1 and PHP 8.2 #1566
Comments
Can you please post yout code that throws this error? |
I added this in phpcs.xml
and run this
|
Try please verbose mode in PHPCS and find the file (and then the specific code) that throws the error. |
File: laravel.phpcs.xml <?xml version="1.0" encoding="UTF-8"?>
<ruleset name="laravel-php-code-style" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="vendor/squizlabs/php_codesniffer/phpcs.xsd">
<description>Laravel PHP Code Style preset</description>
<rule ref="SlevomatCodingStandard.TypeHints.NullTypeHintOnLastPosition"/>
<exclude-pattern>*\.blade\.php$</exclude-pattern>
</ruleset>
Command: Error:
|
@dealense7 I need the specific doc comment in your sources that throws this error. |
No Error: <?php
declare(strict_types=1);
return [
/** @var array */
'exclude_groups' => [],
]; Error: <?php
declare(strict_types=1);
return [
/** @type array */
'exclude_groups' => [],
]; |
It the annotation |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am using the Slevomat Coding Standard version 8.11.1 with PHP 8.2 and I am encountering a TypeError. Specifically, I receive the following error message:
"
..PHP Fatal error: Uncaught TypeError: SlevomatCodingStandard\Helpers\Annotation\TypeAliasAnnotation::__construct(): Argument #5 ($contentNode) must be of type ?PHPStan\PhpDocParser\Ast\PhpDoc\TypeAliasTagValueNode, PHPStan\PhpDocParser\Ast\PhpDoc\GenericTagValueNode given, called in /home/houston/Documents/project/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/AnnotationHelper.php on line 359 and defined in /home/houston/Documents/project/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/Annotation/TypeAliasAnnotation.php:21
"
I have reviewed the code that calls the constructor method for the TypeAliasAnnotation class and confirmed that the fifth argument, $contentNode, is of the correct type ?PHPStan\PhpDocParser\Ast\PhpDoc\TypeAliasTagValueNode
The text was updated successfully, but these errors were encountered: