Skip to content

Commit a19baef

Browse files
authored
Simplify version check (#1907)
* Simplify version check * Simplify version check
1 parent bca7365 commit a19baef

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Routing/Loader/RestRouteLoader.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,8 +119,7 @@ private function getControllerLocator($controller)
119119
// service_id
120120
$prefix = $controller.':';
121121

122-
// sf > 4.1 support
123-
if (method_exists(Kernel::class, 'getAnnotatedClassesToCompile')) {
122+
if (Kernel::VERSION_ID >= 40100) {
124123
$prefix .= ':';
125124
}
126125

Tests/Routing/Loader/RestYamlCollectionLoaderTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ public function testControllerAsServiceWithClassName()
219219

220220
// We check that it's "controller:method" if sf < 4.1 (controller as service) and not "controller::method"
221221
$this->assertEquals(
222-
UsersController::class.(!method_exists(Kernel::class, 'getAnnotatedClassesToCompile') ? ':' : '::').'getUsersAction',
222+
UsersController::class.(Kernel::VERSION_ID >= 40100 ? '::' : ':').'getUsersAction',
223223
$route->getDefault('_controller')
224224
);
225225

0 commit comments

Comments
 (0)