-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1131 from oat-sa/feat/HKD-6/integration
chore: silence an error and log it
- Loading branch information
Showing
3 changed files
with
41 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -757,24 +757,28 @@ public function equals(core_kernel_classes_Resource $resource): bool | |
} | ||
|
||
/** | ||
* Whenever or not the current resource is | ||
* an instance of the specified class | ||
* Whenever or not the current resource is an instance of the specified class | ||
* | ||
* @access public | ||
* @author Joel Bout, <[email protected]> | ||
* @param Class class | ||
* @return boolean | ||
*/ | ||
public function isInstanceOf(core_kernel_classes_Class $class): bool | ||
{ | ||
$returnValue = (bool) false; | ||
foreach ($this->getTypes() as $type) { | ||
if ($class->equals($type) || $type->isSubClassOf($class)) { | ||
$returnValue = true; | ||
break; | ||
} | ||
} | ||
return (bool) $returnValue; | ||
return in_array($class->getUri(), $this->getParentClassesIds(), true); | ||
} | ||
|
||
public function getRootId(): string | ||
{ | ||
$parentClassesIds = $this->getParentClassesIds(); | ||
|
||
return array_pop($parentClassesIds); | ||
} | ||
|
||
/** | ||
* Return the parent class URI of a resource | ||
*/ | ||
public function getParentClassId(): ?string | ||
{ | ||
return current($this->getParentClassesIds()) ?: null; | ||
} | ||
|
||
public function getParentClassesIds(): array | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters