當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ReflectionMethod::getShortName方法代碼示例

本文整理匯總了PHP中ReflectionMethod::getShortName方法的典型用法代碼示例。如果您正苦於以下問題:PHP ReflectionMethod::getShortName方法的具體用法?PHP ReflectionMethod::getShortName怎麽用?PHP ReflectionMethod::getShortName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在ReflectionMethod的用法示例。


在下文中一共展示了ReflectionMethod::getShortName方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: __construct

 /**
  * @param string $className
  * @param string $methodName
  * @param Factory $factory <-
  */
 public function __construct($className, $methodName, Factory $factory)
 {
     parent::__construct(self::asClass($className, $methodName), $factory);
     $this->method = new \ReflectionMethod($className, $methodName);
     $this->createClassDefinition();
     $this->setName(ucfirst(preg_replace('/([a-z])([A-Z])/', '$1 $2', $this->method->getShortName())));
 }
開發者ID:watoki,項目名稱:qrator,代碼行數:12,代碼來源:MethodActionRepresenter.php

示例2: getCallableName

 /**
  * @param $callable
  *
  * @return string
  */
 public function getCallableName($callable)
 {
     $name = '(Unknown)';
     if (is_array($callable)) {
         $method = new \ReflectionMethod($callable[0], $callable[1]);
         $className = $method->getDeclaringClass()->getName();
         $className = str_replace('Ciconia\\Extension\\', '', $className);
         $name = $className . ':' . $method->getShortName();
     }
     return $name;
 }
開發者ID:bencalie,項目名稱:Ciconia,代碼行數:16,代碼來源:Markdown.php

示例3: assertEqualMethods

 /**
  * @param \ReflectionMethod $reflectionMethod
  * @param \Donquixote\HastyReflectionCommon\Reflection\FunctionLike\MethodReflectionInterface $methodReflection
  */
 private function assertEqualMethods(\ReflectionMethod $reflectionMethod, MethodReflectionInterface $methodReflection)
 {
     $this->assertEquals($reflectionMethod->isAbstract(), $methodReflection->isAbstract());
     $this->assertEquals($reflectionMethod->getDeclaringClass()->getName(), $methodReflection->getDeclaringClassName());
     $this->assertEquals($reflectionMethod->getDocComment(), $methodReflection->getDocComment());
     $this->assertEquals($reflectionMethod->getShortName(), $methodReflection->getName());
     $this->assertEquals($reflectionMethod->getName(), $methodReflection->getName());
     $this->assertEquals($reflectionMethod->class . '::' . $reflectionMethod->getName(), $methodReflection->getQualifiedName());
     $this->assertEquals($reflectionMethod->returnsReference(), $methodReflection->isByReference());
     $this->assertEquals($reflectionMethod->isPrivate(), $methodReflection->isPrivate());
     $this->assertEquals($reflectionMethod->isProtected(), $methodReflection->isProtected());
     $this->assertEquals($reflectionMethod->isPublic(), $methodReflection->isPublic());
     $this->assertEquals($reflectionMethod->isStatic(), $methodReflection->isStatic());
 }
開發者ID:donquixote,項目名稱:hasty-reflection-common,代碼行數:18,代碼來源:ClassIndexTest.php

示例4: addMethod

 /**
  * Add a method to the reflected class.
  *
  * @param ReflectionMethod $method
  */
 public function addMethod(ReflectionMethod $method)
 {
     $this->methods[$method->getShortName()] = $method;
     $method->setDeclaringClassLike($this);
     $method->setFilename($this->getFileName());
     return $this;
 }
開發者ID:benoth,項目名稱:static-reflection,代碼行數:12,代碼來源:ReflectionClassLike.php

示例5: fieldFromInjector

 /**
  * @param \ReflectionMethod $method
  * @return string
  * @todo ¿Quizás moverlo al Inflector?
  */
 private static function fieldFromInjector(\ReflectionMethod $method)
 {
     $name = substr($method->getShortName(), strlen('inject'));
     return Inflector::hyphenate($name);
 }
開發者ID:gointegro,項目名稱:hateoas,代碼行數:10,代碼來源:ResourceMetadata.php

示例6: test

    $staticX++;
    $x = $staticX;
    return $x;
}
class Test
{
    public function test()
    {
    }
}
$rf = new \ReflectionFunction('\\foo\\bar\\f');
print "--- getShortName(\"\\foo\\bar\\f\") ---\n";
var_dump($rf->getShortName());
print "\n";
print "--- getNamespaceName(\"\\foo\\bar\\f\") ---\n";
var_dump($rf->getNamespaceName());
print "\n";
$rf = new \ReflectionMethod('\\foo\\bar\\Test', 'test');
print "--- getShortName(\"\\foo\\bar\\Test::test\") ---\n";
var_dump($rf->getShortName());
print "\n";
print "--- getNamespaceName(\"\\foo\\bar\\Test::test\") ---\n";
var_dump($rf->getNamespaceName());
print "\n";
$rf = new \ReflectionFunction('\\strlen');
print "--- getShortName(\"strlen\") ---\n";
var_dump($rf->getShortName());
print "\n";
print "--- getNamespaceName(\"strlen\") ---\n";
var_dump($rf->getNamespaceName());
print "\n";
開發者ID:badlamer,項目名稱:hhvm,代碼行數:31,代碼來源:ReflectionFunction_getShortName.php

示例7: processMetadataForMethod

 /**
  * handle custom metadata for method annotation
  *
  * @param ClassMetadata $metadata
  * @param \ReflectionMethod $method
  */
 public function processMetadataForMethod(ClassMetadata $metadata, \ReflectionMethod $method)
 {
     $metadata->tags[$this->key] = $this->value;
     $metadata->tags[$this->key . '.target'] = $method->getShortName();
 }
開發者ID:stefnoten,項目名稱:JMSDiExtraBundle,代碼行數:11,代碼來源:CustomAnnotation.php

示例8: isMethod

 private static function isMethod(\ReflectionMethod $method, $prefix)
 {
     return $method->isPublic() && !$method->isStatic() && 0 === $method->getNumberOfRequiredParameters() && $prefix === substr($method->getShortName(), 0, strlen($prefix));
 }
開發者ID:gointegro,項目名稱:hateoas,代碼行數:4,代碼來源:Reflection.php


注:本文中的ReflectionMethod::getShortName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。