本文整理汇总了PHP中ReflectionClass::__construct方法的典型用法代码示例。如果您正苦于以下问题:PHP ReflectionClass::__construct方法的具体用法?PHP ReflectionClass::__construct怎么用?PHP ReflectionClass::__construct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ReflectionClass
的用法示例。
在下文中一共展示了ReflectionClass::__construct方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* Constructs a ReflectionClass
* @link http://php.net/manual/en/reflectionclass.construct.php
*
* @param mixed $argument <p>
* Either a string containing the name of the class to
* reflect, or an object.
* </p>
*
* @since 5.0
*/
public function __construct($argument)
{
parent::__construct($argument);
foreach ($this->getProperties() as $property) {
$this->propertyMap[$property->getName()] = $property;
}
}
示例2: __construct
/**
* @param mixed $class
*
* @throws \LogicException
*/
public function __construct($class)
{
parent::__construct($class);
foreach ($this->getProperties(\ReflectionProperty::IS_PUBLIC) as $reflectionProperty) {
$this->definitions[$reflectionProperty->getName()] = new Property($class, $reflectionProperty->getDocComment());
}
}
示例3: __construct
/**
* @param mixed $argument
* @param IMapper|null $mapper
*/
public function __construct($argument, IMapper $mapper = null)
{
parent::__construct($argument);
$this->mapper = $mapper;
$this->parseProperties();
$this->initGettersAndSetters();
}
示例4: __construct
/**
* ReflectionRegistration constructor.
* @param mixed $argument
* @throws InvalidRegistrationException
*/
public function __construct($argument)
{
if (!is_subclass_of($argument, '\\OctoBroccoli\\ReflectionVariable\\ReflectionVariableInterface')) {
throw new InvalidRegistrationException();
}
parent::__construct($argument);
}
示例5: strrpos
function __construct($class)
{
is_string($class) && \Patchwork\Superloader::exists($class, false);
// Do a lightweigh autoload
parent::__construct($class);
if (false !== ($parent = parent::getParentClass())) {
$p = $parent->name;
$top = $this->name;
$i = strrpos($top, '__');
if (false !== $i && isset($top[$i + 2]) && '' === trim(substr($top, $i + 2), '0123456789')) {
$this->isTop = false;
$top = substr($top, 0, $i);
}
$top .= '__';
$i = strlen($top);
while (isset($p[$i]) && $top === rtrim($p, '0123456789')) {
$this->superStack[] = $parent;
if (false === ($parent = $parent->getParentClass())) {
break;
}
$p = $parent->name;
}
$this->superParent = $parent;
}
}
示例6: __construct
/**
* [__construct description]
* @param [type] $testsClass [description]
*/
public function __construct($testsClass, array $constructor_args = null)
{
$this->forceCLI();
parent::__construct($testsClass);
$this->constructor_args = $constructor_args;
$this->init();
}
示例7: __construct
/**
* Constructs a new ReflectionClass object.
*
* @param string|object $class
* @throws ReflectionException
* @return ReflectionClass
*/
public final function __construct($class)
{
$bt = debug_backtrace();
if (!isset($bt[1]['class']) || $bt[1]['class'] !== __CLASS__) {
throw new ReflectionException('ReflectionClass\' constructor cannot be called from outside the class');
}
parent::__construct($class);
}
示例8: rebuild
/**
* Change the present class to be able to use reflection on it.
*
* @param string $name
* @return bool True if success
*/
public function rebuild($name) {
try {
parent::__construct($name);
return true;
} catch(Exception $e) {
return false;
}
}
示例9: __construct
public function __construct($object)
{
if (!is_object($object)) {
throw new \InvalidArgumentException(sprintf('Expected "object", got "%s".', gettype($object)));
}
parent::__construct($object);
$this->object = $object;
}
示例10: __construct
public function __construct($class)
{
parent::__construct($class);
$this->annotations = array();
$this->annotations["class"] = array();
$this->annotations["properties"] = array();
$this->extractAnnotations();
}
示例11: __construct
/**
* Constructor
*
* @access public
* @param mixed $class
* @param string $relative
*/
public function __construct($class, $relative)
{
parent::__construct($class);
if (!is_string($relative)) {
throw new \InvalidArgumentException('The second parameter specifying the relative position of the class must be a string.');
}
$this->relative = trim(preg_replace('#/{2,}#', '/', strtr($relative, '\\', '/')), '/');
}
示例12: __construct
/**
* __construct(\Zend\ServiceManager\ServiceManager $ServiceManager)
* @param \Zend\ServiceManager\ServiceManager $ServiceManager
* @return instance of ServiceManager, Provider Configuration
*
*/
public function __construct(\Zend\ServiceManager\ServiceManager $ServiceManager)
{
parent::__construct(__CLASS__);
// set ServiceManager throught constructor
if (null === $this->_sm) {
$this->_sm = $ServiceManager;
}
$this->__config = $this->_sm->get('Config')["Submissions\\Provider\\Config"][$this->getShortName()];
}
示例13: __construct
/**
* Called when the object is constructed
*
* @param object $instance the instance to refract
* @return self
* @throws InvalidArgumentException if $instance is not an object
* @since 0.1.0
*/
public function __construct($instance)
{
if (!is_object($instance)) {
throw new \InvalidArgumentException(__METHOD__ . "() expects parameter one, instance, to be an object");
}
parent::__construct($instance);
$this->instance = $instance;
return;
}
示例14: __construct
/**
* Constructs a new ezcReflectionClass object.
*
* @param string|object|ReflectionClass $argument
* Name, instance or ReflectionClass object of the class to be
* reflected
* @throws ReflectionException if the specified class doesn't exist
*/
public function __construct($argument)
{
if (!$argument instanceof parent) {
parent::__construct($argument);
}
$this->reflectionSource = $argument;
// TODO: Parse comment on demand to save CPU time and memory
$this->docParser = ezcReflection::getDocCommentParser();
$this->docParser->parse($this->getDocComment());
}
示例15: __construct
/**
* Constructor
*
* Instantiate the code reflection object
*
* @param mixed $class
* @return Reflection
*/
public function __construct($class)
{
if (is_string($class)) {
$this->classString = $class;
} else {
$this->objectInstance = $class;
$this->classString = get_class($class);
}
parent::__construct($class);
$this->buildGenerator();
}