Skip to content

Commit ba936f7

Browse files
committed
Remove php5 support
1 parent 9bd5a8c commit ba936f7

File tree

5 files changed

+16
-31
lines changed

5 files changed

+16
-31
lines changed

.travis.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,13 @@
11
language: php
22

33
php:
4-
- 5.5
5-
- 5.6
64
- 7.0
75
- 7.1
8-
- hhvm
96

107
env:
118
- COMPOSER_FLAGS=--prefer-lowest
129
- COMPOSER_FLAGS=
13-
10+
1411
before_script:
1512
- composer update --no-interaction --no-suggest --prefer-dist $COMPOSER_FLAGS
1613

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@
1313
"psr-3"
1414
],
1515
"require": {
16-
"php": ">=5.5",
16+
"php": ">=7.0",
1717
"psr/log": "^1.0.0",
1818
"psr/http-message": "^1.0",
1919
"zendframework/zend-diactoros": "^1.1.3",
2020
"http-interop/http-middleware": "^0.4.1"
2121
},
2222
"require-dev": {
23-
"phpunit/phpunit": "^4.8"
23+
"phpunit/phpunit": "^6.1"
2424
},
2525
"autoload": {
2626
"psr-4": {

src/LogMiddleware.php

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare (strict_types=1);
4+
35
namespace PhpMiddleware\LogHttpMessages;
46

57
use Interop\Http\ServerMiddleware\DelegateInterface;
@@ -11,28 +13,14 @@
1113
use Psr\Log\LogLevel;
1214
use UnexpectedValueException;
1315

14-
class LogMiddleware implements MiddlewareInterface
16+
final class LogMiddleware implements MiddlewareInterface
1517
{
16-
/**
17-
* @var Logger
18-
*/
1918
protected $logger;
2019

21-
/**
22-
* @var int
23-
*/
2420
protected $level;
2521

26-
/**
27-
* @var HttpMessagesFormatter
28-
*/
2922
protected $formatter;
3023

31-
/**
32-
* @param HttpMessagesFormatter $formatter
33-
* @param Logger $logger
34-
* @param int $level
35-
*/
3624
public function __construct(HttpMessagesFormatter $formatter, Logger $logger, $level = LogLevel::INFO)
3725
{
3826
$this->formatter = $formatter;

test/Formatter/BothFormatterTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,11 @@
55
use PhpMiddleware\LogHttpMessages\Formatter\BothFormatter;
66
use PhpMiddleware\LogHttpMessages\Formatter\RequestFormatter;
77
use PhpMiddleware\LogHttpMessages\Formatter\ResponseFormatter;
8-
use PHPUnit_Framework_TestCase;
8+
use PHPUnit\Framework\TestCase;
99
use Zend\Diactoros\Response;
1010
use Zend\Diactoros\ServerRequest;
1111

12-
class BothFormatterTest extends PHPUnit_Framework_TestCase
12+
class BothFormatterTest extends TestCase
1313
{
1414
protected $formatter;
1515

test/LogMiddlewareTest.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@
55
use Interop\Http\ServerMiddleware\DelegateInterface;
66
use PhpMiddleware\LogHttpMessages\Formatter\HttpMessagesFormatter;
77
use PhpMiddleware\LogHttpMessages\LogMiddleware;
8-
use PHPUnit_Framework_TestCase;
8+
use PHPUnit\Framework\TestCase;
99
use Psr\Http\Message\ResponseInterface;
1010
use Psr\Http\Message\ServerRequestInterface;
1111
use Psr\Log\LoggerInterface;
1212
use Psr\Log\LogLevel;
1313
use UnexpectedValueException;
1414

15-
class LogMiddlewareTest extends PHPUnit_Framework_TestCase
15+
class LogMiddlewareTest extends TestCase
1616
{
1717
public $middleware;
1818
protected $formatter;
@@ -26,17 +26,17 @@ class LogMiddlewareTest extends PHPUnit_Framework_TestCase
2626

2727
protected function setUp()
2828
{
29-
$this->request = $this->getMock(ServerRequestInterface::class);
30-
$this->response = $this->getMock(ResponseInterface::class);
29+
$this->request = $this->createMock(ServerRequestInterface::class);
30+
$this->response = $this->createMock(ResponseInterface::class);
3131
$this->nextResponse = clone $this->response;
3232
$this->next = function () {
3333
return $this->nextResponse;
3434
};
35-
$this->delegate = $this->getMock(DelegateInterface::class);
35+
$this->delegate = $this->createMock(DelegateInterface::class);
3636
$this->delegate->method('process')->willReturn($this->nextResponse);
3737

38-
$this->formatter = $this->getMock(HttpMessagesFormatter::class);
39-
$this->logger = $this->getMock(LoggerInterface::class);
38+
$this->formatter = $this->createMock(HttpMessagesFormatter::class);
39+
$this->logger = $this->createMock(LoggerInterface::class);
4040
$this->level = LogLevel::ALERT;
4141

4242
$this->middleware = new LogMiddleware($this->formatter, $this->logger, $this->level);
@@ -60,7 +60,7 @@ public function testTryToLogNullMessage($middlewareExecutor)
6060
{
6161
$this->formatter->method('format')->willReturn(null);
6262

63-
$this->setExpectedException(UnexpectedValueException::class);
63+
$this->expectException(UnexpectedValueException::class);
6464

6565
$middlewareExecutor($this);
6666
}

0 commit comments

Comments
 (0)