File tree Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Expand file tree Collapse file tree 2 files changed +4
-6
lines changed Original file line number Diff line number Diff line change 2
2
3
3
namespace Realodix \Relax ;
4
4
5
- use PhpCsFixer \Config as PhpCsFixerConfig ;
6
5
use PhpCsFixer \ConfigInterface ;
7
6
use Realodix \Relax \Exceptions \RulesetNotFoundException ;
8
7
use Realodix \Relax \RuleSet \RuleSetInterface ;
9
8
10
- class Config extends PhpCsFixerConfig
9
+ class Config extends \ PhpCsFixer \Config
11
10
{
12
11
const LOCAL_RULES_NAME = 'Local Rules ' ;
13
12
@@ -46,12 +45,13 @@ public function setRules(array $rules = []): ConfigInterface
46
45
*/
47
46
public static function create ($ ruleSet = null )
48
47
{
49
- if (! ( $ ruleSet instanceof RuleSetInterface) && ! is_string ($ ruleSet ) && $ ruleSet !== null ) {
48
+ if (! $ ruleSet instanceof RuleSetInterface && ! is_string ($ ruleSet ) && $ ruleSet !== null ) {
50
49
throw new \InvalidArgumentException (
51
50
'Ruleset must be of type Relax RuleSetInterface, string or null '
52
51
);
53
52
}
54
53
54
+ // If the rule set is a string, we try to find it in the RuleSet namespace
55
55
if (is_string ($ ruleSet )) {
56
56
/** @TODO remove me */
57
57
if (ucfirst ($ ruleSet ) == 'Realodix ' ) {
Original file line number Diff line number Diff line change 2
2
3
3
namespace Realodix \Relax ;
4
4
5
- use PhpCsFixer \Finder as BaseFinder ;
6
-
7
5
/**
8
6
* {@inheritDoc}
9
7
*
10
8
* @see https://symfony.com/doc/current/components/finder.html
11
9
* @see https://github.com/symfony/finder/blob/7.1/Finder.php
12
10
* @see https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/src/Finder.php
13
11
*/
14
- class Finder extends BaseFinder
12
+ class Finder extends \ PhpCsFixer \Finder
15
13
{
16
14
/**
17
15
* @return \PhpCsFixer\Finder
You can’t perform that action at this time.
0 commit comments