Skip to content

Commit

Permalink
pulling in phpstan-strict-rules, tweaking if conditions to pass stric…
Browse files Browse the repository at this point in the history
…t rules
  • Loading branch information
SignpostMarv committed Feb 13, 2018
1 parent 2e45b91 commit ce02517
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
"php-mock/php-mock-phpunit": "^2.0",
"phpstan/phpstan-phpunit": "0.9.2",
"phpstan/phpstan-shim": "0.9.1",
"phpstan/phpstan-strict-rules": "^0.9.0",
"phpunit/phpunit": "^6.4",
"squizlabs/php_codesniffer": "^3.0"
},
Expand Down
2 changes: 2 additions & 0 deletions phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
includes:
- ./vendor/phpstan/phpstan-strict-rules/rules.neon
parameters:
ignoreErrors:
- '#Function uuid_create not found#'
Expand Down
2 changes: 1 addition & 1 deletion src/Provider/Node/FallbackNodeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public function __construct(array $providers)
public function getNode()
{
foreach ($this->nodeProviders as $provider) {
if ($node = $provider->getNode()) {
if ((bool) ($node = $provider->getNode())) {
return $node;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Uuid.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ public function toString()
*/
public static function getFactory()
{
if (!self::$factory) {
if (!(self::$factory instanceof UuidFactoryInterface)) {
self::$factory = new UuidFactory();
}

Expand Down

0 comments on commit ce02517

Please sign in to comment.