File tree 2 files changed +5
-11
lines changed
Bundle/TwigBundle/Command 2 files changed +5
-11
lines changed Original file line number Diff line number Diff line change 39
39
#[AsCommand(name: 'lint:twig ' , description: 'Lint a Twig template and outputs encountered errors ' )]
40
40
class LintCommand extends Command
41
41
{
42
- protected string |array $ namePatterns ;
43
- private Environment $ twig ;
44
42
private string $ format ;
45
43
46
- public function __construct (Environment $ twig , string |array $ namePatterns = ['*.twig ' ])
47
- {
44
+ public function __construct (
45
+ private Environment $ twig ,
46
+ private array $ namePatterns = ['*.twig ' ],
47
+ ) {
48
48
parent ::__construct ();
49
-
50
- $ this ->twig = $ twig ;
51
- $ this ->namePatterns = $ namePatterns ;
52
49
}
53
50
54
51
protected function configure ()
Original file line number Diff line number Diff line change 13
13
14
14
use Symfony \Bridge \Twig \Command \LintCommand as BaseLintCommand ;
15
15
use Symfony \Component \Console \Attribute \AsCommand ;
16
- use Symfony \Component \Finder \Finder ;
17
16
18
17
/**
19
18
* Command that will validate your template syntax and output encountered errors.
@@ -47,9 +46,7 @@ protected function configure()
47
46
protected function findFiles (string $ filename ): iterable
48
47
{
49
48
if (str_starts_with ($ filename , '@ ' )) {
50
- $ dir = $ this ->getApplication ()->getKernel ()->locateResource ($ filename );
51
-
52
- return Finder::create ()->files ()->in ($ dir )->name ($ this ->namePatterns );
49
+ $ filename = $ this ->getApplication ()->getKernel ()->locateResource ($ filename );
53
50
}
54
51
55
52
return parent ::findFiles ($ filename );
You can’t perform that action at this time.
0 commit comments