1: <?php
2: /**
3: * This file is part of the Autarky package.
4: *
5: * (c) Andreas Lutro <anlutro@gmail.com>
6: *
7: * For the full copyright and license information, please view the LICENSE
8: * file that was distributed with this source code.
9: */
10:
11: namespace Autarky\Container\Factory;
12:
13: /**
14: * Factory argument that is class type-hinted.
15: */
16: class ClassArgument extends AbstractArgument implements ArgumentInterface
17: {
18: /**
19: * @var string
20: */
21: protected $class;
22:
23: /**
24: * Constructor.
25: *
26: * @param int $position
27: * @param string $name
28: * @param string $class
29: * @param boolean $required
30: */
31: public function __construct($position, $name, $class, $required = true)
32: {
33: parent::__construct($position, $name, $required);
34: $this->class = $class;
35: }
36:
37: /**
38: * {@inheritdoc}
39: */
40: public function isClass()
41: {
42: return true;
43: }
44:
45: /**
46: * Get the name of the class type of the argument.
47: *
48: * @return string
49: */
50: public function getClass()
51: {
52: return $this->class;
53: }
54: }
55: