4 * This file is part of the Symfony package.
6 * (c) Fabien Potencier <fabien@symfony.com>
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
12 namespace Symfony\Component\DependencyInjection;
21 * @param string $id Alias identifier
22 * @param bool $public If this alias is public
24 public function __construct($id, $public = true)
26 $this->id = (string) $id;
27 $this->public = $public;
28 $this->private = 2 > \func_num_args();
32 * Checks if this DI Alias should be public or not.
36 public function isPublic()
42 * Sets if this Alias is public.
44 * @param bool $boolean If this Alias should be public
48 public function setPublic($boolean)
50 $this->public = (bool) $boolean;
51 $this->private = false;
57 * Sets if this Alias is private.
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.
64 * @param bool $boolean
68 public function setPrivate($boolean)
70 $this->private = (bool) $boolean;
76 * Whether this alias is private.
80 public function isPrivate()
82 return $this->private;
86 * Returns the Id of this alias.
88 * @return string The alias id
90 public function __toString()