PhpSigep\Config::setCacheFactory PHP Method

setCacheFactory() public method

public setCacheFactory ( string | phpsigep\FactoryInterface $cacheFactory )
$cacheFactory string | phpsigep\FactoryInterface
    public function setCacheFactory($cacheFactory)
    {
        if ($cacheFactory != $this->cacheFactory || !$cacheFactory instanceof FactoryInterface) {
            if (is_string($cacheFactory)) {
                $cacheFactory = new $cacheFactory();
            }
            if (!$cacheFactory || !$cacheFactory instanceof FactoryInterface) {
                throw new InvalidArgument('O cacheFactory deve implementar PhpSigep\\FactoryInterface.');
            }
            $this->cacheFactory = $cacheFactory;
        }
    }