protected function detect(array $registries)
    {
        $length = max(array_map('strlen', $registries));

        $found = false;
        foreach (self::DETECT_LAYOUT as $cnab => $start) {
            if ($length <= $cnab) {
                $found = true;
                break;
            }
        }

        if (!$found) {
            throw new \DomainException('Could not detect Return File layout');
        }

        $this->bank_code = substr($registries[0], $start, 3);
        $this->cnab = $cnab;
    }
protected function detect(array $registries)
    {
        $length = max(array_map('strlen', $registries));

        $found = false;
        foreach (self::DETECT_LAYOUT as $cnab => $start) {
            if ($length <= $cnab) {
                $found = true;
                break;
            }
        }

        if (!$found) {
            throw new \DomainException('Could not detect Return File layout');
        }

        $this->bank_code = substr($registries[0], $start, 3);
        $this->cnab = $cnab;
    }
protected function detect ( array $ registries ) { $ length = max ( array_map ( 'strlen' , $ registries ) ) ; $ found = false ; foreach ( self :: DETECT_LAYOUT as $ cnab => $ start ) { if ( $ length <= $ cnab ) { $ found = true ; break ; } } if ( ! $ found ) { throw new \ DomainException ( 'Could not detect Return File layout' ) ; } $ this -> bank_code = substr ( $ registries [ 0 ] , $ start , 3 ) ; $ this -> cnab = $ cnab ; }
Detects the CNAB layout and the Bank Code

@param string[] $registries Return File registries

@throws \DomainException If could not detect Return File layout
Detects the CNAB layout and the Bank Code