Beispiel #1
0
 /**
  * Tries to find the right class to call.
  *
  * @param string $callingClass The original class
  * @param string $method       The method
  * @param array  $arguments    The arguments
  *
  * @return string The correct class
  */
 protected static function computeClassToCall($callingClass, $method, $arguments)
 {
     if (!StringsMethods::find($callingClass, 'Underscore\\Types')) {
         if (isset($arguments[0])) {
             $callingClass = Dispatch::toClass($arguments[0]);
         } else {
             $callingClass = Method::findInClasses($callingClass, $method);
         }
     }
     return $callingClass;
 }
 /**
  * Check if an array has a given key.
  */
 public static function has($array, $key)
 {
     // Generate unique string to use as marker
     $unfound = StringsMethods::random(5);
     return static::get($array, $key, $unfound) !== $unfound;
 }
Beispiel #3
0
 /**
  * Whether the link is special or not
  *
  * @return boolean
  */
 public function isSpecialUrl()
 {
     foreach ($this->hidden as $hidden) {
         if (StringsMethods::startsWith($this->href, $hidden)) {
             return true;
         }
     }
     return false;
 }