mirror of
https://github.com/sitelease/sugar-cube-client.git
synced 2025-10-31 20:12:29 +01:00
Updated RequestChainable Interface and Trait
+ Added a new searchRequestChain() method that will climb up the request chain searching for an object of a certain class + Added some test code for the new method in the TestRun.php file
This commit is contained in:
@ -5,6 +5,7 @@ namespace Gitea;
|
||||
require 'vendor/autoload.php';
|
||||
|
||||
use Gitea\Client;
|
||||
use Gitea\Model\Repository;
|
||||
|
||||
print("Starting Script... \n");
|
||||
print("Creating Guzzle client \n");
|
||||
@ -65,6 +66,13 @@ if ($repository) {
|
||||
if ($debugChain) {
|
||||
print("Chain ".$debugChain."\n");
|
||||
}
|
||||
$foundObj = $branch->searchRequestChain(Repository::class);
|
||||
if ($foundObj) {
|
||||
print("Repository class found \n");
|
||||
print("Type: ".get_class($foundObj)." \n");
|
||||
} else{
|
||||
print("Repository class NOT found \n");
|
||||
}
|
||||
print("\n\n");
|
||||
}
|
||||
print("Total Branches: ".count($branches)."\n");
|
||||
|
||||
Reference in New Issue
Block a user