DataSift\Storyplayer\PlayerLib\Prose_Loader::determineProseClassFor PHP Method

determineProseClassFor() public method

public determineProseClassFor ( $methodName ) : string
return string
    public function determineProseClassFor($methodName)
    {
        // this new, simplified naming scheme was introduced for
        // Storyplayer 1.4
        //
        // it isn't considered a b/c break, because we didn't document
        // how to create modules until v1.4 was released
        $className = ucfirst($methodName);
        // all done
        return $className;
    }

Usage Example

Beispiel #1
0
 /**
  *
  * @param  string $methodName
  * @param  array  $methodArgs
  * @return mixed
  */
 public function __call($methodName, $methodArgs)
 {
     // what class do we want?
     $className = $this->proseLoader->determineProseClassFor($methodName);
     // use the Prose Loader to create the object to call
     $obj = $this->proseLoader->loadProse($this, $className, $methodArgs);
     // did we find something?
     if (!is_object($obj)) {
         // alas, no
         throw new E5xx_NoMatchingActions($methodName);
     }
     // all done
     return $obj;
 }