src/Fixer/ClassNotation/OrderedClassElementsFixer.php
public function configure(array $configuration = null)
    {
        parent::configure($configuration);

        $this->typePosition = [];
        $pos = 0;
        foreach ($this->configuration['order'] as $type) {
            $this->typePosition[$type] = $pos++;
        }

        foreach (self::$typeHierarchy as $type => $parents) {
            if (isset($this->typePosition[$type])) {
                continue;
            }

            if (!$parents) {
                $this->typePosition[$type] = null;

                continue;
            }

            foreach ($parents as $parent) {
                if (isset($this->typePosition[$parent])) {
                    $this->typePosition[$type] = $this->typePosition[$parent];

                    continue 2;
                }
            }

            $this->typePosition[$type] = null;
        }

        $lastPosition = \count($this->configuration['order']);
        foreach ($this->typePosition as &$pos) {
            if (null === $pos) {
                $pos = $lastPosition;
            }
            // last digit is used by phpunit method ordering
            $pos *= 10;
        }
    }
public function configure(array $configuration = null)
    {
        parent::configure($configuration);

        $this->typePosition = [];
        $pos = 0;
        foreach ($this->configuration['order'] as $type) {
            $this->typePosition[$type] = $pos++;
        }

        foreach (self::$typeHierarchy as $type => $parents) {
            if (isset($this->typePosition[$type])) {
                continue;
            }

            if (!$parents) {
                $this->typePosition[$type] = null;

                continue;
            }

            foreach ($parents as $parent) {
                if (isset($this->typePosition[$parent])) {
                    $this->typePosition[$type] = $this->typePosition[$parent];

                    continue 2;
                }
            }

            $this->typePosition[$type] = null;
        }

        $lastPosition = \count($this->configuration['order']);
        foreach ($this->typePosition as &$pos) {
            if (null === $pos) {
                $pos = $lastPosition;
            }
            // last digit is used by phpunit method ordering
            $pos *= 10;
        }
    }
public function configure ( array $ configuration = null ) { parent :: configure ( $ configuration ) ; $ this -> typePosition = [ ] ; $ pos = 0 ; foreach ( $ this -> configuration [ 'order' ] as $ type ) { $ this -> typePosition [ $ type ] = $ pos ++ ; } foreach ( self :: $ typeHierarchy as $ type => $ parents ) { if ( isset ( $ this -> typePosition [ $ type ] ) ) { continue ; } if ( ! $ parents ) { $ this -> typePosition [ $ type ] = null ; continue ; } foreach ( $ parents as $ parent ) { if ( isset ( $ this -> typePosition [ $ parent ] ) ) { $ this -> typePosition [ $ type ] = $ this -> typePosition [ $ parent ] ; continue 2 ; } } $ this -> typePosition [ $ type ] = null ; } $ lastPosition = \ count ( $ this -> configuration [ 'order' ] ) ; foreach ( $ this -> typePosition as & $ pos ) { if ( null === $ pos ) { $ pos = $ lastPosition ; } // last digit is used by phpunit method ordering $ pos *= 10 ; } }
{@inheritdoc}
{