Skip to content

Commit 54fb41e

Browse files
committed
minor #21537 Static code analysis with Php Inspections (EA Extended) (kalessil)
This PR was squashed before being merged into the 2.7 branch (closes #21537). Discussion ---------- Static code analysis with Php Inspections (EA Extended) | Q | A | ------------- | --- | Branch? | 2.7 | Bug fix? | no | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | -- | License | MIT | Doc PR | -- - Unnecessary proxy methods and methods duplicating parents ones removed; - Type casings instead of PHP4 functions; - Usage of copy instead of file combining file get/put contents; - One time use variables cleaned up; - Superfluous functions calls in loop termination conditions fixed; Commits ------- 3feeca7 Static code analysis with Php Inspections (EA Extended)
2 parents 87a0b9e + 664b773 commit 54fb41e

File tree

4 files changed

+7
-24
lines changed

4 files changed

+7
-24
lines changed

Client.php

Lines changed: 3 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
* Client simulates a browser and makes requests to a Kernel object.
2626
*
2727
* @author Fabien Potencier <[email protected]>
28+
*
29+
* @method Request|null getRequest() A Request instance
30+
* @method Response|null getResponse() A Response instance
2831
*/
2932
class Client extends BaseClient
3033
{
@@ -47,26 +50,6 @@ public function __construct(HttpKernelInterface $kernel, array $server = array()
4750
parent::__construct($server, $history, $cookieJar);
4851
}
4952

50-
/**
51-
* {@inheritdoc}
52-
*
53-
* @return Request|null A Request instance
54-
*/
55-
public function getRequest()
56-
{
57-
return parent::getRequest();
58-
}
59-
60-
/**
61-
* {@inheritdoc}
62-
*
63-
* @return Response|null A Response instance
64-
*/
65-
public function getResponse()
66-
{
67-
return parent::getResponse();
68-
}
69-
7053
/**
7154
* Makes a request.
7255
*

DataCollector/Util/ValueExporter.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public function exportValue($value, $depth = 1, $deep = false)
3333

3434
if (is_object($value)) {
3535
if ($value instanceof \DateTime || $value instanceof \DateTimeInterface) {
36-
return sprintf('Object(%s) - %s', get_class($value), $value->format(\DateTime::ISO8601));
36+
return sprintf('Object(%s) - %s', get_class($value), $value->format(\DateTime::ATOM));
3737
}
3838

3939
return sprintf('Object(%s)', get_class($value));

Profiler/MemcacheProfilerStorage.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ protected function getMemcache()
4141
$port = $matches[3];
4242

4343
$memcache = new \Memcache();
44-
$memcache->addserver($host, $port);
44+
$memcache->addServer($host, $port);
4545

4646
$this->memcache = $memcache;
4747
}

Tests/DataCollector/Util/ValueExporterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ protected function setUp()
2828
public function testDateTime()
2929
{
3030
$dateTime = new \DateTime('2014-06-10 07:35:40', new \DateTimeZone('UTC'));
31-
$this->assertSame('Object(DateTime) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime));
31+
$this->assertSame('Object(DateTime) - 2014-06-10T07:35:40+00:00', $this->valueExporter->exportValue($dateTime));
3232
}
3333

3434
/**
@@ -37,7 +37,7 @@ public function testDateTime()
3737
public function testDateTimeImmutable()
3838
{
3939
$dateTime = new \DateTimeImmutable('2014-06-10 07:35:40', new \DateTimeZone('UTC'));
40-
$this->assertSame('Object(DateTimeImmutable) - 2014-06-10T07:35:40+0000', $this->valueExporter->exportValue($dateTime));
40+
$this->assertSame('Object(DateTimeImmutable) - 2014-06-10T07:35:40+00:00', $this->valueExporter->exportValue($dateTime));
4141
}
4242

4343
public function testIncompleteClass()

0 commit comments

Comments
 (0)