File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -122,6 +122,18 @@ public function addArgs(array $args)
122122 return $ this ;
123123 }
124124
125+ /**
126+ * Remove all available arguments
127+ *
128+ * @return Definition
129+ */
130+ public function cleanArgs ()
131+ {
132+ $ this ->arguments = array ();
133+
134+ return $ this ;
135+ }
136+
125137 /**
126138 * Adds a method call to be executed after instantiating.
127139 *
Original file line number Diff line number Diff line change @@ -224,6 +224,27 @@ public function testAddArgs()
224224 );
225225 }
226226
227+ /**
228+ * Tests removing arguments from a Defintion.
229+ *
230+ * @return void
231+ */
232+ public function testCleanArgs ()
233+ {
234+ $ definition = new Definition ($ this ->container , 'League \\Di \\Stub \\Foo ' );
235+
236+ $ definition ->addArgs (array ('foo ' , 'bar ' ));
237+
238+ $ definition ->cleanArgs ();
239+
240+ $ this ->assertAttributeEquals (
241+ array (),
242+ 'arguments ' ,
243+ $ definition ,
244+ 'All arguments should be removed from the arguments array. '
245+ );
246+ }
247+
227248 public function testWithMethod ()
228249 {
229250 $ definition = new Definition ($ this ->container , 'League \\Di \\Stub \\Qux ' );
You can’t perform that action at this time.
0 commit comments