private function getSandboxCall(&$source, $method, $path, $input, callable $getSource, array $parameters)
    {
        return $this->getNewSandBox(function () use (&$source, $method, $path, $input, $getSource, $parameters) {
            $adapter = $this->getAdapter();
            $cacheEnabled = (
                $adapter->hasOption('cache_dir') && $adapter->getOption('cache_dir') ||
                $this->hasOption('cache_dir') && $this->getOption('cache_dir')
            );
            if ($cacheEnabled) {
                $this->expectCacheAdapter();
                $adapter = $this->getAdapter();
                $display = function () use ($adapter, $path, $input, $getSource, $parameters) {
                    /* @var CacheInterface $adapter */
                    $adapter->displayCached($path, $input, $getSource, $parameters);
                };

                return in_array($method, ['display', 'displayFile'])
                    ? $display()
                    : $adapter->captureBuffer($display);
            }

            $source = $getSource($path, $input);

            return $adapter->$method(
                $source,
                $parameters
            );
        });
    }
private function getSandboxCall(&$source, $method, $path, $input, callable $getSource, array $parameters)
    {
        return $this->getNewSandBox(function () use (&$source, $method, $path, $input, $getSource, $parameters) {
            $adapter = $this->getAdapter();
            $cacheEnabled = (
                $adapter->hasOption('cache_dir') && $adapter->getOption('cache_dir') ||
                $this->hasOption('cache_dir') && $this->getOption('cache_dir')
            );
            if ($cacheEnabled) {
                $this->expectCacheAdapter();
                $adapter = $this->getAdapter();
                $display = function () use ($adapter, $path, $input, $getSource, $parameters) {
                    /* @var CacheInterface $adapter */
                    $adapter->displayCached($path, $input, $getSource, $parameters);
                };

                return in_array($method, ['display', 'displayFile'])
                    ? $display()
                    : $adapter->captureBuffer($display);
            }

            $source = $getSource($path, $input);

            return $adapter->$method(
                $source,
                $parameters
            );
        });
    }
private function getSandboxCall ( & $ source , $ method , $ path , $ input , callable $ getSource , array $ parameters ) { return $ this -> getNewSandBox ( function ( ) use ( & $ source , $ method , $ path , $ input , $ getSource , $ parameters ) { $ adapter = $ this -> getAdapter ( ) ; $ cacheEnabled = ( $ adapter -> hasOption ( 'cache_dir' ) && $ adapter -> getOption ( 'cache_dir' ) || $ this -> hasOption ( 'cache_dir' ) && $ this -> getOption ( 'cache_dir' ) ) ; if ( $ cacheEnabled ) { $ this -> expectCacheAdapter ( ) ; $ adapter = $ this -> getAdapter ( ) ; $ display = function ( ) use ( $ adapter , $ path , $ input , $ getSource , $ parameters ) { /* @var CacheInterface $adapter */ $ adapter -> displayCached ( $ path , $ input , $ getSource , $ parameters ) ; } ; return in_array ( $ method , [ 'display' , 'displayFile' ] ) ? $ display ( ) : $ adapter -> captureBuffer ( $ display ) ; } $ source = $ getSource ( $ path , $ input ) ; return $ adapter -> $ method ( $ source , $ parameters ) ; } ) ; }
Call an adapter method inside a sandbox and return the SandBox result.

@param string   $source
@param string   $method
@param string   $path
@param string   $input
@param callable $getSource
@param array    $parameters

@return SandBox
Call an adapter method inside a sandbox and return the SandBox result .