Add phive tools folder, Switch to tabs for indent and add phpcs.xml

This commit is contained in:
2026-01-13 11:06:11 +09:00
parent 4adbf4e30a
commit b0d8c55536
19 changed files with 2813 additions and 2769 deletions

2
.gitignore vendored
View File

@@ -3,3 +3,5 @@ vendor
composer.lock
**/.env
**/.target
.phpunit.cache/
tools/

8
.phive/phars.xml Normal file
View File

@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<phive xmlns="https://phar.io/phive">
<phar name="phpcs" version="^4.0.1" installed="4.0.1" location="./tools/phpcs" copy="false"/>
<phar name="phpcbf" version="^4.0.1" installed="4.0.1" location="./tools/phpcbf" copy="false"/>
<phar name="phan" version="^5.5.2" installed="5.5.2" location="./tools/phan" copy="false"/>
<phar name="phpstan" version="^2.1.33" installed="2.1.33" location="./tools/phpstan" copy="false"/>
<phar name="phpunit" version="^12.5.4" installed="12.5.4" location="./tools/phpunit" copy="false"/>
</phive>

View File

@@ -152,3 +152,19 @@ New entries can be written with
On sucessful run the log data is accessable with `$aws->getLog()`
On exception the log data is in the error message json (see exceptions)
## Development
### Phan
`vendor/bin/phan --analyze-twice`
### PHPstan
`vendor/bin/phpstan`
### PHPUnit
Unit tests have to be run from base folder with
`vendor/bin/phpunit test/phpUnitTests/`

18
phpcs.xml Normal file
View File

@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<ruleset name="MyStandard">
<description>PSR12 override rules (strict, standard). Switch spaces indent to tab.</description>
<arg name="tab-width" value="4"/>
<rule ref="PSR1"/>
<rule ref="PSR12">
<!-- turn off white space check for tab -->
<exclude name="Generic.WhiteSpace.DisallowTabIndent"/>
</rule>
<!-- no space indent, must be tab, 4 is tab iwdth -->
<rule ref="Generic.WhiteSpace.DisallowSpaceIndent"/>
<rule ref="Generic.WhiteSpace.ScopeIndent">
<properties>
<property name="indent" value="4"/>
<property name="tabIndent" value="true"/>
</properties>
</rule>
</ruleset>