Skip to content

Commit 610ac76

Browse files
authored
Merge pull request #81 from samsonasik/php8
V4
2 parents 9877c0f + 6875813 commit 610ac76

File tree

36 files changed

+230
-233
lines changed

36 files changed

+230
-233
lines changed

.github/ISSUE_TEMPLATE.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,14 @@ What PHP version you're using?
1616
- [ ] PHP 7.2
1717
- [ ] PHP 7.3
1818
- [ ] PHP 7.4
19+
- [ ] PHP 8.0
1920

2021
What ErrorHeroModule version you're using?
2122

2223
- [ ] ^1.0
2324
- [ ] ^2.0
25+
- [ ] ^3.0
26+
- [ ] ^4.0
2427

2528
What Database you're using?
2629

.github/workflows/ci_build.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: "ci build"
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches:
7+
- "master"
8+
9+
jobs:
10+
build:
11+
name: PHP ${{ matrix.php-versions }}
12+
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php-versions: ['8.0']
17+
steps:
18+
- name: Setup PHP Action
19+
uses: shivammathur/setup-php@v2
20+
with:
21+
extensions: intl
22+
php-version: "${{ matrix.php-versions }}"
23+
coverage: xdebug
24+
- name: Setup MySQL
25+
uses: shogo82148/actions-setup-mysql@v1
26+
with:
27+
mysql-version: '8.0'
28+
- run: mysql -uroot -h127.0.0.1 -e 'SELECT version()'
29+
- name: Checkout
30+
uses: actions/checkout@v2
31+
- name: Import DB
32+
run: "mysql -u root -h 127.0.0.1 -e 'create database errorheromodule' && mysql -u root -h 127.0.0.1 errorheromodule < spec/Fixture/data/sql.sql"
33+
- name: "Validate composer.json and composer.lock"
34+
run: "composer validate"
35+
- name: "Install dependencies"
36+
run: "composer install --prefer-dist --ignore-platform-reqs"
37+
- name: "CS Check"
38+
run: "composer cs-check"
39+
- name: "Code analyze"
40+
run: |
41+
bin/phpstan analyse src/ --level=max -c phpstan.neon
42+
bin/rector process --dry-run
43+
- name: "Run test suite"
44+
run: "mkdir -p build/logs && bin/kahlan --coverage=4 --reporter=verbose --clover=build/logs/clover.xml"
45+
- name: Upload coverage to Codecov
46+
uses: codecov/codecov-action@v1
47+
with:
48+
token: ${{ secrets.CODECOV_TOKEN }}
49+
file: ./build/logs/clover.xml
50+
flags: tests
51+
name: codecov-umbrella
52+
yml: ./codecov.yml
53+
fail_ci_if_error: true

.travis.yml

Lines changed: 0 additions & 26 deletions
This file was deleted.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,13 @@ ErrorHeroModule
33

44
[![Latest Version](https://img.shields.io/github/release/samsonasik/ErrorHeroModule.svg?style=flat-square)](https://github.com/samsonasik/ErrorHeroModule/releases)
55
[![Build Status](https://travis-ci.org/samsonasik/ErrorHeroModule.svg?branch=master)](https://travis-ci.org/samsonasik/ErrorHeroModule)
6-
[![Coverage Status](https://coveralls.io/repos/github/samsonasik/ErrorHeroModule/badge.svg?branch=master)](https://coveralls.io/github/samsonasik/ErrorHeroModule?branch=master)
6+
[![Code Coverage](https://codecov.io/gh/samsonasik/ErrorHeroModule/branch/master/graph/badge.svg)](https://codecov.io/gh/samsonasik/ErrorHeroModule)
77
[![PHPStan](https://img.shields.io/badge/style-level%20max-brightgreen.svg?style=flat-square&label=phpstan)](https://github.com/phpstan/phpstan)
88
[![Downloads](https://poser.pugx.org/samsonasik/error-hero-module/downloads)](https://packagist.org/packages/samsonasik/error-hero-module)
99

10-
> This is README for version ^3.0 which only support Laminas Mvc version 3 and Mezzio version 3 with php ^7.1.
10+
> This is README for version ^4.0 which only support Laminas Mvc version 3 and Mezzio version 3 with php ^8.0.
11+
12+
> For version ^3.0, you can read at [version 3 readme](https://github.com/samsonasik/ErrorHeroModule/tree/3.x.x) which only support Laminas Mvc version 3 and Mezzio version 3 with php ^7.1.
1113
1214
> For version ^2.0, you can read at [version 2 readme](https://github.com/samsonasik/ErrorHeroModule/tree/2.x.x) which only support ZF3 and ZF Expressive version 3 with php ^7.1.
1315

composer.json

Lines changed: 28 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -38,44 +38,41 @@
3838
}
3939
],
4040
"require": {
41-
"php": "^7.1",
42-
"laminas/laminas-db": "^2.5",
43-
"laminas/laminas-diactoros": "^2.0",
44-
"laminas/laminas-log": "^2.10",
45-
"laminas/laminas-mail": "^2.9",
46-
"laminas/laminas-psr7bridge": "^1.1",
47-
"laminas/laminas-text": "^2.5",
48-
"laminas/laminas-uri": "^2.7",
49-
"psr/container": "^1.0",
50-
"seld/jsonlint": "^1.5",
51-
"webmozart/assert": "^1.4"
41+
"php": "^8.0",
42+
"laminas/laminas-db": "^2.12",
43+
"laminas/laminas-diactoros": "^2.5",
44+
"laminas/laminas-log": "^2.13",
45+
"laminas/laminas-mail": "^2.13",
46+
"laminas/laminas-psr7bridge": "^1.3",
47+
"laminas/laminas-text": "^2.8",
48+
"laminas/laminas-uri": "^2.8",
49+
"psr/container": "^1.0 || 2.0",
50+
"seld/jsonlint": "^1.8",
51+
"webmozart/assert": "^1.9.1"
5252
},
5353
"conflict": {
54-
"doctrine/doctrine-orm-module": "<2.1",
55-
"elie29/zend-phpdi-config": "<4.0",
56-
"laminas/laminas-mvc": "<3.0 >=4.0",
57-
"laminas/laminas-servicemanager": "<3.3",
58-
"mezzio/mezzio": "<3.0 >=4.0"
54+
"doctrine/doctrine-orm-module": "<4.0",
55+
"laminas/laminas-mvc": "<3.2 >=4.0",
56+
"laminas/laminas-servicemanager": "<3.6",
57+
"mezzio/mezzio": "<3.3 >=4.0"
5958
},
6059
"require-dev": {
61-
"aura/di": "^3.4",
62-
"doctrine/doctrine-orm-module": "^2.1",
63-
"elie29/zend-phpdi-config": "^4.0",
64-
"kahlan/kahlan": "^4.6.4",
65-
"laminas/laminas-cache": "^2.9",
66-
"laminas/laminas-coding-standard": "^2.0",
67-
"laminas/laminas-form": "^2.14",
68-
"laminas/laminas-mvc": "^3.0",
60+
"aura/di": "^3.4 || ^4.0",
61+
"doctrine/doctrine-orm-module": "^4.0",
62+
"kahlan/kahlan": "^5.1.3",
63+
"laminas/laminas-coding-standard": "^2.1.1",
64+
"laminas/laminas-form": "^2.16 || ^3.0",
65+
"laminas/laminas-mvc": "^3.2",
6966
"laminas/laminas-mvc-console": "^1.1",
70-
"laminas/laminas-servicemanager": "^3.3",
71-
"mezzio/mezzio": "^3.0",
72-
"mezzio/mezzio-laminasviewrenderer": "^2.0",
67+
"laminas/laminas-servicemanager": "^3.6",
68+
"mezzio/mezzio": "^3.3",
69+
"mezzio/mezzio-laminasviewrenderer": "^2.3",
7370
"northwoods/container": "^3.0",
74-
"php-coveralls/php-coveralls": "^2.0",
75-
"php-di/php-di": "^6.0",
76-
"phpstan/phpstan": "^0.12",
77-
"phpstan/phpstan-webmozart-assert": "^0.12",
71+
"php-coveralls/php-coveralls": "^2.4",
72+
"phpstan/phpstan": "^0.12.86",
73+
"phpstan/phpstan-webmozart-assert": "^0.12.7",
7874
"pimple/pimple": "^3.2",
75+
"rector/rector": "0.11.20",
7976
"symfony/dependency-injection": "^4.0"
8077
},
8178
"suggest": {

config/module.config.php

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,22 @@
22

33
namespace ErrorHeroModule;
44

5+
use ErrorHeroModule\Controller\ErrorPreviewController;
6+
use ErrorHeroModule\Controller\ErrorPreviewConsoleController;
7+
use Laminas\Log\LoggerAbstractServiceFactory;
8+
use ErrorHeroModule\Listener\Mvc;
9+
use ErrorHeroModule\Listener\MvcFactory;
10+
use ErrorHeroModule\Handler\Logging;
11+
use ErrorHeroModule\Handler\LoggingFactory;
512
use Laminas\Log;
613
use Laminas\ServiceManager\Factory\InvokableFactory;
714

815
return [
916

1017
'controllers' => [
1118
'factories' => [
12-
Controller\ErrorPreviewController::class => InvokableFactory::class,
13-
Controller\ErrorPreviewConsoleController::class => InvokableFactory::class,
19+
ErrorPreviewController::class => InvokableFactory::class,
20+
ErrorPreviewConsoleController::class => InvokableFactory::class,
1421
],
1522
],
1623

@@ -22,7 +29,7 @@
2229
'options' => [
2330
'route' => '/error-preview[/][:action]',
2431
'defaults' => [
25-
'controller' => Controller\ErrorPreviewController::class,
32+
'controller' => ErrorPreviewController::class,
2633
'action' => 'exception',
2734
],
2835
],
@@ -38,7 +45,7 @@
3845
'options' => [
3946
'route' => 'error-preview [<action>]',
4047
'defaults' => [
41-
'controller' => Controller\ErrorPreviewConsoleController::class,
48+
'controller' => ErrorPreviewConsoleController::class,
4249
'action' => 'exception'
4350
],
4451
],
@@ -49,16 +56,16 @@
4956

5057
'service_manager' => [
5158
'abstract_factories' => [
52-
Log\LoggerAbstractServiceFactory::class,
59+
LoggerAbstractServiceFactory::class,
5360
],
5461
'factories' => [
55-
Listener\Mvc::class => Listener\MvcFactory::class,
56-
Handler\Logging::class => Handler\LoggingFactory::class,
62+
Mvc::class => MvcFactory::class,
63+
Logging::class => LoggingFactory::class,
5764
],
5865
],
5966

6067
'listeners' => [
61-
Listener\Mvc::class,
68+
Mvc::class,
6269
],
6370

6471
'view_manager' => [

phpcs.xml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@
99
<exclude name="WebimpressCodingStandard.NamingConventions.AbstractClass"/>
1010
</rule>
1111

12-
<rule ref="SlevomatCodingStandard.Classes.UnusedPrivateElements">
13-
<exclude name="SlevomatCodingStandard.Classes.UnusedPrivateElements"/>
14-
</rule>
15-
1612
<rule ref="WebimpressCodingStandard.NamingConventions.ValidVariableName">
1713
<exclude name="WebimpressCodingStandard.NamingConventions.ValidVariableName"/>
1814
</rule>

rector.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?php
2+
3+
use Rector\Core\Configuration\Option;
4+
use Rector\Core\ValueObject\PhpVersion;
5+
use Rector\Set\ValueObject\SetList;
6+
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
7+
8+
return static function (ContainerConfigurator $containerConfigurator): void {
9+
$containerConfigurator->import(SetList::PHP_80);
10+
11+
$parameters = $containerConfigurator->parameters();
12+
$parameters->set(Option::PATHS, [__DIR__ . '/config', __DIR__ . '/src', __DIR__ . '/spec']);
13+
14+
$parameters->set(Option::AUTO_IMPORT_NAMES, true);
15+
$parameters->set(Option::ENABLE_CACHE, true);
16+
$parameters->set(Option::PHP_VERSION_FEATURES, PhpVersion::PHP_80);
17+
};

spec/Fixture/config/autoload-for-cannot-connect-to-db/error-hero-module.local.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
'driver' => 'Pdo',
2121
'dsn' => 'mysql:dbname=errorheromodule;host=127.0.0.1',
2222
'driver_options' => [
23-
\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
23+
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
2424
],
2525
],
2626

spec/Fixture/config/autoload-for-enable-display-errors/error-hero-module.local.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
'driver' => 'Pdo',
2121
'dsn' => 'mysql:dbname=errorheromodule;host=127.0.0.1',
2222
'driver_options' => [
23-
\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
23+
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES \'UTF8\'',
2424
],
2525
],
2626

0 commit comments

Comments
 (0)