Skip to content

Commit be8296c

Browse files
committed
Cleanup
1 parent 5d435d5 commit be8296c

File tree

7 files changed

+773
-259
lines changed

7 files changed

+773
-259
lines changed

Makefile

Lines changed: 33 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,18 @@ push-travis:
111111
#-------------------------------------------------------------------------------
112112
# Linting and Static Analysis
113113

114-
.PHONY: lint
115-
lint:
114+
.PHONY: mkdir
115+
mkdir:
116116
@ mkdir -p reports
117117

118+
.PHONY: phpcsfixer
119+
phpcsfixer:
118120
@ echo " "
119121
@ echo "=====> Running PHP CS Fixer..."
120122
- bin/php-cs-fixer fix -vvv
121123

124+
.PHONY: phpcs
125+
phpcs:
122126
@ echo " "
123127
@ echo "=====> Running PHP Code Sniffer..."
124128
- bin/phpcs --report-xml=reports/phpcs-src.xml -p --colors --encoding=utf-8 $$(find src/ -type f -name "*.php" | sort | uniq)
@@ -130,30 +134,54 @@ lint:
130134
@ echo " "
131135
@ php tools/reporter.php
132136

133-
.PHONY: analyze
134-
analyze: lint test
137+
.PHONY: lint
138+
lint: mkdir phpcsfixer phpcs
139+
140+
.PHONY: xdebug
141+
xdebug:
142+
bin/phpunit --dump-xdebug-filter tests/phpunit-xdebug-coverage.php
143+
144+
.PHONY: phpcpd
145+
phpcpd:
135146
@ echo " "
136147
@ echo "=====> Running PHP Copy-Paste Detector..."
137148
- bin/phpcpd --names=*.php --log-pmd=$$(pwd)/reports/copy-paste.xml --fuzzy src/
138149

150+
.PHONY: phploc
151+
phploc:
139152
@ echo " "
140153
@ echo "=====> Running PHP Lines-of-Code..."
141154
- bin/phploc --names=*.php --log-xml=$$(pwd)/reports/phploc-src.xml src/ > $$(pwd)/reports/phploc-src.txt
142155
- bin/phploc --names=*.php --log-xml=$$(pwd)/reports/phploc-tests.xml tests/ > $$(pwd)/reports/phploc-tests.txt
143156

157+
.PHONY: phpca
158+
phpca:
144159
@ echo " "
145160
@ echo "=====> Running PHP Code Analyzer..."
146161
- php bin/phpca src/ --no-progress | tee reports/phpca-src.txt
147162
- php bin/phpca tests/ --no-progress | tee reports/phpca-tests.txt
148163

164+
.PHONY: licenses
165+
licenses:
149166
@ echo " "
150167
@ echo "=====> Running Open-Source License Check..."
151-
- composer licenses | grep -v BSD-.-Clause | grep -v MIT | grep -v Apache-2.0 | tee reports/licenses.txt
168+
- composer licenses | grep -v BSD-.-Clause | grep -v MIT | grep -v Apache-2.0 | grep -v ISC | tee reports/licenses.txt
152169

170+
.PHONY: vulns
171+
vulns:
153172
@ echo " "
154173
@ echo "=====> Comparing Composer dependencies against the PHP Security Advisories Database..."
155174
- curl -sSL -H "Accept: text/plain" https://security.symfony.com/check_lock -F lock=@composer.lock | tee reports/sensiolabs.txt
156175

176+
.PHONY: psalm
177+
psalm:
178+
@ echo " "
179+
@ echo "=====> Running Psalm..."
180+
- bin/psalm --find-unused-code=always --generate-json-map=./reports/psalm.json --output-format=console --show-info=true --show-snippet=true --stats --threads=$$(nproc) --php-version=7.2
181+
182+
.PHONY: analyze
183+
analyze: lint test phpcpd phploc phpca licenses vulns
184+
157185
#-------------------------------------------------------------------------------
158186
# Git Tasks
159187

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,8 @@
6060
"phpunit/phpunit": "^8.1",
6161
"sebastian/phpcpd": "^4.0",
6262
"squizlabs/php_codesniffer": "dev-master",
63-
"wapmorgan/php-code-analyzer": "^1.0",
64-
"vimeo/psalm": "^3.3"
63+
"vimeo/psalm": "^3.3",
64+
"wapmorgan/php-code-analyzer": "^1.0"
6565
},
6666
"config": {
6767
"bin-dir": "bin/",

0 commit comments

Comments
 (0)