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

"if" without curly braces is not supported. #1716

Open
kamil-tekiela opened this issue Dec 10, 2024 · 0 comments
Open

"if" without curly braces is not supported. #1716

kamil-tekiela opened this issue Dec 10, 2024 · 0 comments

Comments

@kamil-tekiela
Copy link

I got the following error:

Fatal error: Uncaught Exception: "if" without curly braces is not supported. in D:\projects\phpmyadmin\vendor\slevomat\coding-standard\SlevomatCodingStandard\Sniffs\ControlStructures\EarlyExitSniff.php:453
Stack trace:
#0 D:\projects\phpmyadmin\vendor\slevomat\coding-standard\SlevomatCodingStandard\Sniffs\ControlStructures\EarlyExitSniff.php(401): SlevomatCodingStandard\Sniffs\ControlStructures\EarlyExitSniff->getAllConditionsPointers(Object(PHP_CodeSniffer\Files\LocalFile), 
170)
#1 D:\projects\phpmyadmin\vendor\slevomat\coding-standard\SlevomatCodingStandard\Sniffs\ControlStructures\EarlyExitSniff.php(111): SlevomatCodingStandard\Sniffs\ControlStructures\EarlyExitSniff->findEarlyExitInScope(Object(PHP_CodeSniffer\Files\LocalFile), 167, 193)
#2 D:\projects\phpmyadmin\vendor\slevomat\coding-standard\SlevomatCodingStandard\Sniffs\ControlStructures\EarlyExitSniff.php(75): SlevomatCodingStandard\Sniffs\ControlStructures\EarlyExitSniff->processElse(Object(PHP_CodeSniffer\Files\LocalFile), 195)
#3 D:\projects\phpmyadmin\vendor\squizlabs\php_codesniffer\src\Files\File.php(519): SlevomatCodingStandard\Sniffs\ControlStructures\EarlyExitSniff->process(Object(PHP_CodeSniffer\Files\LocalFile), 195)
#4 D:\projects\phpmyadmin\vendor\squizlabs\php_codesniffer\src\Files\LocalFile.php(92): PHP_CodeSniffer\Files\File->process()
#5 D:\projects\phpmyadmin\vendor\squizlabs\php_codesniffer\src\Fixer.php(175): PHP_CodeSniffer\Files\LocalFile->process()
#6 D:\projects\phpmyadmin\vendor\squizlabs\php_codesniffer\src\Reports\Cbf.php(53): PHP_CodeSniffer\Fixer->fixFile()
#7 D:\projects\phpmyadmin\vendor\squizlabs\php_codesniffer\src\Reporter.php(285): PHP_CodeSniffer\Reports\Cbf->generateFileReport(Array, Object(PHP_CodeSniffer\Files\LocalFile), false, 261)
#8 D:\projects\phpmyadmin\vendor\squizlabs\php_codesniffer\src\Runner.php(714): PHP_CodeSniffer\Reporter->cacheFileReport(Object(PHP_CodeSniffer\Files\LocalFile))
#9 D:\projects\phpmyadmin\vendor\squizlabs\php_codesniffer\src\Runner.php(454): PHP_CodeSniffer\Runner->processFile(Object(PHP_CodeSniffer\Files\LocalFile))
#10 D:\projects\phpmyadmin\vendor\squizlabs\php_codesniffer\src\Runner.php(216): PHP_CodeSniffer\Runner->run()
#11 D:\projects\phpmyadmin\vendor\squizlabs\php_codesniffer\bin\phpcbf(14): PHP_CodeSniffer\Runner->runPHPCBF()
#12 D:\projects\phpmyadmin\vendor\bin\phpcbf(119): include('D:\\projects\\php...')
#13 {main}
  thrown in D:\projects\phpmyadmin\vendor\slevomat\coding-standard\SlevomatCodingStandard\Sniffs\ControlStructures\EarlyExitSniff.php on line 453

And the code that triggered it is this:

        if (is_string($separators)) {
            if ($separators !== '')
                $this->separators = [$separators];
        } else {
            $this->separators = $separators;
        }
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