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\Argument;
14 use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
15 use Symfony\Component\DependencyInjection\Reference;
18 * Represents a service wrapped in a memoizing closure.
20 * @author Nicolas Grekas <p@tchwork.com>
22 class ServiceClosureArgument implements ArgumentInterface
26 public function __construct(Reference $reference)
28 $this->values = array($reference);
34 public function getValues()
42 public function setValues(array $values)
44 if (array(0) !== array_keys($values) || !($values[0] instanceof Reference || null === $values[0])) {
45 throw new InvalidArgumentException('A ServiceClosureArgument must hold one and only one Reference.');
48 $this->values = $values;