PHP code example of odinns / coding-style

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

    

odinns / coding-style example snippets




declare(strict_types=1);

use Odinns\CodingStyle\OdinnsRectorConfig;
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
    OdinnsRectorConfig::setup($rectorConfig);

    $rectorConfig->paths([
        __DIR__ . '/app',
        __DIR__ . '/bootstrap',
        __DIR__ . '/config',
        __DIR__ . '/database',
        __DIR__ . '/routes',
        __DIR__ . '/tests',
    ]);
};

return static function (RectorConfig $rectorConfig): void {
    OdinnsRectorConfig::setup($rectorConfig);

    $rectorConfig->paths([
        __DIR__ . '/app',
        __DIR__ . '/tests',
    ]);

    $rectorConfig->skip([
        __DIR__ . '/app/Legacy',
        SomeProjectSpecificRector::class,
    ]);
};



declare(strict_types=1);

it('describes behavior clearly', function (): void {
    expect(true)->toBeTrue();
});
bash
cp vendor/odinns/coding-style/stubs/rector.php.stub rector.php
cp vendor/odinns/coding-style/stubs/phpstan.neon.stub phpstan.neon
text
vendor/odinns/coding-style/stubs/rector.php.stub
vendor/odinns/coding-style/stubs/phpstan.neon.stub