1 | <?php |
||
23 | class CreateWebCacheCommand extends ContainerAwareCommand |
||
24 | { |
||
25 | const COMMAND_NAME = 'cache:web:create'; |
||
26 | |||
27 | /** |
||
28 | * @var OutputInterface |
||
29 | */ |
||
30 | private $output; |
||
31 | |||
32 | /** |
||
33 | * Configures the command. |
||
34 | * |
||
35 | * @return void |
||
36 | * |
||
37 | * @throws InvalidArgumentException |
||
38 | */ |
||
39 | protected function configure() |
||
47 | |||
48 | /** |
||
49 | * Executes the command. |
||
50 | * |
||
51 | * @param InputInterface $input |
||
52 | * @param OutputInterface $output |
||
53 | * |
||
54 | * @return int|null |
||
55 | */ |
||
56 | protected function execute(InputInterface $input, OutputInterface $output) |
||
81 | |||
82 | /** |
||
83 | * Compiles js to one file. |
||
84 | * |
||
85 | * @param string $projectDir |
||
86 | * |
||
87 | * @return void |
||
88 | */ |
||
89 | private function compileJs($projectDir) |
||
90 | { |
||
91 | $this->output->writeln('Generating javascript'); |
||
92 | |||
93 | $applicationJsPath = $projectDir . '/app/Resources/assets/js/'; |
||
94 | |||
95 | if (!file_exists($applicationJsPath)) { |
||
96 | $this->output->writeln('- Javascript directory not found!'); |
||
97 | return; |
||
98 | } |
||
99 | |||
100 | $rii = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($applicationJsPath)); |
||
101 | |||
102 | $js = ''; |
||
103 | |||
104 | /** |
||
105 | * @var SplFileInfo $file |
||
106 | */ |
||
107 | foreach ($rii as $file) { |
||
108 | |||
109 | if ($file->isDir() || $file->getExtension() !== 'js'){ |
||
110 | continue; |
||
111 | } |
||
112 | |||
113 | $js .= file_get_contents($file->getRealPath()) . PHP_EOL; |
||
114 | } |
||
115 | |||
116 | file_put_contents($projectDir . '/web/assets/js/main.js', $js); |
||
117 | |||
118 | $this->output->writeln('- Javascript generated'); |
||
119 | } |
||
120 | |||
121 | /** |
||
122 | * Compiles scss to one file. |
||
123 | * |
||
124 | * @param string $projectDir |
||
125 | * |
||
126 | * @return void |
||
127 | */ |
||
128 | private function compileCss($projectDir) |
||
181 | } |
||
182 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: