Skip to content

Commit ab386cb

Browse files
Merge pull request #100 from oliverklee/cleanup/simplify-returns
[CLEANUP] Simplify some method returns
2 parents 434a8ab + e2be807 commit ab386cb

File tree

2 files changed

+2
-10
lines changed

2 files changed

+2
-10
lines changed

src/Reflection/RepositoryCountByMethodsClassReflectionExtension.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,7 @@ public function hasMethod(ClassReflection $classReflection, string $methodName):
4545
$modelName = $this->translateRepositoryNameToModelName($className);
4646

4747
$modelReflection = $this->reflectionProvider->getClass($modelName);
48-
if (!$modelReflection->hasProperty($propertyName)) {
49-
return false;
50-
}
51-
52-
return true;
48+
return $modelReflection->hasProperty($propertyName);
5349
}
5450

5551
public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection

src/Reflection/RepositoryFindMethodsClassReflectionExtension.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,11 +49,7 @@ public function hasMethod(ClassReflection $classReflection, string $methodName):
4949
$modelName = $this->translateRepositoryNameToModelName($className);
5050

5151
$modelReflection = $this->reflectionProvider->getClass($modelName);
52-
if (!$modelReflection->hasProperty($propertyName)) {
53-
return false;
54-
}
55-
56-
return true;
52+
return $modelReflection->hasProperty($propertyName);
5753
}
5854

5955
public function getMethod(ClassReflection $classReflection, string $methodName): MethodReflection

0 commit comments

Comments
 (0)