public function toArray(bool $withParentAndChild = true): array
    {
        $array = [
            'name'                  => $this->getName(),
            'shortName'             => $this->getShortName(),
            'configurationRootName' => $this->getConfigurationRootName(),
            'rootNamespace'         => $this->getRootNamespace(),
            'path'                  => $this->getPath(),
            'dataFixtures'          => $this->getDataFixtures()->toArray(),
        ];

        if ($withParentAndChild) {
            if (null !== $this->getParentBundleDescriptor()) {
                $array['parentBundleDescriptor'] = $this->getParentBundleDescriptor()->toArray(false);
            }

            if (null !== $this->getChildBundleDescriptor()) {
                $array['childBundleDescriptor'] = $this->getChildBundleDescriptor()->toArray(false);
            }
        }

        return $array;
    }