File tree Expand file tree Collapse file tree 2 files changed +5
-10
lines changed
Bundle/TwigBundle/Command Expand file tree Collapse file tree 2 files changed +5
-10
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 string |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 @@ -47,9 +47,7 @@ protected function configure()
47
47
protected function findFiles (string $ filename ): iterable
48
48
{
49
49
if (str_starts_with ($ filename , '@ ' )) {
50
- $ dir = $ this ->getApplication ()->getKernel ()->locateResource ($ filename );
51
-
52
- return Finder::create ()->files ()->in ($ dir )->name ($ this ->namePatterns );
50
+ $ filename = $ this ->getApplication ()->getKernel ()->locateResource ($ filename );
53
51
}
54
52
55
53
return parent ::findFiles ($ filename );
You can’t perform that action at this time.
0 commit comments