Skip to content

Commit f5e4757

Browse files
author
Alcides Ramos
committed
docs: updated documents
1 parent b9d2c54 commit f5e4757

2 files changed

Lines changed: 60 additions & 84 deletions

File tree

Makefile

Lines changed: 30 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ else
2626
RESET := ""
2727
endif
2828

29-
#---
30-
31-
RANDOM_ORDER_SEED := $(shell head -200 /dev/urandom | cksum | cut -f1 -d " ")
32-
33-
#---
34-
3529
###
3630
# HELP
3731
###
@@ -83,97 +77,89 @@ endef
8377
###
8478

8579
.PHONY: composer-dump
86-
composer-dump: ## [COMPOSER] Executes <composer dump-auto> inside the container
80+
composer-dump: ## Composer: executes <composer dump-auto> inside the container
8781
$(call showInfo,"Executing \<composer dump-auto\>...")
8882
@echo ""
89-
@$(DOCKER_RUN_AS_USER) composer dump-auto --ansi --no-plugins --profile --classmap-authoritative --apcu --strict-psr
83+
@$(DOCKER_RUN_AS_USER) composer dump-auto
9084
$(call taskDone)
9185

9286
.PHONY: composer-install
93-
composer-install: ## [COMPOSER] Executes <composer install> inside the container
87+
composer-install: ## Composer: executes <composer install> inside the container
9488
$(call showInfo,"Executing \<composer install\>...")
9589
@echo ""
96-
@$(DOCKER_RUN_AS_USER) composer install --ansi --no-plugins --classmap-authoritative --audit --apcu-autoloader
90+
@$(DOCKER_RUN_AS_USER) composer install
9791
$(call taskDone)
9892

9993
.PHONY: composer-remove
100-
composer-remove: require-package ## [COMPOSER] Executes <composer remove> inside the container
94+
composer-remove: require-package ## Composer: executes <composer remove> inside the container
10195
$(call showInfo,"Executing \<composer remove\>...")
10296
@echo ""
103-
@$(DOCKER_RUN_AS_USER) composer remove --ansi --no-plugins --classmap-authoritative --apcu-autoloader --with-all-dependencies --unused
97+
@$(DOCKER_RUN_AS_USER) composer remove
10498
$(call taskDone)
10599

106100
.PHONY: composer-require-dev
107-
composer-require-dev: ## [COMPOSER] Executes <composer require --dev> inside the container
101+
composer-require-dev: ## Composer: executes <composer require --dev> inside the container
108102
$(call showInfo,"Executing \<composer require --dev\>...")
109103
@echo ""
110-
@$(DOCKER_RUN_AS_USER) composer require --ansi --no-plugins --classmap-authoritative --apcu-autoloader --with-all-dependencies --prefer-stable --sort-packages --dev
104+
@$(DOCKER_RUN_AS_USER) composer require --dev
111105
$(call taskDone)
112106

113107
.PHONY: composer-require
114-
composer-require: ## [COMPOSER] Executes <composer require> inside the container
108+
composer-require: ## Composer: executes <composer require> inside the container
115109
$(call showInfo,"Executing \<composer require\>...")
116110
@echo ""
117-
@$(DOCKER_RUN_AS_USER) composer require --ansi --no-plugins --classmap-authoritative --apcu-autoloader --with-all-dependencies --prefer-stable --sort-packages
111+
@$(DOCKER_RUN_AS_USER) composer require
118112
$(call taskDone)
119113

120114
.PHONY: composer-update
121-
composer-update: ## [COMPOSER] Executes <composer update> inside the container
115+
composer-update: ## Composer: executes <composer update> inside the container
122116
$(call showInfo,"Executing \<composer update\>...")
123117
@echo ""
124-
@$(DOCKER_RUN_AS_USER) composer update --ansi --no-plugins --classmap-authoritative --apcu-autoloader --with-all-dependencies
118+
@$(DOCKER_RUN_AS_USER) composer update
125119
$(call taskDone)
126120

127121
###
128122
# QA
129123
###
130124

131125
.PHONY: check-syntax
132-
check-syntax: ## [QA] Executes <check-syntax> inside the container <filter=[app|path]>
133-
@$(eval filter ?= 'app')
134-
$(call showInfo,"Check code syntax...")
126+
check-syntax: ## QA: executes <check-syntax> inside the container
127+
$(call showInfo,"Executing \<composer check-syntax\>...")
135128
@echo ""
136-
@vendor/bin/parallel-lint --colors -e php -j 10 $(filter)
129+
@$(DOCKER_RUN_AS_USER) composer check-syntax
137130
$(call taskDone)
138131

139132
.PHONY: check-style
140-
check-style: ## [QA] Executes <check-style> inside the container <filter=[app|path]>
141-
@$(eval filter ?= 'app')
142-
$(call showInfo,"Checking code style...")
133+
check-style: ## QA: executes <check-style> inside the container
134+
$(call showInfo,"Executing \<composer check-style\>...")
143135
@echo ""
144-
@vendor/bin/phpcs -p --colors --standard=phpcs.xml $(filter)
136+
@$(DOCKER_RUN_AS_USER) composer check-style
145137
$(call taskDone)
146138

147139
.PHONY: fix-style
148-
fix-style: ## [QA] Executes <fix-style> inside the container <filter=[app|path]>
149-
@$(eval filter ?= 'app')
150-
$(call showInfo,"Fixing code style...")
140+
fix-style: ## QA: executes <fix-style> inside the container
141+
$(call showInfo,"Executing \<composer fix-style\>...")
151142
@echo ""
152-
@vendor/bin/phpcbf -p --colors --standard=phpcs.xml $(filter)
143+
@$(DOCKER_RUN_AS_USER) composer fix-style
153144
$(call taskDone)
154145

155146
.PHONY: phpstan
156-
phpstan: ## [QA] Executes <phpstan> inside the container <filter=[app|path]>
157-
@$(eval filter ?= 'app')
158-
$(call showInfo,"Executing PHPStan...")
147+
phpstan: ## QA: executes <composer phpstan> inside the container
148+
$(call showInfo,"Executing \<composer phpstan\>...")
159149
@echo ""
160-
@vendor/bin/phpstan analyse --ansi --memory-limit=1G --no-progress --configuration=phpstan.neon $(filter)
150+
@$(DOCKER_RUN_AS_USER) composer phpstan
161151
$(call taskDone)
162152

163153
.PHONY: tests
164-
tests: ## [QA] Executes <phpunit> inside the container <testsuite=[Unit|...]> <filter=[.|method + filename]>
165-
@$(eval testsuite ?= 'Unit')
166-
@$(eval filter ?= '.')
167-
$(call showInfo,"Executing PHPUnit...")
154+
test: ## QA: executes <composer paratest> inside the container
155+
$(call showInfo,"Executing \<composer paratest\>...")
168156
@echo ""
169-
@XDEBUG_MODE=off vendor/bin/phpunit --testsuite=$(testsuite) --filter=$(filter) --configuration=phpunit.xml --coverage-text --testdox --colors --order-by=random --random-order-seed=$(RANDOM_ORDER_SEED)
157+
@$(DOCKER_RUN_AS_USER) composer paratest
170158
$(call taskDone)
171159

172160
.PHONY: coverage
173-
coverage: ## [QA] Executes <phpunit with pcov coverage support> inside the container
174-
$(call showInfo,"Generating Code Coverage report...")
161+
coverage: ## QA: executes <composer paracoverage> inside the container
162+
$(call showInfo,"Executing \<composer paracoverage\>...")
175163
@echo ""
176-
@rm -Rf .coverage
177-
@mkdir .coverage
178-
@XDEBUG_MODE=off vendor/bin/phpunit --coverage-html=.coverage --configuration=phpunit.xml --coverage-text --testdox --colors --order-by=random --random-order-seed=$(RANDOM_ORDER_SEED)
164+
@$(DOCKER_RUN_AS_USER) composer paracoverage
179165
$(call taskDone)

README.md

Lines changed: 30 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -48,21 +48,18 @@ $ git clone git@github.com:alcidesrc/php-skeleton.git .
4848

4949
```text
5050
.
51-
├── app # Application business logic goes here
52-
├── public # Public folder
53-
│ └── index.php # Application entry point
54-
├── tests # Tests folder
55-
│ └── Unit # Unit Tests folder
56-
├── vendor # Dependencies folder
57-
├── .gitignore # Git ignore file
58-
├── composer.json # Composer dependencies files
59-
├── composer.lock # Composer lock file
60-
├── LICENSE # License document
61-
├── Makefile # Makefile with frequent commands
51+
├── app # Your application business logic goes here
52+
├── composer.json # Application dependencies main file
53+
├── composer.lock # Application dependencies locked file
54+
├── LICENSE
55+
├── Makefile
6256
├── phpcs.xml # PHPCS configuration file
6357
├── phpstan.neon # PHPStan configuration file
6458
├── phpunit.xml # PHPUnit configuration file
65-
└── README.md # This document
59+
├── public # Public folder
60+
├── README.md
61+
├── tests # Tests folder
62+
└── vendor
6663
```
6764

6865
#### Composer commands
@@ -88,24 +85,25 @@ Additionally a *Makefile* is provided with frequently used commands:
8885
```bash
8986
~/path/to/my-new-project$ make
9087

91-
╔══════════════════════════════════════════════════════════════════════════════╗
92-
║ ║
93-
║ .: AVAILABLE COMMANDS :. ║
94-
║ ║
95-
╚══════════════════════════════════════════════════════════════════════════════╝
96-
97-
· composer-dump [COMPOSER] Executes <composer dump-auto> inside the container
98-
· composer-install [COMPOSER] Executes <composer install> inside the container
99-
· composer-remove [COMPOSER] Executes <composer remove> inside the container
100-
· composer-require-dev [COMPOSER] Executes <composer require --dev> inside the container
101-
· composer-require [COMPOSER] Executes <composer require> inside the container
102-
· composer-update [COMPOSER] Executes <composer update> inside the container
103-
· check-syntax [QA] Executes <check-syntax [filter=app]> inside the container
104-
· check-style [QA] Executes <check-style [filter=app]> inside the container
105-
· fix-style [QA] Executes <fix-style [filter=app]> inside the container
106-
· phpstan [QA] Executes <phpstan [filter=app]> inside the container
107-
· tests [QA] Executes <phpunit --testsuite=[testsuite=Unit] --filter=[filter=.]> inside the container
108-
· coverage [QA] Executes <phpunit --coverage-html=[folder=./coverage]> inside the container
88+
╔════════════════════════════════════════════════════════════════════════════════════════════════════════╗
89+
║ ║
90+
║ .: AVAILABLE COMMANDS :. ║
91+
║ ║
92+
╚════════════════════════════════════════════════════════════════════════════════════════════════════════╝
93+
94+
· composer-dump Composer: executes <composer dump-auto> inside the container
95+
· composer-install Composer: executes <composer install> inside the container
96+
· composer-remove Composer: executes <composer remove> inside the container
97+
· composer-require-dev Composer: executes <composer require --dev> inside the container
98+
· composer-require Composer: executes <composer require> inside the container
99+
· composer-update Composer: executes <composer update> inside the container
100+
· check-syntax QA: executes <check-syntax> inside the container
101+
· check-style QA: executes <check-style> inside the container
102+
· fix-style QA: executes <fix-style> inside the container
103+
· phpstan QA: executes <composer phpstan> inside the container
104+
· test QA: executes <composer paratest> inside the container
105+
· coverage QA: executes <composer paracoverage> inside the container
106+
109107
```
110108

111109
##### Installing Dependencies
@@ -116,23 +114,15 @@ $ make composer-install
116114

117115
##### Running the Test Cases
118116

119-
###### Default command
120-
121-
```bash
122-
$ make tests [filter="checkInvokeMethod tests/Unit/Providers/FooTest.php"]
123-
```
124-
125-
###### Run only Unit testsuite
126-
127117
```bash
128-
$ make tests-unit [filter="checkInvokeMethod tests/Unit/Providers/FooTest.php"]
118+
$ make test
129119
```
130120

131121
#### Volumes
132122

133123
##### Coverage report in HTML
134124

135-
Coverage report in HTML is generated on a root folder `/coverage`
125+
Coverage report in HTML is generated on a root folder `/.coverage`
136126

137127
> [!TIP]
138128
>

0 commit comments

Comments
 (0)