PHP code example of schwarzer / php-code-style

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

    

schwarzer / php-code-style example snippets




$classLoader = r(true);

$rules = [
    // 'use-this-to-override' => 'the-default-rules',
];

$finder = PhpCsFixer\Finder::create()
    ->in([
        __DIR__.'/your/source/code',
    ]);

return (new Schwarzer\PhpCs\Styles)($finder, $rules);



$classLoader = r(true);

$rules = [
    // 'use-this-to-override' => 'the-default-rules',
];

$finder = PhpCsFixer\Finder::create()
    ->notPath('bootstrap')
    ->notPath('storage')
    ->notPath('vendor')
    ->in(getcwd())
    ->name('*.php')
    ->notName('*.blade.php')
    ->notName('index.php')
    ->notName('server.php')
    ->ignoreDotFiles(true)
    ->ignoreVCS(true);

return (new Schwarzer\PhpCs\Styles)($finder, $rules);