Skip to content
This repository was archived by the owner on Nov 15, 2025. It is now read-only.

Commit cb29d2d

Browse files
authored
Update from 4.4 to 6.1 (#77)
1 parent d6f3c02 commit cb29d2d

152 files changed

Lines changed: 5179 additions & 5878 deletions

File tree

Some content is hidden

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

.circleci/config.yml

Lines changed: 74 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -5,28 +5,28 @@ commands:
55
description: Install alpine requirements for checkout
66
steps:
77
- run:
8-
name: "Install alpine requirements for checkout"
9-
command: apk add git openssh-client curl make
8+
name: "Install alpine requirements for checkout"
9+
command: apk add git openssh-client curl make
1010
- checkout
1111

1212
composer-install:
1313
description: "Install dependencies"
1414
steps:
1515
- run:
16-
name: "Execute: composer install"
17-
command: |
18-
if [ ! -f vendor/autoload.php ];then
19-
curl https://getcomposer.org/composer-1.phar --location --silent --output /usr/bin/composer;
20-
chmod +x /usr/bin/composer;
21-
composer global require hirak/prestissimo;
22-
composer install --no-interaction --no-progress;
23-
fi
16+
name: "Execute: composer install"
17+
command: |
18+
if [ ! -f vendor/autoload.php ];then
19+
curl https://getcomposer.org/composer-2.phar --location --silent --output /usr/bin/composer;
20+
chmod +x /usr/bin/composer;
21+
cp .env.ci .env.local;
22+
composer install --no-interaction --no-progress;
23+
fi
2424
2525
restore-composer-cache:
2626
description: "Restore vendor folder from CircleCI cache"
2727
steps:
2828
- restore_cache:
29-
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
29+
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
3030

3131
store-composer-cache:
3232
description: "Store vendor folder in CircleCI cache"
@@ -35,39 +35,63 @@ commands:
3535
- restore-composer-cache
3636
- composer-install
3737
- save_cache:
38-
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
39-
paths:
40-
- ./vendor
38+
key: composer-{{ checksum "composer.json" }}-{{ checksum "composer.lock" }}
39+
paths:
40+
- ./vendor
4141
- persist_to_workspace:
42-
root: .
43-
paths:
44-
- vendor
42+
root: .
43+
paths:
44+
- vendor
4545

4646
phpcs:
4747
description: "Execute PHPCS"
4848
steps:
4949
- run:
50-
name: "Execute: make phpcs"
51-
command: make phpcs
50+
name: "Execute: make lint"
51+
command: |
52+
cp .env.ci .env.local
53+
make lint
5254
5355
phpstan:
5456
description: "Execute PHPStan"
5557
steps:
5658
- run:
57-
name: "Execute: make stan"
58-
command: make stan
59+
name: "Execute: make analyse"
60+
command: |
61+
cp .env.ci .env.local
62+
make analyse
63+
64+
copy-paste:
65+
description: "Execute Copy/Paste"
66+
steps:
67+
- run:
68+
name: "Execute: make copy-paste"
69+
command: |
70+
cp .env.ci .env.local
71+
make copy-paste
72+
73+
security:
74+
description: "Execute security checker"
75+
steps:
76+
- run:
77+
name: "Execute: make security"
78+
command: |
79+
cp .env.ci .env.local
80+
make security
5981
6082
doctrine_schema_validate:
6183
description: "Execute doctrine:schema:validate"
6284
steps:
6385
- run:
64-
name: "Execute: bin/console d:s:v"
65-
command: bin/console d:s:v --skip-sync
86+
name: "Execute: bin/console d:s:v"
87+
command: |
88+
cp .env.ci .env.local
89+
bin/console d:s:v --skip-sync
6690
6791
executors:
6892
php:
6993
docker:
70-
- image: php:7.3.8-cli-alpine3.10
94+
- image: php:8.1-cli-alpine
7195
working_directory: ~/repository
7296

7397
jobs:
@@ -90,6 +114,20 @@ jobs:
90114
- restore-composer-cache
91115
- phpstan
92116

117+
copy-paste:
118+
executor: php
119+
steps:
120+
- checkout-alpine
121+
- restore-composer-cache
122+
- copy-paste
123+
124+
security:
125+
executor: php
126+
steps:
127+
- checkout-alpine
128+
- restore-composer-cache
129+
- security
130+
93131
doctrine_schema_validate:
94132
executor: php
95133
steps:
@@ -103,11 +141,17 @@ workflows:
103141
jobs:
104142
- composer
105143
- phpcs:
106-
requires:
107-
- composer
144+
requires:
145+
- composer
108146
- phpstan:
109-
requires:
110-
- composer
147+
requires:
148+
- composer
149+
- copy-paste:
150+
requires:
151+
- composer
152+
- security:
153+
requires:
154+
- composer
111155
- doctrine_schema_validate:
112-
requires:
113-
- composer
156+
requires:
157+
- composer

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
# Require the plugin EditorConfig in Phpstorm
2+
[*]
3+
end_of_line = lf
4+
insert_final_newline = true
5+
trim_trailing_whitespace = true
6+
charset = utf-8
7+
8+
# Tab indentation (no size specified)
9+
[Makefile]
10+
indent_style = tab
11+
12+
# http://www.php-fig.org/psr/psr-2/#indenting
13+
[*.{php,yaml,yml,sh}]
14+
indent_style = space
15+
indent_size = 4

.env

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
###> symfony/framework-bundle ###
2+
APP_ENV=dev
3+
APP_SECRET=fake_secret
4+
TRUSTED_PROXIES=REMOTE_ADDR
5+
###< symfony/framework-bundle ###
6+
7+
###> league/oauth2-github ###
8+
GITHUB_CLIENT_ID=
9+
GITHUB_CLIENT_SECRET=
10+
###> league/oauth2-github ###
11+
12+
###> knplabs/github-api ###
13+
GITHUB_AUTH_METHOD=http_password
14+
GITHUB_USERNAME=username
15+
GITHUB_SECRET=password_or_token
16+
###< knplabs/github-api ###

.env.ci

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
###> symfony/framework-bundle ###
2+
APP_ENV=dev
3+
APP_SECRET=fake_secret
4+
TRUSTED_PROXIES=REMOTE_ADDR
5+
###< symfony/framework-bundle ###
6+
7+
###> league/oauth2-github ###
8+
GITHUB_CLIENT_ID=fake_id
9+
GITHUB_CLIENT_SECRET=fake_secret
10+
###> league/oauth2-github ###
11+
12+
###> knplabs/github-api ###
13+
GITHUB_AUTH_METHOD=http_password
14+
GITHUB_USERNAME=username
15+
GITHUB_SECRET=password_or_token
16+
###< knplabs/github-api ###
17+
18+
HTTP_HOST=github-gui.ci
19+
MYSQL_ROOT_PASSWORD=root
20+
MYSQL_HOST=github_gui_ci
21+
MYSQL_DATABASE=github_gui_ci
22+
MYSQL_USER=github_gui_ci
23+
MYSQL_PASSWORD=github_gui_ci

.env.dist

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

.gitignore

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
1+
12
###> symfony/framework-bundle ###
2-
/.env
33
/.env.local
44
/.env.local.php
55
/.env.*.local
6+
/config/secrets/prod/prod.decrypt.private.php
67
/public/bundles/
78
/var/
89
/vendor/
910
###< symfony/framework-bundle ###
1011

11-
/.idea/
12-
13-
/docker/.env
14-
/docker/docker-compose.override.yml
12+
###> squizlabs/php_codesniffer ###
13+
/.phpcs-cache
14+
/phpcs.xml.dist
15+
###< squizlabs/php_codesniffer ###

Makefile

Lines changed: 85 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,99 @@
1-
start-dev: hooks
2-
bash ./docker/start_dev.sh
1+
#-include docker/.env
32

4-
start-prod:
5-
bash ./docker/start_prod.sh
3+
.SILENT: shell analyse clear-cache
4+
.DEFAULT_GOAL := help
65

7-
stop-dev:
8-
cd ./docker/ && docker-compose -f docker-compose.yml -f docker-compose.dev.yml stop
6+
help:
7+
@grep -E '(^[a-zA-Z_-]+:.*?##.*$$)|(^##)' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[32m%-30s\033[0m %s\n", $$1, $$2}' | sed -e 's/\[32m##/[33m/'
98

10-
stop-prod:
11-
cd ./docker/ && docker-compose -f docker-compose.yml -f docker-compose.prod.yml stop
9+
##
10+
## Project
11+
##---------------------------------------------------------------------------
1212

13-
shell:
14-
cd ./docker/ && docker-compose exec php bash
13+
install: ## Install the project
14+
install: hooks
15+
cd ./docker && ./install.sh
1516

16-
check:
17-
cd ./docker/ && docker-compose exec -T php make phpcs
18-
cd ./docker/ && docker-compose exec -T php make stan
19-
cd ./docker/ && docker-compose exec -T php make check-doctrine
17+
start: ## Start the project
18+
start: hooks
19+
cd ./docker && ./start.sh
20+
21+
stop: ## Stop the project
22+
stop:
23+
cd ./docker && ./stop.sh
24+
25+
restart: ## Restart the project
26+
restart: stop start
27+
28+
update: ## Update the project
29+
update:
30+
cd ./docker && ./update.sh
2031

2132
hooks:
33+
# Pre commit
2234
echo "#!/bin/bash" > .git/hooks/pre-commit
2335
echo "make check" >> .git/hooks/pre-commit
2436
chmod +x .git/hooks/pre-commit
2537

26-
phpcs:
27-
vendor/bin/phpcs
38+
shell: ## Connect to PHP container
39+
shell:
40+
cd ./docker && docker-compose exec php bash
41+
42+
warmup-cache:
43+
bin/console cache:warmup
44+
45+
clear-cache:
46+
bin/console cache:clear --no-warmup
47+
48+
##
49+
## Database
50+
##---------------------------------------------------------------------------
2851

29-
stan:
52+
reset: ## Reset the database (only on container)
53+
reset:
54+
bin/console doctrine:database:drop --if-exists --force
55+
make doctrine-migrations
56+
57+
doctrine-migrations: ## Execute all migrations (only on container)
58+
doctrine-migrations:
59+
bin/console doctrine:database:create --if-not-exists
60+
bin/console doctrine:migration:migrate --allow-no-migration --no-interaction --all-or-nothing
61+
62+
##
63+
## Code quality (only on PHP test container)
64+
##---------------------------------------------------------------------------
65+
66+
check:
67+
cd ./docker/ && docker-compose exec -T php make clear-cache
68+
cd ./docker/ && docker-compose exec -T php make lint
69+
cd ./docker/ && docker-compose exec -T php make analyse
70+
cd ./docker/ && docker-compose exec -T php make copy-paste
71+
cd ./docker/ && docker-compose exec -T php make doctrine
72+
cd ./docker/ && docker-compose exec -T php make security
73+
74+
lint: ## Execute PHPCS
75+
lint:
76+
vendor/bin/phpcs -p
77+
78+
fixer: ## Execute PHPCS fixer
79+
fixer:
80+
./vendor/bin/phpcbf -p
81+
82+
analyse: ## Execute PHPStan
83+
analyse:
3084
bin/console cache:warmup --env=dev
31-
vendor/bin/phpstan analyse src --level max -c extension.neon
85+
vendor/bin/phpstan analyse --memory-limit=4G
86+
87+
doctrine: ## Validate Doctrine schema
88+
doctrine: reset
89+
bin/console d:s:v --env=test
90+
bin/console d:s:u --dump-sql --env=test
91+
92+
copy-paste: ## Check duplicate code
93+
copy-paste:
94+
./bin/phpcpd src \
95+
--fuzzy
3296

33-
check-doctrine:
34-
bin/console d:s:v
35-
bin/console d:s:u --dump-sql
97+
security: ## Check CVE for vendor dependencies
98+
security:
99+
./bin/security-checker --path=./composer.lock

0 commit comments

Comments
 (0)