@@ -29,13 +29,8 @@ protected function tearDown(): void
2929
3030 /**
3131 * Shortcut for quickly defining services. The returned Definition object can be further modified if necessary.
32- *
33- * @param $serviceId
34- * @param $class
35- *
36- * @return Definition
3732 */
38- protected function registerService ($ serviceId , $ class )
33+ protected function registerService (string $ serviceId , string $ class ): Definition
3934 {
4035 $ definition = new Definition ($ class );
4136
@@ -46,41 +41,34 @@ protected function registerService($serviceId, $class)
4641
4742 /**
4843 * Set a service definition you manually created.
49- *
50- * @param $serviceId
51- * @param Definition $definition
5244 */
53- protected function setDefinition ($ serviceId , Definition $ definition )
45+ protected function setDefinition (string $ serviceId , Definition $ definition ): void
5446 {
5547 $ this ->container ->setDefinition ($ serviceId , $ definition );
5648 }
5749
5850 /**
5951 * Set a parameter.
6052 *
61- * @param $parameterId
62- * @param $parameterValue
53+ * @param mixed $parameterValue
6354 */
64- protected function setParameter ($ parameterId , $ parameterValue )
55+ protected function setParameter (string $ parameterId , $ parameterValue ): void
6556 {
6657 $ this ->container ->setParameter ($ parameterId , $ parameterValue );
6758 }
6859
6960 /**
7061 * Call this method to compile the ContainerBuilder, to test if any problems would occur at runtime.
7162 */
72- protected function compile ()
63+ protected function compile (): void
7364 {
7465 $ this ->container ->compile ();
7566 }
7667
7768 /**
7869 * Assert that the ContainerBuilder for this test has a service definition with the given id and class.
79- *
80- * @param $serviceId
81- * @param $expectedClass
8270 */
83- protected function assertContainerBuilderHasService ($ serviceId , $ expectedClass = null )
71+ protected function assertContainerBuilderHasService (string $ serviceId , ? string $ expectedClass = null ): void
8472 {
8573 $ checkExpectedClass = (func_num_args () > 1 );
8674
@@ -92,10 +80,8 @@ protected function assertContainerBuilderHasService($serviceId, $expectedClass =
9280
9381 /**
9482 * Assert that the ContainerBuilder for this test does not have a service definition with the given id.
95- *
96- * @param $serviceId
9783 */
98- protected function assertContainerBuilderNotHasService ($ serviceId )
84+ protected function assertContainerBuilderNotHasService (string $ serviceId ): void
9985 {
10086 self ::assertThat (
10187 $ this ->container ,
@@ -105,10 +91,8 @@ protected function assertContainerBuilderNotHasService($serviceId)
10591
10692 /**
10793 * Assert that the ContainerBuilder for this test has a synthetic service with the given id.
108- *
109- * @param $serviceId
11094 */
111- protected function assertContainerBuilderHasSyntheticService ($ serviceId )
95+ protected function assertContainerBuilderHasSyntheticService (string $ serviceId ): void
11296 {
11397 self ::assertThat (
11498 $ this ->container ,
@@ -118,11 +102,8 @@ protected function assertContainerBuilderHasSyntheticService($serviceId)
118102
119103 /**
120104 * Assert that the ContainerBuilder for this test has an alias and that it is an alias for the given service id.
121- *
122- * @param $aliasId
123- * @param $expectedServiceId
124105 */
125- protected function assertContainerBuilderHasAlias ($ aliasId , $ expectedServiceId = null )
106+ protected function assertContainerBuilderHasAlias (string $ aliasId , ? string $ expectedServiceId = null ): void
126107 {
127108 self ::assertThat (
128109 $ this ->container ,
@@ -133,10 +114,9 @@ protected function assertContainerBuilderHasAlias($aliasId, $expectedServiceId =
133114 /**
134115 * Assert that the ContainerBuilder for this test has a parameter and that its value is the given value.
135116 *
136- * @param $parameterName
137- * @param $expectedParameterValue
117+ * @param mixed $expectedParameterValue
138118 */
139- protected function assertContainerBuilderHasParameter ($ parameterName , $ expectedParameterValue = null )
119+ protected function assertContainerBuilderHasParameter (string $ parameterName , $ expectedParameterValue = null ): void
140120 {
141121 $ checkParameterValue = (func_num_args () > 1 );
142122
@@ -150,15 +130,13 @@ protected function assertContainerBuilderHasParameter($parameterName, $expectedP
150130 * Assert that the ContainerBuilder for this test has a service definition with the given id, which has an argument
151131 * at the given index, and its value is the given value.
152132 *
153- * @param $serviceId
154- * @param $argumentIndex
155- * @param $expectedValue
133+ * @param mixed $expectedValue
156134 */
157135 protected function assertContainerBuilderHasServiceDefinitionWithArgument (
158- $ serviceId ,
136+ string $ serviceId ,
159137 $ argumentIndex ,
160138 $ expectedValue = null
161- ) {
139+ ): void {
162140 $ definition = $ this ->container ->findDefinition ($ serviceId );
163141 $ checkValue = (func_num_args () > 2 );
164142
@@ -172,15 +150,14 @@ protected function assertContainerBuilderHasServiceDefinitionWithArgument(
172150 * Assert that the ContainerBuilder for this test has a service definition with the given id, which has an argument
173151 * at the given index, and its value is a ServiceLocator with a reference-map equal to the given value.
174152 *
175- * @param string $serviceId
176153 * @param int|string $argumentIndex
177154 * @param array $expectedServiceMap an array of service-id references and their key in the map
178155 */
179156 protected function assertContainerBuilderHasServiceDefinitionWithServiceLocatorArgument (
180- $ serviceId ,
157+ string $ serviceId ,
181158 $ argumentIndex ,
182159 array $ expectedValue
183- ) {
160+ ): void {
184161 self ::assertThat (
185162 $ this ->container ,
186163 new DefinitionArgumentEqualsServiceLocatorConstraint ($ serviceId , $ argumentIndex , $ expectedValue )
@@ -191,17 +168,14 @@ protected function assertContainerBuilderHasServiceDefinitionWithServiceLocatorA
191168 * Assert that the ContainerBuilder for this test has a service definition with the given id, which has a method
192169 * call to the given method with the given arguments.
193170 *
194- * @param string $serviceId
195- * @param string $method
196- * @param array $arguments
197171 * @param int|null $index
198172 */
199173 protected function assertContainerBuilderHasServiceDefinitionWithMethodCall (
200- $ serviceId ,
201- $ method ,
174+ string $ serviceId ,
175+ string $ method ,
202176 array $ arguments = [],
203177 $ index = null
204- ) {
178+ ): void {
205179 $ definition = $ this ->container ->findDefinition ($ serviceId );
206180
207181 self ::assertThat ($ definition , new DefinitionHasMethodCallConstraint ($ method , $ arguments , $ index ));
@@ -210,16 +184,12 @@ protected function assertContainerBuilderHasServiceDefinitionWithMethodCall(
210184 /**
211185 * Assert that the ContainerBuilder for this test has a service definition with the given id, which has a tag
212186 * with the given attributes.
213- *
214- * @param string $serviceId
215- * @param string $tag
216- * @param array $attributes
217187 */
218188 protected function assertContainerBuilderHasServiceDefinitionWithTag (
219- $ serviceId ,
220- $ tag ,
189+ string $ serviceId ,
190+ string $ tag ,
221191 array $ attributes = []
222- ) {
192+ ): void {
223193 $ definition = $ this ->container ->findDefinition ($ serviceId );
224194
225195 self ::assertThat ($ definition , new DefinitionHasTagConstraint ($ tag , $ attributes ));
@@ -228,11 +198,8 @@ protected function assertContainerBuilderHasServiceDefinitionWithTag(
228198 /**
229199 * Assert that the ContainerBuilder for this test has a service definition with the given id which is a decorated
230200 * service and it has the given parent service.
231- *
232- * @param $serviceId
233- * @param $parentServiceId
234201 */
235- protected function assertContainerBuilderHasServiceDefinitionWithParent ($ serviceId , $ parentServiceId )
202+ protected function assertContainerBuilderHasServiceDefinitionWithParent (string $ serviceId , string $ parentServiceId ): void
236203 {
237204 $ definition = $ this ->container ->findDefinition ($ serviceId );
238205
@@ -242,10 +209,9 @@ protected function assertContainerBuilderHasServiceDefinitionWithParent($service
242209 /**
243210 * Assert that the ContainerBuilder for this test has a ServiceLocator service definition with the given id.
244211 *
245- * @param string $serviceId
246- * @param array $expectedServiceMap an array of service-id references and their key in the map
212+ * @param array $expectedServiceMap an array of service-id references and their key in the map
247213 */
248- protected function assertContainerBuilderHasServiceLocator (string $ serviceId , array $ expectedServiceMap = [])
214+ protected function assertContainerBuilderHasServiceLocator (string $ serviceId , array $ expectedServiceMap = []): void
249215 {
250216 $ definition = $ this ->container ->findDefinition ($ serviceId );
251217
0 commit comments