Skip to content

Commit

Permalink
Added PER preset (#163)
Browse files Browse the repository at this point in the history
  • Loading branch information
vinkla authored Apr 3, 2023
1 parent 4d7b77d commit fdbdb8f
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions app/Factories/ConfigurationResolverFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ class ConfigurationResolverFactory
*/
public static $presets = [
'laravel',
'per',
'psr12',
'symfony',
];
Expand Down
1 change: 1 addition & 0 deletions app/Output/SummaryOutput.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class SummaryOutput
* @var array<string, string>
*/
protected $presets = [
'per' => 'PER',
'psr12' => 'PSR 12',
'laravel' => 'Laravel',
'symfony' => 'Symfony',
Expand Down
8 changes: 8 additions & 0 deletions resources/presets/per.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

use App\Factories\ConfigurationFactory;

return ConfigurationFactory::preset([
'@PER' => true,
'no_unused_imports' => true,
]);
11 changes: 11 additions & 0 deletions tests/Feature/PresetTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,17 @@
->toContain('── PSR 12');
});

it('may use the PER preset', function () {
[$statusCode, $output] = run('default', [
'path' => base_path('tests/Fixtures/without-issues'),
'--preset' => 'per',
]);

expect($statusCode)->toBe(0)
->and($output)
->toContain('── PER');
});

it('may use the Laravel preset', function () {
[$statusCode, $output] = run('default', [
'path' => base_path('tests/Fixtures/without-issues'),
Expand Down

0 comments on commit fdbdb8f

Please sign in to comment.