| Total Complexity | 6 | 
| Total Lines | 80 | 
| Duplicated Lines | 0 % | 
| Coverage | 0% | 
| Changes | 1 | ||
| Bugs | 0 | Features | 0 | 
| 1 | <?php | ||
| 10 | final class Restful extends AbstractApi implements IApi | ||
| 11 | { | ||
| 12 | |||
| 13 | /** | ||
| 14 | * instanciate | ||
| 15 | * | ||
| 16 | * @param Container $container | ||
| 17 | */ | ||
| 18 | public function __construct(Container $container) | ||
| 19 |     { | ||
| 20 | parent::__construct($container); | ||
| 21 | } | ||
| 22 | |||
| 23 | /** | ||
| 24 | * index | ||
| 25 | * | ||
| 26 | * @Request.method GET | ||
| 27 | * @return Restful | ||
| 28 | */ | ||
| 29 | final public function index(): Restful | ||
| 32 | } | ||
| 33 | |||
| 34 | /** | ||
| 35 | * store | ||
| 36 | * | ||
| 37 | * @Request.method POST | ||
| 38 | * @return Restful | ||
| 39 | */ | ||
| 40 | final public function store(): Restful | ||
| 41 |     { | ||
| 42 | return $this->setResponse(__CLASS__, __FUNCTION__); | ||
| 43 | } | ||
| 44 | |||
| 45 | /** | ||
| 46 | * update | ||
| 47 | * | ||
| 48 | * @Request.method PUT/PATCH | ||
| 49 | * @return Restful | ||
| 50 | */ | ||
| 51 | final public function update(): Restful | ||
| 52 |     { | ||
| 53 | return $this->setResponse(__CLASS__, __FUNCTION__); | ||
| 54 | } | ||
| 55 | |||
| 56 | /** | ||
| 57 | * delete | ||
| 58 | * | ||
| 59 | * @Request.method DELETE | ||
| 60 | * @return Restful | ||
| 61 | */ | ||
| 62 | final public function delete(): Restful | ||
| 63 |     { | ||
| 64 | return $this->setResponse(__CLASS__, __FUNCTION__); | ||
| 65 | } | ||
| 66 | |||
| 67 | /** | ||
| 68 | * set response with for a classname and action | ||
| 69 | * | ||
| 70 | * @param string $classname | ||
| 71 | * @param string $action | ||
| 72 | * @return Restful | ||
| 73 | */ | ||
| 74 | protected function setResponse(string $classname, string $action): Restful | ||
| 90 | } | ||
| 91 | } | ||
| 92 |