Skip to content

Commit

Permalink
Statanal
Browse files Browse the repository at this point in the history
  • Loading branch information
anyitsolutions committed Apr 10, 2022
1 parent 5892348 commit 75a7c2e
Show file tree
Hide file tree
Showing 51 changed files with 1,046 additions and 70 deletions.
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,10 @@
###> lexik/jwt-authentication-bundle ###
/config/jwt/*.pem
###< lexik/jwt-authentication-bundle ###

###> friendsofphp/php-cs-fixer ###
/.php-cs-fixer.php
/.php-cs-fixer.cache
###< friendsofphp/php-cs-fixer ###

.deptrac.cache
12 changes: 12 additions & 0 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<?php

$finder = (new PhpCsFixer\Finder())
->in(__DIR__)
->exclude(['var', 'vendor']);

return (new PhpCsFixer\Config())
->setRules([
'@Symfony' => true,
'php_unit_method_casing' => ['case' => 'snake_case'],
])
->setFinder($finder);
45 changes: 35 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,41 +1,66 @@
##################
# Variables
##################

DOCKER_COMPOSE = docker-compose -f ./docker/docker-compose.yml
DOCKER_COMPOSE_PHP_FPM_EXEC = ${DOCKER_COMPOSE} exec -u www-data php-fpm

##################
# Docker compose
##################

dc_build:
docker-compose -f ./docker/docker-compose.yml build
${DOCKER_COMPOSE} build

dc_start:
docker-compose -f ./docker/docker-compose.yml start
${DOCKER_COMPOSE} start

dc_stop:
docker-compose -f ./docker/docker-compose.yml stop
${DOCKER_COMPOSE} stop

dc_up:
docker-compose -f ./docker/docker-compose.yml up -d --remove-orphans
${DOCKER_COMPOSE} up -d --remove-orphans

dc_ps:
docker-compose -f ./docker/docker-compose.yml ps
${DOCKER_COMPOSE} ps

dc_logs:
docker-compose -f ./docker/docker-compose.yml logs -f
${DOCKER_COMPOSE} logs -f

dc_down:
docker-compose -f ./docker/docker-compose.yml down -v --rmi=all --remove-orphans
${DOCKER_COMPOSE} down -v --rmi=all --remove-orphans


##################
# App
##################

app_bash:
docker-compose -f ./docker/docker-compose.yml exec -u www-data php-fpm bash
${DOCKER_COMPOSE} exec -u www-data php-fpm bash


##################
# Database
##################

db_migrate:
docker-compose -f ./docker/docker-compose.yml exec -u www-data php-fpm bin/console doctrine:migrations:migrate --no-interaction
${DOCKER_COMPOSE} exec -u www-data php-fpm bin/console doctrine:migrations:migrate --no-interaction
db_diff:
docker-compose -f ./docker/docker-compose.yml exec -u www-data php-fpm bin/console doctrine:migrations:diff --no-interaction
${DOCKER_COMPOSE} exec -u www-data php-fpm bin/console doctrine:migrations:diff --no-interaction

##################
# Static code analysis
##################

phpstan:
${DOCKER_COMPOSE_PHP_FPM_EXEC} vendor/bin/phpstan analyse src tests -c phpstan.neon

deptrac:
${DOCKER_COMPOSE_PHP_FPM_EXEC} vendor/bin/deptrac analyze deptrac-layers.yaml
${DOCKER_COMPOSE_PHP_FPM_EXEC} vendor/bin/deptrac analyze deptrac-modules.yaml

cs_fix:
${DOCKER_COMPOSE_PHP_FPM_EXEC} vendor/bin/php-cs-fixer fix

cs_fix_diff:
${DOCKER_COMPOSE_PHP_FPM_EXEC} vendor/bin/php-cs-fixer fix --dry-run --diff
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@

### Auth
- [X] [JWT Authentication](https://github.com/lexik/LexikJWTAuthenticationBundle)
- [X] [JWT Refresh Token](https://github.com/markitosgv/JWTRefreshTokenBundle)
- [X] [JWT Refresh Token](https://github.com/markitosgv/JWTRefreshTokenBundle)

### Static analysis tool
- [X] [PHP CS Fixer](https://github.com/FriendsOfPHP/PHP-CS-Fixer)
- [X] [Deptrac](https://qossmic.github.io/deptrac/)
- [X] [PHPStan](https://github.com/phpstan/phpstan)
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,11 @@
"dama/doctrine-test-bundle": "^6.7",
"doctrine/doctrine-fixtures-bundle": "^3.4",
"fakerphp/faker": "^1.19",
"friendsofphp/php-cs-fixer": "^3.8",
"liip/test-fixtures-bundle": "^2.2",
"phpstan/phpstan": "^1.5",
"phpunit/phpunit": "^9.5",
"qossmic/deptrac-shim": "^0.19.3",
"symfony/browser-kit": "6.0.*",
"symfony/css-selector": "6.0.*",
"symfony/phpunit-bridge": "^6.0"
Expand Down
Loading

0 comments on commit 75a7c2e

Please sign in to comment.