Skip to content

Commit 3b0a4a3

Browse files
author
DKravtsov
committed
updated environment to php 8, refactoring.
1 parent 435d561 commit 3b0a4a3

File tree

363 files changed

+7519
-11536
lines changed

Some content is hidden

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

363 files changed

+7519
-11536
lines changed

.dockerignore

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
1+
### User-specific stuff:
12
/.git*
23
/.idea*
34
.dockerignore
45
.editorconfig
56

7+
###> symfony/framework-bundle ###
68
/.env.local
79
/.env.*.local
8-
.env.local.php
10+
/.env.local.php
911
/public/bundles/
1012
/var/mysql-data
1113
/var/rabbitmq
1214
/var/elasticsearch-data
1315
/vendor/
16+
###< symfony/framework-bundle ###
17+
18+
### Vendor bin dependencies
1419
/tools/*/vendor/
1520

21+
### Docker
1622
Dockerfile
1723
docker-compose.yml
1824
docker-compose-test-ci.yml

.env

+6
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,9 @@ DATABASE_LOG_REQUEST_HISTORY_DAYS=15
7979
REQUEST_LOG_SENSITIVE_PROPERTIES='["password", "token", "authorization", "cookie"]'
8080

8181
REQUEST_LOG_IGNORED_ROUTES='["", "/", "/api", "/api/", "/api/health", "/api/version", "/api/secret/*"]'
82+
83+
###> symfony/lock ###
84+
# Choose one of the stores below
85+
# LOCK_DSN=redis://localhost
86+
LOCK_DSN=semaphore
87+
###< symfony/lock ###

.php_cs.dist renamed to .php-cs-fixer.dist.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
<?php
22

3+
declare(strict_types=1);
4+
35
// https://mlocati.github.io/php-cs-fixer-configurator/
4-
return PhpCsFixer\Config::create()
6+
$finder = PhpCsFixer\Finder::create()->in(__DIR__)->exclude('somedir');
7+
8+
return (new PhpCsFixer\Config())
59
->setRules([
610
'@Symfony' => true,
711
'array_syntax' => ['syntax' => 'short'],
@@ -11,7 +15,7 @@
1115
'cast_spaces' => ['space' => 'none'],
1216
'ordered_imports' => ['imports_order' => ['class', 'function', 'const']],
1317
'no_superfluous_phpdoc_tags' => ['remove_inheritdoc' => false, 'allow_mixed' => true, 'allow_unused_params' => true],
14-
'declare_equal_normalize' => ['space' => 'single'],
18+
'declare_equal_normalize' => ['space' => 'none'],
1519
'blank_line_before_statement' => ['statements' => ['continue', 'declare', 'return', 'throw', 'try']],
1620
'single_blank_line_before_namespace' => true,
1721
'blank_line_after_namespace' => true,
@@ -27,6 +31,4 @@
2731
'not_operator_with_successor_space' => false,
2832
'single_line_throw' => false,
2933
'blank_line_after_strict_types' => false,
30-
31-
])
32-
;
34+
])->setFinder($finder);

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM php:7.4-fpm
1+
FROM php:8.0-fpm
22

33
# set main params
44
ARG BUILD_ARGUMENT_DEBUG_ENABLED=false
@@ -37,7 +37,7 @@ RUN apt-get update && apt-get upgrade -y && apt-get install -y \
3737
libzip-dev \
3838
wget \
3939
librabbitmq-dev \
40-
&& pecl install amqp \
40+
&& pecl install amqp-1.11.0beta \
4141
&& docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd \
4242
&& docker-php-ext-configure intl \
4343
&& yes '' | pecl install -o -f redis && docker-php-ext-enable redis \

Makefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ report-code-coverage: ## update code coverage on coveralls.io. Note: COVERALLS_R
200200

201201
###> phpcs ###
202202
phpcs: ## Run PHP CodeSniffer
203-
@make exec-bash cmd="./vendor/bin/phpcs --version && ./vendor/bin/phpcs --standard=PSR2 --colors -p src tests"
203+
@make exec-bash cmd="./vendor/bin/phpcs --version && ./vendor/bin/phpcs --standard=PSR12 --colors -p src tests"
204204
###< phpcs ###
205205

206206
###> ecs ###
@@ -233,7 +233,7 @@ phpcpd:
233233

234234
###> php mess detector ###
235235
phpmd:
236-
@make exec cmd="php ./vendor/bin/phpmd src text phpmd_ruleset.xml --suffixes php --exclude *src/Migrations/*"
236+
@make exec cmd="php ./vendor/bin/phpmd src text phpmd_ruleset.xml --suffixes php"
237237
###< php mess detector ###
238238

239239
###> PHPStan static analysis tool ###

bin/console

+5-4
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,20 @@
11
#!/usr/bin/env php
22
<?php
3-
declare(strict_types = 1);
3+
4+
declare(strict_types=1);
45

56
use App\Kernel;
67
use Symfony\Bundle\FrameworkBundle\Console\Application;
78
use Symfony\Component\Console\Input\ArgvInput;
89
use Symfony\Component\Dotenv\Dotenv;
910
use Symfony\Component\ErrorHandler\Debug;
1011

11-
set_time_limit(0);
12-
13-
if (!in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true)) {
12+
if (in_array(PHP_SAPI, ['cli', 'phpdbg', 'embed'], true) === false) {
1413
echo 'Warning: The console should be invoked via the CLI version of PHP, not the ' . PHP_SAPI . ' SAPI' . PHP_EOL;
1514
}
1615

16+
set_time_limit(0);
17+
1718
require dirname(__DIR__) . '/vendor/autoload.php';
1819

1920
if (!class_exists(Application::class) || !class_exists(Dotenv::class)) {

composer.json

+44-29
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@
1414
"Elasticsearch"
1515
],
1616
"homepage": "https://github.com/dimadeush/docker-symfony-api",
17-
"version": "1.0.0",
18-
"license": "proprietary",
17+
"version": "0.0.0",
18+
"license": "MIT",
1919
"authors": [
2020
{
2121
"name": "Dmitriy Kravtsov",
@@ -25,69 +25,77 @@
2525
}
2626
],
2727
"require": {
28-
"php": "^7.4.0",
28+
"php": "^8.0.0",
29+
"ext-amqp": "*",
2930
"ext-ctype": "*",
3031
"ext-iconv": "*",
3132
"ext-json": "*",
3233
"ext-mbstring": "*",
3334
"ext-pdo": "*",
3435
"ext-pdo_mysql": "*",
35-
"ext-amqp": "*",
36-
"stof/doctrine-extensions-bundle": "^1.5",
3736
"beberlei/doctrineextensions": "^1.3",
38-
"doctrine/doctrine-migrations-bundle": "^3.0",
39-
"systemsdk/easy-log-bundle": "1.10.*",
40-
"elasticsearch/elasticsearch": "^7.10",
41-
"jmose/command-scheduler-bundle": "^3.0",
42-
"lexik/jwt-authentication-bundle": "^2.10",
37+
"doctrine/annotations": "^1.13",
38+
"doctrine/doctrine-bundle": "^2.4",
39+
"doctrine/doctrine-migrations-bundle": "^3.1",
40+
"doctrine/orm": "^2.9",
41+
"dukecity/command-scheduler-bundle": "^4.0",
42+
"elasticsearch/elasticsearch": "^7.13",
43+
"gedmo/doctrine-extensions": "^3.1",
44+
"lexik/jwt-authentication-bundle": "^2.12",
4345
"mark-gerarts/automapper-plus-bundle": "^1.3",
46+
"matomo/device-detector": "^4.3",
4447
"matthiasnoback/symfony-console-form": "^3.6",
45-
"nelmio/api-doc-bundle": "^4.1",
48+
"nelmio/api-doc-bundle": "^4.4",
4649
"nelmio/cors-bundle": "^2.1",
47-
"matomo/device-detector": "^4.0",
50+
"phpdocumentor/reflection-docblock": "^5.2",
4851
"ramsey/uuid-doctrine": "^1.6",
49-
"sensio/framework-extra-bundle": "^5.6",
52+
"sensio/framework-extra-bundle": "^6.1",
5053
"symfony/asset": "4.4.*",
5154
"symfony/config": "4.4.*",
5255
"symfony/console": "4.4.*",
5356
"symfony/dotenv": "4.4.*",
5457
"symfony/expression-language": "4.4.*",
55-
"symfony/flex": "^1.9",
58+
"symfony/flex": "^1.13",
5659
"symfony/form": "4.4.*",
5760
"symfony/framework-bundle": "4.4.*",
5861
"symfony/http-client": "4.4.*",
5962
"symfony/intl": "4.4.*",
6063
"symfony/mailer": "4.4.*",
6164
"symfony/messenger": "4.4.*",
62-
"symfony/monolog-bundle": "^3.6",
63-
"symfony/orm-pack": "*",
65+
"symfony/monolog-bundle": "^3.7",
6466
"symfony/process": "4.4.*",
67+
"symfony/property-access": "4.4.*",
68+
"symfony/property-info": "4.4.*",
69+
"symfony/proxy-manager-bridge": "4.4.*",
6570
"symfony/routing": "4.4.*",
6671
"symfony/security-bundle": "4.4.*",
67-
"symfony/serializer-pack": "*",
72+
"symfony/serializer": "4.4.*",
6873
"symfony/translation": "4.4.*",
6974
"symfony/twig-bundle": "4.4.*",
7075
"symfony/validator": "4.4.*",
7176
"symfony/web-link": "4.4.*",
72-
"symfony/yaml": "4.4.*"
77+
"symfony/yaml": "4.4.*",
78+
"systemsdk/easy-log-bundle": "1.10.*"
7379
},
7480
"conflict": {
7581
"symfony/symfony": "*"
7682
},
7783
"require-dev": {
7884
"bamarni/composer-bin-plugin": "^1.4",
7985
"doctrine/doctrine-fixtures-bundle": "^3.4",
80-
"ergebnis/composer-normalize": "^2.13",
81-
"roave/security-advisories": "dev-master",
86+
"ergebnis/composer-normalize": "^2.15",
87+
"roave/security-advisories": "dev-latest",
88+
"symfony/browser-kit": "4.4.*",
8289
"symfony/debug-bundle": "4.4.*",
83-
"symfony/maker-bundle": "^1.26",
90+
"symfony/maker-bundle": "^1.33",
8491
"symfony/requirements-checker": "^2.0",
92+
"symfony/stopwatch": "4.4.*",
8593
"symfony/var-dumper": "4.4.*",
8694
"symfony/web-profiler-bundle": "4.4.*"
8795
},
8896
"config": {
8997
"platform": {
90-
"php": "7.4.0"
98+
"php": "8.0.0"
9199
},
92100
"preferred-install": {
93101
"*": "dist"
@@ -106,19 +114,23 @@
106114
"autoload": {
107115
"psr-4": {
108116
"App\\": "src/"
109-
}
117+
},
118+
"classmap": [],
119+
"exclude-from-classmap": []
110120
},
111121
"autoload-dev": {
112122
"psr-4": {
113123
"App\\Tests\\": "tests/",
114124
"PHPUnit\\": "tools/01_phpunit/vendor/phpunit/phpunit/src",
115-
"Symfony\\Component\\BrowserKit\\": "tools/01_phpunit/vendor/symfony/browser-kit",
116125
"Symfony\\Bridge\\PhpUnit\\": "tools/01_phpunit/vendor/symfony/phpunit-bridge",
117126
"PHPMD\\": "tools/06_phpmd/vendor/phpmd/phpmd/src/bin",
118-
"PhpCsFixer\\": "tools/03_ecs/vendor/friendsofphp/php-cs-fixer/src",
119-
"SlevomatCodingStandard\\": "tools/03_ecs/vendor/slevomat/coding-standard/SlevomatCodingStandard",
120-
"Symplify\\CodingStandard\\": "tools/03_ecs/vendor/symplify/coding-standard/src",
127+
"PhpCsFixer\\": "tools/03_ecs/vendor/symplify/easy-coding-standard/vendor/friendsofphp/php-cs-fixer/src",
128+
"Symplify\\CodingStandard\\": "tools/03_ecs/vendor/symplify/easy-coding-standard/vendor/symplify/coding-standard/src",
129+
"Symplify\\RuleDocGenerator\\": "tools/03_ecs/vendor/symplify/easy-coding-standard/vendor/symplify/rule-doc-generator-contracts/src",
130+
"PHPStan\\PhpDoc\\PHPUnit\\": "tools/02_phpstan/vendor/phpstan/phpstan-phpunit/src/PhpDoc/PHPUnit",
131+
"PHPStan\\Rules\\PHPUnit\\": "tools/02_phpstan/vendor/phpstan/phpstan-phpunit/src/Rules/PHPUnit",
121132
"PHPStan\\Symfony\\": "tools/02_phpstan/vendor/phpstan/phpstan-symfony/src/Symfony",
133+
"PHPStan\\Type\\PHPUnit\\": "tools/02_phpstan/vendor/phpstan/phpstan-phpunit/src/Type/PHPUnit",
122134
"PHPStan\\Type\\Symfony\\": "tools/02_phpstan/vendor/phpstan/phpstan-symfony/src/Type/Symfony"
123135
}
124136
},
@@ -128,17 +140,20 @@
128140
"if test -d vendor/symfony/requirements-checker; then ./vendor/bin/requirements-checker; fi",
129141
"if test -d vendor/bamarni/composer-bin-plugin; then composer bin all install; fi",
130142
"if which local-php-security-checker; then local-php-security-checker --update-cache && local-php-security-checker; fi",
131-
"@auto-scripts"
143+
"@auto-scripts",
144+
"@composer dump-autoload"
132145
],
133146
"post-update-cmd": [
134147
"if test -d vendor/symfony/requirements-checker; then ./vendor/bin/requirements-checker; fi",
135148
"if test -d vendor/bamarni/composer-bin-plugin; then composer bin all update; fi",
136149
"if which local-php-security-checker; then local-php-security-checker --update-cache && local-php-security-checker; fi",
137-
"@auto-scripts"
150+
"@auto-scripts",
151+
"@composer dump-autoload"
138152
],
139153
"auto-scripts": {
140154
"cache:clear": "symfony-cmd",
141155
"cache:warmup": "symfony-cmd",
156+
"assets:install --symlink --relative %PUBLIC_DIR%": "symfony-cmd",
142157
"assets:install %PUBLIC_DIR%": "symfony-cmd"
143158
}
144159
},

0 commit comments

Comments
 (0)