Ejemplo n.º 1
0
 /**
  * Identify API method version by its reflection.
  *
  * @param ReflectionMethod $methodReflection
  * @return string|bool Method version with prefix on success.
  *      false is returned in case when method should not be exposed via API.
  */
 protected function _getMethodVersion(ReflectionMethod $methodReflection)
 {
     $methodVersion = false;
     $methodNameWithSuffix = $methodReflection->getName();
     $regularExpression = $this->_helper->getMethodNameRegularExpression();
     if (preg_match($regularExpression, $methodNameWithSuffix, $methodMatches)) {
         $resourceNamePosition = 2;
         $methodVersion = ucfirst($methodMatches[$resourceNamePosition]);
     }
     return $methodVersion;
 }