Overview
Comment:Add PHPStan for analysis of code
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 2e7f7546084947ef3638e37d8ad490f0e52f4e90
User & Date: bohwaz on 2020-12-17 00:34:30
Other Links: manifest | tags
Context
2020-12-17
18:21
Try to fix another issue with forms check-in: c151d71bc6 user: bohwaz tags: trunk, stable
00:34
Add PHPStan for analysis of code check-in: 2e7f754608 user: bohwaz tags: trunk
00:17
Fix potential errors reported by PHPStan check-in: f965328227 user: bohwaz tags: trunk
Changes

Modified src/Makefile from [e1a9f9cdf3] to [6c4f6dc2aa].

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20



21
22
23
24
25
26
27
.PHONY: dev-server release deps publish check-dependencies test minify
KD2_FILE := https://fossil.kd2.org/kd2fw/uv/KD2-7.2.zip

deps:
	$(eval TMP_KD2=$(shell mktemp -d))
	#cd ${TMP_KD2}

	wget ${KD2_FILE} -O ${TMP_KD2}/kd2.zip

	rm -rf "include/lib/KD2"
	unzip "${TMP_KD2}/kd2.zip" -d include/lib

	rm -rf ${TMP_KD2}

dev-server:
	php -S localhost:8082 -t www www/_route.php

test:
	find . -name '*.php' -print0 | xargs -0 -n1 php -l > /dev/null




release: test minify
	$(eval VERSION=$(shell cat VERSION))
	rm -rf /tmp/garradin-build
	mkdir -p /tmp/garradin-build
	fossil zip ${VERSION} /tmp/garradin-build/src.zip --name garradin
	unzip -d /tmp/garradin-build /tmp/garradin-build/src.zip
	cd include/lib; \
|



















>
>
>







1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
.PHONY: dev-server release deps publish check-dependencies test minify phpstan
KD2_FILE := https://fossil.kd2.org/kd2fw/uv/KD2-7.2.zip

deps:
	$(eval TMP_KD2=$(shell mktemp -d))
	#cd ${TMP_KD2}

	wget ${KD2_FILE} -O ${TMP_KD2}/kd2.zip

	rm -rf "include/lib/KD2"
	unzip "${TMP_KD2}/kd2.zip" -d include/lib

	rm -rf ${TMP_KD2}

dev-server:
	php -S localhost:8082 -t www www/_route.php

test:
	find . -name '*.php' -print0 | xargs -0 -n1 php -l > /dev/null

phpstan:
	php ../tests/phpstan.phar analyze -c ../tests/phpstan.neon include www

release: test minify
	$(eval VERSION=$(shell cat VERSION))
	rm -rf /tmp/garradin-build
	mkdir -p /tmp/garradin-build
	fossil zip ${VERSION} /tmp/garradin-build/src.zip --name garradin
	unzip -d /tmp/garradin-build /tmp/garradin-build/src.zip
	cd include/lib; \

Added tests/phpstan.config.php version [13e3cda87a].















>
>
>
>
>
>
>
1
2
3
4
5
6
7
<?php

namespace Garradin;

const WWW_URL = 'http://localhost/';

const WWW_URI = '/';

Added tests/phpstan.neon version [e5c89f56d6].





































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
parameters:
    bootstrapFiles:
      - phpstan.config.php
      - ../src/include/init.php
    level: 1
    scanDirectories:
      - ../src/include
      - ../src/www
      - ../src/scripts
    excludes_analyse:
      - ../src/include/lib/KD2
    reportUnmatchedIgnoredErrors: false
    ignoreErrors:
        - '#Access to protected property Garradin\\Entities#'
        - '#Access to an undefined property KD2\\DB\\AbstractEntity#'
        -
          message: '#Variable \$(tpl|form|session|user|session|wiki|config|membres) might not be defined#'
          path: ../src/www/*