This repository was archived by the owner on Feb 6, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +31
-31
lines changed Expand file tree Collapse file tree 4 files changed +31
-31
lines changed Original file line number Diff line number Diff line change @@ -140,24 +140,6 @@ public function validate($instance)
140
140
));
141
141
}
142
142
143
- /**
144
- * Implemented for backwards compatibility only.
145
- *
146
- * Returns the creation context.
147
- *
148
- * @deprecated since 3.0.0. Factories using 3.0 should use the container
149
- * instance passed to the factory instead.
150
- * @return ContainerInterface
151
- */
152
- public function getServiceLocator ()
153
- {
154
- trigger_error (sprintf (
155
- 'Usage of %s is deprecated since v3.0.0; please use the container passed to the factory instead ' ,
156
- __METHOD__
157
- ), E_USER_DEPRECATED );
158
- return $ this ->creationContext ;
159
- }
160
-
161
143
/**
162
144
* Implemented for backwards compatibility only.
163
145
*
Original file line number Diff line number Diff line change @@ -140,6 +140,24 @@ public function __construct(array $config = [])
140
140
$ this ->configure ($ config );
141
141
}
142
142
143
+ /**
144
+ * Implemented for backwards compatibility with previous plugin managers only.
145
+ *
146
+ * Returns the creation context.
147
+ *
148
+ * @deprecated since 3.0.0. Factories using 3.0 should use the container
149
+ * instance passed to the factory instead.
150
+ * @return ContainerInterface
151
+ */
152
+ public function getServiceLocator ()
153
+ {
154
+ trigger_error (sprintf (
155
+ 'Usage of %s is deprecated since v3.0.0; please use the container passed to the factory instead ' ,
156
+ __METHOD__
157
+ ), E_USER_DEPRECATED );
158
+ return $ this ->creationContext ;
159
+ }
160
+
143
161
/**
144
162
* {@inheritDoc}
145
163
*/
Original file line number Diff line number Diff line change @@ -180,19 +180,6 @@ public function testGetRaisesExceptionWhenNoFactoryIsResolved()
180
180
$ pluginManager ->get ('Some\Unknown\Service ' );
181
181
}
182
182
183
- /**
184
- * @group migration
185
- */
186
- public function testCanRetrieveParentContainerViaGetServiceLocatorWithDeprecationNotice ()
187
- {
188
- $ container = $ this ->createContainer ();
189
- set_error_handler (function ($ errno , $ errstr ) {
190
- $ this ->assertEquals (E_USER_DEPRECATED , $ errno );
191
- }, E_USER_DEPRECATED );
192
- $ this ->assertSame ($ this ->creationContext , $ container ->getServiceLocator ());
193
- restore_error_handler ();
194
- }
195
-
196
183
/**
197
184
* @group migration
198
185
*/
Original file line number Diff line number Diff line change @@ -770,4 +770,17 @@ public function testAllowOverrideFlagIsMutable($container)
770
770
$ container ->setAllowOverride (true );
771
771
$ this ->assertTrue ($ container ->getAllowOverride ());
772
772
}
773
+
774
+ /**
775
+ * @group migration
776
+ */
777
+ public function testCanRetrieveParentContainerViaGetServiceLocatorWithDeprecationNotice ()
778
+ {
779
+ $ container = $ this ->createContainer ();
780
+ set_error_handler (function ($ errno , $ errstr ) {
781
+ $ this ->assertEquals (E_USER_DEPRECATED , $ errno );
782
+ }, E_USER_DEPRECATED );
783
+ $ this ->assertSame ($ this ->creationContext , $ container ->getServiceLocator ());
784
+ restore_error_handler ();
785
+ }
773
786
}
You can’t perform that action at this time.
0 commit comments