Пример #1
0
 public function testIsString()
 {
     $this->assertFalse(Obj::isString(10));
     $this->assertFalse(Obj::isString(10.5));
     $this->assertFalse(Obj::isString(true));
     $this->assertTrue(Obj::isString('var'));
     $this->assertTrue(Obj::isString('10'));
     $this->assertFalse(Obj::isString([10]));
     $this->assertFalse(Obj::isInt($this->object));
 }
Пример #2
0
 /**
  * Find latest entry in $string after $delimiter
  * @param string $string
  * @param string $delimiter
  * @param bool $withoutDelimiter
  * @return string|bool
  */
 public static function lastIn($string, $delimiter, $withoutDelimiter = false)
 {
     $pos = strrpos($string, $delimiter);
     // if entry is not founded return false
     if (!Obj::isInt($pos)) {
         return false;
     }
     // remove delimiter pointer
     if (true === $withoutDelimiter) {
         ++$pos;
     }
     return self::sub($string, $pos);
 }