@@ -29,7 +29,7 @@ |
||
| 29 | 29 | { |
| 30 | 30 | // add extra classes |
| 31 | 31 | $previous->walk( |
| 32 | - function ($e) { |
|
| 32 | + function($e) { |
|
| 33 | 33 | if ($e instanceof HTMLNode) { |
| 34 | 34 | if ($e->getTag() === 'input') { |
| 35 | 35 | $e->setTag('v-color-picker'); |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | { |
| 28 | 28 | // add extra classes |
| 29 | 29 | $previous->walk( |
| 30 | - function ($e) { |
|
| 30 | + function($e) { |
|
| 31 | 31 | if ($e instanceof HTMLNode) { |
| 32 | 32 | if ($e->getTag() === 'input') { |
| 33 | 33 | $e->setTag('v-date-picker'); |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | /** @var HTMLNode $base */ |
| 24 | 24 | $base = $this->_editable($value, $field, $previous); |
| 25 | 25 | |
| 26 | - $base->filter(function ($e) { |
|
| 26 | + $base->filter(function($e) { |
|
| 27 | 27 | if ($e instanceof HTMLNode) { |
| 28 | 28 | if ($e->getTag() === 'label') { |
| 29 | 29 | return false; |
@@ -26,22 +26,22 @@ |
||
| 26 | 26 | |
| 27 | 27 | foreach ($validators as $validator => $data) { |
| 28 | 28 | switch ($validator) { |
| 29 | - case MinLength::class: |
|
| 30 | - $element->setAttribute('minlength', $field->getValidatorOption($validator, 'value', '')); |
|
| 31 | - break; |
|
| 32 | - case MaxLength::class: |
|
| 33 | - $element->setAttribute('maxlength', $field->getValidatorOption($validator, 'value', '')); |
|
| 34 | - $element->setAttribute('mgmvlength', 'xxxxxxxxxxx'); |
|
| 35 | - break; |
|
| 36 | - case Regex::class: |
|
| 37 | - $pattern = $field->getValidatorOption($validator, 'value', ''); |
|
| 38 | - if ($pattern[0] === '/' && $pattern[-1] === '/') { |
|
| 39 | - $pattern = mb_substr($pattern, 1, mb_strlen($pattern) - 2); |
|
| 40 | - } |
|
| 41 | - $element->setAttribute('pattern', $pattern); |
|
| 42 | - break; |
|
| 43 | - default: |
|
| 44 | - break; |
|
| 29 | + case MinLength::class: |
|
| 30 | + $element->setAttribute('minlength', $field->getValidatorOption($validator, 'value', '')); |
|
| 31 | + break; |
|
| 32 | + case MaxLength::class: |
|
| 33 | + $element->setAttribute('maxlength', $field->getValidatorOption($validator, 'value', '')); |
|
| 34 | + $element->setAttribute('mgmvlength', 'xxxxxxxxxxx'); |
|
| 35 | + break; |
|
| 36 | + case Regex::class: |
|
| 37 | + $pattern = $field->getValidatorOption($validator, 'value', ''); |
|
| 38 | + if ($pattern[0] === '/' && $pattern[-1] === '/') { |
|
| 39 | + $pattern = mb_substr($pattern, 1, mb_strlen($pattern) - 2); |
|
| 40 | + } |
|
| 41 | + $element->setAttribute('pattern', $pattern); |
|
| 42 | + break; |
|
| 43 | + default: |
|
| 44 | + break; |
|
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | public static function getNames(): array |
| 159 | 159 | { |
| 160 | 160 | return static::map( |
| 161 | - function (\ReflectionClass $reflection) { |
|
| 161 | + function(\ReflectionClass $reflection) { |
|
| 162 | 162 | return static::getNamePair($reflection); |
| 163 | 163 | } |
| 164 | 164 | ); |
@@ -213,7 +213,7 @@ discard block |
||
| 213 | 213 | foreach (static::getBaseNamespaces() as $ns) { |
| 214 | 214 | $base = $ns . $subns; |
| 215 | 215 | $x = array_map( |
| 216 | - function ($f) use ($base) { |
|
| 216 | + function($f) use ($base) { |
|
| 217 | 217 | $fName = "$base\\$f\\CodeGenerator"; |
| 218 | 218 | return new $fName(); |
| 219 | 219 | }, |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $choices = $datatype->getChoices(); |
| 25 | 25 | |
| 26 | 26 | $choicesTS = array_map( |
| 27 | - function ($c) { |
|
| 27 | + function($c) { |
|
| 28 | 28 | return " \"$c\" = \"$c\""; |
| 29 | 29 | }, |
| 30 | 30 | array_keys($choices) |
@@ -28,12 +28,12 @@ |
||
| 28 | 28 | { |
| 29 | 29 | $classes = DatatypeGeneratorFactory::specializedFactoryAll($this); |
| 30 | 30 | $declarations = array_map( |
| 31 | - function (DatatypeGenerator $c) { |
|
| 31 | + function(DatatypeGenerator $c) { |
|
| 32 | 32 | return $c->datatypeDeclaration($this); |
| 33 | 33 | }, |
| 34 | 34 | $classes |
| 35 | 35 | ); |
| 36 | - $cleanDeclarations = array_filter($declarations, function ($d) { |
|
| 36 | + $cleanDeclarations = array_filter($declarations, function($d) { |
|
| 37 | 37 | return $d; |
| 38 | 38 | }); |
| 39 | 39 | return join("\n\n", $cleanDeclarations); |
@@ -13,8 +13,8 @@ |
||
| 13 | 13 | { |
| 14 | 14 | try { |
| 15 | 15 | /** |
| 16 | - * @var Datatype_enum $datatype |
|
| 17 | - */ |
|
| 16 | + * @var Datatype_enum $datatype |
|
| 17 | + */ |
|
| 18 | 18 | $datatype = $this->getDatatype(); |
| 19 | 19 | |
| 20 | 20 | /** |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | $choices = $datatype->getChoices(); |
| 25 | 25 | |
| 26 | 26 | $choicesEscaped = array_map( |
| 27 | - function ($c) { |
|
| 27 | + function($c) { |
|
| 28 | 28 | $c = preg_replace("/[^A-Za-z0-9]+/s", "_", $c); |
| 29 | 29 | return ((ctype_alpha($c[0]) || $c[0] === '_') ? $c : '_' . $c); |
| 30 | 30 | }, |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | try { |
| 41 | 41 | $className = get_class($this->getDatatype()); |
| 42 | 42 | $escapedClassName = str_replace("\\", "\\\\", $className); |
| 43 | - return 'scalar ' . $this->getDatatypeName($generator) . ' @scalar(class: "'. $escapedClassName . '")'; |
|
| 43 | + return 'scalar ' . $this->getDatatypeName($generator) . ' @scalar(class: "' . $escapedClassName . '")'; |
|
| 44 | 44 | } catch (\Throwable $e) { |
| 45 | 45 | return ''; |
| 46 | 46 | } |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | * @var GraphQLCodeGenerator $generator |
| 54 | 54 | */ |
| 55 | 55 | $renderable = array_map( |
| 56 | - function ($name, $value) { |
|
| 56 | + function($name, $value) { |
|
| 57 | 57 | $v = $value; |
| 58 | 58 | if (is_string($value)) { |
| 59 | 59 | $v = '"' . str_replace('"', '\\"', $value) . '"'; |
@@ -64,7 +64,7 @@ discard block |
||
| 64 | 64 | $field->getRenderables() |
| 65 | 65 | ); |
| 66 | 66 | |
| 67 | - return $field->getName() . ': ' . $this->getDatatypeName($generator) . |
|
| 67 | + return $field->getName() . ': ' . $this->getDatatypeName($generator) . |
|
| 68 | 68 | ($field->getValidatorOption(Datatype::REQUIRED, 'value', false) ? '!' : '') . |
| 69 | 69 | // TODO: validators |
| 70 | 70 | ($field->getRenderables() ? " @renderable(\n" . join("\n", $renderable) . "\n)" : '') . |