Skip to content

Commit b84db01

Browse files
committed
Get rid of Fluent inheritance on Field
1 parent 9c3fa79 commit b84db01

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed

src/Support/Field.php

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
use Closure;
88
use Validator;
99
use Illuminate\Support\Arr;
10-
use Illuminate\Support\Fluent;
1110
use GraphQL\Type\Definition\NonNull;
1211
use GraphQL\Type\Definition\ListOfType;
1312
use GraphQL\Type\Definition\WrappingType;
@@ -16,11 +15,16 @@
1615
use Rebing\GraphQL\Error\AuthorizationError;
1716
use GraphQL\Type\Definition\Type as GraphqlType;
1817

19-
abstract class Field extends Fluent
18+
abstract class Field
2019
{
20+
protected $attributes = [];
21+
2122
/**
2223
* Override this in your queries or mutations
2324
* to provide custom authorization.
25+
*
26+
* @param array $args
27+
* @return bool
2428
*/
2529
public function authorize(array $args): bool
2630
{
@@ -204,7 +208,7 @@ protected function getResolver(): ?Closure
204208
*
205209
* @return array
206210
*/
207-
public function getAttributes()
211+
public function getAttributes(): array
208212
{
209213
$attributes = $this->attributes();
210214

@@ -227,7 +231,7 @@ public function getAttributes()
227231
*
228232
* @return array
229233
*/
230-
public function toArray()
234+
public function toArray(): array
231235
{
232236
return $this->getAttributes();
233237
}
@@ -259,4 +263,9 @@ public function __isset($key)
259263

260264
return isset($attributes[$key]);
261265
}
266+
267+
public function __set(string $key, $value): void
268+
{
269+
$this->attributes[$key] = $value;
270+
}
262271
}

0 commit comments

Comments
 (0)