From e87cfd14729b96f55886fab3edd7dbc6c6a2c441 Mon Sep 17 00:00:00 2001 From: Roman Lytvynenko Date: Thu, 25 Jul 2024 14:45:32 +0300 Subject: [PATCH] fix windows not firing after class registered event --- src/Infer/Analyzer/ClassAnalyzer.php | 2 +- src/Infer/Services/ReferenceTypeResolver.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Infer/Analyzer/ClassAnalyzer.php b/src/Infer/Analyzer/ClassAnalyzer.php index d5b1ebe9..7fe94f23 100644 --- a/src/Infer/Analyzer/ClassAnalyzer.php +++ b/src/Infer/Analyzer/ClassAnalyzer.php @@ -29,7 +29,7 @@ private function shouldAnalyzeParentClass(ReflectionClass $parentClassReflection * Classes from `vendor` aren't analyzed at the moment. Instead, it is up to developers to provide * definitions for them using the dictionaries. */ - return ! str_contains($parentClassReflection->getFileName(), '/vendor/'); + return ! str_contains($parentClassReflection->getFileName(), DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR); } /** diff --git a/src/Infer/Services/ReferenceTypeResolver.php b/src/Infer/Services/ReferenceTypeResolver.php index 99150c02..b050154a 100644 --- a/src/Infer/Services/ReferenceTypeResolver.php +++ b/src/Infer/Services/ReferenceTypeResolver.php @@ -346,7 +346,7 @@ private function resolveUnknownClassResolver(string $className): ?ClassDefinitio try { $reflection = new \ReflectionClass($className); - if (Str::contains($reflection->getFileName(), '/vendor/')) { + if (Str::contains($reflection->getFileName(), DIRECTORY_SEPARATOR.'vendor'.DIRECTORY_SEPARATOR)) { Context::getInstance()->extensionsBroker->afterClassDefinitionCreated(new ClassDefinitionCreatedEvent($className, new ClassDefinition($className))); return $this->index->getClassDefinition($className);