Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/dependency-injection/Alias.php @ 0:4c8ae668cc8c
Initial import (non-working)
author | Chris Cannam |
---|---|
date | Wed, 29 Nov 2017 16:09:58 +0000 |
parents | |
children | 1fec387a4317 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:4c8ae668cc8c |
---|---|
1 <?php | |
2 | |
3 /* | |
4 * This file is part of the Symfony package. | |
5 * | |
6 * (c) Fabien Potencier <fabien@symfony.com> | |
7 * | |
8 * For the full copyright and license information, please view the LICENSE | |
9 * file that was distributed with this source code. | |
10 */ | |
11 | |
12 namespace Symfony\Component\DependencyInjection; | |
13 | |
14 class Alias | |
15 { | |
16 private $id; | |
17 private $public; | |
18 | |
19 /** | |
20 * @param string $id Alias identifier | |
21 * @param bool $public If this alias is public | |
22 */ | |
23 public function __construct($id, $public = true) | |
24 { | |
25 $this->id = strtolower($id); | |
26 $this->public = $public; | |
27 } | |
28 | |
29 /** | |
30 * Checks if this DI Alias should be public or not. | |
31 * | |
32 * @return bool | |
33 */ | |
34 public function isPublic() | |
35 { | |
36 return $this->public; | |
37 } | |
38 | |
39 /** | |
40 * Sets if this Alias is public. | |
41 * | |
42 * @param bool $boolean If this Alias should be public | |
43 */ | |
44 public function setPublic($boolean) | |
45 { | |
46 $this->public = (bool) $boolean; | |
47 } | |
48 | |
49 /** | |
50 * Returns the Id of this alias. | |
51 * | |
52 * @return string The alias id | |
53 */ | |
54 public function __toString() | |
55 { | |
56 return $this->id; | |
57 } | |
58 } |