本文整理匯總了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()');
}
示例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);
}
}
示例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);
}
}
示例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'));
}
示例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')));
}
示例6: testParameterCreationForTypeHinting
function testParameterCreationForTypeHinting()
{
$reflection = new SimpleReflection('AnyOldTypeHintedClass');
$function = $reflection->getSignature('aMethod');
$this->assertEqual('function aMethod(SimpleTest $argument)', $function);
}