diff --git a/lib/class-argument-datalist.php b/lib/class-argument-datalist.php new file mode 100644 index 0000000..30f7001 --- /dev/null +++ b/lib/class-argument-datalist.php @@ -0,0 +1,9 @@ + */ -function export_arguments( array $arguments ) : array { +function export_arguments( array $arguments ) : ArgumentDataList { $output = array(); foreach ( $arguments as $argument ) { @@ -158,15 +156,13 @@ function export_arguments( array $arguments ) : array { ); } - return $output; + return new ArgumentDataList( ...$output ); } /** * @param \phpDocumentor\Reflection\Php\Property[] $properties - * - * @return array */ -function export_properties( array $properties ) : array { +function export_properties( array $properties ) : PropertyDataList { $out = array(); foreach ( $properties as $property ) { @@ -181,19 +177,16 @@ function export_properties( array $properties ) : array { ); } - return $out; + return new PropertyDataList( ...$out ); } /** * @param \phpDocumentor\Reflection\Php\Method[] $methods - * - * @return array */ -function export_methods( array $methods ) : array { +function export_methods( array $methods ) : MethodDataList { $output = array(); foreach ( $methods as $method ) { - $namespace = get_namespace( $method->getFqsen() ); $output[] = new MethodData( @@ -210,15 +203,13 @@ function export_methods( array $methods ) : array { ); } - return $output; + return new MethodDataList( ...$output ); } /** * @param HooksMetadata $hooks_metadata - * - * @return array */ -function export_hooks( HooksMetadata $hooks_metadata ) : array { +function export_hooks( HooksMetadata $hooks_metadata ) : HookDataList { $out = array(); /** @var Hook $hook */ @@ -233,7 +224,7 @@ function export_hooks( HooksMetadata $hooks_metadata ) : array { ); } - return $out; + return new HookDataList( ...$out ); } /**