PHP code example of ivang11 / php-style

1. Go to this page and download the library: Download ivang11/php-style 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/ */

    

ivang11 / php-style example snippets




// specify the paths to fix

$finder = PhpCsFixer\Finder::create()
    ->notPath('bootstrap/*')
    ->notPath('storage/*')
    ->notPath('vendor')
    ->in([
        __DIR__ . '/app',
        __DIR__ . '/tests',
        __DIR__ . '/database',
    ])
    ->name('*.php')
    ->notName('*.blade.php')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true);


// then call and return the following style function

return Ivang11\styles($finder);
json
"scripts": {
    "format": [
        "vendor/bin/php-cs-fixer fix"
    ],
}
sh
./vendor/bin/php-cs-fixer fix --dry-run