Skip to content

Commit 15e991b

Browse files
authored
Merge pull request #1 from Micro-PHP/v1.0-release
v1.0 released
2 parents 3973b9e + 646f89c commit 15e991b

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+2775
-1
lines changed

.gitattributes

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/.github export-ignore
2+
/tests export-ignore
3+
/phpunit.xml.dist export-ignore
4+
/.gitattributes export-ignore
5+
/.gitignore export-ignore
6+
/.php-cs-fixer.dist.php export-ignore
7+
/psalm.xml export-ignore
8+
9+
*.php diff=php

.github/workflows/.editorconfig

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
[{*.yaml,*.yml}]
2+
indent_size = 2

.github/workflows/ci.yaml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
name: Plugin CI
2+
on:
3+
push:
4+
branches: [ 'master' ]
5+
pull_request:
6+
7+
env:
8+
PHP_CS_FIXER_IGNORE_ENV: 1
9+
XDEBUG_MODE: coverage
10+
11+
jobs:
12+
tests:
13+
name: "Tests ${{ matrix.php-version }} deps ${{ matrix.dependency-versions }}"
14+
runs-on: ubuntu-22.04
15+
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
# normal, highest, non-dev installs
20+
php-version: [ '8.2' ]
21+
dependency-versions: [ 'highest' ]
22+
include:
23+
# testing lowest PHP version with the lowest dependencies
24+
# - php-version: '8.2'
25+
# dependency-versions: 'lowest'
26+
27+
# testing dev versions with the highest PHP
28+
- php-version: '8.2'
29+
dependency-versions: 'highest'
30+
31+
steps:
32+
- name: "Checkout code"
33+
uses: "actions/checkout@v2"
34+
35+
- name: "Install PHP"
36+
uses: "shivammathur/setup-php@v2"
37+
with:
38+
coverage: "none"
39+
php-version: "${{ matrix.php-version }}"
40+
41+
- name: "Composer install"
42+
uses: "ramsey/composer-install@v2"
43+
with:
44+
dependency-versions: "${{ matrix.dependency-versions }}"
45+
composer-options: "--prefer-dist --no-progress"
46+
47+
- name: Run tests
48+
run: composer run test

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
.idea
2+
vendor
3+
composer.lock
4+
.phpunit.result.cache
5+
.php-cs-fixer.cache
6+
test-coverage-report
7+
phpunit.xml
8+
.php-cs-fixer.php
9+
phpstan.neon

.php-cs-fixer.dist.php

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
<?php
2+
3+
if (!file_exists(__DIR__.'/src')) {
4+
exit(0);
5+
}
6+
7+
$finder = (new PhpCsFixer\Finder())
8+
->in(__DIR__.'/src')
9+
->in(__DIR__.'/tests')
10+
;
11+
12+
return (new PhpCsFixer\Config())
13+
->setRules(array(
14+
'@Symfony' => true,
15+
'@Symfony:risky' => true,
16+
'protected_to_private' => false,
17+
'semicolon_after_instruction' => false,
18+
'header_comment' => [
19+
'header' => <<<EOF
20+
This file is part of the Micro framework package.
21+
22+
(c) Stanislau Komar <kost@micro-php.net>
23+
24+
For the full copyright and license information, please view the LICENSE
25+
file that was distributed with this source code.
26+
EOF
27+
]
28+
))
29+
->setRiskyAllowed(true)
30+
->setFinder($finder);

composer.json

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "micro/plugin-http-exceptions",
2+
"name": "micro/plugin-http-exceptions-dev",
33
"description": "Micro Framework: Exception response builder.",
44
"license": "MIT",
55
"type": "micro-plugin",
@@ -15,9 +15,12 @@
1515
"require-dev": {
1616
"ergebnis/composer-normalize": "^2.29",
1717
"friendsofphp/php-cs-fixer": "^3.13",
18+
"micro/plugin-http-exceptions": "^1",
19+
"micro/plugin-http-router-code": "^1",
1820
"phpstan/phpstan": "^1.9",
1921
"phpunit/php-code-coverage": "^9.2",
2022
"phpunit/phpunit": "^9.5",
23+
"symfony/var-dumper": "^6",
2124
"vimeo/psalm": "^5.2"
2225
},
2326
"autoload": {

phpstan.neon.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
parameters:
2+
level: 7
3+
paths:
4+
- src
5+
excludePaths:
6+
- 'src/Exception/FlattenException.php'
7+
- 'src/Business/Exception/Renderer/HtmlRenderer.php'

phpunit.xml.dist

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!-- https://phpunit.readthedocs.io/en/9.5/configuration.html#the-phpunit-element -->
3+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
4+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.5/phpunit.xsd"
5+
backupGlobals="false"
6+
bootstrap="vendor/autoload.php"
7+
colors="true"
8+
failOnRisky="true"
9+
failOnWarning="true"
10+
>
11+
<php>
12+
<ini name="error_reporting" value="-1" force="true"/>
13+
</php>
14+
<testsuites>
15+
<testsuite name="Unit tests">
16+
<directory>tests/</directory>
17+
</testsuite>
18+
</testsuites>
19+
<coverage>
20+
<include>
21+
<directory suffix=".php">src</directory>
22+
</include>
23+
<report>
24+
<html outputDirectory="test-coverage-report/" />
25+
</report>
26+
</coverage>
27+
</phpunit>

psalm.xml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
<?xml version="1.0"?>
2+
<psalm
3+
errorLevel="2"
4+
resolveFromConfigFile="true"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xmlns="https://getpsalm.org/schema/config"
7+
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
>
9+
<projectFiles>
10+
<directory name="src" />
11+
<ignoreFiles>
12+
<directory name="vendor" />
13+
</ignoreFiles>
14+
15+
</projectFiles>
16+
17+
<issueHandlers>
18+
19+
<UnnecessaryVarAnnotation>
20+
<errorLevel type="suppress">
21+
<file name="src/HttpExceptionResponseDevPlugin.php"/>
22+
</errorLevel>
23+
</UnnecessaryVarAnnotation>
24+
25+
<ArgumentTypeCoercion>
26+
<errorLevel type="info">
27+
<file name="src/Exception/FlattenException.php"/>
28+
</errorLevel>
29+
</ArgumentTypeCoercion>
30+
31+
<UnsafeInstantiation>
32+
<errorLevel type="info">
33+
<file name="src/Exception/FlattenException.php"/>
34+
</errorLevel>
35+
</UnsafeInstantiation>
36+
37+
<UnresolvableInclude>
38+
<errorLevel type="suppress">
39+
<file name="src/Business/Exception/Renderer/HtmlRenderer.php"/>
40+
</errorLevel>
41+
</UnresolvableInclude>
42+
43+
<InternalMethod>
44+
<errorLevel type="info">
45+
<file name="src/Exception/FlattenException.php"/>
46+
<file name="src/Business/Exception/Renderer/RendererFactory.php"/>
47+
<file name="src/Business/Executor/HttpExceptionPageExecutorDecorator.php"/>
48+
</errorLevel>
49+
</InternalMethod>
50+
51+
<PossiblyInvalidArgument>
52+
<errorLevel type="info">
53+
<file name="src/Exception/FlattenException.php"/>
54+
</errorLevel>
55+
</PossiblyInvalidArgument>
56+
57+
<MissingConstructor>
58+
<errorLevel type="suppress">
59+
<file name="src/HttpExceptionResponseDevPlugin.php"/>
60+
<file name="src/Exception/FlattenException.php"/>
61+
</errorLevel>
62+
</MissingConstructor>
63+
64+
<ImplementedReturnTypeMismatch>
65+
<errorLevel type="suppress">
66+
<file name="src/HttpExceptionResponseDevPlugin.php"/>
67+
</errorLevel>
68+
</ImplementedReturnTypeMismatch>
69+
</issueHandlers>
70+
71+
</psalm>

0 commit comments

Comments
 (0)