PHP code example of binary-cats / laravel-php-styles

1. Go to this page and download the library: Download binary-cats/laravel-php-styles library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

binary-cats / laravel-php-styles example snippets


return [
    '@Symfony' => true,
    'AdamWojs/phpdoc_force_fqcn_fixer' => true,
    'concat_space' => ['spacing' => 'one'],
    'new_with_braces' => true,
    'no_superfluous_phpdoc_tags' => false,
    'not_operator_with_successor_space' => true,
    'ordered_imports' => ['imports_order' => ['class', 'function', 'const'], 'sort_algorithm' => 'alpha'],
    'phpdoc_separation' => false,
];



$finder = PhpCsFixer\Finder::create()->in([
    __DIR__.'/app',
    __DIR__.'/config',
    __DIR__.'/database',
    __DIR__.'/routes',
    __DIR__.'/tests',
]);

return BinaryCats\PhpStyles\styles($finder);

...
return BinaryCats\PhpStyles\styles($finder, [
    // Do not wrap concat . with spaces
    'concat_space' => ['spacing' => 'none'],
]);

...
return BinaryCats\PhpStyles\styles($finder, [
    // turn the force FQCN fixer off
    'AdamWojs/phpdoc_force_fqcn_fixer' => false,
], [
    new \AdamWojs\PhpCsFixerPhpdocForceFQCN\Fixer\Phpdoc\ForceFQCNFixer,
]);

json
    ""binary-cats/laravel-php-styles": "^2.0"
    },
bash
php artisan vendor:publish --provider=BinaryCats\\PhpStyles\\PhpStyleServiceProvider
bash
./vendor/bin/php-cs-fixer fix
json
    ...
    "scripts": {
        "style": "./vendor/bin/php-cs-fixer fix"
    }