__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
<?php
declare(strict_types=1);
namespace DI\Definition\Source;
use DI\Definition\Definition;
/**
* Reads DI definitions from a file returning a PHP array.
*
* @author Matthieu Napoli <matthieu@mnapoli.fr>
*/
class DefinitionFile extends DefinitionArray
{
private bool $initialized = false;
/**
* @param string $file File in which the definitions are returned as an array.
*/
public function __construct(
private string $file,
Autowiring $autowiring = null,
) {
// Lazy-loading to improve performances
parent::__construct([], $autowiring);
}
public function getDefinition(string $name) : Definition|null
{
$this->initialize();
return parent::getDefinition($name);
}
public function getDefinitions() : array
{
$this->initialize();
return parent::getDefinitions();
}
/**
* Lazy-loading of the definitions.
*/
private function initialize() : void
{
if ($this->initialized === true) {
return;
}
$definitions = require $this->file;
if (! is_array($definitions)) {
throw new \Exception("File $this->file should return an array of definitions");
}
$this->addDefinitions($definitions);
$this->initialized = true;
}
}
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| AttributeBasedAutowiring.php | File | 8.6 KB | 0777 |
|
| Autowiring.php | File | 522 B | 0777 |
|
| DefinitionArray.php | File | 3.39 KB | 0777 |
|
| DefinitionFile.php | File | 1.32 KB | 0777 |
|
| DefinitionNormalizer.php | File | 3.66 KB | 0777 |
|
| DefinitionSource.php | File | 637 B | 0777 |
|
| MutableDefinitionSource.php | File | 356 B | 0777 |
|
| NoAutowiring.php | File | 582 B | 0777 |
|
| ReflectionBasedAutowiring.php | File | 2.37 KB | 0777 |
|
| SourceCache.php | File | 2.38 KB | 0777 |
|
| SourceChain.php | File | 2.64 KB | 0777 |
|