Skip to content

Commit

Permalink
Fixed #1
Browse files Browse the repository at this point in the history
Now aired() method return all data that contains in raw JSON
  • Loading branch information
Travis committed Jul 18, 2020
1 parent 64b0658 commit 2761d32
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 7 deletions.
6 changes: 3 additions & 3 deletions metadata/JikanPHP.Model.Common.DateProp.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
JikanPHP\Model\Common\DateProp:
properties:
day:
type: ''
type: integer
month:
type: ''
type: integer
year:
type: ''
type: integer
8 changes: 7 additions & 1 deletion metadata/JikanPHP.Model.Common.DateRange.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
JikanPHP\Model\Common\DateRange:
properties:
date:
string:
type: string
from:
type: string
to:
type: string
prop:
type: array<JikanPHP\Model\Common\DateProp>
53 changes: 50 additions & 3 deletions model/Common/DateRange.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,60 @@ class DateRange
/**
* @var string
*/
private $date;
private $string;

/**
* @var string
*/
private $from;

/**
* @var string
*/
private $to;

/**
* @var DateProp[]
*/
private $prop;

/**
* @return string
*/
public function getDate(): string
{
return $this->date;
return $this->string;
}

/**
* @return string
*/
public function getFrom(): string
{
return $this->from;
}

/**
* @return string
*/
public function getUntil(): string
{
return $this->to;
}

/**
* @return DateProp
*/
public function getFromProp(): DateProp
{
return reset($this->prop);
}

/**
* @return DateProp
*/
public function getUntilProp(): DateProp
{
return end($this->prop);
}
}
}

0 comments on commit 2761d32

Please sign in to comment.