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
if (! $this->name || (! $this->outputType && ! $this->phpType)) {
53
-
thrownewBadMethodCallException('The #[MagicField] attribute must be passed a name and an output type or a php type. For instance: "#[MagicField(name: \'phone\', outputType: \'String!\')]" or "#[MagicField(name: \'phone\', phpType: \'string\')]"');
56
+
if (! $this->outputType && ! $this->phpType) {
57
+
thrownewBadMethodCallException(
58
+
"The #[MagicField] attribute must be passed an output type or a php type.
59
+
For instance: #[MagicField(name: 'phone', outputType: 'String!')]
60
+
or #[MagicField(name: 'phone', phpType: 'string')]",
61
+
);
54
62
}
55
63
if (isset($this->outputType) && $this->phpType) {
56
-
thrownewBadMethodCallException('In a #[MagicField] attribute, you cannot use the outputType and the phpType at the same time. For instance: "#[MagicField(name: \'phone\', outputType: \'String!\')]" or "#[MagicField(name: \'phone\', phpType: \'string\')]"');
64
+
thrownewBadMethodCallException(
65
+
"In a #[MagicField] attribute, you cannot use the outputType and the phpType at the
66
+
same time. For instance: #[MagicField(name: 'phone', outputType: 'String!')]
67
+
or #[MagicField(name: 'phone', phpType: 'string')]",
68
+
);
57
69
}
58
70
$middlewareAnnotations = [];
59
71
$parameterAnnotations = [];
@@ -67,13 +79,18 @@ public function __construct(array $attributes = [], string|null $name = null, st
thrownewBadMethodCallException('The #[MagicField] attribute\'s "annotations" attribute must be passed an array of annotations implementing either MiddlewareAnnotationInterface or ParameterAnnotationInterface."');
82
+
thrownewBadMethodCallException(
83
+
"The #[MagicField] attribute's 'annotation' attribute must be passed an array
84
+
of annotations implementing either MiddlewareAnnotationInterface or
thrownewBadMethodCallException('The #[Security] attribute must be passed an expression. For instance: "#[Security("is_granted(\'CAN_EDIT_STUFF\')")]"');
0 commit comments