public function checkReservedCodes()
    {
        $reserved = $this->getReservedCodes();

        // First iterate: check all factory
        foreach ($reserved as $factoryClass => $reservedForFactory) {
            // Second iterate: check in each factory
            foreach ($reserved as $checkInFactory => $reservedInCheckFactory) {
                if ($checkInFactory == $factoryClass) {
                    continue;
                }

                if ($reservedInCheckFactory[0] >= $reservedForFactory[0] &&
                    $reservedInCheckFactory[0] <= $reservedForFactory[1]
                ) {
                    throw new \RuntimeException(sprintf(
                        'The reserved codes for factory "%s" [%d - %d] superimposed on "%s" factory [%d - %d].',
                        $checkInFactory,
                        $reservedInCheckFactory[0],
                        $reservedInCheckFactory[1],
                        $factoryClass,
                        $reservedForFactory[0],
                        $reservedForFactory[1]
                    ));
                }

                if ($reservedInCheckFactory[1] >= $reservedForFactory[0] &&
                    $reservedInCheckFactory[1] <= $reservedForFactory[1]
                ) {
                    throw new \RuntimeException(sprintf(
                        'The reserved codes for factory "%s" [%d - %d] superimposed on "%s" factory [%d - %d].',
                        $checkInFactory,
                        $reservedInCheckFactory[0],
                        $reservedInCheckFactory[1],
                        $factoryClass,
                        $reservedForFactory[0],
                        $reservedForFactory[1]
                    ));
                }
            }
        }
    }
public function checkReservedCodes()
    {
        $reserved = $this->getReservedCodes();

        // First iterate: check all factory
        foreach ($reserved as $factoryClass => $reservedForFactory) {
            // Second iterate: check in each factory
            foreach ($reserved as $checkInFactory => $reservedInCheckFactory) {
                if ($checkInFactory == $factoryClass) {
                    continue;
                }

                if ($reservedInCheckFactory[0] >= $reservedForFactory[0] &&
                    $reservedInCheckFactory[0] <= $reservedForFactory[1]
                ) {
                    throw new \RuntimeException(sprintf(
                        'The reserved codes for factory "%s" [%d - %d] superimposed on "%s" factory [%d - %d].',
                        $checkInFactory,
                        $reservedInCheckFactory[0],
                        $reservedInCheckFactory[1],
                        $factoryClass,
                        $reservedForFactory[0],
                        $reservedForFactory[1]
                    ));
                }

                if ($reservedInCheckFactory[1] >= $reservedForFactory[0] &&
                    $reservedInCheckFactory[1] <= $reservedForFactory[1]
                ) {
                    throw new \RuntimeException(sprintf(
                        'The reserved codes for factory "%s" [%d - %d] superimposed on "%s" factory [%d - %d].',
                        $checkInFactory,
                        $reservedInCheckFactory[0],
                        $reservedInCheckFactory[1],
                        $factoryClass,
                        $reservedForFactory[0],
                        $reservedForFactory[1]
                    ));
                }
            }
        }
    }
public function checkReservedCodes ( ) { $ reserved = $ this -> getReservedCodes ( ) ; // First iterate: check all factory foreach ( $ reserved as $ factoryClass => $ reservedForFactory ) { // Second iterate: check in each factory foreach ( $ reserved as $ checkInFactory => $ reservedInCheckFactory ) { if ( $ checkInFactory == $ factoryClass ) { continue ; } if ( $ reservedInCheckFactory [ 0 ] >= $ reservedForFactory [ 0 ] && $ reservedInCheckFactory [ 0 ] <= $ reservedForFactory [ 1 ] ) { throw new \ RuntimeException ( sprintf ( 'The reserved codes for factory "%s" [%d - %d] superimposed on "%s" factory [%d - %d].' , $ checkInFactory , $ reservedInCheckFactory [ 0 ] , $ reservedInCheckFactory [ 1 ] , $ factoryClass , $ reservedForFactory [ 0 ] , $ reservedForFactory [ 1 ] ) ) ; } if ( $ reservedInCheckFactory [ 1 ] >= $ reservedForFactory [ 0 ] && $ reservedInCheckFactory [ 1 ] <= $ reservedForFactory [ 1 ] ) { throw new \ RuntimeException ( sprintf ( 'The reserved codes for factory "%s" [%d - %d] superimposed on "%s" factory [%d - %d].' , $ checkInFactory , $ reservedInCheckFactory [ 0 ] , $ reservedInCheckFactory [ 1 ] , $ factoryClass , $ reservedForFactory [ 0 ] , $ reservedForFactory [ 1 ] ) ) ; } } } }
Check reserved codes

@throws \Exception
Check reserved codes