Skip to content

Commit 43d9925

Browse files
committed
Cleanup: remove constructor lazy checker
1 parent a9ea546 commit 43d9925

File tree

3 files changed

+0
-23
lines changed

3 files changed

+0
-23
lines changed

src/DI/ConsoleExtension.php

-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
use Contributte\Console\Application;
66
use Contributte\Console\CommandLoader\ContainerCommandLoader;
7-
use Contributte\Console\Exception\Logical\InvalidArgumentException;
87
use Nette\DI\CompilerExtension;
98
use Nette\DI\Definitions\ServiceDefinition;
109
use Nette\DI\Definitions\Statement;
@@ -32,10 +31,6 @@ class ConsoleExtension extends CompilerExtension
3231

3332
public function __construct(bool $cliMode = false)
3433
{
35-
if (func_num_args() <= 0) {
36-
throw new InvalidArgumentException(sprintf('Provide CLI mode, e.q. %s(%%consoleMode%%).', self::class));
37-
}
38-
3934
$this->cliMode = $cliMode;
4035
}
4136

src/Exception/Logical/InvalidArgumentException.php

-10
This file was deleted.

tests/cases/DI/ConsoleExtension.phpt

-8
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use Contributte\Console\Application;
44
use Contributte\Console\DI\ConsoleExtension;
5-
use Contributte\Console\Exception\Logical\InvalidArgumentException;
65
use Contributte\Tester\Environment;
76
use Contributte\Tester\Toolkit;
87
use Nette\Bridges\HttpDI\HttpExtension;
@@ -72,13 +71,6 @@ Toolkit::test(function (): void {
7271
Assert::equal('https://contributte.org/', (string) $container->getService('http.request')->getUrl());
7372
});
7473

75-
// No mode provided
76-
Toolkit::test(function (): void {
77-
Assert::exception(function (): void {
78-
new ConsoleExtension();
79-
}, InvalidArgumentException::class, 'Provide CLI mode, e.q. Contributte\Console\DI\ConsoleExtension(%consoleMode%).');
80-
});
81-
8274
// Non-CLI mode
8375
Toolkit::test(function (): void {
8476
$loader = new ContainerLoader(Environment::getTestDir(), true);

0 commit comments

Comments
 (0)