comparison vendor/symfony/dependency-injection/Alias.php @ 14:1fec387a4317

Update Drupal core to 8.5.2 via Composer
author Chris Cannam
date Mon, 23 Apr 2018 09:46:53 +0100
parents 4c8ae668cc8c
children 129ea1e6d783
comparison
equal deleted inserted replaced
13:5fb285c0d0e3 14:1fec387a4317
13 13
14 class Alias 14 class Alias
15 { 15 {
16 private $id; 16 private $id;
17 private $public; 17 private $public;
18 private $private;
18 19
19 /** 20 /**
20 * @param string $id Alias identifier 21 * @param string $id Alias identifier
21 * @param bool $public If this alias is public 22 * @param bool $public If this alias is public
22 */ 23 */
23 public function __construct($id, $public = true) 24 public function __construct($id, $public = true)
24 { 25 {
25 $this->id = strtolower($id); 26 $this->id = (string) $id;
26 $this->public = $public; 27 $this->public = $public;
28 $this->private = 2 > func_num_args();
27 } 29 }
28 30
29 /** 31 /**
30 * Checks if this DI Alias should be public or not. 32 * Checks if this DI Alias should be public or not.
31 * 33 *
38 40
39 /** 41 /**
40 * Sets if this Alias is public. 42 * Sets if this Alias is public.
41 * 43 *
42 * @param bool $boolean If this Alias should be public 44 * @param bool $boolean If this Alias should be public
45 *
46 * @return $this
43 */ 47 */
44 public function setPublic($boolean) 48 public function setPublic($boolean)
45 { 49 {
46 $this->public = (bool) $boolean; 50 $this->public = (bool) $boolean;
51 $this->private = false;
52
53 return $this;
54 }
55
56 /**
57 * Sets if this Alias is private.
58 *
59 * When set, the "private" state has a higher precedence than "public".
60 * In version 3.4, a "private" alias always remains publicly accessible,
61 * but triggers a deprecation notice when accessed from the container,
62 * so that the alias can be made really private in 4.0.
63 *
64 * @param bool $boolean
65 *
66 * @return $this
67 */
68 public function setPrivate($boolean)
69 {
70 $this->private = (bool) $boolean;
71
72 return $this;
73 }
74
75 /**
76 * Whether this alias is private.
77 *
78 * @return bool
79 */
80 public function isPrivate()
81 {
82 return $this->private;
47 } 83 }
48 84
49 /** 85 /**
50 * Returns the Id of this alias. 86 * Returns the Id of this alias.
51 * 87 *