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

What i do wrong? #1696

Open
hackimov opened this issue Sep 22, 2024 · 2 comments
Open

What i do wrong? #1696

hackimov opened this issue Sep 22, 2024 · 2 comments

Comments

@hackimov
Copy link

vendor/bin/phpcbf --standard=phpcs.dist.xml

FFFFFFFFFFFFFFPHP Fatal error:  Uncaught PHP_CodeSniffer\Exceptions\RuntimeException: Undefined array key "scope_closer" in /var/www/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php on line 238 in /var/www/vendor/squizlabs/php_codesniffer/src/Runner.php:623
Stack trace:
#0 /var/www/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php(238): PHP_CodeSniffer\Runner->handleErrors(2, 'Undefined array...', '/var/www/vendor...', 238)
#1 /var/www/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffLocalCache.php(42): SlevomatCodingStandard\Helpers\UseStatementHelper::SlevomatCodingStandard\Helpers\{closure}()
#2 /var/www/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffLocalCache.php(31): SlevomatCodingStandard\Helpers\SniffLocalCache::setIfNotCached(2, '/var/www/app/Ca...', Object(Closure))
#3 /var/www/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php(259): SlevomatCodingStandard\Helpers\SniffLocalCache::getAndSetIfNotCached(Object(PHP_CodeSniffer\Files\LocalFile), 'useStatementPoi...', Object(Closure))
#4 /var/www/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php(168): SlevomatCodingStandard\Helpers\UseStatementHelper::getUseStatementPointers(Object(PHP_CodeSniffer\Files\LocalFile), 0)
#5 /var/www/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffLocalCache.php(42): SlevomatCodingStandard\Helpers\UseStatementHelper::SlevomatCodingStandard\Helpers\{closure}()
#6 /var/www/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/SniffLocalCache.php(31): SlevomatCodingStandard\Helpers\SniffLocalCache::setIfNotCached(2, '/var/www/app/Ca...', Object(Closure))
#7 /var/www/vendor/slevomat/coding-standard/SlevomatCodingStandard/Helpers/UseStatementHelper.php(202): SlevomatCodingStandard\Helpers\SniffLocalCache::getAndSetIfNotCached(Object(PHP_CodeSniffer\Files\LocalFile), 'useStatements', Object(Closure))
#8 /var/www/vendor/slevomat/coding-standard/SlevomatCodingStandard/Sniffs/Namespaces/AlphabeticallySortedUsesSniff.php(70): SlevomatCodingStandard\Helpers\UseStatementHelper::getFileUseStatements(Object(PHP_CodeSniffer\Files\LocalFile))
#9 /var/www/vendor/squizlabs/php_codesniffer/src/Files/File.php(519): SlevomatCodingStandard\Sniffs\Namespaces\AlphabeticallySortedUsesSniff->process(Object(PHP_CodeSniffer\Files\LocalFile), 0)
#10 /var/www/vendor/squizlabs/php_codesniffer/src/Files/LocalFile.php(92): PHP_CodeSniffer\Files\File->process()
#11 /var/www/vendor/squizlabs/php_codesniffer/src/Fixer.php(175): PHP_CodeSniffer\Files\LocalFile->process()
#12 /var/www/vendor/squizlabs/php_codesniffer/src/Reports/Cbf.php(53): PHP_CodeSniffer\Fixer->fixFile()
#13 /var/www/vendor/squizlabs/php_codesniffer/src/Reporter.php(285): PHP_CodeSniffer\Reports\Cbf->generateFileReport(Array, Object(PHP_CodeSniffer\Files\LocalFile), false, 136)
#14 /var/www/vendor/squizlabs/php_codesniffer/src/Runner.php(706): PHP_CodeSniffer\Reporter->cacheFileReport(Object(PHP_CodeSniffer\Files\LocalFile))
#15 /var/www/vendor/squizlabs/php_codesniffer/src/Runner.php(453): PHP_CodeSniffer\Runner->processFile(Object(PHP_CodeSniffer\Files\LocalFile))
#16 /var/www/vendor/squizlabs/php_codesniffer/src/Runner.php(215): PHP_CodeSniffer\Runner->run()
#17 /var/www/vendor/squizlabs/php_codesniffer/bin/phpcbf(14): PHP_CodeSniffer\Runner->runPHPCBF()
#18 /var/www/vendor/bin/phpcbf(119): include('/var/www/vendor...')
#19 {main}
  thrown in /var/www/vendor/squizlabs/php_codesniffer/src/Runner.php on line 623
@hackimov
Copy link
Author

PS PHP 8.3

@hackimov
Copy link
Author

hackimov commented Oct 5, 2024

error throws if code like this

<?php
namespace App\Models;

i was changed to

<?php

namespace App\Models;

and it works fine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant