Exemplo n.º 1
0
 /**
  * This method tests the "make" method.
  *
  * @dataProvider data_make
  */
 public function test_make(array $provided, array $expected)
 {
     $p0 = IBool\Type::make($provided[0]);
     $this->assertInstanceOf('\\Saber\\Data\\IBool\\Type', $p0);
     $p1 = $p0->unbox();
     $e1 = $expected[0];
     $this->assertInternalType('boolean', $p1);
     $this->assertSame($e1, $p1);
 }
Exemplo n.º 2
0
 /**
  * This method returns whether the specified object matches the regular expression.
  *
  * @access public
  * @static
  * @param IRegex\Type $x                                    the regular expression
  * @param Core\Type $ys                                     the object to be evaluated
  * @return IBool\Type                                       whether the specified object matches
  *                                                          the regular expression
  */
 public static function match(IRegex\Type $x, Core\Type $ys) : IBool\Type
 {
     return IBool\Type::make(preg_match($x->unbox(), $ys->__toString()));
 }
Exemplo n.º 3
0
 /**
  * This method returns whether this character is a symbol.
  *
  * @access public
  * @static
  * @param IChar\Type $x                                     the character to be evaluated
  * @return IBool\Type                                       whether this is a symbol
  *
  * @see http://php.net/manual/en/regexp.reference.unicode.php
  */
 public static function isSymbol(IChar\Type $x) : IBool\Type
 {
     return IBool\Type::make(preg_match('/^\\p{S}$/', $x->unbox()));
 }