Skip to content

Commit

Permalink
Use lowercase for ruleset name
Browse files Browse the repository at this point in the history
  • Loading branch information
realodix committed Jul 2, 2024
1 parent be3b272 commit 20621b4
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$finder = Finder::base()
->append(['.php-cs-fixer.dist.php', 'bin/relax']);

return Config::create('Realodix')
return Config::create('realodix')
->setRules($localRules)
->setFinder($finder)
->setParallelConfig(\PhpCsFixer\Runner\Parallel\ParallelConfigFactory::detect())
Expand Down
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ $localRules = [
// ...
];

return Config::create('Laravel')
return Config::create('laravel')
->setRules($localRules);
```

Expand All @@ -45,9 +45,9 @@ A ruleset is a named list of rules that can be used to fix code style issues in

| Ruleset | Description |
| ------------------------- |-------------|
| [`Laravel`][rs_laravel] | Rules that follow the official Laravel coding standards |
| [`Realodix`][rs_realodix] | Inherits `Laravel` with some tweaks |
| [`Spatie`][rs_spatie] | The rule set used by Spatie |
| [`laravel`][rs_laravel] | Rules that follow the official Laravel coding standards |
| [`realodix`][rs_realodix] | Inherits `laravel` with some tweaks |
| [`spatie`][rs_spatie] | The rule set used by Spatie |


#### Custom Fixers
Expand Down Expand Up @@ -106,7 +106,7 @@ $finder = Finder::create()
->notName('*.foo.php')
->append(['.php-cs-fixer.dist.php']);

return Config::create('Laravel')
return Config::create('laravel')
->setRules($localRules)
->setFinder($finder)
->setRiskyAllowed(false)
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/GenerateConfigCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ protected function generateAndSaveCode($output): bool
// ...
];
return Config::create()
return Config::create('realodix')
->setRules($localRules);
CODE;

Expand Down
2 changes: 1 addition & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public static function create($ruleSet = null)
}

if (is_string($ruleSet)) {
$relaxRuleset = 'Realodix\\Relax\\RuleSet\\Sets\\'.$ruleSet;
$relaxRuleset = 'Realodix\\Relax\\RuleSet\\Sets\\'.ucfirst($ruleSet);

if (! class_exists($relaxRuleset)) {
throw new RulesetNotFoundException($ruleSet);
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/ConfigTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public function testSetRuleset(): void

public function testSetRulesetWithStringInput(): void
{
$this->assertSame('@Realodix', Config::create('Realodix')->getName());
$this->assertSame('@Realodix', Config::create('realodix')->getName());
}

public function testSetRulesetWithInvalidStringInput(): void
Expand Down

0 comments on commit 20621b4

Please sign in to comment.