diff --git a/.travis.yml b/.travis.yml index 84851bb..34aa704 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,6 +9,7 @@ php: - "7.4" - "7.3" - "7.2" + - "8.0" install: - "mkdir -p build/logs" diff --git a/composer.json b/composer.json index 86228f0..c7c8b0b 100644 --- a/composer.json +++ b/composer.json @@ -10,7 +10,7 @@ "homepage": "https://dephpend.com", "bin": ["bin/dephpend", "bin/php-trace"], "require": { - "php": "^7.2", + "php": "^7.2 || ^8.0", "nikic/php-parser": "^4.0", "symfony/console": "^4 || ^5", "symfony/event-dispatcher": "^4 || ^5" diff --git a/src/Analyser/XDebugFunctionTraceAnalyser.php b/src/Analyser/XDebugFunctionTraceAnalyser.php index d00e98b..c76df68 100644 --- a/src/Analyser/XDebugFunctionTraceAnalyser.php +++ b/src/Analyser/XDebugFunctionTraceAnalyser.php @@ -30,7 +30,7 @@ public function __construct(DependencyFactory $dependencyFactory) public function analyse(\SplFileInfo $file) : DependencyMap { - $fileHandle = @fopen($file->getPathname(), 'r'); + $fileHandle = !empty($file->getPathname()) ? @fopen($file->getPathname(), 'r') : false; if (!$fileHandle) { throw new \InvalidArgumentException('Unable to open trace file for reading'); } diff --git a/tests/unit/Util/DependencyContainerTest.php b/tests/unit/Util/DependencyContainerTest.php index ae23367..b77e9c3 100644 --- a/tests/unit/Util/DependencyContainerTest.php +++ b/tests/unit/Util/DependencyContainerTest.php @@ -25,7 +25,7 @@ public function provideMethods(): array if (!$method->hasReturnType()) { continue; } - $methods[] = [$method->getName(), (string) $method->getReturnType()]; + $methods[] = [$method->getName(), $method->getReturnType()->getName()]; } return $methods; }