Skip to content

Commit aa67a4b

Browse files
committed
use ::class constant over FQN string
1 parent c70dd93 commit aa67a4b

File tree

5 files changed

+25
-23
lines changed

5 files changed

+25
-23
lines changed

src/ResponseTagger.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,14 @@ class ResponseTagger
4242
private $tags = [];
4343

4444
/**
45-
* Options for the constructor are:
45+
* Create the response tagger with a tag capable proxy client and options.
46+
*
47+
* Supported options are:
4648
*
4749
* - strict (bool) Default: false. If set to true, throws exception when adding empty tags
4850
*
4951
* @param TagsInterface $proxyClient
5052
* @param array $options
51-
*
5253
*/
5354
public function __construct(TagsInterface $proxyClient, array $options = array())
5455
{

tests/Unit/SymfonyCache/CustomTtlListenerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function testCustomTtl()
4242
$ttlListener->useCustomTtl($event);
4343
$response = $event->getResponse();
4444

45-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
45+
$this->assertInstanceOf(Response::class, $response);
4646
$this->assertSame('120', $response->headers->getCacheControlDirective('s-maxage'));
4747
$this->assertSame('60', $response->headers->get(CustomTtlListener::SMAXAGE_BACKUP));
4848
}
@@ -60,7 +60,7 @@ public function testCustomTtlNoSmaxage()
6060
$ttlListener->useCustomTtl($event);
6161
$response = $event->getResponse();
6262

63-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
63+
$this->assertInstanceOf(Response::class, $response);
6464
$this->assertSame('120', $response->headers->getCacheControlDirective('s-maxage'));
6565
$this->assertSame('false', $response->headers->get(CustomTtlListener::SMAXAGE_BACKUP));
6666
}
@@ -79,7 +79,7 @@ public function testCleanup()
7979
$ttlListener->cleanResponse($event);
8080
$response = $event->getResponse();
8181

82-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
82+
$this->assertInstanceOf(Response::class, $response);
8383
$this->assertTrue($response->headers->hasCacheControlDirective('s-maxage'));
8484
$this->assertSame('60', $response->headers->getCacheControlDirective('s-maxage'));
8585
$this->assertFalse($response->headers->has('X-Reverse-Proxy-TTL'));
@@ -100,7 +100,7 @@ public function testCleanupNoSmaxage()
100100
$ttlListener->cleanResponse($event);
101101
$response = $event->getResponse();
102102

103-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
103+
$this->assertInstanceOf(Response::class, $response);
104104
$this->assertFalse($response->headers->hasCacheControlDirective('s_maxage'));
105105
$this->assertFalse($response->headers->has('X-Reverse-Proxy-TTL'));
106106
$this->assertFalse($response->headers->has(CustomTtlListener::SMAXAGE_BACKUP));

tests/Unit/SymfonyCache/DebugListenerTest.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function testDebugHit()
4141
$debugListener->handleDebug($event);
4242
$response = $event->getResponse();
4343

44-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
44+
$this->assertInstanceOf(Response::class, $response);
4545
$this->assertSame('HIT', $response->headers->get('X-Cache'));
4646
}
4747

@@ -57,7 +57,7 @@ public function testDebugMiss()
5757
$debugListener->handleDebug($event);
5858
$response = $event->getResponse();
5959

60-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
60+
$this->assertInstanceOf(Response::class, $response);
6161
$this->assertSame('MISS', $response->headers->get('X-Cache'));
6262
}
6363

@@ -73,7 +73,7 @@ public function testDebugUndefined()
7373
$debugListener->handleDebug($event);
7474
$response = $event->getResponse();
7575

76-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
76+
$this->assertInstanceOf(Response::class, $response);
7777
$this->assertSame('UNDETERMINED', $response->headers->get('X-Cache'));
7878
}
7979

@@ -87,7 +87,7 @@ public function testNoHeader()
8787
$debugListener->handleDebug($event);
8888
$response = $event->getResponse();
8989

90-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
90+
$this->assertInstanceOf(Response::class, $response);
9191
$this->assertFalse($response->headers->has('X-Cache'));
9292
}
9393
}

tests/Unit/SymfonyCache/PurgeSubscriberTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ public function testPurgeAllowedMiss()
6262
$purgeSubscriber->handlePurge($event);
6363
$response = $event->getResponse();
6464

65-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
65+
$this->assertInstanceOf(Response::class, $response);
6666
$this->assertSame(200, $response->getStatusCode());
6767
}
6868

@@ -78,7 +78,7 @@ public function testPurgeForbiddenMatcher()
7878
$purgeSubscriber->handlePurge($event);
7979
$response = $event->getResponse();
8080

81-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
81+
$this->assertInstanceOf(Response::class, $response);
8282
$this->assertSame(400, $response->getStatusCode());
8383
}
8484

@@ -93,7 +93,7 @@ public function testPurgeForbiddenIp()
9393
$purgeSubscriber->handlePurge($event);
9494
$response = $event->getResponse();
9595

96-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
96+
$this->assertInstanceOf(Response::class, $response);
9797
$this->assertSame(400, $response->getStatusCode());
9898
}
9999

tests/Unit/SymfonyCache/UserContextSubscriberTest.php

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public function testGenerateUserHashNotAllowed($arg, $options)
7070
$userContextSubscriber->preHandle($event);
7171
$response = $event->getResponse();
7272

73-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
73+
$this->assertInstanceOf(Response::class, $response);
7474
$this->assertSame(400, $response->getStatusCode());
7575
}
7676

@@ -88,7 +88,7 @@ public function testPassingUserHashNotAllowed($arg, $options)
8888
$userContextSubscriber->preHandle($event);
8989
$response = $event->getResponse();
9090

91-
$this->assertInstanceOf('Symfony\\Component\\HttpFoundation\\Response', $response);
91+
$this->assertInstanceOf(Response::class, $response);
9292
$this->assertSame(400, $response->getStatusCode());
9393
}
9494

@@ -206,14 +206,15 @@ public function testUserHashUserWithAuthorizationHeader($arg, $options)
206206
->with(
207207
\Mockery::on(
208208
function (Request $request) use ($that, $hashRequest) {
209-
// we need to call some methods to get the internal fields initialized
210-
$request->getMethod();
211-
$request->getPathInfo();
212-
$that->assertEquals($hashRequest, $request);
213-
$that->assertCount(0, $request->cookies->all());
214-
215-
return true;
216-
})
209+
// we need to call some methods to get the internal fields initialized
210+
$request->getMethod();
211+
$request->getPathInfo();
212+
$that->assertEquals($hashRequest, $request);
213+
$that->assertCount(0, $request->cookies->all());
214+
215+
return true;
216+
}
217+
)
217218
)
218219
->andReturn($hashResponse)
219220
->getMock();

0 commit comments

Comments
 (0)