Skip to content

Commit

Permalink
OXDEV-7557 Convert DataType Graphqllite docblocs to attributes
Browse files Browse the repository at this point in the history
Attributes handled better by editors, it will not show Field and Type classes are unused anymore

Signed-off-by: Anton Fedurtsya <[email protected]>
  • Loading branch information
Sieg committed Nov 16, 2023
1 parent 91ae8f1 commit 12ed1c4
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 48 deletions.
12 changes: 3 additions & 9 deletions src/Setting/DataType/BooleanSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
use TheCodingMachine\GraphQLite\Annotations\Type;
use TheCodingMachine\GraphQLite\Types\ID;

/**
* @Type()
*/
#[Type]
final class BooleanSetting
{
public function __construct(
Expand All @@ -24,17 +22,13 @@ public function __construct(
) {
}

/**
* @Field()
*/
#[Field]
public function getName(): ID
{
return $this->name;
}

/**
* @Field()
*/
#[Field]
public function getValue(): bool
{
return $this->value;
Expand Down
12 changes: 3 additions & 9 deletions src/Setting/DataType/FloatSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
use TheCodingMachine\GraphQLite\Annotations\Type;
use TheCodingMachine\GraphQLite\Types\ID;

/**
* @Type()
*/
#[Type]
final class FloatSetting
{
public function __construct(
Expand All @@ -24,17 +22,13 @@ public function __construct(
) {
}

/**
* @Field()
*/
#[Field]
public function getName(): ID
{
return $this->name;
}

/**
* @Field()
*/
#[Field]
public function getValue(): float
{
return $this->value;
Expand Down
12 changes: 3 additions & 9 deletions src/Setting/DataType/IntegerSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
use TheCodingMachine\GraphQLite\Annotations\Type;
use TheCodingMachine\GraphQLite\Types\ID;

/**
* @Type()
*/
#[Type]
final class IntegerSetting
{
public function __construct(
Expand All @@ -24,17 +22,13 @@ public function __construct(
) {
}

/**
* @Field()
*/
#[Field]
public function getName(): ID
{
return $this->name;
}

/**
* @Field()
*/
#[Field]
public function getValue(): int
{
return $this->value;
Expand Down
16 changes: 4 additions & 12 deletions src/Setting/DataType/SettingType.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@
use TheCodingMachine\GraphQLite\Annotations\Type;
use TheCodingMachine\GraphQLite\Types\ID;

/**
* @Type
*/
#[Type]
final class SettingType
{
public function __construct(
Expand All @@ -25,25 +23,19 @@ public function __construct(
) {
}

/**
* @Field
*/
#[Field]
public function getName(): ID
{
return $this->name;
}

/**
* @Field
*/
#[Field]
public function getType(): string
{
return $this->type;
}

/**
* @Field
*/
#[Field]
public function isSupported(): bool
{
return FieldType::validateFieldType($this->getType());
Expand Down
12 changes: 3 additions & 9 deletions src/Setting/DataType/StringSetting.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@
use TheCodingMachine\GraphQLite\Annotations\Type;
use TheCodingMachine\GraphQLite\Types\ID;

/**
* @Type()
*/
#[Type]
final class StringSetting
{
public function __construct(
Expand All @@ -24,17 +22,13 @@ public function __construct(
) {
}

/**
* @Field()
*/
#[Field]
public function getName(): ID
{
return $this->name;
}

/**
* @Field()
*/
#[Field]
public function getValue(): string
{
return $this->value;
Expand Down

0 comments on commit 12ed1c4

Please sign in to comment.