Skip to content

Commit 3aeea6f

Browse files
committed
php 8.0 min version
1 parent b3b899c commit 3aeea6f

File tree

10 files changed

+43
-67
lines changed

10 files changed

+43
-67
lines changed

.github/workflows/ci.yml

-23
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,6 @@ on:
77
- cron: '0 0 * * *'
88

99
jobs:
10-
php74-min:
11-
name: PHP 7.4 (--prefer-lowest)
12-
runs-on: ubuntu-20.04
13-
steps:
14-
- name: checkout
15-
uses: actions/checkout@v2
16-
- name: composer test
17-
uses: docker://chubbyphp/ci-php74:latest
18-
env:
19-
COMPOSER_ARGS: "--prefer-lowest"
20-
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21-
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
22-
php74:
23-
name: PHP 7.4
24-
runs-on: ubuntu-20.04
25-
steps:
26-
- name: checkout
27-
uses: actions/checkout@v2
28-
- name: composer test
29-
uses: docker://chubbyphp/ci-php74:latest
30-
env:
31-
COVERALLS_REPO_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32-
STRYKER_DASHBOARD_API_KEY: ${{ secrets.STRYKER_DASHBOARD_API_KEY }}
3310
php80:
3411
name: PHP 8.0
3512
runs-on: ubuntu-20.04

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2021 Dominik Zogg
1+
Copyright (c) 2022 Dominik Zogg
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

+11-11
Original file line numberDiff line numberDiff line change
@@ -22,20 +22,20 @@ A minimal skeleton to start with a minimal php project.
2222

2323
## Requirements
2424

25-
* php: ^7.4|^8.0
26-
* [chubbyphp/chubbyphp-clean-directories][20]: ^1.1.1
27-
* [chubbyphp/chubbyphp-framework][21]: ^3.5
28-
* [chubbyphp/chubbyphp-framework-router-fastroute][22]: ^1.2
29-
* [chubbyphp/chubbyphp-laminas-config][23]: ^1.2.1
30-
* [monolog/monolog][24]: ^2.2
31-
* [psr/container][25]: ^1.1|^2.0
25+
* php: ^8.0
26+
* [chubbyphp/chubbyphp-clean-directories][20]: ^1.2
27+
* [chubbyphp/chubbyphp-framework][21]: ^4.1
28+
* [chubbyphp/chubbyphp-framework-router-fastroute][22]: ^1.3.1
29+
* [chubbyphp/chubbyphp-laminas-config][23]: ^1.3
30+
* [monolog/monolog][24]: ^2.3.5
31+
* [psr/container][25]: ^1.1.2|^2.0.2
3232
* [psr/http-factory][26]: ^1.0.1
3333
* [psr/http-message][27]: ^1.0.1
3434
* [psr/http-server-handler][28]: ^1.0.1
3535
* [psr/http-server-middleware][29]: ^1.0.1
36-
* [psr/log][30]: ^1.1.4
37-
* [slim/psr7][31]: ^1.4
38-
* [symfony/console][32]: ^4.4.23|^5.2.8
36+
* [psr/log][30]: ^1.1.4|^2.0|^3.0
37+
* [slim/psr7][31]: ^1.5
38+
* [symfony/console][32]: ^4.4.38|^5.4.5|^6.0
3939

4040
## Installation
4141

@@ -55,7 +55,7 @@ APP_ENV=dev php -S localhost:10080 -t public public/index.php
5555

5656
## Copyright
5757

58-
Dominik Zogg 2021
58+
Dominik Zogg 2022
5959

6060
[10]: https://travis-ci.org/chubbyphp/chubbyphp-framework-skeleton
6161

composer.json

+19-15
Original file line numberDiff line numberDiff line change
@@ -10,31 +10,31 @@
1010
}
1111
],
1212
"require": {
13-
"php": "^7.4|^8.0",
13+
"php": "^8.0",
1414
"ext-json": "*",
15-
"chubbyphp/chubbyphp-clean-directories": "^1.1.1",
16-
"chubbyphp/chubbyphp-framework-router-fastroute": "^1.2",
17-
"chubbyphp/chubbyphp-framework": "^3.5",
18-
"chubbyphp/chubbyphp-laminas-config": "^1.2.1",
19-
"monolog/monolog": "^2.2",
20-
"psr/container": "^1.1|^2.0",
15+
"chubbyphp/chubbyphp-clean-directories": "^1.2",
16+
"chubbyphp/chubbyphp-framework": "^4.1",
17+
"chubbyphp/chubbyphp-framework-router-fastroute": "^1.3.1",
18+
"chubbyphp/chubbyphp-laminas-config": "^1.3",
19+
"monolog/monolog": "^2.3.5",
20+
"psr/container": "^1.1.2|^2.0.2",
2121
"psr/http-factory": "^1.0.1",
2222
"psr/http-message": "^1.0.1",
2323
"psr/http-server-handler": "^1.0.1",
2424
"psr/http-server-middleware": "^1.0.1",
25-
"psr/log": "^1.1.4",
26-
"slim/psr7": "^1.4",
27-
"symfony/console": "^4.4.23|^5.2.8"
25+
"psr/log": "^1.1.4|^2.0|^3.0",
26+
"slim/psr7": "^1.5",
27+
"symfony/console": "^4.4.38|^5.4.5|^6.0"
2828
},
2929
"require-dev": {
3030
"chubbyphp/chubbyphp-dev-helper": "dev-master",
3131
"chubbyphp/chubbyphp-mock": "^1.6.1",
32-
"infection/infection": "^0.25.3",
33-
"php-coveralls/php-coveralls": "^2.5.1",
32+
"infection/infection": "^0.26.5",
33+
"php-coveralls/php-coveralls": "^2.5.2",
3434
"phploc/phploc": "^7.0.2",
3535
"phpstan/extension-installer": "^1.1",
36-
"phpstan/phpstan": "^1.1.2",
37-
"phpunit/phpunit": "^9.5.10"
36+
"phpstan/phpstan": "^1.4.8",
37+
"phpunit/phpunit": "^9.5.17"
3838
},
3939
"autoload": {
4040
"psr-4": { "App\\": "src/" }
@@ -43,7 +43,11 @@
4343
"psr-4": { "App\\Tests\\": "tests/" }
4444
},
4545
"config": {
46-
"sort-packages": true
46+
"sort-packages": true,
47+
"allow-plugins": {
48+
"infection/extension-installer": true,
49+
"phpstan/extension-installer": true
50+
}
4751
},
4852
"scripts": {
4953
"clean-directories": "bin/console clean-directories cache log",

infection.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
},
77
"timeout": 10,
88
"logs": {
9-
"text": "build/phpinfection.log",
10-
"badge": {
11-
"branch": "master"
9+
"text": "build/phpinfection/infection.log",
10+
"html": "build/phpinfection/infection.html",
11+
"json": "build/phpinfection/infection.json",
12+
"summary": "build/phpinfection/summary.log",
13+
"stryker": {
14+
"report": "master"
1215
}
1316
},
1417
"mutators": {

src/RequestHandler/PingRequestHandler.php

+2-5
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@
1111

1212
final class PingRequestHandler implements RequestHandlerInterface
1313
{
14-
private ResponseFactoryInterface $responseFactory;
15-
16-
public function __construct(ResponseFactoryInterface $responseFactory)
14+
public function __construct(private ResponseFactoryInterface $responseFactory)
1715
{
18-
$this->responseFactory = $responseFactory;
1916
}
2017

2118
public function handle(ServerRequestInterface $request): ResponseInterface
@@ -28,7 +25,7 @@ public function handle(ServerRequestInterface $request): ResponseInterface
2825
;
2926

3027
/** @var string $body */
31-
$body = json_encode(['datetime' => date(\DateTime::ATOM)]);
28+
$body = json_encode(['datetime' => date(\DateTime::ATOM)], JSON_THROW_ON_ERROR);
3229

3330
$response->getBody()->write($body);
3431

tests/Integration/PingRequestHandlerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public function testPing(): void
2626
self::assertSame('0', $response['headers']['expires'][0]);
2727
self::assertSame('no-cache', $response['headers']['pragma'][0]);
2828

29-
$ping = json_decode($response['body'], true);
29+
$ping = json_decode($response['body'], true, 512, JSON_THROW_ON_ERROR);
3030

3131
self::assertArrayHasKey('datetime', $ping);
3232

tests/PhpServerTestHook.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public function executeBeforeTest(string $test): void
4040

4141
private function isIntegrationTest(string $test): bool
4242
{
43-
return 0 === strpos($test, 'App\\Tests\\Integration');
43+
return str_starts_with($test, 'App\\Tests\\Integration');
4444
}
4545

4646
private function initialize(): void

tests/Unit/RequestHandler/PingRequestHandlerTest.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public function testHandle(): void
3232
/** @var MockObject|StreamInterface $body */
3333
$body = $this->getMockByCalls(StreamInterface::class, [
3434
Call::create('write')->with(new ArgumentCallback(static function (string $body): void {
35-
$data = json_decode($body, true);
35+
$data = json_decode($body, true, 512, JSON_THROW_ON_ERROR);
3636

3737
self::assertArrayHasKey('datetime', $data);
3838
})),

tests/Unit/ServiceFactory/Http/ResponseFactoryFactoryTest.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@
66

77
use App\ServiceFactory\Http\ResponseFactoryFactory;
88
use Chubbyphp\Mock\MockByCallsTrait;
9-
use PHPUnit\Framework\MockObject\MockObject;
109
use PHPUnit\Framework\TestCase;
11-
use Psr\Container\ContainerInterface;
1210
use Slim\Psr7\Factory\ResponseFactory;
1311

1412
/**
@@ -22,11 +20,8 @@ final class ResponseFactoryFactoryTest extends TestCase
2220

2321
public function testInvoke(): void
2422
{
25-
/** @var ContainerInterface|MockObject $container */
26-
$container = $this->getMockByCalls(ContainerInterface::class);
27-
2823
$factory = new ResponseFactoryFactory();
2924

30-
self::assertInstanceOf(ResponseFactory::class, $factory($container));
25+
self::assertInstanceOf(ResponseFactory::class, $factory());
3126
}
3227
}

0 commit comments

Comments
 (0)