You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -64,9 +64,17 @@ use MLL\GraphQLScalars\Regex;
64
64
// The name is implicitly set through the class name here
65
65
class HexValue extends Regex
66
66
{
67
-
public $description = 'A hexadecimal color is specified with: #RRGGBB, where RR (red), GG (green) and BB (blue) are hexadecimal integers between 00 and FF specifying the intensity of the color.';
68
-
69
-
protected function regex() : string
67
+
/**
68
+
* The description that is used for schema introspection.
69
+
*
70
+
* @var string
71
+
*/
72
+
public $description = <<<'DESCRIPTION'
73
+
A hexadecimal color is specified with: #RRGGBB, where RR (red), GG (green) and BB (blue)
74
+
are hexadecimal integers between 00 and FF specifying the intensity of the color.
75
+
DESCRIPTION;
76
+
77
+
public static function regex() : string
70
78
{
71
79
return '/^#?([a-f0-9]{6}|[a-f0-9]{3})$/';
72
80
}
@@ -75,7 +83,7 @@ class HexValue extends Regex
75
83
76
84
### [StringScalar](StringScalar.php)
77
85
78
-
The `StringScalar`encapsulate all the boilerplate associated with creating a string-based Scalar type.
86
+
The `StringScalar`encapsulates all the boilerplate associated with creating a string-based Scalar type.
79
87
It does the proper string checking for you and let's you focus on the minimal logic that is specific to your use case.
80
88
81
89
All you have to specify is a function that checks if the given string is valid. Use the factory method
0 commit comments