src/Services/Translations/Finder.php
protected function chunk($translations, $page = 1, $perPage = 20)
    {
        if (!$count = count($translations)) {
            return [];
        }

        $pages = array_chunk($translations, $perPage, true);

        $min = 1;
        $max = ceil($count / $perPage);

        if ($page < $min || $page > $max) {
            $page = 1;
        }

        return $pages[$page - 1];
    }
protected function chunk($translations, $page = 1, $perPage = 20)
    {
        if (!$count = count($translations)) {
            return [];
        }

        $pages = array_chunk($translations, $perPage, true);

        $min = 1;
        $max = ceil($count / $perPage);

        if ($page < $min || $page > $max) {
            $page = 1;
        }

        return $pages[$page - 1];
    }
protected function chunk ( $ translations , $ page = 1 , $ perPage = 20 ) { if ( ! $ count = count ( $ translations ) ) { return [ ] ; } $ pages = array_chunk ( $ translations , $ perPage , true ) ; $ min = 1 ; $ max = ceil ( $ count / $ perPage ) ; if ( $ page < $ min || $ page > $ max ) { $ page = 1 ; } return $ pages [ $ page - 1 ] ; }
Retrieves the current page chunk.

@param $translations
@param int $page
@param int $perPage

@return array
Retrieves the current page chunk .