@@ -30,7 +30,7 @@ protected function tearDown(): void
3030 /**
3131 * Shortcut for quickly defining services. The returned Definition object can be further modified if necessary.
3232 */
33- protected function registerService (string $ serviceId , string $ class ): Definition
33+ final protected function registerService (string $ serviceId , string $ class ): Definition
3434 {
3535 $ definition = new Definition ($ class );
3636
@@ -42,7 +42,7 @@ protected function registerService(string $serviceId, string $class): Definition
4242 /**
4343 * Set a service definition you manually created.
4444 */
45- protected function setDefinition (string $ serviceId , Definition $ definition ): void
45+ final protected function setDefinition (string $ serviceId , Definition $ definition ): void
4646 {
4747 $ this ->container ->setDefinition ($ serviceId , $ definition );
4848 }
@@ -52,24 +52,26 @@ protected function setDefinition(string $serviceId, Definition $definition): voi
5252 *
5353 * @param mixed $parameterValue
5454 */
55- protected function setParameter (string $ parameterId , $ parameterValue ): void
55+ final protected function setParameter (string $ parameterId , $ parameterValue ): void
5656 {
5757 $ this ->container ->setParameter ($ parameterId , $ parameterValue );
5858 }
5959
6060 /**
6161 * Call this method to compile the ContainerBuilder, to test if any problems would occur at runtime.
6262 */
63- protected function compile (): void
63+ final protected function compile (): void
6464 {
6565 $ this ->container ->compile ();
6666 }
6767
6868 /**
6969 * Assert that the ContainerBuilder for this test has a service definition with the given id and class.
7070 */
71- protected function assertContainerBuilderHasService (string $ serviceId , ?string $ expectedClass = null ): void
72- {
71+ final protected function assertContainerBuilderHasService (
72+ string $ serviceId ,
73+ ?string $ expectedClass = null
74+ ): void {
7375 $ checkExpectedClass = (func_num_args () > 1 );
7476
7577 self ::assertThat (
@@ -81,7 +83,7 @@ protected function assertContainerBuilderHasService(string $serviceId, ?string $
8183 /**
8284 * Assert that the ContainerBuilder for this test does not have a service definition with the given id.
8385 */
84- protected function assertContainerBuilderNotHasService (string $ serviceId ): void
86+ final protected function assertContainerBuilderNotHasService (string $ serviceId ): void
8587 {
8688 self ::assertThat (
8789 $ this ->container ,
@@ -92,7 +94,7 @@ protected function assertContainerBuilderNotHasService(string $serviceId): void
9294 /**
9395 * Assert that the ContainerBuilder for this test has a synthetic service with the given id.
9496 */
95- protected function assertContainerBuilderHasSyntheticService (string $ serviceId ): void
97+ final protected function assertContainerBuilderHasSyntheticService (string $ serviceId ): void
9698 {
9799 self ::assertThat (
98100 $ this ->container ,
@@ -103,8 +105,10 @@ protected function assertContainerBuilderHasSyntheticService(string $serviceId):
103105 /**
104106 * Assert that the ContainerBuilder for this test has an alias and that it is an alias for the given service id.
105107 */
106- protected function assertContainerBuilderHasAlias (string $ aliasId , ?string $ expectedServiceId = null ): void
107- {
108+ final protected function assertContainerBuilderHasAlias (
109+ string $ aliasId ,
110+ ?string $ expectedServiceId = null
111+ ): void {
108112 self ::assertThat (
109113 $ this ->container ,
110114 new ContainerBuilderHasAliasConstraint ($ aliasId , $ expectedServiceId )
@@ -116,8 +120,10 @@ protected function assertContainerBuilderHasAlias(string $aliasId, ?string $expe
116120 *
117121 * @param mixed $expectedParameterValue
118122 */
119- protected function assertContainerBuilderHasParameter (string $ parameterName , $ expectedParameterValue = null ): void
120- {
123+ final protected function assertContainerBuilderHasParameter (
124+ string $ parameterName ,
125+ $ expectedParameterValue = null
126+ ): void {
121127 $ checkParameterValue = (func_num_args () > 1 );
122128
123129 self ::assertThat (
@@ -132,7 +138,7 @@ protected function assertContainerBuilderHasParameter(string $parameterName, $ex
132138 *
133139 * @param mixed $expectedValue
134140 */
135- protected function assertContainerBuilderHasServiceDefinitionWithArgument (
141+ final protected function assertContainerBuilderHasServiceDefinitionWithArgument (
136142 string $ serviceId ,
137143 $ argumentIndex ,
138144 $ expectedValue = null
@@ -153,7 +159,7 @@ protected function assertContainerBuilderHasServiceDefinitionWithArgument(
153159 * @param int|string $argumentIndex
154160 * @param array $expectedServiceMap an array of service-id references and their key in the map
155161 */
156- protected function assertContainerBuilderHasServiceDefinitionWithServiceLocatorArgument (
162+ final protected function assertContainerBuilderHasServiceDefinitionWithServiceLocatorArgument (
157163 string $ serviceId ,
158164 $ argumentIndex ,
159165 array $ expectedValue
@@ -170,7 +176,7 @@ protected function assertContainerBuilderHasServiceDefinitionWithServiceLocatorA
170176 *
171177 * @param int|null $index
172178 */
173- protected function assertContainerBuilderHasServiceDefinitionWithMethodCall (
179+ final protected function assertContainerBuilderHasServiceDefinitionWithMethodCall (
174180 string $ serviceId ,
175181 string $ method ,
176182 array $ arguments = [],
@@ -185,7 +191,7 @@ protected function assertContainerBuilderHasServiceDefinitionWithMethodCall(
185191 * Assert that the ContainerBuilder for this test has a service definition with the given id, which has a tag
186192 * with the given attributes.
187193 */
188- protected function assertContainerBuilderHasServiceDefinitionWithTag (
194+ final protected function assertContainerBuilderHasServiceDefinitionWithTag (
189195 string $ serviceId ,
190196 string $ tag ,
191197 array $ attributes = []
@@ -199,8 +205,10 @@ protected function assertContainerBuilderHasServiceDefinitionWithTag(
199205 * Assert that the ContainerBuilder for this test has a service definition with the given id which is a decorated
200206 * service and it has the given parent service.
201207 */
202- protected function assertContainerBuilderHasServiceDefinitionWithParent (string $ serviceId , string $ parentServiceId ): void
203- {
208+ final protected function assertContainerBuilderHasServiceDefinitionWithParent (
209+ string $ serviceId ,
210+ string $ parentServiceId
211+ ): void {
204212 $ definition = $ this ->container ->findDefinition ($ serviceId );
205213
206214 self ::assertThat ($ definition , new DefinitionIsChildOfConstraint ($ parentServiceId ));
@@ -211,8 +219,10 @@ protected function assertContainerBuilderHasServiceDefinitionWithParent(string $
211219 *
212220 * @param array $expectedServiceMap an array of service-id references and their key in the map
213221 */
214- protected function assertContainerBuilderHasServiceLocator (string $ serviceId , array $ expectedServiceMap = []): void
215- {
222+ final protected function assertContainerBuilderHasServiceLocator (
223+ string $ serviceId ,
224+ array $ expectedServiceMap = []
225+ ): void {
216226 $ definition = $ this ->container ->findDefinition ($ serviceId );
217227
218228 // Service locator was provided as context (and therefor a factory)
0 commit comments