Version 5.1 - All the GraphQL #32

Closed
timw4mail wants to merge 1160 commits from develop into master
6 changed files with 18 additions and 7 deletions
Showing only changes of commit 698025146f - Show all commits

View File

@ -29,7 +29,7 @@ if ( ! function_exists('glob_recursive'))
}
}
function get_text_to_replace($tokens)
function get_text_to_replace(array $tokens): string
{
$output = '';
@ -57,7 +57,7 @@ function get_text_to_replace($tokens)
return $output;
}
function get_tokens($source)
function get_tokens($source): array
{
return token_get_all($source);
}

View File

@ -179,7 +179,8 @@ final class Model
*
* @param string $malId - The unique identifier of that list item
* @param string $type - Them media type (anime/manga)
* @return mixed
*
* @return array
*/
public function getListItem(string $malId, string $type): array
{

View File

@ -26,7 +26,10 @@ use Aviat\Ion\Transformer\AbstractTransformer;
*/
final class CharacterTransformer extends AbstractTransformer {
public function transform($characterData): Character
/**
* @param array $characterData
*/
public function transform(array $characterData): Character
{
$data = JsonAPI::organizeData($characterData);
$attributes = $data[0]['attributes'];

View File

@ -25,7 +25,7 @@ use Aviat\Ion\Transformer\AbstractTransformer;
*/
final class PersonTransformer extends AbstractTransformer {
public function transform($personData): Person
public function transform(array $personData): Person
{
$data = JsonAPI::organizeData($personData);
$included = JsonAPI::organizeIncludes($personData['included']);

View File

@ -26,7 +26,7 @@ use Aviat\Ion\Transformer\AbstractTransformer;
* Transform user profile data for display
*/
final class UserTransformer extends AbstractTransformer {
public function transform($profileData): User
public function transform(array $profileData): User
{
$orgData = JsonAPI::organizeData($profileData)[0];
$attributes = $orgData['attributes'];
@ -132,7 +132,7 @@ final class UserTransformer extends AbstractTransformer {
return $output;
}
private function organizeStats($stats, $data = []): array
private function organizeStats(array $stats, $data = []): array
{
$animeStats = [];
$mangaStats = [];

View File

@ -167,6 +167,8 @@ final class AnimeCollection extends Collection {
* Verify that an item was added
*
* @param $data
* @param array|null|object $data
*
* @return bool
*/
public function wasAdded($data): bool
@ -205,6 +207,8 @@ final class AnimeCollection extends Collection {
* Verify that the collection item was updated
*
* @param $data
* @param array|null|object $data
*
* @return bool
*/
public function wasUpdated($data): bool
@ -243,6 +247,9 @@ final class AnimeCollection extends Collection {
->delete('anime_set');
}
/**
* @param array|null|object $data
*/
public function wasDeleted($data): bool
{
$animeRow = $this->get($data['hummingbird_id']);