comparison vendor/symfony/dependency-injection/Exception/ServiceNotFoundException.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
22 { 22 {
23 private $id; 23 private $id;
24 private $sourceId; 24 private $sourceId;
25 private $alternatives; 25 private $alternatives;
26 26
27 public function __construct($id, $sourceId = null, \Exception $previous = null, array $alternatives = array(), $msg = null) 27 public function __construct($id, $sourceId = null, \Exception $previous = null, array $alternatives = [], $msg = null)
28 { 28 {
29 if (null !== $msg) { 29 if (null !== $msg) {
30 // no-op 30 // no-op
31 } elseif (null === $sourceId) { 31 } elseif (null === $sourceId) {
32 $msg = sprintf('You have requested a non-existent service "%s".', $id); 32 $msg = sprintf('You have requested a non-existent service "%s".', $id);
33 } else { 33 } else {
34 $msg = sprintf('The service "%s" has a dependency on a non-existent service "%s".', $sourceId, $id); 34 $msg = sprintf('The service "%s" has a dependency on a non-existent service "%s".', $sourceId, $id);
35 } 35 }
36 36
37 if ($alternatives) { 37 if ($alternatives) {
38 if (1 == count($alternatives)) { 38 if (1 == \count($alternatives)) {
39 $msg .= ' Did you mean this: "'; 39 $msg .= ' Did you mean this: "';
40 } else { 40 } else {
41 $msg .= ' Did you mean one of these: "'; 41 $msg .= ' Did you mean one of these: "';
42 } 42 }
43 $msg .= implode('", "', $alternatives).'"?'; 43 $msg .= implode('", "', $alternatives).'"?';