diff --git a/lib/class-argument-data.php b/lib/class-argument-data.php new file mode 100644 index 0000000..c725d1e --- /dev/null +++ b/lib/class-argument-data.php @@ -0,0 +1,14 @@ + $tags + */ + public function __construct( + public string $name, + public ?string $default, + public string $type, + ) {} +} diff --git a/lib/runner.php b/lib/runner.php index 64fbb66..0e7bd9f 100644 --- a/lib/runner.php +++ b/lib/runner.php @@ -137,16 +137,16 @@ function export_docblock( Property|Method|Hook|File|Function_|Class_ $element ) /** * @param \phpDocumentor\Reflection\Php\Argument[] $arguments * - * @return array + * @return array */ -function export_arguments( array $arguments ) { +function export_arguments( array $arguments ) : array { $output = array(); foreach ( $arguments as $argument ) { - $output[] = array( - 'name' => '$' . $argument->getName(), - 'default' => $argument->getDefault(), - 'type' => (string) $argument->getType(), + $output[] = new ArgumentData( + '$' . $argument->getName(), + $argument->getDefault(), + (string) $argument->getType(), ); }