diff --git a/.php_cs b/.php_cs new file mode 100644 index 0000000..609d4c3 --- /dev/null +++ b/.php_cs @@ -0,0 +1,22 @@ +setRules([ + '@PHP71Migration' => true, + '@PHPUnit75Migration:risky' => true, + '@Symfony' => true, + '@Symfony:risky' => true, + 'protected_to_private' => false, + ]) + ->setRiskyAllowed(true) + ->setFinder( + (new PhpCsFixer\Finder()) + ->in(__DIR__.'/src') + ->in(__DIR__.'/tests') + ->append([__FILE__]) + ) +; diff --git a/tests/Format/PortNumbersTest.php b/tests/Format/PortNumbersTest.php index 3071179..80bdb7e 100644 --- a/tests/Format/PortNumbersTest.php +++ b/tests/Format/PortNumbersTest.php @@ -90,6 +90,7 @@ public function testRemotePortInvalid($line) $this->expectException(\Kassner\LogParser\FormatException::class); $this->parser->parse($line); } + /** * @dataProvider successProvider */ @@ -118,9 +119,9 @@ public function testCanonicalPortInvalid($line) */ public function testPortFormatSuccess($portType) { - $format = '%t "%r" %{' . $portType . '}p'; + $format = '%t "%r" %{'.$portType.'}p'; $this->parser->setFormat($format); - $entry= $this->parser->parse('[10/Sep/2013:15:50:06 +0000] "GET /electronics/cameras/accessories/universal-camera-charger HTTP/1.1" 8080'); + $entry = $this->parser->parse('[10/Sep/2013:15:50:06 +0000] "GET /electronics/cameras/accessories/universal-camera-charger HTTP/1.1" 8080'); $propertyName = sprintf('%sPort', $portType); $this->assertObjectHasAttribute($propertyName, $entry); @@ -132,7 +133,7 @@ public function testPortFormatSuccess($portType) */ public function testPortFormatInvalid($portType) { - $format = '%t "%r" %{' . $portType . '}p'; + $format = '%t "%r" %{'.$portType.'}p'; $this->parser->setFormat($format); $this->expectException(\Kassner\LogParser\FormatException::class); $this->parser->parse('[10/Sep/2013:15:50:06 +0000] "GET /electronics/cameras/accessories/universal-camera-charger HTTP/1.1" 8080'); @@ -143,7 +144,7 @@ public function successProvider() return [ ['443'], ['80'], - ['123423'] + ['123423'], ]; } @@ -153,7 +154,7 @@ public function invalidProvider() [''], ['Nan'], ['+Inf'], - ['1.6e-19'] + ['1.6e-19'], ]; }