mirror of
https://github.com/sitelease/sugar-cube-client.git
synced 2025-11-01 12:32:29 +01:00
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:
56
src/Core/Interfaces/RequestChainableInterface.php
Normal file
56
src/Core/Interfaces/RequestChainableInterface.php
Normal 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;
|
||||
}
|
||||
Reference in New Issue
Block a user