mirror of
https://github.com/jikan-me/jikan-rest.git
synced 2025-02-20 11:23:35 +08:00
add phpdoc
This commit is contained in:
parent
1ad4a23831
commit
d38d4bd887
@ -7,7 +7,13 @@ use Symfony\Component\HttpFoundation\Exception\BadRequestException;
|
||||
|
||||
class Query
|
||||
{
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
private string $name;
|
||||
/**
|
||||
* @var mixed
|
||||
*/
|
||||
private mixed $value;
|
||||
|
||||
/**
|
||||
|
@ -4,12 +4,15 @@ namespace App\Http\QueryBuilder\Scraper;
|
||||
|
||||
class QueryResolver
|
||||
{
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private array $queries = [];
|
||||
|
||||
public function __construct() {
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Query $query
|
||||
* @return $this
|
||||
*/
|
||||
public function setNewQuery(Query $query): self
|
||||
{
|
||||
$this->queries[] = $query;
|
||||
|
@ -4,9 +4,6 @@ namespace App\Http\QueryBuilder\Scraper;
|
||||
|
||||
use App\Providers\SerializerFactory;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ScraperHandler
|
||||
{
|
||||
/**
|
||||
@ -31,8 +28,9 @@ class ScraperHandler
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return string
|
||||
* @return array
|
||||
*/
|
||||
public function getSerializedJSON(): array
|
||||
{
|
||||
|
@ -4,8 +4,14 @@ namespace App\Http\Validation;
|
||||
|
||||
abstract class Validation implements ValidationInterface
|
||||
{
|
||||
/**
|
||||
* @var array|int|float|string
|
||||
*/
|
||||
public array|int|float|string $criteria;
|
||||
|
||||
/**
|
||||
* @param array|int|float|string $criteria
|
||||
*/
|
||||
public function __construct(array|int|float|string $criteria) {
|
||||
$this->criteria = $criteria;
|
||||
}
|
||||
|
@ -4,5 +4,9 @@ namespace App\Http\Validation;
|
||||
|
||||
interface ValidationInterface
|
||||
{
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
public function validate(mixed $value):bool;
|
||||
}
|
||||
|
@ -3,6 +3,10 @@ namespace App\Http\Validation;
|
||||
|
||||
class ValidationTypeEnum extends Validation
|
||||
{
|
||||
/**
|
||||
* @param mixed $value
|
||||
* @return bool
|
||||
*/
|
||||
public function validate(mixed $value) : bool
|
||||
{
|
||||
return in_array($value, $this->criteria);
|
||||
|
Loading…
x
Reference in New Issue
Block a user