src/Charcoal/Loader/CollectionLoader.php
public function createCollection()
    {
        $collectClass = $this->collectionClass();
        if ($collectClass === 'array') {
            return [];
        }

        if (!class_exists($collectClass)) {
            throw new RuntimeException(sprintf(
                'Collection class [%s] does not exist.',
                $collectClass
            ));
        }

        if (!is_subclass_of($collectClass, ArrayAccess::class)) {
            throw new RuntimeException(sprintf(
                'Collection class [%s] must implement ArrayAccess.',
                $collectClass
            ));
        }

        $collection = new $collectClass;

        return $collection;
    }
public function createCollection()
    {
        $collectClass = $this->collectionClass();
        if ($collectClass === 'array') {
            return [];
        }

        if (!class_exists($collectClass)) {
            throw new RuntimeException(sprintf(
                'Collection class [%s] does not exist.',
                $collectClass
            ));
        }

        if (!is_subclass_of($collectClass, ArrayAccess::class)) {
            throw new RuntimeException(sprintf(
                'Collection class [%s] must implement ArrayAccess.',
                $collectClass
            ));
        }

        $collection = new $collectClass;

        return $collection;
    }
public function createCollection ( ) { $ collectClass = $ this -> collectionClass ( ) ; if ( $ collectClass === 'array' ) { return [ ] ; } if ( ! class_exists ( $ collectClass ) ) { throw new RuntimeException ( sprintf ( 'Collection class [%s] does not exist.' , $ collectClass ) ) ; } if ( ! is_subclass_of ( $ collectClass , ArrayAccess :: class ) ) { throw new RuntimeException ( sprintf ( 'Collection class [%s] must implement ArrayAccess.' , $ collectClass ) ) ; } $ collection = new $ collectClass ; return $ collection ; }
Create a collection class or array.

@throws RuntimeException If the collection class is invalid.
@return array|ArrayAccess
Create a collection class or array .