protected function configAssert($key, $singular)
    {
        $types = $this->config->get($key);
        // No types, nothing to assert. The route _DOES_ expect a string, so
        // we return a regex that never matches.
        if (empty($types)) {
            return '$.';
        }

        $slugs = [];
        foreach ($types as $type) {
            $slugs[] = $type['slug'];
            if ($singular) {
                $slugs[] = $type['singular_slug'];
            }
        }

        return implode('|', $slugs);
    }
protected function configAssert($key, $singular)
    {
        $types = $this->config->get($key);
        // No types, nothing to assert. The route _DOES_ expect a string, so
        // we return a regex that never matches.
        if (empty($types)) {
            return '$.';
        }

        $slugs = [];
        foreach ($types as $type) {
            $slugs[] = $type['slug'];
            if ($singular) {
                $slugs[] = $type['singular_slug'];
            }
        }

        return implode('|', $slugs);
    }
protected function configAssert ( $ key , $ singular ) { $ types = $ this -> config -> get ( $ key ) ; // No types, nothing to assert. The route _DOES_ expect a string, so // we return a regex that never matches. if ( empty ( $ types ) ) { return '$.' ; } $ slugs = [ ] ; foreach ( $ types as $ type ) { $ slugs [ ] = $ type [ 'slug' ] ; if ( $ singular ) { $ slugs [ ] = $ type [ 'singular_slug' ] ; } } return implode ( '|' , $ slugs ) ; }
Gets slugs from config imploded for regex.

@param string $key      contenttypes or taxonomy
@param bool   $singular Include singular slugs

@return string
Gets slugs from config imploded for regex .