Verzeichnisstruktur phpBB-3.1.0


Veröffentlicht
27.10.2014

So funktioniert es


Auf das letzte Element klicken. Dies geht jeweils ein Schritt zurück

Auf das Icon klicken, dies öffnet das Verzeichnis. Nochmal klicken schließt das Verzeichnis.
Auf den Verzeichnisnamen klicken, dies zeigt nur das Verzeichnis mit Inhalt an

(Beispiel Datei-Icons)

Auf das Icon klicken um den Quellcode anzuzeigen

ScopeWideningInjectionException.php

Zuletzt modifiziert: 09.10.2024, 12:58 - Dateigröße: 1.90 KiB


01  <?php
02   
03  /*
04   * This file is part of the Symfony package.
05   *
06   * (c) Fabien Potencier <fabien@symfony.com>
07   *
08   * For the full copyright and license information, please view the LICENSE
09   * file that was distributed with this source code.
10   */
11   
12  namespace Symfony\Component\DependencyInjection\Exception;
13   
14  /**
15   * Thrown when a scope widening injection is detected.
16   *
17   * @author Johannes M. Schmitt <schmittjoh@gmail.com>
18   */
19  class ScopeWideningInjectionException extends RuntimeException
20  {
21      private $sourceServiceId;
22      private $sourceScope;
23      private $destServiceId;
24      private $destScope;
25   
26      public function __construct($sourceServiceId, $sourceScope, $destServiceId, $destScope, \Exception $previous = null)
27      {
28          parent::__construct(sprintf(
29              'Scope Widening Injection detected: The definition "%s" references the service "%s" which belongs to a narrower scope. '
30             .'Generally, it is safer to either move "%s" to scope "%s" or alternatively rely on the provider pattern by injecting the container itself, and requesting the service "%s" each time it is needed. '
31             .'In rare, special cases however that might not be necessary, then you can set the reference to strict=false to get rid of this error.',
32             $sourceServiceId,
33             $destServiceId,
34             $sourceServiceId,
35             $destScope,
36             $destServiceId
37          ), 0, $previous);
38   
39          $this->sourceServiceId = $sourceServiceId;
40          $this->sourceScope = $sourceScope;
41          $this->destServiceId = $destServiceId;
42          $this->destScope = $destScope;
43      }
44   
45      public function getSourceServiceId()
46      {
47          return $this->sourceServiceId;
48      }
49   
50      public function getSourceScope()
51      {
52          return $this->sourceScope;
53      }
54   
55      public function getDestServiceId()
56      {
57          return $this->destServiceId;
58      }
59   
60      public function getDestScope()
61      {
62          return $this->destScope;
63      }
64  }
65