Skip to content

Commit

Permalink
Merge pull request #1 from PBXg33k/scrutinizer-patch-1
Browse files Browse the repository at this point in the history
Scrutinizer Auto-Fixes
  • Loading branch information
PBXg33k committed May 24, 2016
2 parents 6dc83bb + e915a1b commit 98c4a02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/HydratableTrait.php
Expand Up @@ -87,7 +87,7 @@ public function hydrateClass($class)

if (in_array($propertyClassName, self::$nonObjectTypes)) {
$this->setPropertyValue($propertyName, $itemValue, true);
} elseif(interface_exists($propertyClassName)) {
} elseif (interface_exists($propertyClassName)) {
// We cannot instantiate an interface, so we skip it
continue;
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/ReflectionTrait.php
Expand Up @@ -13,11 +13,11 @@ trait ReflectionTrait
{
public function getClassFromClassProperty($class, $property)
{
if(!class_exists($class)) {
throw new \Exception($class. ' not found or does not exist');
if (!class_exists($class)) {
throw new \Exception($class . ' not found or does not exist');
}

if(!property_exists($class, $property)) {
if (!property_exists($class, $property)) {
throw new \Exception($class . ' has no property with the name ' . $property);
}
}
Expand All @@ -36,7 +36,7 @@ public static function getClassFromDocComment($comment, $includeNamespaces = tru
if (preg_match('~\@var[\s]+([A-Za-z0-9\\\\]+)~', $comment, $matches)) {
if ($includeNamespaces) {
if ($reflectionClass instanceof \ReflectionClass && !in_array($matches[1], HydratableTrait::$nonObjectTypes)) {
if($reflectionClass->getNamespaceName()) {
if ($reflectionClass->getNamespaceName()) {
return sprintf('\%s\%s', $reflectionClass->getNamespaceName(), $matches[1]);
} else {
return sprintf('\%s', $matches[1]);
Expand Down

0 comments on commit 98c4a02

Please sign in to comment.