Submit
Path:
~
/
/
usr
/
local
/
psa
/
admin
/
plib
/
modules
/
monitoring
/
vendor
/
laminas
/
laminas-cache
/
src
/
Command
/
File Content:
DeprecatedStorageFactoryConfigurationCheckCommandFactory.php
<?php declare (strict_types=1); namespace PleskMonitoring\Laminas\Cache\Command; use ArrayAccess; use ArrayObject; use PleskMonitoring\Laminas\Cache\Service\DeprecatedSchemaDetector; use PleskMonitoring\Psr\Container\ContainerInterface; use RuntimeException; use function is_array; /** * @internal */ final class DeprecatedStorageFactoryConfigurationCheckCommandFactory { public function __invoke(ContainerInterface $container) : DeprecatedStorageFactoryConfigurationCheckCommand { $config = $this->detectConfigFromContainer($container); $schemaDetector = new DeprecatedSchemaDetector(); return new DeprecatedStorageFactoryConfigurationCheckCommand($config, $schemaDetector); } private function detectConfigFromContainer(ContainerInterface $container) : ArrayAccess { if (!$container->has('config')) { return new ArrayObject([]); } $config = $container->get('config'); if (is_array($config)) { $config = new ArrayObject($config); } if (!$config instanceof ArrayAccess) { throw new RuntimeException('Configuration from container must be either `ArrayAccess` or an array.'); } return $config; } }
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
DeprecatedStorageFactoryConfigurationCheckCommand.php
5007 bytes
0644
DeprecatedStorageFactoryConfigurationCheckCommandFactory.php
1247 bytes
0644
N4ST4R_ID | Naxtarrr