Exemple #1
0
 /**
  * Returns the class name without the namespace.
  *
  * If the class does not exist false is returned.
  * @param string|object $cls object or fully qualified class name
  * @return string|false
  */
 public static function className($cls)
 {
     if (is_string($cls) && !class_exists($cls)) {
         return false;
     } elseif (is_object($cls)) {
         $cls = get_class($cls);
     }
     return Str::splitLast($cls, "\\");
 }
Exemple #2
0
 public function test_split_last_containing_delimiter()
 {
     $this->assertSame("derp", Str::splitLast("herp derp", " "));
 }