Skip to content

Commit c9b3ed6

Browse files
committed
outsourced GraphQLEnumValue into own file
1 parent e8f743e commit c9b3ed6

File tree

1 file changed

+52
-0
lines changed

1 file changed

+52
-0
lines changed

src/Types/GraphQLEnumValue.php

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?php
2+
3+
namespace GraphQL\Types;
4+
5+
/**
6+
* Class GraphQLEnumValue
7+
* @package GraphQL\Types
8+
*/
9+
class GraphQLEnumValue
10+
{
11+
12+
private $id;
13+
private $description;
14+
private $deprecationReason;
15+
16+
/**
17+
* GraphQLEnumValue constructor.
18+
* @param string $id
19+
* @param string $description
20+
* @param string|null $deprecationReason
21+
*/
22+
public function __construct(string $id, string $description = "", ?string $deprecationReason = null)
23+
{
24+
$this->id = $id;
25+
$this->description = $description;
26+
$this->deprecationReason = $deprecationReason ?? null;
27+
}
28+
29+
/**
30+
* @return string
31+
*/
32+
public function getName(): string
33+
{
34+
return $this->id;
35+
}
36+
37+
/**
38+
* @return string
39+
*/
40+
public function getDescription(): string
41+
{
42+
return $this->description;
43+
}
44+
45+
/**
46+
* @return ?string
47+
*/
48+
public function getDeprecationReason(): ?string
49+
{
50+
return $this->deprecationReason;
51+
}
52+
}

0 commit comments

Comments
 (0)