本文整理汇总了PHP中ReflectionParameter::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ReflectionParameter::__construct方法的具体用法?PHP ReflectionParameter::__construct怎么用?PHP ReflectionParameter::__construct使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReflectionParameter
的用法示例。
在下文中一共展示了ReflectionParameter::__construct方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param string $function this is the first argument of the original `\ReflectionParameter::__construct()`
* @param string $parameter this is the second argument of the original `\ReflectionParameter::__construct()`
* @param mixed $value the user value of the parameter
* @throws \Exception caught from parent constructor
*/
public function __construct($function, $parameter, $value)
{
try {
parent::__construct($function, $parameter);
} catch (\Exception $e) {
throw $e;
}
$this->value = $value;
$this->type = gettype($value);
}
示例2: __construct
/**
* Constructor
*
* If called with a ReflectionParameter instance as second argument the,
* first argument should be a string identifying the type of the parameter.
* @param string|array<integer,string|object> $functionOrMethod
* The function, method or type of the parameter given as function
* name, array($classname, $method), or array($object, $method)
* @param integer|string|ReflectionParameter $parameter
* Position (starting at 0), name, or ReflectionParameter instance
* of the parameter to introspect.
* @param string $type
* Type of the parameter given in form of the type name.
* @throws ReflectionException
* in case the given method or function does not exist.
*/
public function __construct($functionOrMethod, $parameterPositionNameOrSource, $type = null)
{
if ($parameterPositionNameOrSource instanceof parent) {
$this->parameter = $parameterPositionNameOrSource;
// source
$this->reflectionSource = $parameterPositionNameOrSource;
} else {
parent::__construct($functionOrMethod, $parameterPositionNameOrSource);
}
$this->type = ezcReflection::getTypeByName($type);
}
示例3: __construct
/**
* Constructor.
*
* @param string|array $function Defining function/method
* @param string $paramName Parameter name
* @param \TokenReflection\Broker $broker Reflection broker
* @param \ReflectionFunctionAbstract $parent Parent reflection object
*/
public function __construct($function, $paramName, Broker $broker, InternalReflectionFunctionAbstract $parent)
{
parent::__construct($function, $paramName);
$this->broker = $broker;
$this->userDefined = $parent->isUserDefined();
}
示例4: __construct
public function __construct($function, $parameter)
{
parent::__construct($this->function = $function, $parameter);
}
示例5: __construct
/**
* The constructor, initializes the reflection parameter
*
* @param string $functionName: Name of the function
* @param string $propertyName: Name of the property to reflect
* @return void
*/
public function __construct($function, $parameterName)
{
parent::__construct($function, $parameterName);
}
示例6:
extends\ReflectionParameter{private$function;function
__construct($function,$parameter){parent::__construct($this->function=$function,$parameter);}function
示例7: __construct
/**
* Constructor
*
* @param string $function Name of the function to reflect parameters from
* @param string $parameter The name of the parameter
* @access public
* @return void
*/
public function __construct($function, $parameter)
{
parent::__construct($function, $parameter);
$parser = new AnnotationParser($this->getDocComment());
$this->annotations = $parser->getAnnotationArray();
}
示例8: __construct
public function __construct(Method $method, $parameter, Reflection $reflection)
{
parent::__construct([$method->class, $method->name], $parameter);
$this->method = $method;
$this->reflection = $reflection;
}