本文整理汇总了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);
}