public function setAutoGenerateProxyClasses(int $mode) : void
    {
        $this->autoGenerateProxyClasses = $mode;
        $proxyManagerConfig             = $this->getProxyManagerConfiguration();

        switch ($mode) {
            case self::AUTOGENERATE_FILE_NOT_EXISTS:
                $proxyManagerConfig->setGeneratorStrategy(new FileWriterGeneratorStrategy(
                    new FileLocator($proxyManagerConfig->getProxiesTargetDir())
                ));

                break;
            case self::AUTOGENERATE_EVAL:
                $proxyManagerConfig->setGeneratorStrategy(new EvaluatingGeneratorStrategy());

                break;
            default:
                throw new InvalidArgumentException('Invalid proxy generation strategy given - only AUTOGENERATE_FILE_NOT_EXISTS and AUTOGENERATE_EVAL are supported.');
        }
    }
public function setAutoGenerateProxyClasses(int $mode) : void
    {
        $this->autoGenerateProxyClasses = $mode;
        $proxyManagerConfig             = $this->getProxyManagerConfiguration();

        switch ($mode) {
            case self::AUTOGENERATE_FILE_NOT_EXISTS:
                $proxyManagerConfig->setGeneratorStrategy(new FileWriterGeneratorStrategy(
                    new FileLocator($proxyManagerConfig->getProxiesTargetDir())
                ));

                break;
            case self::AUTOGENERATE_EVAL:
                $proxyManagerConfig->setGeneratorStrategy(new EvaluatingGeneratorStrategy());

                break;
            default:
                throw new InvalidArgumentException('Invalid proxy generation strategy given - only AUTOGENERATE_FILE_NOT_EXISTS and AUTOGENERATE_EVAL are supported.');
        }
    }
public function setAutoGenerateProxyClasses ( int $ mode ) : void { $ this -> autoGenerateProxyClasses = $ mode ; $ proxyManagerConfig = $ this -> getProxyManagerConfiguration ( ) ; switch ( $ mode ) { case self :: AUTOGENERATE_FILE_NOT_EXISTS : $ proxyManagerConfig -> setGeneratorStrategy ( new FileWriterGeneratorStrategy ( new FileLocator ( $ proxyManagerConfig -> getProxiesTargetDir ( ) ) ) ) ; break ; case self :: AUTOGENERATE_EVAL : $ proxyManagerConfig -> setGeneratorStrategy ( new EvaluatingGeneratorStrategy ( ) ) ; break ; default : throw new InvalidArgumentException ( 'Invalid proxy generation strategy given - only AUTOGENERATE_FILE_NOT_EXISTS and AUTOGENERATE_EVAL are supported.' ) ; } }
Sets an int flag that indicates whether proxy classes should always be regenerated
during each script execution.

@throws InvalidArgumentException If an invalid mode was given.
Sets an int flag that indicates whether proxy classes should always be regenerated during each script execution .