create() public method

public create ( $template, array $tokens = [], $phpBinary = null )
$tokens array
Example #1
0
 public function payload($template, array $tokens)
 {
     $tokens['bootstrap'] = '';
     if (null !== $this->bootstrap) {
         if (!file_exists($this->bootstrap)) {
             throw new \InvalidArgumentException(sprintf('Bootstrap file "%s" does not exist.', $this->bootstrap));
         }
         $tokens['bootstrap'] = $this->bootstrap;
     }
     $phpBinary = $this->resolvePhpBinary();
     $payload = $this->payloadFactory->create($template, $tokens, $phpBinary);
     if ($this->phpWrapper) {
         $payload->setWrapper($this->phpWrapper);
     }
     if ($this->phpConfig) {
         $payload->setPhpConfig($this->phpConfig);
     }
     return $payload;
 }