当前位置: 首页>>代码示例>>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;未经允许,请勿转载。