1313
1414use Brotkrueml \Schema \Core \Model \TypeInterface ;
1515use Brotkrueml \Schema \Type \TypeFactory ;
16+ use TYPO3Fluid \Fluid \Core \Parser \SyntaxTree \ViewHelperNode ;
1617use TYPO3Fluid \Fluid \Core \ViewHelper \AbstractViewHelper ;
1718use TYPO3Fluid \Fluid \Core \ViewHelper \ArgumentDefinition ;
1819
@@ -24,7 +25,7 @@ final class TypeViewHelper extends AbstractViewHelper
2425 private TypeInterface $ schemaType ;
2526
2627 /**
27- * @var array<string, list< ArgumentDefinition>>
28+ * @var array<string, array<string, ArgumentDefinition>>
2829 */
2930 private static array $ typeArgumentDefinitions = [];
3031
@@ -45,10 +46,11 @@ public function setArguments(array $arguments): void
4546 }
4647
4748 /**
48- * @return list< ArgumentDefinition>
49+ * @return array<string, ArgumentDefinition>
4950 */
5051 public function prepareArguments (): array
5152 {
53+ \assert ($ this ->viewHelperNode instanceof ViewHelperNode);
5254 $ name = $ this ->viewHelperNode ->getName ();
5355 if (! \str_starts_with ($ name , 'type. ' )) {
5456 // There is something wrong, this should not happen
@@ -66,7 +68,7 @@ public function prepareArguments(): array
6668 if (! isset (self ::$ typeArgumentDefinitions [$ typeName ])) {
6769 self ::$ typeArgumentDefinitions [$ typeName ] = $ this ->getNotableArguments ();
6870 foreach ($ this ->schemaType ->getPropertyNames () as $ propertyName ) {
69- self ::$ typeArgumentDefinitions [$ this -> schemaType -> getType () ][$ propertyName ] = new ArgumentDefinition (
71+ self ::$ typeArgumentDefinitions [$ typeName ][$ propertyName ] = new ArgumentDefinition (
7072 $ propertyName ,
7173 'mixed ' ,
7274 \sprintf ('Property "%s" ' , $ propertyName ),
@@ -75,11 +77,11 @@ public function prepareArguments(): array
7577 }
7678 }
7779
78- return self ::$ typeArgumentDefinitions [$ this -> schemaType -> getType () ];
80+ return self ::$ typeArgumentDefinitions [$ typeName ];
7981 }
8082
8183 /**
82- * @return array<string, list< ArgumentDefinition> >
84+ * @return array<string, ArgumentDefinition>
8385 */
8486 private function getNotableArguments (): array
8587 {
0 commit comments