Skip to content

Commit

Permalink
Add bootstrap.php (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
kubawerlos committed Aug 22, 2023
1 parent ea0211b commit a31d7fd
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,13 @@ composer require --dev tpay-com/coding-standards
Create `.php-cs-fixer.php` file and use `Tpay\CodingStandards\PhpCsFixerConfigFactory`:
```php
<?php

require __DIR__ . '/vendor/tpay-com/coding-standards/bootstrap.php';

return Tpay\CodingStandards\PhpCsFixerConfigFactory::createWithAllRules()
->setFinder(
PhpCsFixer\Finder::create()
->ignoreDotFiles(false)
->in(__DIR__)
);
```
Expand Down
16 changes: 16 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?php

declare(strict_types=1);

$customFixersBootstrap = __DIR__.'/../../kubawerlos/php-cs-fixer-custom-fixers/bootstrap.php';
if (is_readable($customFixersBootstrap)) {
require $customFixersBootstrap;
}

spl_autoload_register(function (string $class): void {
if (0 !== strncmp($class, 'Tpay\\CodingStandards\\', 21)) {
return;
}

require __DIR__.'/src/'.str_replace('\\', '/', substr($class, 21)).'.php';
});

0 comments on commit a31d7fd

Please sign in to comment.