Large changes to inter-object interfaces + More

+ Created a new core interface (called RequestChainable) and applied it to most of the objects using a trait
+ Altered the `__construct()` and `fromJson()` methods of all model classes by replacing the second parameter ($apiRequester) with a $caller parameter
+ Altered the  `__construct()` method of all requester classes to make them accept $client by reference instead of by value
+ Altered the  `__construct()` method of all requester classes by replacing the second parameter ($authToken) with a $caller parameter
+ Changed the name of several methods and properties
+ Altered several docblocks
This commit is contained in:
Benjamin Blake
2020-02-26 20:23:06 -07:00
parent 57bf45938f
commit 70f978847e
21 changed files with 568 additions and 309 deletions

View File

@ -0,0 +1,56 @@
<?php
namespace Gitea\Core\Interfaces;
/**
* Interface that allows the tracking of request heirarchies
*
* @author Benjamin Blake (sitelease.ca)
*/
interface RequestChainableInterface
{
/**
* Get the object that called this method
*
* @author Benjamin Blake (sitelease.ca)
*
* @return object|null
*/
public function getCaller(): ?object;
/**
* Set the object that called this method
*
* @author Benjamin Blake (sitelease.ca)
*
* @return self
*/
public function setCaller($object): self;
/**
* Return the request chain heirarchy
* as an array of objects
*
* This is useful if you need to know
* what objects where called in order to
* get the current object
*
* @author Benjamin Blake (sitelease.ca)
*
* @return array
*/
public function getRequestChain(): array;
/**
* Return the request chain heirarchy
* as a string of class names
*
* This is useful if you need to quickly print out
* a breadcrumb like heirarchy of callers
*
* @author Benjamin Blake (sitelease.ca)
* @return array
*/
public function debugRequestChain(): string;
}