Last active
January 8, 2025 18:54
-
-
Save rginnow/e7a0267431d8b06f31589ed898401368 to your computer and use it in GitHub Desktop.
My Laravel Files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/.coverage | |
/.phpunit.cache | |
/.fleet | |
/.idea | |
/.nova | |
/.vscode | |
/.zed | |
/node_modules | |
/public/hot | |
/public/storage | |
/public/build | |
/storage/*.key | |
/storage/pail | |
/vendor | |
/auth.json | |
Homestead.json | |
Homestead.yaml | |
herd.yml | |
npm-debug.log | |
yarn-error.log | |
.env | |
.env.backup | |
.env.production | |
.env.testing | |
.phpactor.json | |
.phpunit.result.cache | |
.DS_Store | |
.php_cs.cache | |
.cursorrules | |
.gitattributes | |
.gitignore | |
.phpcsfixer | |
.cursorrules | |
*.code-workspace | |
*.sublime-project | |
*.sublime-workspace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$finder = PhpCsFixer\Finder::create() | |
->in(__DIR__) | |
->exclude([ | |
'config', | |
'database', | |
'public', | |
'resources', | |
'storage', | |
'tests', | |
'bootstrap' | |
]) | |
; | |
return PhpCsFixer\Config::create() | |
->setRiskyAllowed(true) | |
->setRules([ | |
'@PSR12' => true, // use normal PSR12 formatting | |
'align_multiline_comment' => ['comment_type' => 'phpdocs_only'], // Align the docblock by asterisk | |
'array_syntax' => ['syntax' => 'short'], // Force [] syntax | |
'binary_operator_spaces' => true, | |
'blank_line_after_opening_tag' => true, // for readability, make sure nothing is after the <?php line | |
'concat_space' => ['spacing' => 'one'], // force a space when concatinating with a . | |
'new_with_braces' => [ | |
'anonymous_class' => false, | |
'named_class' => true | |
], | |
'no_blank_lines_before_namespace' => true, // personal preference | |
'no_unused_imports' => true, // Make sure the imports are clean and only importing what we use | |
'no_empty_comment' => true, // Comments should not be left empty | |
'no_empty_phpdoc' => true, // same as above | |
'no_useless_else' => true, // if/else statements should be useful, not empty | |
'no_whitespace_in_blank_line' => true, // remove extra spaces on empty lines | |
'ordered_imports' => ['sortAlgorithm' => 'length'], // order imports by length | |
'phpdoc_add_missing_param_annotation' => true, // any missing @params are auto added | |
'phpdoc_align' => true, // Align each part of the PHP doc | |
'phpdoc_indent' => true, // Indent the docblock to the function | |
'phpdoc_order' => true, // Order the annotations by type (@param -> @throw -> @return) | |
'phpdoc_separation' => true, // Separate each of the types of annotations | |
'psr4' => true, // force filename to match class name | |
'return_type_declaration' => [ | |
'space_before' => 'one' | |
], | |
'single_line_comment_style' => true, // force one-line comments to use the double slash syntax | |
'single_quote' => true, // convert "" to '' for simple strings | |
'standardize_not_equals' => true, // force != if using <> | |
])->setFinder($finder); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment