Skip to content

Commit 5f46759

Browse files
committed
Quality of life
1 parent 6cb44ec commit 5f46759

File tree

69 files changed

+1598
-3980
lines changed

Some content is hidden

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

69 files changed

+1598
-3980
lines changed

.gitattributes

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
1+
.github/ export-ignore
2+
.vscode/ export-ignore
13
tests export-ignore
24
.gitignore export-ignore
35
.gitattributes export-ignore
46
.travis.yml export-ignore
57
behat.yml export-ignore
68
composer.lock export-ignore
79
phpunit.xml.dist export-ignore
10+
psalm.xml export-ignore
11+
phpcs.xml export-ignore

.github/workflows/ci.yml

Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
name: "Continuous Integration"
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
unittest:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
matrix:
11+
php:
12+
- version: 8.0
13+
coverage: true
14+
- version: 8.1
15+
coverage: false
16+
- version: 8.2
17+
coverage: false
18+
prefer-lowest: ["", "--prefer-lowest"]
19+
20+
name: Unit Tests - PHP ${{ matrix.php.version }} ${{ matrix.prefer-lowest }}
21+
22+
steps:
23+
- uses: actions/checkout@v3
24+
25+
- name: Install PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php.version }}
29+
extensions: mbstring
30+
31+
- name: Validate composer.json and composer.lock
32+
run: composer validate --strict
33+
34+
- name: Cache Composer packages
35+
id: composer-cache
36+
uses: actions/cache@v3
37+
with:
38+
path: vendor
39+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
40+
restore-keys: |
41+
${{ runner.os }}-php-
42+
43+
- name: Remove static analyse tools
44+
run: |
45+
composer remove --dev --with-all-dependencies --ignore-platform-reqs \
46+
squizlabs/php_codesniffer \
47+
vimeo/psalm \
48+
slevomat/coding-standard \
49+
laminas/laminas-coding-standard
50+
51+
- name: Update dependencies
52+
run: composer update --prefer-dist --no-progress --with-all-dependencies ${{ matrix.prefer-lowest }}
53+
54+
- name: Run test suite
55+
if: ${{ ! matrix.php.coverage }}
56+
run: ./vendor/bin/phpunit --verbose
57+
58+
- name: Run test suite with code coverage
59+
if: ${{ matrix.php.coverage }}
60+
run: ./vendor/bin/phpunit --verbose --coverage-clover=build/logs/clover.xml
61+
env:
62+
XDEBUG_MODE: coverage
63+
64+
- name: Update code coverage to Scrutinizer
65+
if: ${{ matrix.php.coverage }}
66+
run: |
67+
wget -q https://scrutinizer-ci.com/ocular.phar
68+
php ocular.phar code-coverage:upload --format=php-clover build/logs/clover.xml || true
69+
70+
psalm:
71+
name: Psalm
72+
runs-on: ubuntu-latest
73+
steps:
74+
- name: Checkout code
75+
uses: actions/checkout@v3
76+
77+
- name: Psalm
78+
uses: docker://vimeo/psalm-github-actions
79+
with:
80+
security_analysis: true
81+
report_file: results.sarif
82+
composer_ignore_platform_reqs: true
83+
84+
- name: Upload Security Analysis results to GitHub
85+
uses: github/codeql-action/upload-sarif@v2
86+
with:
87+
sarif_file: results.sarif
88+
89+
phpcs:
90+
name: PHPCS
91+
runs-on: ubuntu-latest
92+
steps:
93+
- name: Checkout code
94+
uses: actions/checkout@v3
95+
96+
- name: Setup PHP
97+
uses: shivammathur/setup-php@v2
98+
with:
99+
php-version: "8.2"
100+
coverage: none
101+
tools: composer, cs2pr
102+
103+
- name: Cache Composer packages
104+
id: composer-cache
105+
uses: actions/cache@v3
106+
with:
107+
path: vendor
108+
key: ${{ runner.os }}-php-${{ hashFiles('**/composer.lock') }}
109+
restore-keys: |
110+
${{ runner.os }}-php-
111+
112+
- name: Install dependencies
113+
run: composer install --prefer-dist --no-suggest --no-progress
114+
115+
- name: Detect coding standard violations (PR)
116+
run: ./vendor/bin/phpcs -q --report=checkstyle | cs2pr --graceful-warnings
117+
if: github.event_name == 'pull_request'
118+
119+
- name: Detect coding standard violations
120+
run: ./vendor/bin/phpcs
121+
if: github.event_name != 'pull_request'

.gitignore

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
/vendor/
2+
composer.lock
3+
.phpunit.cache/
4+
.phpunit.result.cache
5+
.phpcs-cache
6+
*.bak

.travis.yml

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

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License
22

3-
Copyright (c) 2016 Burntromi
3+
Copyright (c) 2016 Burntromi, 2023 Fabian Grutschus
44

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

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
1-
# Burntromi Exception-Generator
1+
# Fabiang Exception-Generator
22

33
In software projects and libraries it is very common and needed to generate exception
44
classes. For generating these classes, the following best-practice enforced in the
55
PHP environment:
66

7-
http://ralphschindler.com/2010/09/15/exception-best-practices-in-php-5-3
7+
[Exception Best Practices in PHP 5.3](https://web.archive.org/web/20190128162922/http://ralphschindler.com/2010/09/15/exception-best-practices-in-php-5-3)
88

99
The manual creation of those classes is time-consuming and error-prone.
1010
To save time and reduce errors, this tool was made!
1111

12-
[![Build Status](https://travis-ci.org/burntromi/exception-generator.svg?branch=master)](https://travis-ci.org/burntromi/exception-generator)
13-
[![Latest Stable Version](https://poser.pugx.org/burntromi/exception-generator/version)](https://packagist.org/packages/burntromi/exception-generator)
14-
[![License](https://poser.pugx.org/burntromi/exception-generator/license)](https://packagist.org/packages/burntromi/exception-generator)
12+
[![Continuous Integration](https://github.com/fabiang/exception-generator/actions/workflows/ci.yml/badge.svg)](https://github.com/fabiang/exception-generator/actions/workflows/ci.yml)
13+
[![Latest Stable Version](https://poser.pugx.org/fabiang/exception-generator/version)](https://packagist.org/packages/fabiang/exception-generator)
14+
[![License](https://poser.pugx.org/fabiang/exception-generator/license)](https://packagist.org/packages/fabiang/exception-generator)
1515

1616
## Installation/Usage
1717

1818
```
19-
composer global require burntromi/exception-generator
19+
composer global require fabiang/exception-generator
2020
```
2121

2222
Make sure you have `~/.composer/vendor/bin/` in your path.

behat.yml

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
default:
2-
suites:
3-
default:
4-
paths: [ %paths.base%/tests/features/ ]
5-
contexts:
6-
- Burntromi\ExceptionGenerator\IntegrationTest\FeatureContext
7-
- Burntromi\ExceptionGenerator\IntegrationTest\CreateExceptionContext
8-
- Burntromi\ExceptionGenerator\IntegrationTest\TemplateContext
9-
testers:
10-
strict: true
11-
extensions:
12-
Burntromi\ExceptionGenerator\IntegrationTest\Initializer\Extension:
13-
options:
14-
inputOptions:
15-
"--quiet": ""
16-
"--no-interaction": ""
17-
"-vv": ""
2+
suites:
3+
default:
4+
paths: ["%paths.base%/tests/features/"]
5+
contexts:
6+
- Fabiang\ExceptionGenerator\IntegrationTest\FeatureContext
7+
- Fabiang\ExceptionGenerator\IntegrationTest\CreateExceptionContext
8+
- Fabiang\ExceptionGenerator\IntegrationTest\TemplateContext
9+
testers:
10+
strict: true
11+
extensions:
12+
Fabiang\ExceptionGenerator\IntegrationTest\Initializer\Extension:
13+
options:
14+
inputOptions:
15+
"--quiet": ""
16+
"--no-interaction": ""
17+
"-vv": ""

bin/exception-generator

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
#!/usr/bin/env php
22
<?php
33

4+
declare(strict_types=1);
5+
46
$autoload = false;
57

68
foreach (array(
@@ -18,8 +20,8 @@ if (false === $autoload) {
1820
fwrite(
1921
STDERR,
2022
'You need to set up the project dependencies using the following commands:' . PHP_EOL .
21-
'wget http://getcomposer.org/composer.phar' . PHP_EOL .
22-
'php composer.phar install' . PHP_EOL
23+
'wget http://getcomposer.org/composer.phar' . PHP_EOL .
24+
'php composer.phar install' . PHP_EOL
2325
);
2426
exit(1);
2527
}
@@ -30,7 +32,7 @@ if (empty(ini_get('date.timezone'))) {
3032
ini_set('date.timezone', 'UTC');
3133
}
3234

33-
use Burntromi\ExceptionGenerator\Cli\Console\Application;
35+
use Fabiang\ExceptionGenerator\Cli\Console\Application;
3436

35-
$console = new Application('Burntromi Exception-Generator', '1.0.0');
37+
$console = new Application('Fabiang Exception-Generator', '1.0.0');
3638
$console->run();

composer.json

Lines changed: 38 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,58 @@
11
{
2-
"name": "burntromi/exception-generator",
2+
"name": "fabiang/exception-generator",
33
"license": "MIT",
44
"description": "Tool for creating standard exceptions",
55
"type": "application",
66
"autoload": {
77
"psr-4": {
8-
"Burntromi\\ExceptionGenerator\\": "src/"
8+
"Fabiang\\ExceptionGenerator\\": "src/"
99
}
1010
},
1111
"autoload-dev": {
1212
"psr-4": {
13-
"Burntromi\\ExceptionGenerator\\IntegrationTest\\": "tests/features/bootstrap",
14-
"Burntromi\\ExceptionGenerator\\IntegrationTest\\Initializer\\": "tests/features/initializer",
15-
"Burntromi\\ExceptionGenerator\\TestHelper\\": "tests/helper"
13+
"Fabiang\\ExceptionGenerator\\IntegrationTest\\": "tests/features/bootstrap",
14+
"Fabiang\\ExceptionGenerator\\IntegrationTest\\Initializer\\": "tests/features/initializer",
15+
"Fabiang\\ExceptionGenerator\\TestHelper\\": "tests/helper"
1616
},
1717
"files": [
1818
"vendor/phpunit/phpunit/src/Framework/Assert/Functions.php"
1919
]
2020
},
2121
"minimum-stability": "stable",
2222
"require": {
23-
"php": "^5.6 || ^7.0",
24-
"symfony/console": "^2.5",
25-
"symfony/event-dispatcher": "^2.5 || ^3.0",
26-
"zendframework/zend-escaper": "^2.2",
27-
"zendframework/zend-filter": "^2.2",
28-
"zendframework/zend-servicemanager": "^3.0 || ^2.2",
29-
"zendframework/zend-view": "^2.2"
23+
"php": "^8.0",
24+
"symfony/console": "^6.0",
25+
"symfony/event-dispatcher": "^6.0",
26+
"laminas/laminas-escaper": "^2.12",
27+
"laminas/laminas-filter": "^2.31",
28+
"laminas/laminas-servicemanager": "^3.0 || ^2.2",
29+
"laminas/laminas-view": "^2.27"
3030
},
3131
"require-dev": {
32-
"behat/behat": "^3.2.2",
33-
"mikey179/vfsStream": "^1.6",
34-
"phpunit/phpunit": "^5.6.5"
32+
"behat/behat": "^3.12",
33+
"mikey179/vfsstream": "^1.6.11",
34+
"phpunit/phpunit": "^9.6.3",
35+
"vimeo/psalm": "^5.6",
36+
"laminas/laminas-coding-standard": "^2.5"
3537
},
36-
"bin": ["bin/exception-generator"]
37-
}
38+
"bin": [
39+
"bin/exception-generator"
40+
],
41+
"config": {
42+
"allow-plugins": {
43+
"dealerdirect/phpcodesniffer-composer-installer": true
44+
}
45+
},
46+
"scripts": {
47+
"phpcs": "phpcs",
48+
"psalm": "psalm",
49+
"phpunit": "phpunit",
50+
"behat": "behat",
51+
"test": [
52+
"@psalm",
53+
"@phpcs",
54+
"@phpunit",
55+
"@behat"
56+
]
57+
}
58+
}

0 commit comments

Comments
 (0)