<?php
class RootObject
{
/** @var Data[] */
public array $data;
/**
* @param Data[] $data
*/
public function __construct(array $data)
{
$this->data = $data;
}
}
<?php
class Data
{
public int $id;
public string $name;
/** @var Categories[] */
public array $categories;
/**
* @param Categories[] $categories
*/
public function __construct(
int $id,
string $name,
array $categories
) {
$this->id = $id;
$this->name = $name;
$this->categories = $categories;
}
}
<?php
class Categories
{
public string $name;
public function __construct(string $name)
{
$this->name = $name;
}
}
It will be nice if in "[Namespace / Class]" we have an option to keep hierarchy and have something like:
<?php
namespace Demo;
class RootObject
{
/** @var Data[] */
public array $data;
/**
* @param Data[] $data
*/
public function __construct(array $data)
{
$this->data = $data;
}
}
<?php
namespace Demo\RootObject;
class Data
{
public int $id;
public string $name;
/** @var Categories[] */
public array $categories;
/**
* @param Categories[] $categories
*/
public function __construct(
int $id,
string $name,
array $categories
) {
$this->id = $id;
$this->name = $name;
$this->categories = $categories;
}
}
<?php
namespace Demo\RootObject\Data;
class Categories
{
public string $name;
public function __construct(string $name)
{
$this->name = $name;
}
}
And a folder structure following it, beacause on big json is bit a mess
Exemple:
We get with default options:
It will be nice if in "[Namespace / Class]" we have an option to keep hierarchy and have something like:
And a folder structure following it, beacause on big json is bit a mess
Thanks for your nice project