Skip to content

Commit faf7ef6

Browse files
committed
Fix array_filter call returning a scalar
1 parent b148539 commit faf7ef6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/CreateCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ protected function configure()
3939

4040
protected function execute(InputInterface $input, OutputInterface $output)
4141
{
42-
$create = array_filter($this->createOrder, static function ($option) use ($input) {
43-
return $input->getOption($option);
42+
$create = array_filter($this->createOrder, static function (string $option) use ($input): bool {
43+
return (bool) $input->getOption($option);
4444
});
4545

4646
// Default to the full creation order if no options were specified

lib/Doctrine/ODM/MongoDB/Tools/Console/Command/Schema/DropCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ protected function configure()
3636

3737
protected function execute(InputInterface $input, OutputInterface $output)
3838
{
39-
$drop = array_filter($this->dropOrder, static function ($option) use ($input) {
40-
return $input->getOption($option);
39+
$drop = array_filter($this->dropOrder, static function (string $option) use ($input): bool {
40+
return (bool) $input->getOption($option);
4141
});
4242

4343
// Default to the full drop order if no options were specified

0 commit comments

Comments
 (0)