Skip to content

Commit

Permalink
add phpdoc
Browse files Browse the repository at this point in the history
  • Loading branch information
irfan-dahir committed Oct 30, 2022
1 parent 1ad4a23 commit d38d4bd
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 8 deletions.
6 changes: 6 additions & 0 deletions app/Http/QueryBuilder/Scraper/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@

class Query
{
/**
* @var string
*/
private string $name;
/**
* @var mixed
*/
private mixed $value;

/**
Expand Down
11 changes: 7 additions & 4 deletions app/Http/QueryBuilder/Scraper/QueryResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,15 @@

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;
Expand Down
6 changes: 2 additions & 4 deletions app/Http/QueryBuilder/Scraper/ScraperHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,6 @@

use App\Providers\SerializerFactory;

/**
*
*/
class ScraperHandler
{
/**
Expand All @@ -31,8 +28,9 @@ public function __construct(string $getterFuncName, string $requestResolverClass
);
}


/**
* @return string
* @return array
*/
public function getSerializedJSON(): array
{
Expand Down
6 changes: 6 additions & 0 deletions app/Http/Validation/Validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,14 @@

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;
}
Expand Down
4 changes: 4 additions & 0 deletions app/Http/Validation/ValidationInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@

interface ValidationInterface
{
/**
* @param mixed $value
* @return bool
*/
public function validate(mixed $value):bool;
}
4 changes: 4 additions & 0 deletions app/Http/Validation/ValidationTypeEnum.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

class ValidationTypeEnum extends Validation
{
/**
* @param mixed $value
* @return bool
*/
public function validate(mixed $value) : bool
{
return in_array($value, $this->criteria);
Expand Down

0 comments on commit d38d4bd

Please sign in to comment.