extensions/felixfbecker.php-intellisense-0.0.12/vendor/felixfbecker/language-server/src/Formatter.php
/**
     * Search for PHP_CodeSniffer configuration file at given directory or its parents.
     * If no configuration found then PSR2 standard is loaded by default.
     *
     * @param string $path path to file or directory
     * @return string[]
     */
Search for PHP_CodeSniffer configuration file at given directory or its parents.
If no configuration found then PSR2 standard is loaded by default.

@param string $path path to file or directory
@return string[]
Search for PHP_CodeSniffer configuration file at given directory or its parents . If no configuration found then PSR2 standard is loaded by default . @param string $path path to file or directory @return string []
private static function findConfiguration(string $path)
    {
        if (is_dir($path)) {
            $currentDir = $path;
        } else {
            $currentDir = dirname($path);
        }
        do {
            $default = $currentDir . DIRECTORY_SEPARATOR . 'phpcs.xml';
            if (is_file($default)) {
                return [$default];
            }
            $default = $currentDir . DIRECTORY_SEPARATOR . 'phpcs.xml.dist';
            if (is_file($default)) {
                return [$default];
            }
            $lastDir = $currentDir;
            $currentDir = dirname($currentDir);
        } while ($currentDir !== '.' && $currentDir !== $lastDir);
        $standard = Config::getConfigData('default_standard') ?? 'PSR2';
        return explode(',', $standard);
    }
private static function findConfiguration ( string $ path ) { if ( is_dir ( $ path ) ) { $ currentDir = $ path ; } else { $ currentDir = dirname ( $ path ) ; } do { $ default = $ currentDir . DIRECTORY_SEPARATOR . 'phpcs.xml' ; if ( is_file ( $ default ) ) { return [ $ default ] ; } $ default = $ currentDir . DIRECTORY_SEPARATOR . 'phpcs.xml.dist' ; if ( is_file ( $ default ) ) { return [ $ default ] ; } $ lastDir = $ currentDir ; $ currentDir = dirname ( $ currentDir ) ; } while ( $ currentDir !== '.' && $ currentDir !== $ lastDir ) ; $ standard = Config :: getConfigData ( 'default_standard' ) ?? 'PSR2' ; return explode ( ',' , $ standard ) ; }
Search for PHP_CodeSniffer configuration file at given directory or its parents.
Search for PHP_CodeSniffer configuration file at given directory or its parents .