Skip to content

Commit 5120e53

Browse files
authored
Merge pull request #5 from freshp/feature/update-sca-tools
update sca tools and integration
2 parents 1395b44 + 4ee22cf commit 5120e53

File tree

6 files changed

+15
-15
lines changed

6 files changed

+15
-15
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
11
vendor
2+
.phpunit.result.cache
3+
composer.lock

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ before_script:
1010
- composer install --prefer-source --no-interaction
1111

1212
script:
13-
- ./vendor/bin/phpunit.phar -c ./phpunit.xml --debug --verbose
13+
- ./vendor/bin/phpunit.phar -c ./phpunit.xml --testdox
1414
- ./vendor/bin/phpmd.phar ./src/ text phpmd.xml
15-
- ./vendor/bin/phpstan.phar analyse -l 7 ./src
15+
- ./vendor/bin/phpstan.phar analyse -l max ./src
1616
- ./vendor/bin/phpcs.phar ./src --standard=PSR2
1717
- ./vendor/bin/phpcpd.phar ./src

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ Run each command in the project root directory.
2121
2222
### Execute PHPUnit tests
2323
```
24-
./vendor/bin/phpunit.phar -c ./phpunit.xml --debug --verbose
24+
./vendor/bin/phpunit.phar -c ./phpunit.xml --testdox
2525
```
2626
2727
### Execute PHPMD checks
@@ -32,5 +32,5 @@ Run each command in the project root directory.
3232
### Execute PHPSTAN checks
3333
3434
```
35-
./vendor/bin/phpstan analyse -l 4 src/
35+
./vendor/bin/phpstan.phar analyse -l max ./src/
3636
```

composer.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
}
1919
},
2020
"require-dev": {
21-
"tm/tooly-composer-script": "~1.2.6"
21+
"tm/tooly-composer-script": "^1.2"
2222
},
2323
"scripts": {
2424
"post-install-cmd": "Tooly\\ScriptHandler::installPharTools",
@@ -27,23 +27,23 @@
2727
"extra": {
2828
"tools": {
2929
"phpunit": {
30-
"url": "https://phar.phpunit.de/phpunit-7.1.2.phar",
30+
"url": "https://phar.phpunit.de/phpunit-8.1.2.phar",
3131
"force-replace": true
3232
},
3333
"phpmd": {
34-
"url": "http://static.phpmd.org/php/2.6.0/phpmd.phar",
34+
"url": "http://static.phpmd.org/php/latest/phpmd.phar",
3535
"force-replace": true
3636
},
3737
"phpcpd": {
38-
"url": "https://github.com/sebastianbergmann/phpcpd/releases/download/2.0.0/phpcpd.phar",
38+
"url": "https://phar.phpunit.de/phpcpd.phar",
3939
"force-replace": true
4040
},
4141
"phpcs": {
42-
"url": "https://github.com/squizlabs/PHP_CodeSniffer/releases/download/3.2.3/phpcs.phar",
42+
"url": "https://squizlabs.github.io/PHP_CodeSniffer/phpcs.phar",
4343
"force-replace": true
4444
},
4545
"phpstan": {
46-
"url": "https://github.com/phpstan/phpstan/releases/download/0.9.2/phpstan.phar",
46+
"url": "https://github.com/phpstan/phpstan/releases/download/0.11.5/phpstan.phar",
4747
"force-replace": true
4848
}
4949
}

phpunit.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
convertWarningsToExceptions="true"
99
processIsolation="false"
1010
stopOnFailure="false"
11-
syntaxCheck="false"
1211
bootstrap="vendor/autoload.php">
1312

1413
<testsuites>

src/Enum.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
namespace FreshP\PhpEnumeration;
44

5+
use ReflectionClass;
6+
57
abstract class Enum
68
{
79
protected $value;
@@ -16,7 +18,6 @@ public function __toString(): string
1618
return $this->value;
1719
}
1820

19-
2021
abstract protected function getDefault(): string;
2122

2223
protected function setValue(string $value): void
@@ -32,8 +33,6 @@ protected function setValue(string $value): void
3233

3334
protected function toArray(): array
3435
{
35-
$reflection = new \ReflectionClass($this);
36-
37-
return $reflection->getConstants();
36+
return (new ReflectionClass(static::class))->getConstants();
3837
}
3938
}

0 commit comments

Comments
 (0)