Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Rules/ClassNameNodePair.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,16 @@
final class ClassNameNodePair
{

/**
* @param non-empty-string $className
*/
public function __construct(private string $className, private Node $node)
{
}

/**
* @return non-empty-string
*/
public function getClassName(): string
{
return $this->className;
Expand Down
4 changes: 2 additions & 2 deletions src/Rules/FunctionDefinitionCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ private function getParameterNode(
}

/**
* @return string[]
* @return non-empty-string[]
*/
private function getParameterReferencedClasses(ParameterReflection $parameter): array
{
Expand Down Expand Up @@ -732,7 +732,7 @@ private function getParameterReferencedClasses(ParameterReflection $parameter):
}

/**
* @return string[]
* @return non-empty-string[]
*/
private function getReturnTypeReferencedClasses(ParametersAcceptor $parametersAcceptor): array
{
Expand Down
4 changes: 4 additions & 0 deletions src/Type/ObjectType.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,10 @@ public function getUnresolvedStaticPropertyPrototype(string $propertyName, Class

public function getReferencedClasses(): array
{
if ($this->className === '') {
return [];
}

return [$this->className];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Type/Type.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ interface Type
{

/**
* @return list<string>
* @return list<non-empty-string>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

analog Type->getObjectClassNames()

*/
public function getReferencedClasses(): array;

Expand Down
Loading