diff --git a/src/Attribute/PsalmTypeIgnore.php b/src/Attribute/PsalmTypeIgnore.php new file mode 100644 index 0000000..29ca76d --- /dev/null +++ b/src/Attribute/PsalmTypeIgnore.php @@ -0,0 +1,12 @@ +iterator->current(); + $current = $this->iterator->current(); + $reflection = null; if ($current instanceof SplFileInfo) { - return $this->reflectionProvider->getReflection($current->getPathname()); + $reflection = $this->reflectionProvider->getReflection($current->getPathname()); } if (is_string($current)) { - return $this->reflectionProvider->getReflection($current); + $reflection = $this->reflectionProvider->getReflection($current); } - return null; + if ($reflection !== null && $reflection->getAttributes(PsalmTypeIgnore::class) !== []) { + return null; + } + + return $reflection; } public function next(): void diff --git a/test/Locator/Asset/IgnoredForm.php b/test/Locator/Asset/IgnoredForm.php new file mode 100644 index 0000000..3726d4b --- /dev/null +++ b/test/Locator/Asset/IgnoredForm.php @@ -0,0 +1,13 @@ +