Skip to content

Commit

Permalink
Drop Phing for Makefile
Browse files Browse the repository at this point in the history
  • Loading branch information
Kocal committed May 14, 2021
1 parent 4efb461 commit 65355b6
Show file tree
Hide file tree
Showing 11 changed files with 150 additions and 214 deletions.
12 changes: 11 additions & 1 deletion .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,11 @@
/tests export-ignore
*.php text eol=lf

.github export-ignore
tests export-ignore
tmp export-ignore
.gitattributes export-ignore
.gitignore export-ignore
Makefile export-ignore
phpcs.xml export-ignore
phpstan.neon export-ignore
phpunit.xml export-ignore
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
/composer.lock
/tests/tmp
/vendor
composer.lock
.phpunit.result.cache
23 changes: 23 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
.PHONY: check
check: lint cs tests phpstan

.PHONY: tests
tests:
php vendor/bin/phpunit

.PHONY: lint
lint:
php vendor/bin/parallel-lint --colors \
src tests

.PHONY: cs
cs:
composer install --working-dir build-cs && php build-cs/vendor/bin/phpcs

.PHONY: cs-fix
cs-fix:
php build-cs/vendor/bin/phpcbf

.PHONY: phpstan
phpstan:
php vendor/bin/phpstan analyse -l 8 -c phpstan.neon src tests
2 changes: 1 addition & 1 deletion build-cs/composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"require-dev": {
"consistence/coding-standard": "^3.10",
"consistence-community/coding-standard": "^3.10",
"dealerdirect/phpcodesniffer-composer-installer": "^0.7.0",
"slevomat/coding-standard": "^6.4"
}
Expand Down
123 changes: 0 additions & 123 deletions build.xml

This file was deleted.

11 changes: 10 additions & 1 deletion phpcs.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
<?xml version="1.0"?>
<ruleset name="PHPStan Strict Rules extension">
<rule ref="build-cs/vendor/consistence/coding-standard/Consistence/ruleset.xml">
<arg name="colors"/>
<arg name="extensions" value="php"/>
<arg name="encoding" value="utf-8"/>
<arg name="tab-width" value="4"/>
<arg name="cache" value="tmp/cache/phpcs"/>
<arg value="sp"/>
<file>src</file>
<file>tests</file>
<rule ref="build-cs/vendor/consistence-community/coding-standard/Consistence/ruleset.xml">
<exclude name="Squiz.Functions.GlobalFunction.Found"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameAfterKeyword"/>
<exclude name="SlevomatCodingStandard.Namespaces.FullyQualifiedClassNameInAnnotation"/>
Expand Down Expand Up @@ -53,5 +61,6 @@
<property name="rootNamespaces" type="array" value="src=>PHPStan,tests=>PHPStan"/>
</properties>
</rule>
<exclude-pattern>tests/tmp</exclude-pattern>
<exclude-pattern>tests/*/data</exclude-pattern>
</ruleset>
36 changes: 36 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<?xml version="1.0"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="tests/bootstrap.php"
colors="true"
backupGlobals="false"
backupStaticAttributes="false"
beStrictAboutChangesToGlobalState="true"
beStrictAboutOutputDuringTests="true"
beStrictAboutTestsThatDoNotTestAnything="true"
beStrictAboutTodoAnnotatedTests="true"
failOnRisky="true"
failOnWarning="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
>
<coverage>
<include>
<directory suffix=".php">./src</directory>
</include>
<report>
<clover outputFile="tests/tmp/clover.xml"/>
<text
outputFile="php://stdout"
showUncoveredFiles="true"
showOnlySummary="true"
/>
</report>
</coverage>

<testsuites>
<testsuite name="PHPStan for Symfony">
<directory suffix="Test.php">tests</directory>
</testsuite>
</testsuites>

<logging/>
</phpunit>
122 changes: 61 additions & 61 deletions tests/Rules/ForLoop/data/data.php
Original file line number Diff line number Diff line change
@@ -1,62 +1,62 @@
<?php

namespace OverwriteVariablesWithForLoopInit;

class Foo{

public function simple(int $i): void
{
for($i = 0; $i < 10; ++$i){

}

for($j = 0; $j < 10; ++$j){

}
}

public function multi(int $i, int $j): void
{
for($i = 0, $j = 0; $i < 10; ++$i){

}

for($i = 0, $k = 0; $i < 10; ++$i){

}

for($k = 0, $l = 0; $k < 10; ++$k){

}
}

public function list(int $i, int $j, array $b): void
{
for(list($i, $j) = $b; $i < 10; ++$i){

}

for(list($i, list($j, $k)) = $b; $i < 10; ++$i){

}

for(list($k, list($l, $m)) = $b; $k < 10; ++$k){

}
}

public function array(int $i, array $b): void
{
for([$i, $j] = $b; $i < 10; ++$i){

}

for([$i, [$j, $k]] = $b; $i < 10; ++$i){

}

for([$k, [$l, $m]] = $b; $k < 10; ++$k){

}
}
<?php

namespace OverwriteVariablesWithForLoopInit;

class Foo{

public function simple(int $i): void
{
for($i = 0; $i < 10; ++$i){

}

for($j = 0; $j < 10; ++$j){

}
}

public function multi(int $i, int $j): void
{
for($i = 0, $j = 0; $i < 10; ++$i){

}

for($i = 0, $k = 0; $i < 10; ++$i){

}

for($k = 0, $l = 0; $k < 10; ++$k){

}
}

public function list(int $i, int $j, array $b): void
{
for(list($i, $j) = $b; $i < 10; ++$i){

}

for(list($i, list($j, $k)) = $b; $i < 10; ++$i){

}

for(list($k, list($l, $m)) = $b; $k < 10; ++$k){

}
}

public function array(int $i, array $b): void
{
for([$i, $j] = $b; $i < 10; ++$i){

}

for([$i, [$j, $k]] = $b; $i < 10; ++$i){

}

for([$k, [$l, $m]] = $b; $k < 10; ++$k){

}
}
}
26 changes: 0 additions & 26 deletions tests/phpunit.xml

This file was deleted.

3 changes: 3 additions & 0 deletions tmp/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
*
!cache
!.*
2 changes: 2 additions & 0 deletions tmp/cache/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.*

0 comments on commit 65355b6

Please sign in to comment.