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;
    }
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;
    }
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 ; }
Returns an array representation of the descriptor

@param bool $withParentAndChild (optional) If is set to true, includes descriptor of the parent and child
bundle (default behaviour). Otherwise - not.
@return array
Returns an array representation of the descriptor