Verzeichnisstruktur phpBB-3.3.15
- Veröffentlicht
- 28.08.2024
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. |
|
(Beispiel Datei-Icons)
|
Auf das Icon klicken um den Quellcode anzuzeigen |
ServiceNotFoundException.php
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 use Psr\Container\NotFoundExceptionInterface;
15
16 /**
17 * This exception is thrown when a non-existent service is requested.
18 *
19 * @author Johannes M. Schmitt <schmittjoh@gmail.com>
20 */
21 class ServiceNotFoundException extends InvalidArgumentException implements NotFoundExceptionInterface
22 {
23 private $id;
24 private $sourceId;
25 private $alternatives;
26
27 public function __construct($id, $sourceId = null, \Exception $previous = null, array $alternatives = [], $msg = null)
28 {
29 if (null !== $msg) {
30 // no-op
31 } elseif (null === $sourceId) {
32 $msg = sprintf('You have requested a non-existent service "%s".', $id);
33 } else {
34 $msg = sprintf('The service "%s" has a dependency on a non-existent service "%s".', $sourceId, $id);
35 }
36
37 if ($alternatives) {
38 if (1 == \count($alternatives)) {
39 $msg .= ' Did you mean this: "';
40 } else {
41 $msg .= ' Did you mean one of these: "';
42 }
43 $msg .= implode('", "', $alternatives).'"?';
44 }
45
46 parent::__construct($msg, 0, $previous);
47
48 $this->id = $id;
49 $this->sourceId = $sourceId;
50 $this->alternatives = $alternatives;
51 }
52
53 public function getId()
54 {
55 return $this->id;
56 }
57
58 public function getSourceId()
59 {
60 return $this->sourceId;
61 }
62
63 public function getAlternatives()
64 {
65 return $this->alternatives;
66 }
67 }
68