File tree Expand file tree Collapse file tree 2 files changed +13
-4
lines changed
src/Symfony/Component/DependencyInjection Expand file tree Collapse file tree 2 files changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -51,8 +51,8 @@ class Definition
51
51
private static $ defaultDeprecationTemplate = 'The "%service_id%" service is deprecated. You should stop using it, as it will soon be removed. ' ;
52
52
53
53
/**
54
- * @param string|null $class The service class
55
- * @param array $arguments An array of arguments to pass to the service constructor
54
+ * @param string|Parameter| null $class The service class
55
+ * @param array $arguments An array of arguments to pass to the service constructor
56
56
*/
57
57
public function __construct ($ class = null , array $ arguments = [])
58
58
{
@@ -157,7 +157,7 @@ public function getDecoratedService()
157
157
/**
158
158
* Sets the service class.
159
159
*
160
- * @param string $class The service class
160
+ * @param string|Parameter|null $class The service class
161
161
*
162
162
* @return $this
163
163
*/
@@ -173,7 +173,7 @@ public function setClass($class)
173
173
/**
174
174
* Gets the service class.
175
175
*
176
- * @return string|null The service class
176
+ * @return string|Parameter| null The service class
177
177
*/
178
178
public function getClass ()
179
179
{
Original file line number Diff line number Diff line change 13
13
14
14
use PHPUnit \Framework \TestCase ;
15
15
use Symfony \Component \DependencyInjection \Definition ;
16
+ use Symfony \Component \DependencyInjection \Parameter ;
16
17
17
18
class DefinitionTest extends TestCase
18
19
{
@@ -45,6 +46,14 @@ public function testSetGetClass()
45
46
$ this ->assertEquals ('foo ' , $ def ->getClass (), '->getClass() returns the class name ' );
46
47
}
47
48
49
+ public function testSetGetClassWithParameter ()
50
+ {
51
+ $ def = new Definition ('stdClass ' );
52
+ $ parameter = new Parameter ('foo ' );
53
+ $ this ->assertSame ($ def , $ def ->setClass ($ parameter ), '->setClass() implements a fluent interface ' );
54
+ $ this ->assertSame ($ parameter , $ def ->getClass (), '->getClass() returns the parameterized class name ' );
55
+ }
56
+
48
57
public function testSetGetDecoratedService ()
49
58
{
50
59
$ def = new Definition ('stdClass ' );
You can’t perform that action at this time.
0 commit comments