Skip to content
This repository was archived by the owner on Aug 28, 2022. It is now read-only.

Commit c3efd9a

Browse files
authored
🆙 Upgrade PHP to version 8 (#44)
* 🔥 Remove unused `composer serve` command
1 parent cbfd44b commit c3efd9a

File tree

8 files changed

+1447
-3086
lines changed

8 files changed

+1447
-3086
lines changed

.editorconfig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@ indent_size = 2
1313
[Makefile]
1414
indent_style = tab
1515

16-
[*.{php}]
16+
[*.php]
1717
indent_style = space
1818
indent_size = 4

Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM ghcr.io/shrink/docker-php-api:7.4 as php
1+
FROM ghcr.io/shrink/docker-php-api:8 as php
22

33
USER root
44
RUN docker-php-ext-install pdo_mysql
@@ -10,10 +10,9 @@ FROM php as dependencies
1010

1111
ENV HOME=/run
1212

13-
COPY --from=composer:1 /usr/bin/composer /usr/bin/composer
13+
COPY --from=composer:2 /usr/bin/composer /usr/bin/composer
1414
COPY composer.json composer.lock ./
15-
RUN composer global require hirak/prestissimo --dev --prefer-dist && \
16-
composer install --no-ansi --no-autoloader --no-interaction
15+
RUN composer install --no-ansi --no-autoloader --no-interaction
1716

1817
COPY --chown=nobody . ./
1918
RUN composer dump-autoload

Makefile

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,6 @@ check:
5959
test:
6060
${COMPOSER_COMMAND} test
6161

62-
# Run the application's PHP Insights
63-
.PHONY: insights
64-
insights:
65-
${COMPOSER_COMMAND} insights -- -v
66-
6762
# Install all of the application's composer dependencies
6863
.PHONY: install
6964
install:

README-project.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@ including `check`, `shell`, `logs`, `upgrade`, `build` and more.
2323
### Quality
2424

2525
Code quality is verified using the `check` command which executes all test
26-
suites, performs static analysis and generates code insights.
26+
suites, performs static analysis and validates compliance with
27+
[PSR-12: Extended Coding Style][psr-12].
2728

2829
```console
2930
dev:~$ make check
@@ -41,3 +42,4 @@ dev:~$ git config core.hooksPath .github/hooks
4142
[dockerfile]: Dockerfile
4243
[dc-config]: docker-compose.yml
4344
[mmake]: https://github.com/tj/mmake
45+
[psr-12]: https://www.php-fig.org/psr/psr-12/

README.md

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# Laravel Strict
22

33
**Laravel** [`8`][laravel-8] + **Docker**
4-
[`shrink/docker-php-api`][shrink/docker-php-api]
4+
[`shrink/docker-php-api:8`][shrink/docker-php-api]
55

66
Laravel Strict is a
77
[<img src="https://laravel.com/img/favicon/favicon-32x32.png" height="12"> Laravel <sup>&neArr;</sup>][laravel]
88
install designed for building high quality containerised Laravel applications.
99

1010
* **All HTTP requests served by Laravel** &mdash; ideal for an API
11-
* Code quality enforced by
12-
[`nunomaduro/phpinsights`<sup>&neArr;</sup>][php-insights] and
13-
[`vimeo/psalm`<sup>&neArr;</sup>][psalm]
11+
* Code quality enforced by [`vimeo/psalm`<sup>&neArr;</sup>][psalm] and
12+
[`squizlabs/php_codesniffer`<sup>&neArr;</sup>][phpcs]
1413
* Laravel configured with sane defaults and without boilerplate
1514
* Continuous Delivery using [GitHub Actions][workflows] and the GitHub Container
1615
Registry
@@ -153,8 +152,8 @@ performance in development by ~10x
153152
[laravel]: https://laravel.com
154153
[laravel-8]: https://laravel.com/docs/8.x
155154
[shrink/docker-php-api]: https://github.com/shrink/docker-php-api
156-
[php-insights]: https://phpinsights.com
157155
[psalm]: https://psalm.dev
156+
[phpcs]: https://github.com/squizlabs/PHP_CodeSniffer
158157
[workflows]: .github/workflows
159158
[workflows/build]: .github/workflows/build.yml
160159
[laravel/laravel]: https://github.com/laravel/laravel

composer.json

Lines changed: 61 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,64 @@
11
{
2-
"name": "shrink/laravel-project",
3-
"type": "project",
4-
"description": "Add a project description here",
5-
"license": "proprietary",
6-
"require": {
7-
"php": "^7.4",
8-
"fideloper/proxy": "^4.0",
9-
"laravel/framework": "^8.0",
10-
"laravel/tinker": "^2.0",
11-
"shrink/conductor-laravel": "^0.3.0"
12-
},
13-
"require-dev": {
14-
"facade/ignition": "^2.3.6",
15-
"nunomaduro/collision": "^5.0",
16-
"nunomaduro/phpinsights": "^1.14",
17-
"phpunit/phpunit": "^8.5|^9.0",
18-
"vimeo/psalm": "^3.11"
19-
},
20-
"config": {
21-
"optimize-autoloader": false,
22-
"preferred-install": "dist",
23-
"sort-packages": true
24-
},
25-
"extra": {
26-
"laravel": {
27-
"dont-discover": []
28-
}
29-
},
30-
"autoload": {
31-
"psr-4": {
32-
"App\\": "app/"
33-
}
34-
},
35-
"autoload-dev": {
36-
"psr-4": {
37-
"Tests\\": "tests/"
38-
}
39-
},
40-
"minimum-stability": "dev",
41-
"prefer-stable": true,
42-
"scripts": {
43-
"post-autoload-dump": [
44-
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
45-
"@php artisan package:discover --ansi"
46-
],
47-
"generate-key": [
48-
"@php artisan key:generate --ansi"
49-
],
50-
"serve": [
51-
"@generate-key",
52-
"Composer\\Config::disableProcessTimeout",
53-
"(source .env && echo \"\n→ Launching local server at http://localhost:${APP_PORT}\n\")",
54-
"@php -S 0.0.0.0:8080 -t public"
55-
],
56-
"check": [
57-
"@test",
58-
"@static",
59-
"@insights"
60-
],
61-
"test": [
62-
"vendor/bin/phpunit --colors=always"
63-
],
64-
"insights": [
65-
"vendor/bin/phpinsights --ansi --no-interaction --config-path=insights.php"
66-
],
67-
"static": [
68-
"vendor/bin/psalm --long-progress --report=artifacts/psalm.junit.xml"
69-
]
2+
"name": "shrink/laravel-project",
3+
"type": "project",
4+
"description": "Add a project description here",
5+
"license": "proprietary",
6+
"require": {
7+
"php": "^8",
8+
"laravel/framework": "^8.0",
9+
"laravel/tinker": "^2.0",
10+
"shrink/conductor-laravel": "^1.1.0"
11+
},
12+
"require-dev": {
13+
"facade/ignition": "^2.3.6",
14+
"nunomaduro/collision": "^5.0",
15+
"phpunit/phpunit": "^8.5|^9.0",
16+
"squizlabs/php_codesniffer": "^3.5",
17+
"vimeo/psalm": "^4.3"
18+
},
19+
"config": {
20+
"optimize-autoloader": false,
21+
"preferred-install": "dist",
22+
"sort-packages": true
23+
},
24+
"extra": {
25+
"laravel": {
26+
"dont-discover": []
7027
}
28+
},
29+
"autoload": {
30+
"psr-4": {
31+
"App\\": "app/"
32+
}
33+
},
34+
"autoload-dev": {
35+
"psr-4": {
36+
"Tests\\": "tests/"
37+
}
38+
},
39+
"minimum-stability": "dev",
40+
"prefer-stable": true,
41+
"scripts": {
42+
"post-autoload-dump": [
43+
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
44+
"@php artisan package:discover --ansi"
45+
],
46+
"generate-key": [
47+
"@php artisan key:generate --ansi"
48+
],
49+
"check": [
50+
"@test",
51+
"@static",
52+
"@quality"
53+
],
54+
"test": [
55+
"vendor/bin/phpunit --colors=always"
56+
],
57+
"quality": [
58+
"vendor/bin/phpcs --standard=PSR12 src/"
59+
],
60+
"static": [
61+
"vendor/bin/psalm --long-progress --report=artifacts/psalm.junit.xml"
62+
]
63+
}
7164
}

0 commit comments

Comments
 (0)