Skip to content

Commit 958357f

Browse files
fre5hnicolas-grekas
authored andcommitted
Use ::class constants instead of __NAMESPACE__ when possible
1 parent 236fdec commit 958357f

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

Tests/Controller/ContainerControllerResolverTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ public function testGetControllerInvokableService()
7171
public function testGetControllerInvokableServiceWithClassNameAsName()
7272
{
7373
$invokableController = new InvokableController('bar');
74-
$className = __NAMESPACE__.'\InvokableController';
74+
$className = InvokableController::class;
7575

7676
$container = $this->createMockContainer();
7777
$container->expects($this->once())

Tests/ControllerMetadata/ArgumentMetadataFactoryTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function testSignature2()
4848

4949
$this->assertEquals([
5050
new ArgumentMetadata('foo', self::class, false, true, null, true),
51-
new ArgumentMetadata('bar', __NAMESPACE__.'\FakeClassThatDoesNotExist', false, true, null, true),
51+
new ArgumentMetadata('bar', FakeClassThatDoesNotExist::class, false, true, null, true),
5252
new ArgumentMetadata('baz', 'Fake\ImportedAndFake', false, true, null, true),
5353
], $arguments);
5454
}
@@ -58,7 +58,7 @@ public function testSignature3()
5858
$arguments = $this->factory->createArgumentMetadata([$this, 'signature3']);
5959

6060
$this->assertEquals([
61-
new ArgumentMetadata('bar', __NAMESPACE__.'\FakeClassThatDoesNotExist', false, false, null),
61+
new ArgumentMetadata('bar', FakeClassThatDoesNotExist::class, false, false, null),
6262
new ArgumentMetadata('baz', 'Fake\ImportedAndFake', false, false, null),
6363
], $arguments);
6464
}

Tests/DataCollector/RequestDataCollectorTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ public function provideControllerCallables()
9999
'"Regular" callable',
100100
[$this, 'testControllerInspection'],
101101
[
102-
'class' => __NAMESPACE__.'\RequestDataCollectorTest',
102+
'class' => RequestDataCollectorTest::class,
103103
'method' => 'testControllerInspection',
104104
'file' => __FILE__,
105105
'line' => $r1->getStartLine(),

0 commit comments

Comments
 (0)