public function testFromPrimitive() { $bool = rawr_from_primitive(true, rawr_boolean); $action = rawr_from_primitive(function () { return true && false; }, rawr_callable); $this->assertTrue($bool instanceof \Rawr\DataType\Bool); $this->assertEquals($bool->value(), true); $this->assertTrue($action instanceof \Rawr\DataType\Action); $this->assertNotEquals($action(), 1); $this->assertTrue($action() instanceof \Rawr\DataType\Bool); }
/** * Gets the filename from a user-defined function. * @author Marcelo Camargo * @return rawr<String> */ public function getFileName() { return rawr_from_primitive($this->reflection->getFileName(), rawr_string); }
public function negate() { return rawr_from_primitive(!$this->value); }