为php类生成模式并在不同的项目中使用

I have in my php symfony project structure with commands and handlers e.g. my command looks like:

class AddProductToCartCommand
{
    /** @var UuidInterface */
    private $cartItemId;

    /** @var int */
    private $userId;

    /** @var int */
    private $productId;

    /** @var int */
    private $quantity;

    /** @var Product */
    private $product;

    public function __construct(UuidInterface $cartItemId, int $userId, int $productId, int $quantity)
    {
        $this->cartItemId = $cartItemId;
        $this->userId = $userId;
        $this->productId = $productId;
        $this->quantity = $quantity;
    } 
...

I want to call this command from another project. Infrastructure is not important here but schema. I need to know how look schema in related project. So first project has real command and command handler class and second know how it looks like the schema of command.

I want to know structure in my second project.

I was thinking about something like [https://api-platform.com/docs/schema-generator/getting-started].

so the question is:

How to generate structure of my selected classes from one project and use like in swagger - know structure in second project.