Skip to content

Commit

Permalink
Code: fixes for PHP 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
f3l1x committed May 25, 2023
1 parent 0101e6e commit f1d25d1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/DI/Pass/ConsolePass.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,17 @@ public function loadPassConfiguration(): void
$this->prefix('@logger.logger'),
]);

$builder->addDefinition($this->extension->prefix('console.statsCommand'))
->setFactory(StatsCommand::class, [$this->prefix('@transport.container'), []]); // @TODO transportNames

$builder->addDefinition($this->extension->prefix('console.debugCommand'))
->setFactory(DebugCommand::class, [[]]); // @TODO mapping

$builder->addDefinition($this->extension->prefix('console.setupTransportsCommand'))
->setFactory(SetupTransportsCommand::class, [$this->prefix('@transport.container'), []]); // @TODO transportNames

if (class_exists(StatsCommand::class)) {
$builder->addDefinition($this->extension->prefix('console.statsCommand'))
->setFactory(StatsCommand::class, [$this->prefix('@transport.container'), []]); // @TODO transportNames
}

if (PHP_VERSION === 'fake') { // @TODO failing queues
$builder->addDefinition($this->extension->prefix('console.failedMessageRemoveCommand'))
->setFactory(FailedMessagesRemoveCommand::class);
Expand Down
3 changes: 2 additions & 1 deletion tests/Toolkit/Helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Nette\DI\Config\Adapters\NeonAdapter;
use Nette\Neon\Neon;
use Nette\Utils\FileSystem;

final class Helpers
{
Expand All @@ -21,7 +22,7 @@ public static function neon(string $str): array
*/
public static function neonFile(string $file): array
{
return (new NeonAdapter())->process((array) Neon::decodeFile($file));
return (new NeonAdapter())->process((array) Neon::decode(FileSystem::read($file)));
}

}

0 comments on commit f1d25d1

Please sign in to comment.