Skip to content

Commit

Permalink
Make phpstan happy - we won't support intersection types here soon
Browse files Browse the repository at this point in the history
q
  • Loading branch information
ralflang committed Oct 27, 2023
1 parent 8ebe9d4 commit 0aa249d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

use Horde_Support_Backtrace;
use ReflectionClass;
use ReflectionNamedType;

/**
* Basic Horde test case helper.
Expand Down Expand Up @@ -127,7 +128,10 @@ public function getMockDependencies(string $class, array $overrides = [])
} else {
if (is_null($type)) {
throw new Exception("dependency $name has no type defined and is not in overrides array");
} elseif (!($type instanceof ReflectionNamedType)) {
throw new Exception("dependency $name is a union or intersection type");
}
// TODO: How would we handle a union or intersection dependency?
$typeName = $type->getName();
switch ($typeName) {
case 'int':
Expand Down

0 comments on commit 0aa249d

Please sign in to comment.