當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。