生成php类的架构并在其他项目中使用

时间:2018-09-30 17:53:52

标签: php

我在php symfony项目结构中有命令和处理程序,例如我的命令如下:

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;
    } 
...

我想从另一个项目中调用此命令。基础结构在这里并不重要,但架构很重要。 我需要知道如何在相关项目中查看架构。 因此,第一个项目具有真正的命令和命令处理程序类,第二个项目知道它看起来像命令的架构。

我想知道我第二个项目的结构。

我在考虑[https://api-platform.com/docs/schema-generator/getting-started]之类的东西。

所以问题是:

如何从一个项目生成我选择的类的结构,并像大摇大摆一样使用-了解第二个项目的结构。

0 个答案:

没有答案