diff --git a/.php-cs-fixer.php b/.php-cs-fixer.php index eb1463d..54f1c56 100644 --- a/.php-cs-fixer.php +++ b/.php-cs-fixer.php @@ -3,52 +3,13 @@ use PhpCsFixer\Config; use PhpCsFixer\Finder; -/** - * Read excluded paths from .gitignore - * - * @param string $dir - * - * @return string[] - */ -function getGitignorePaths(string $dir): array -{ - $gitignoreFile = $dir . '/.gitignore'; - $paths = []; - - if (!file_exists($gitignoreFile)) { - return $paths; - } - - $lines = file($gitignoreFile, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES); - if (!empty($lines)) { - foreach ($lines as $line) { - // Ignore comments and empty lines - if (strpos($line, '#') === 0 || trim($line) === '') { - continue; - } - // Add relative paths - $paths[] = trim($line); - } - } - - return $paths; -} - -$projectDir = __DIR__; $finder = Finder::create() - ->in($projectDir) + ->in(__DIR__) ->name('*.php'); -// Exclude paths from .gitignore -$gitignorePaths = getGitignorePaths($projectDir); -foreach ($gitignorePaths as $path) { - $finder->notPath($path); -} - $config = new Config(); $rules = [ - '@PSR12' => true, '@PER-CS2.0' => true, 'array_indentation' => true, 'array_syntax' => ['syntax' => 'short'],