Version 5.1 - All the GraphQL #32
@ -37,7 +37,7 @@ abstract class AbstractType implements ArrayAccess, Countable {
|
|||||||
* @param array $data
|
* @param array $data
|
||||||
* @return array|null
|
* @return array|null
|
||||||
*/
|
*/
|
||||||
final public static function check($data = []): ?array
|
final public static function check(array $data = []): ?array
|
||||||
{
|
{
|
||||||
$currentClass = static::class;
|
$currentClass = static::class;
|
||||||
|
|
||||||
@ -199,7 +199,7 @@ abstract class AbstractType implements ArrayAccess, Countable {
|
|||||||
*/
|
*/
|
||||||
final public function count(): int
|
final public function count(): int
|
||||||
{
|
{
|
||||||
$keys = array_keys((array)$this->toArray());
|
$keys = array_keys($this->toArray());
|
||||||
return count($keys);
|
return count($keys);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -224,7 +224,7 @@ abstract class AbstractType implements ArrayAccess, Countable {
|
|||||||
*/
|
*/
|
||||||
final public function isEmpty(): bool
|
final public function isEmpty(): bool
|
||||||
{
|
{
|
||||||
$self = (array)$this->toArray();
|
$self = $this->toArray();
|
||||||
foreach ($self as $value)
|
foreach ($self as $value)
|
||||||
{
|
{
|
||||||
if ( ! empty($value))
|
if ( ! empty($value))
|
||||||
|
@ -36,8 +36,6 @@ class Anime extends AbstractType {
|
|||||||
|
|
||||||
public string $id = '';
|
public string $id = '';
|
||||||
|
|
||||||
public array $included = [];
|
|
||||||
|
|
||||||
public ?string $show_type;
|
public ?string $show_type;
|
||||||
|
|
||||||
public ?string $slug;
|
public ?string $slug;
|
||||||
|
@ -26,8 +26,6 @@ final class Character extends AbstractType {
|
|||||||
|
|
||||||
public string $id;
|
public string $id;
|
||||||
|
|
||||||
public array $included = [];
|
|
||||||
|
|
||||||
public ?Media $media;
|
public ?Media $media;
|
||||||
|
|
||||||
public ?string $name;
|
public ?string $name;
|
||||||
|
@ -6,6 +6,7 @@ data:
|
|||||||
notes: ''
|
notes: ''
|
||||||
private: true
|
private: true
|
||||||
progress: 12
|
progress: 12
|
||||||
|
ratingTwenty: null
|
||||||
reconsumeCount: 0
|
reconsumeCount: 0
|
||||||
reconsuming: true
|
reconsuming: true
|
||||||
status: current
|
status: current
|
||||||
|
Loading…
Reference in New Issue
Block a user