Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
grynchuk committed Mar 11, 2024
1 parent 5b6b25f commit 5364cde
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class CompanyController
{
/** @Query() */
#[Query]
public function getCompany(string $id): Company
{
return new Company('Company');
Expand Down
4 changes: 1 addition & 3 deletions tests/Fixtures/Integration/Models/Company.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

use TheCodingMachine\GraphQLite\Annotations\Type;

/**
* @Type()
*/
#[Type]
class Company
{
public function __construct(
Expand Down
13 changes: 4 additions & 9 deletions tests/Fixtures/Integration/Types/CompanyType.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,22 +10,17 @@
use TheCodingMachine\GraphQLite\Fixtures\Integration\Models\Company;
use TheCodingMachine\GraphQLite\Fixtures\Integration\Models\Contact;

/**
* @ExtendType(class=Company::class)
*/
#[ExtendType(class:Company::class)]
class CompanyType
{
/**
* @Field()
*/

#[Field]
public function getName(Company $company): string
{
return $company->name;
}

/**
* @Field()
*/
#[Field]
public function getContact(
Company $company,
#[Prefetch('prefetchContacts')]
Expand Down
5 changes: 3 additions & 2 deletions tests/Fixtures/Integration/Types/ContactType.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ public static function prefetchContacts(iterable $contacts, string $prefix)
}

/**
* @Field()
*
* @return Post[]|null
*/
#[Field]
public function getPosts(
Contact $contact,
#[Prefetch('prefetchPosts')]
Expand All @@ -76,7 +77,7 @@ public static function prefetchPosts(iterable $contacts): array
fn(Post $post) => $post->author?->getName() === $contact->getName()
);

if ([] === $contactPost) {
if (!$contactPost) {
continue;
}

Expand Down
12 changes: 3 additions & 9 deletions tests/Fixtures/Integration/Types/PostType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,16 @@
use TheCodingMachine\GraphQLite\Annotations\Field;
use TheCodingMachine\GraphQLite\Fixtures\Integration\Models\Post;

/**
* @ExtendType(class=Post::class)
*/
#[ExtendType(class:Post::class)]
class PostType
{
/**
* @Field()
*/
#[Field]
public function getId(Post $post): int
{
return (int) $post->id;
}

/**
* @Field()
*/
#[Field]
public function getTitle(Post $post): string
{
return $post->title;
Expand Down

0 comments on commit 5364cde

Please sign in to comment.