当前位置: 首页>>代码示例>>PHP>>正文


PHP SimpleReflection::getSignature方法代码示例

本文整理汇总了PHP中SimpleReflection::getSignature方法的典型用法代码示例。如果您正苦于以下问题:PHP SimpleReflection::getSignature方法的具体用法?PHP SimpleReflection::getSignature怎么用?PHP SimpleReflection::getSignature使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在SimpleReflection的用法示例。


在下文中一共展示了SimpleReflection::getSignature方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testMostGeneralPossibleSignature

 function testMostGeneralPossibleSignature()
 {
     $reflection = new SimpleReflection('AnyOldThing');
     $this->assertEqualIgnoringCase($reflection->getSignature('aMethod'), 'function &aMethod()');
 }
开发者ID:ljarray,项目名称:dbpedia,代码行数:5,代码来源:reflection_php4_test.php

示例2: testParameterCreationForTypeHinting

 function testParameterCreationForTypeHinting()
 {
     $reflection = new SimpleReflection('AnyOldTypeHintedClass');
     $function = $reflection->getSignature('aMethod');
     if (version_compare(phpversion(), '5.0.2', '<=')) {
         $this->assertEqual('function amethod(AnyOldInterface $argument)', $function);
     } else {
         $this->assertEqual('function aMethod(AnyOldInterface $argument)', $function);
     }
 }
开发者ID:PublicityPort,项目名称:OpenCATS,代码行数:10,代码来源:reflection_php5_test.php

示例3: testUnsetFunctionSignature

 function testUnsetFunctionSignature()
 {
     $reflection = new SimpleReflection('AnyOldOverloadedClass');
     $function = $reflection->getSignature('__unset');
     if (version_compare(phpversion(), '5.1.0', '>=')) {
         $this->assertEqual('function __unset($key)', $function);
     } else {
         $this->assertEqual('function __unset()', $function);
     }
 }
开发者ID:BackupTheBerlios,项目名称:pic2base-svn,代码行数:10,代码来源:reflection_php5_test.php

示例4: testCanProperlyGenerateAbstractMethods

 function testCanProperlyGenerateAbstractMethods()
 {
     $reflection = new SimpleReflection('AnyOldAbstractClassWithAbstractMethods');
     $this->assertEqual('function anAbstract()', $reflection->getSignature('anAbstract'));
     $this->assertEqual('function anAbstractWithParameter($foo)', $reflection->getSignature('anAbstractWithParameter'));
     $this->assertEqual('function anAbstractWithMultipleParameters($foo, $bar)', $reflection->getSignature('anAbstractWithMultipleParameters'));
 }
开发者ID:ready4god2513,项目名称:Journal,代码行数:7,代码来源:reflection_php5_test.php

示例5: SimpleReflection

 function testCopingWithSpecialMethodunsetPHP51()
 {
     $reflection = new SimpleReflection('AnyOldClassInvokingMethodsWithArgumentsInConstructor');
     $this->assertEqual('function __unset($key)', $reflection->getSignature('__unset'));
     $this->assertEqual('function __unset($key)', $reflection->getSignature('__unset', SIG_GEN_DECLARE));
     $this->assertEqual('parent::__unset($key)', $reflection->getSignature('__unset', SIG_GEN_INVOKE_AS_PARENT));
     $this->expectError(new PatternExpectation('/Reflection does not \\(yet\\) support mode ' . SIG_GEN_ASSIGN_ONLY_THE_ARGS . ' for __unset/'));
     $this->assertEqual('$key', $reflection->getSignature('__unset', SIG_GEN_DECLARE_ONLY_THE_ARGS));
     $this->assertEqual('$key', $reflection->getSignature('__unset', SIG_GEN_INVOKE_ONLY_THE_ARGS));
     $this->assertEqual('', $reflection->getSignature('__unset', SIG_GEN_ASSIGN_ONLY_THE_ARGS));
     $this->expectError(new PatternExpectation('/Reflection does not \\(yet\\) support mode ' . SIG_GEN_ASSIGN_ONLY_THE_ARGS . ' for __unset/'));
     $this->expectError(new PatternExpectation('/Reflection does not \\(yet\\) support mode ' . SIG_GEN_ASSIGN_ONLY_THE_ARGS . ' for __unset/'));
     $this->expectError(new PatternExpectation('/Reflection does not \\(yet\\) support mode ' . SIG_GEN_ASSIGN_ONLY_THE_ARGS . ' for __unset/'));
     $this->assertEqual('function __unset($key)', $reflection->getSignature('__unset', SIG_GEN_DECLARE, array('assign' => array('arg1' => 'A10', 'arg2' => 'B20'))));
     $this->assertEqual('parent::__unset($key)', $reflection->getSignature('__unset', SIG_GEN_INVOKE_AS_PARENT, array('assign' => array('arg1' => 'A10', 'arg2' => 'B20'))));
     $this->assertEqual('', $reflection->getSignature('__unset', SIG_GEN_ASSIGN_ONLY_THE_ARGS, array('assign' => array('arg1' => 'A10', 'arg2' => 'B20'))));
     $this->assertEqual('PREFIX::$key::POSTFIX', $reflection->getSignature('__unset', SIG_GEN_DECLARE_ONLY_THE_ARGS, array('prefix' => 'PREFIX::', 'postfix' => '::POSTFIX')));
     $this->assertEqual('PREFIX::$key::POSTFIX', $reflection->getSignature('__unset', SIG_GEN_INVOKE_ONLY_THE_ARGS, array('prefix' => 'PREFIX::', 'postfix' => '::POSTFIX')));
     $this->assertEqual('', $reflection->getSignature('__unset', SIG_GEN_ASSIGN_ONLY_THE_ARGS, array('prefix' => 'PREFIX::', 'postfix' => '::POSTFIX')));
     $this->assertEqual('', $reflection->getSignature('__unset', SIG_GEN_ASSIGN_ONLY_THE_ARGS, array('assign' => array('arg1' => 'A10', 'arg2' => 'B20'), 'prefix' => 'PREFIX::', 'postfix' => '::POSTFIX')));
     $this->assertEqual('PREFIX::$key::POSTFIX', $reflection->getSignature('__unset', SIG_GEN_DECLARE_ONLY_THE_ARGS, array('assign' => array('arg1' => 'A10'), 'prefix' => 'PREFIX::', 'postfix' => '::POSTFIX')));
 }
开发者ID:GerHobbelt,项目名称:simpletest,代码行数:22,代码来源:reflection_test.php

示例6: testParameterCreationForTypeHinting

 function testParameterCreationForTypeHinting()
 {
     $reflection = new SimpleReflection('AnyOldTypeHintedClass');
     $function = $reflection->getSignature('aMethod');
     $this->assertEqual('function aMethod(SimpleTest $argument)', $function);
 }
开发者ID:sebs,项目名称:simpletest,代码行数:6,代码来源:reflection_php5_test.php


注:本文中的SimpleReflection::getSignature方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。