CacheTool\Code::fromString PHP Method

fromString() public static method

public static fromString ( string $statement ) : Code
$statement string
return Code
    public static function fromString($statement)
    {
        $code = new static();
        $code->addStatement($statement);
        return $code;
    }

Usage Example

Beispiel #1
0
 /**
  * @expectedException RuntimeException
  */
 public function testException()
 {
     $cli = new Cli();
     $cli->setTempDir(sys_get_temp_dir());
     $cli->setLogger($this->getMockBuilder('Monolog\\Logger')->disableOriginalConstructor()->getMock());
     $code = Code::fromString('throw new \\Exception("test");');
     $result = $cli->run($code);
 }
All Usage Examples Of CacheTool\Code::fromString