-
Notifications
You must be signed in to change notification settings - Fork 9.4k
Description
When extending \Magento\Setup\Module\Di\Compiler\Log\Writer\Console in your own module, it will crash the DI compiler.
Preconditions
I tried both with Magento CE 2.1.3 and 2.1.4, the same problem occurred with both. In both cases I used the zip file provided by the Magento website.
Steps to reproduce
- Create and enable a module
- Create a php class which extends \Magento\Setup\Module\Di\Compiler\Log\Writer\Console
- Run in the CLI: php magento setup:di:compile
Expected result
ubuntu:# php magento setup:di:compile
Compilation was started.
Interception cache generation... 7/7 [============================] 100% 40 secs 242.0 MiBBMiB
Generated code and dependency injection configuration successfully.
Actual result
ubuntu:# php magento setup:di:compile
Compilation was started.
Area configuration aggregation... 5/7 [====================>-------] 71% 26 secs 168.0 MiBPHP Fatal error: Uncaught Error: Cannot use object of type Symfony\Component\Console\Output\ConsoleOutput as array in /var/www/html/_2.1.3/setup/src/Magento/Setup/Module/Di/Compiler/ArgumentsResolver.php:196
Stack trace:
#0 [internal function]: Magento\Setup\Module\Di\Compiler\ArgumentsResolver->Magento\Setup\Module\Di\Compiler{closure}(Object(Symfony\Component\Console\Output\ConsoleOutput))
#1 /var/www/html/_2.1.3/setup/src/Magento/Setup/Module/Di/Compiler/ArgumentsResolver.php(201): array_map(Object(Closure), Array)
#2 /var/www/html/_2.1.3/setup/src/Magento/Setup/Module/Di/Compiler/ArgumentsResolver.php(92): Magento\Setup\Module\Di\Compiler\ArgumentsResolver->getConfiguredArguments('Something\Foo\M...')
#3 /var/www/html/_2.1.3/setup/src/Magento/Setup/Module/Di/Compiler/Config/Reader.php(121): Magento\Setup\Module\Di\Compiler\ArgumentsResolver->getResolvedConstructorArguments('Something\Foo\M...', Array)
#4 /var/www/html/_2.1.3/setup/src/Magento/Setup/Module/Di/Compiler/Config/Reader.php(89): Magento\Setup\Module\Di\Com in /var/www/html/_2.1.3/setup/src/Magento/Setup/Module/Di/Compiler/ArgumentsResolver.php on line 196
Easy reproduction
I've attached a sample module with which the problem can be reproduced:
Something_Foo.zip