Skip to content

Commit

Permalink
Extension: simplify helperSet schema
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed Dec 11, 2020
1 parent 3727530 commit 973bc5a
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions src/DI/ConsoleExtension.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
use Nette\Http\UrlScript;
use Nette\Schema\Expect;
use Nette\Schema\Schema;
use Nette\Schema\ValidationException;
use Nette\Utils\Arrays;
use stdClass;
use Symfony\Component\Console\Command\Command;
Expand Down Expand Up @@ -51,14 +50,7 @@ public function getConfigSchema(): Schema
'version' => Expect::anyOf(Expect::string(), Expect::int(), Expect::float()),
'catchExceptions' => Expect::bool(),
'autoExit' => Expect::bool(),
'helperSet' => Expect::anyOf(Expect::string(), Expect::type(Statement::class))
->assert(function ($helperSet): bool {
if ($helperSet === null) {
throw new ValidationException('helperSet cannot be null');
}

return true;
}),
'helperSet' => Expect::anyOf(Expect::string(), Expect::type(Statement::class)),
'helpers' => Expect::arrayOf(
Expect::anyOf(Expect::string(), Expect::array(), Expect::type(Statement::class))
),
Expand Down

0 comments on commit 973bc5a

Please sign in to comment.