Skip to content

Commit

Permalink
fix windows not firing after class registered event
Browse files Browse the repository at this point in the history
  • Loading branch information
romalytvynenko committed Jul 25, 2024
1 parent 9e947b3 commit e87cfd1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Infer/Analyzer/ClassAnalyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/Infer/Services/ReferenceTypeResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit e87cfd1

Please sign in to comment.