src/Charcoal/Cache/CacheBuilder.php
private function setItemClass($class)
    {
        if (!class_exists($class)) {
            throw new InvalidArgumentException(
                sprintf('Item class %s does not exist', $class)
            );
        }

        $interfaces = class_implements($class, true);

        if (!in_array(ItemInterface::class, $interfaces)) {
            throw new InvalidArgumentException(sprintf(
                'Item class %s must inherit from %s',
                $class,
                ItemInterface::class
            ));
        }

        $this->itemClass = $class;
    }
private function setItemClass($class)
    {
        if (!class_exists($class)) {
            throw new InvalidArgumentException(
                sprintf('Item class %s does not exist', $class)
            );
        }

        $interfaces = class_implements($class, true);

        if (!in_array(ItemInterface::class, $interfaces)) {
            throw new InvalidArgumentException(sprintf(
                'Item class %s must inherit from %s',
                $class,
                ItemInterface::class
            ));
        }

        $this->itemClass = $class;
    }
private function setItemClass ( $ class ) { if ( ! class_exists ( $ class ) ) { throw new InvalidArgumentException ( sprintf ( 'Item class %s does not exist' , $ class ) ) ; } $ interfaces = class_implements ( $ class , true ) ; if ( ! in_array ( ItemInterface :: class , $ interfaces ) ) { throw new InvalidArgumentException ( sprintf ( 'Item class %s must inherit from %s' , $ class , ItemInterface :: class ) ) ; } $ this -> itemClass = $ class ; }
Changes the specific Item class generated by the Pool objects.

Using this function developers can have the pool class generate custom Item objects.

@param  string $class The item class name.
@throws InvalidArgumentException When passed an invalid or nonexistant class.
@return void
Changes the specific Item class generated by the Pool objects .