Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 87... Línea 87...
87
     *
87
     *
88
     * @param ContainerInterface $wrapperContainer If the container is wrapped by another container.
88
     * @param ContainerInterface $wrapperContainer If the container is wrapped by another container.
89
     */
89
     */
90
    public function __construct(
90
    public function __construct(
91
        array|MutableDefinitionSource $definitions = [],
91
        array|MutableDefinitionSource $definitions = [],
92
        ProxyFactory $proxyFactory = null,
92
        ?ProxyFactory $proxyFactory = null,
93
        ContainerInterface $wrapperContainer = null
93
        ?ContainerInterface $wrapperContainer = null
94
    ) {
94
    ) {
95
        if (is_array($definitions)) {
95
        if (is_array($definitions)) {
96
            $this->definitionSource = $this->createDefaultDefinitionSource($definitions);
96
            $this->definitionSource = $this->createDefaultDefinitionSource($definitions);
97
        } else {
97
        } else {
98
            $this->definitionSource = $definitions;
98
            $this->definitionSource = $definitions;
Línea 342... Línea 342...
342
    {
342
    {
343
        $entryName = $definition->getName();
343
        $entryName = $definition->getName();
Línea 344... Línea 344...
344
 
344
 
345
        // Check if we are already getting this entry -> circular dependency
345
        // Check if we are already getting this entry -> circular dependency
-
 
346
        if (isset($this->entriesBeingResolved[$entryName])) {
346
        if (isset($this->entriesBeingResolved[$entryName])) {
347
            $entryList = implode(" -> ", [...array_keys($this->entriesBeingResolved), $entryName]);
347
            throw new DependencyException("Circular dependency detected while trying to resolve entry '$entryName'");
348
            throw new DependencyException("Circular dependency detected while trying to resolve entry '$entryName': Dependencies: " . $entryList);
348
        }
349
        }
Línea 349... Línea 350...
349
        $this->entriesBeingResolved[$entryName] = true;
350
        $this->entriesBeingResolved[$entryName] = true;
350
 
351