mirror of
https://github.com/anikeen-com/id.git
synced 2026-03-15 22:56:13 +00:00
first commit
This commit is contained in:
11
src/Id/ApiOperations/Delete.php
Normal file
11
src/Id/ApiOperations/Delete.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Anikeen\Id\ApiOperations;
|
||||
|
||||
use Anikeen\Id\Helpers\Paginator;
|
||||
use Anikeen\Id\Result;
|
||||
|
||||
trait Delete
|
||||
{
|
||||
abstract public function delete(string $path = '', array $parameters = [], Paginator $paginator = null): Result;
|
||||
}
|
||||
11
src/Id/ApiOperations/Get.php
Normal file
11
src/Id/ApiOperations/Get.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Anikeen\Id\ApiOperations;
|
||||
|
||||
use Anikeen\Id\Helpers\Paginator;
|
||||
use Anikeen\Id\Result;
|
||||
|
||||
trait Get
|
||||
{
|
||||
abstract public function get(string $path = '', array $parameters = [], Paginator $paginator = null): Result;
|
||||
}
|
||||
11
src/Id/ApiOperations/Post.php
Normal file
11
src/Id/ApiOperations/Post.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Anikeen\Id\ApiOperations;
|
||||
|
||||
use Anikeen\Id\Helpers\Paginator;
|
||||
use Anikeen\Id\Result;
|
||||
|
||||
trait Post
|
||||
{
|
||||
abstract public function post(string $path = '', array $parameters = [], Paginator $paginator = null): Result;
|
||||
}
|
||||
11
src/Id/ApiOperations/Put.php
Normal file
11
src/Id/ApiOperations/Put.php
Normal file
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace Anikeen\Id\ApiOperations;
|
||||
|
||||
use Anikeen\Id\Helpers\Paginator;
|
||||
use Anikeen\Id\Result;
|
||||
|
||||
trait Put
|
||||
{
|
||||
abstract public function put(string $path = '', array $parameters = [], Paginator $paginator = null): Result;
|
||||
}
|
||||
19
src/Id/ApiOperations/Validation.php
Normal file
19
src/Id/ApiOperations/Validation.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace Anikeen\Id\ApiOperations;
|
||||
|
||||
use Anikeen\Id\Exceptions\RequestRequiresMissingParametersException;
|
||||
use Illuminate\Support\Arr;
|
||||
|
||||
trait Validation
|
||||
{
|
||||
/**
|
||||
* @throws RequestRequiresMissingParametersException
|
||||
*/
|
||||
public function validateRequired(array $parameters, array $required)
|
||||
{
|
||||
if (!Arr::has($parameters, $required)) {
|
||||
throw RequestRequiresMissingParametersException::fromValidateRequired($parameters, $required);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user