This is a PHP 7.4.12 Docker Image containing development tools. It should be used alongside uofa/docker-php74.
The following are available globally:
Update your docker-compose.yml with:
workspace:
image: universityofabdn/docker-php74-workspace
Open a bash terminal into the container:
docker exec -it <***-workspace_1> bash
# create a package.json
npm init
To quickly detect deprecated code run phpcs:
phpcs -p myapp --standard="PHPCompatibility" --runtime-set testVersion 7.4
To quickly detect problematic variable use:
phpcs -p myapp --standard="VariableAnalysis"
For a more in depth analysis, and automated refactor, use Rector:
rector process myapp --set php74 --dry-run
# e.g. for scanning the Laravel app directory
rector process laravel/app --set php74 --dry-run --autoload-file laravel/vendor/autoload.php
The --dry-run parameter will highlight the intended changes. In order to automatically refactor your code, run the same command without --dry-run
rector process myapp --set php74
Additional checks can be mande using PHPStan
phpstan analyse -l 1 myapp
# e.g. for scanning the Laravel app directory
phpstan analyse -l 1 laravel/app --autoload-file=laravel/vendor/autoload.php
The -l parameter enables incremental adoption of PHPStan checks (1 to 7, where 7 is the strictest).
Running Easy Coding Standards:
Note, you will need to have a copy of the ECS ruleset in your repo before this can be run. The version in Laravel Starter can be used.
# runs the standards set in ecs.yaml
ecs check myapp
ecs check myapp --fix
Content type
Image
Digest
Size
1.3 GB
Last updated
over 5 years ago
docker pull universityofabdn/docker-php74-workspace