Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit efc2556

Browse files
committed
Hunt down all is_a calls.
1 parent a3d1c71 commit efc2556

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

core/src/plugins/core.access/src/Filter/AJXP_PermissionMask.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -179,14 +179,14 @@ private function mergeTrees($t1, $t2){
179179
continue;
180180
}
181181
$value1 = $t1[$key];
182-
if(is_a($value1, "AJXP_Permission") && is_a($value2, "AJXP_Permission")){
182+
if($value1 instanceof AJXP_Permission && $value2 instanceof AJXP_Permission){
183183
/**
184184
* @var AJXP_Permission $value2
185185
*/
186186
$result[$key] = $value2->override($value1);
187-
}else if(is_a($value1, "AJXP_Permission")){
187+
}else if($value1 instanceof AJXP_Permission){
188188
$result[$key] = $value2;
189-
}else if(is_a($value2, "AJXP_Permission")){
189+
}else if($value2 instanceof AJXP_Permission){
190190
/**
191191
* @var AJXP_Permission $value2
192192
*/
@@ -237,7 +237,7 @@ public function flattenTree($tree = null, &$pathes = null, $currentRoot=""){
237237
if($pathes == null) $pathes = array();
238238
if(!is_array($tree) || $tree == null) $tree = array();
239239
foreach($tree as $pathPart => $value){
240-
if(is_a($value, "AJXP_Permission")){
240+
if($value instanceof AJXP_Permission){
241241
$pathes[$currentRoot."/".$pathPart] = $value;
242242
}else{
243243
$this->flattenTree($value, $pathes, $currentRoot."/".$pathPart);

core/src/plugins/core.access/src/MetaStreamWrapper.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
use Normalizer;
2525
use Pydio\Access\Core\Filter\ContentFilter;
2626
use Pydio\Access\Core\Model\AJXP_Node;
27+
use Pydio\Access\Core\Model\Repository;
2728
use Pydio\Core\Exception\PydioException;
2829
use Pydio\Core\Model\ContextInterface;
2930

@@ -251,7 +252,7 @@ protected static function actualRepositoryWrapperData(AJXP_Node $node){
251252
return self::$cachedRepositoriesWrappers[$repositoryId];
252253
}
253254
$repository = RepositoryService::getRepositoryById($repositoryId);
254-
if(!is_a($repository, "Repository")){
255+
if(!$repository instanceof Repository){
255256
throw new \Exception("Cannot find repository with this id!");
256257
}
257258
if(self::detectWrapperForNode($node, false, $streams, $streamData)){

core/src/plugins/core.access/src/Model/Repository.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
use Pydio\Access\Core\Filter\ContentFilter;
2525
use Pydio\Core\Exception\PydioException;
2626
use Pydio\Core\Exception\RepositoryLoadException;
27-
use Pydio\Core\Model\Context;
2827
use Pydio\Core\Model\ContextInterface;
2928
use Pydio\Core\Model\RepositoryInterface;
3029

@@ -357,7 +356,7 @@ public function getSafeOption($oName){
357356
public function getContextOption(ContextInterface $ctx, $oName, $default = null){
358357
if(isSet($this->inferOptionsFromParent) && isSet($this->parentId)){
359358
$parentTemplateObject = RepositoryService::getRepositoryById($this->parentId);
360-
if(empty($parentTemplateObject) || !is_a($parentTemplateObject, "Repository")) {
359+
if(empty($parentTemplateObject) || !$parentTemplateObject instanceof Repository) {
361360
throw new PydioException("Option should be loaded from parent repository, but it was not found");
362361
}
363362
}

0 commit comments

Comments
 (0)