예제 #1
0
 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);
 }
예제 #2
0
 /**
  * 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);
 }
예제 #3
0
 public function negate()
 {
     return rawr_from_primitive(!$this->value);
 }