src/DataDefinition/Palette/Builder/PaletteBuilder.php
public function createProperty($propertyName, $_ = null)
    {
        if ($this->property) {
            $this->finishProperty();
        }

        $propertyNames = \func_get_args();

        $this->property = [];
        foreach ($propertyNames as $propertyName) {
            $property = $this->propertyClass->newInstance($propertyName);

            $event = new CreatePropertyEvent($property, $this);
            $this->dispatchEvent($event);
            $property = $event->getProperty();

            $this->property[] = $property;
        }

        if (1 === \count($this->property)) {
            $this->property = \array_shift($this->property);
        }

        return $this;
    }
public function createProperty($propertyName, $_ = null)
    {
        if ($this->property) {
            $this->finishProperty();
        }

        $propertyNames = \func_get_args();

        $this->property = [];
        foreach ($propertyNames as $propertyName) {
            $property = $this->propertyClass->newInstance($propertyName);

            $event = new CreatePropertyEvent($property, $this);
            $this->dispatchEvent($event);
            $property = $event->getProperty();

            $this->property[] = $property;
        }

        if (1 === \count($this->property)) {
            $this->property = \array_shift($this->property);
        }

        return $this;
    }
public function createProperty ( $ propertyName , $ _ = null ) { if ( $ this -> property ) { $ this -> finishProperty ( ) ; } $ propertyNames = \ func_get_args ( ) ; $ this -> property = [ ] ; foreach ( $ propertyNames as $ propertyName ) { $ property = $ this -> propertyClass -> newInstance ( $ propertyName ) ; $ event = new CreatePropertyEvent ( $ property , $ this ) ; $ this -> dispatchEvent ( $ event ) ; $ property = $ event -> getProperty ( ) ; $ this -> property [ ] = $ property ; } if ( 1 === \ count ( $ this -> property ) ) { $ this -> property = \ array_shift ( $ this -> property ) ; } return $ this ; }
Start a new single property or set of properties.

@param string            $propertyName The name of the property.
@param PropertyInterface $_            Any more subsequent property names to be used.

@return PaletteBuilder

@SuppressWarnings(PHPMD.UnusedFormalParameter)
@SuppressWarnings(PHPMD.ShortVariable)
@SuppressWarnings(PHPMD.CamelCaseParameterName)
Start a new single property or set of properties .