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
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?php

namespace Rector\PHPUnit\Tests\CodeQuality\Rector\Class_\AddParamTypeFromDependsRector\Fixture;

use PHPUnit\Framework\TestCase;

final class SkipNoDepends extends TestCase
{
public function test(): \stdClass
{
return new \stdClass();
}

public function testNoDepends($value)
{
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ private function resolveReturnTypeOfDependsMethod(ClassMethod $classMethod, Clas
{
$dependsMethodName = $this->resolveDependsAnnotationOrAttributeMethod($classMethod);

if ($dependsMethodName === null || $dependsMethodName === '') {
return null;
}

$dependsClassMethod = $class->getMethod($dependsMethodName);

if (! $dependsClassMethod instanceof ClassMethod) {
Expand Down