Skip to content

Undefined index: scope_opener / scope_closer #1

Closed
robocoder opened this Issue Aug 22, 2013 · 1 comment

1 participant

@robocoder
Owner

Branch: report-memory-improvements
Hash: bbf881a

Error message:

PHP Notice:  Undefined index: scope_opener in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 109

Notice: Undefined index: scope_opener in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 109
PHP Notice:  Undefined index:  in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 110

Notice: Undefined index:  in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 110
PHP Notice:  Undefined index: scope_closer in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 120

Notice: Undefined index: scope_closer in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 120
PHP Notice:  Undefined index:  in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 121

Notice: Undefined index:  in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 121
PHP Notice:  Undefined index: scope_opener in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 138

Notice: Undefined index: scope_opener in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 138
PHP Notice:  Undefined index: scope_opener in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 147

Notice: Undefined index: scope_opener in /var/www/application/vendor/squizlabs/php_codesniffer/CodeSniffer/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php on line 147

FILE: /tmp/Foo.php
--------------------------------------------------------------------------------
FOUND 2 ERROR(S) AFFECTING 2 LINE(S)
--------------------------------------------------------------------------------
 20 | ERROR | CASE statements must not be defined using curly braces
    |       | (PSR2.ControlStructures.SwitchDeclaration.WrongOpenercase)
 21 | ERROR | CASE statements must not be defined using curly braces
    |       | (PSR2.ControlStructures.SwitchDeclaration.WrongOpenercase)
--------------------------------------------------------------------------------

Time: 0 seconds, Memory: 6.25Mb

Sample code:

<?php
namespace Test;

/**
 * Foo
 */
class Foo
{
    const ONE = 1;
    const TWO = 2;

    /**
     * foo
     *
     * @param mixed $bar
     */
    public function foo($bar)
    {
        switch ($bar) {
            case Foo::ONE:
            case Foo::TWO:
                break;
        }
    }
}
@robocoder
Owner

fixed by 6c162f3

@robocoder robocoder closed this Aug 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.