Skip to content

Commit db47e20

Browse files
committed
Release 6.0.0
1 parent 760a56a commit db47e20

File tree

12 files changed

+2847
-81
lines changed

12 files changed

+2847
-81
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,6 @@ composer.phar
3333
# Commit your application's lock file https://getcomposer.org/doc/01-basic-usage.md#commit-your-composer-lock-file-to-version-control
3434
# You may choose to ignore a library lock file http://getcomposer.org/doc/02-libraries.md#lock-file
3535
# composer.lock
36+
37+
# Output for PHPUnit coverage reports
38+
.tmp

.php_cs.dist

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
$config = PhpCsFixer\Config::create()
6+
->setRiskyAllowed(true)
7+
->setUsingCache(false)
8+
->setRules([
9+
'@Symfony' => true,
10+
'@Symfony:risky' => true,
11+
'array_syntax' => ['syntax' => 'short'],
12+
'native_function_invocation' => true,
13+
'ordered_imports' => true,
14+
'declare_strict_types' => true,
15+
'single_import_per_statement' => false,
16+
'concat_space' => ['spacing' => 'one'],
17+
'phpdoc_align' => ['align' => 'left'],
18+
])
19+
->setFinder(
20+
PhpCsFixer\Finder::create()
21+
->in(__DIR__)
22+
->ignoreDotFiles(false)
23+
->name(['.php_cs.dist'])
24+
)
25+
;
26+
27+
return $config;

README.md

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,11 @@ $ composer create-project zegnat/website-starter
3232
[PSR-15 Middlewares][PSR-15].
3333
5. Using [FastRoute][] to parse requested URIs and find the matching
3434
[PSR-15 RequestHandlers][PSR-15].
35-
6. Using [PHP_CodeSniffer][] to check all code against the
36-
[PSR-2 Coding Style Guide][PSR-2].
37-
7. Using a [Zend Emitter][] to output a final response to the web server.
35+
6. Using a [Zend Emitter][] to output a final response to the web server.
36+
7. Using [PHP CS Fixer][] to check all code against a somewhat opinionated set
37+
of style rules based on the [Symfony Coding Standards][].
38+
8. Using [PHPUnit][] to test all classes used in the project and generate
39+
coverage reports using [`phpdbg`][].
3840

3941
## PSR-7 & PSR-17 Providers
4042

@@ -59,11 +61,13 @@ them can be defined as `Nyholm\Psr7\Factory\Psr17Factory::class`.
5961
[Middleland]: https://github.com/oscarotero/middleland
6062
[nyholm/psr7]: https://github.com/Nyholm/psr7
6163
[nyholm/psr7-server]: https://github.com/Nyholm/psr7-server
62-
[PHP_CodeSniffer]: https://github.com/squizlabs/PHP_CodeSniffer
63-
[PSR-2]: http://www.php-fig.org/psr/psr-2/
64+
[PHP CS Fixer]: https://github.com/FriendsOfPHP/PHP-CS-Fixer
65+
[`phpdbg`]: https://www.php.net/manual/en/book.phpdbg.php
66+
[PHPUnit]: https://phpunit.de/
6467
[PSR-7]: http://www.php-fig.org/psr/psr-7/
6568
[PSR-15]: https://www.php-fig.org/psr/psr-15/
6669
[PSR-17]: https://www.php-fig.org/psr/psr-17/
70+
[Symfony Coding Standards]: https://symfony.com/doc/current/contributing/code/standards.html
6771
[Zend Emitter]: https://docs.zendframework.com/zend-httphandlerrunner/emitters/
6872

6973
## License

app/RequestHandler/Home.php

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

3-
declare(strict_types = 1);
3+
declare(strict_types=1);
44

55
namespace app\RequestHandler;
66

7-
use Psr\Http\Server\RequestHandlerInterface;
8-
use Psr\Http\Message\ResponseInterface;
97
use Psr\Http\Message\ResponseFactoryInterface;
8+
use Psr\Http\Message\ResponseInterface;
109
use Psr\Http\Message\ServerRequestInterface;
10+
use Psr\Http\Server\RequestHandlerInterface;
1111

1212
class Home implements RequestHandlerInterface
1313
{

composer.json

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "zegnat/website-starter",
33
"description": "My minimum viable setup for starting a PHP project.",
44
"type": "project",
5-
"version": "5.0.0",
5+
"version": "6.0.0",
66
"license": "0BSD",
77
"authors": [
88
{
@@ -18,14 +18,18 @@
1818
"nyholm/psr7-server": "^0.3.0",
1919
"oscarotero/middleland": "^1.0",
2020
"rdlowrey/auryn": "^1.4",
21-
"zendframework/zend-diactoros": "^2.0",
21+
"zendframework/zend-diactoros": "^2.1",
2222
"zendframework/zend-httphandlerrunner": "^1.0"
2323
},
2424
"require-dev": {
25-
"squizlabs/php_codesniffer": "^3.3"
25+
"friendsofphp/php-cs-fixer": "^2.15",
26+
"phpunit/phpunit": "^8.3"
2627
},
2728
"scripts": {
28-
"check-style": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 app config public"
29+
"check-style": "php-cs-fixer fix --dry-run -vvv",
30+
"fix-style": "php-cs-fixer fix",
31+
"test": "phpdbg -qrr vendor/bin/phpunit",
32+
"serve": "@php -S localhost:8000 -t public/"
2933
},
3034
"config": {
3135
"sort-packages": true

0 commit comments

Comments
 (0)