/**
  * 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;
     }
 }
 /**
  * @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());
     }
 }
Beispiel #3
0
 /**
  * @param mixed $argument
  * @param IMapper|null $mapper
  */
 public function __construct($argument, IMapper $mapper = null)
 {
     parent::__construct($argument);
     $this->mapper = $mapper;
     $this->parseProperties();
     $this->initGettersAndSetters();
 }
 /**
  * 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);
 }
 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;
     }
 }
Beispiel #6
0
 /**
  * [__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();
 }
 /**
  * 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);
 }
Beispiel #8
0
	/**
	 * 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;
		}
	}
 public function __construct($object)
 {
     if (!is_object($object)) {
         throw new \InvalidArgumentException(sprintf('Expected "object", got "%s".', gettype($object)));
     }
     parent::__construct($object);
     $this->object = $object;
 }
 public function __construct($class)
 {
     parent::__construct($class);
     $this->annotations = array();
     $this->annotations["class"] = array();
     $this->annotations["properties"] = array();
     $this->extractAnnotations();
 }
Beispiel #11
0
 /**
  * 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, '\\', '/')), '/');
 }
Beispiel #12
0
 /**
  * __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()];
 }
Beispiel #13
0
 /**
  * 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;
 }
Beispiel #14
0
 /**
  * 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());
 }
Beispiel #15
0
 /**
  * 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();
 }
Beispiel #16
0
 public function __construct($class)
 {
     if (self::$adapterClass !== null) {
         $this->adapter = new self::$adapterClass($class);
     } elseif ($class instanceof OriginReflectionClass) {
         $this->adapter = $class;
         self::$adapterClass = get_class($class);
     } else {
         parent::__construct($class);
     }
 }
 /**
  * @param mixed $classNameOrObject the name of the class or the object to be reflected.
  * @throws Exception\ClassLoadingForReflectionFailedException
  */
 public function __construct($classNameOrObject)
 {
     $throwExceptionOnUnloadedClasses = function ($className) {
         throw new Exception\ClassLoadingForReflectionFailedException(sprintf('Required class "%s" could not be loaded properly for reflection.%2$s%2$sPossible reasons are:%2$s%2$s * Requiring non-existent classes%2$s * Using non-supported annotations%2$s * Class-/filename missmatch.%2$s%2$sThe "TYPO3.Flow.object.excludeClasses" setting can be used to skip classes from being reflected.', $className, chr(10)));
     };
     spl_autoload_register($throwExceptionOnUnloadedClasses);
     try {
         parent::__construct($classNameOrObject);
     } catch (Exception\ClassLoadingForReflectionFailedException $exception) {
         spl_autoload_unregister($throwExceptionOnUnloadedClasses);
         throw $exception;
     }
     spl_autoload_unregister($throwExceptionOnUnloadedClasses);
 }
 /**
  * Constructor
  *
  * @param mixed $classNameOrObject the name of the class or the object to be reflected.
  * @throws \TYPO3\Flow\Reflection\Exception\ClassLoadingForReflectionFailedException
  */
 public function __construct($classNameOrObject)
 {
     $throwExceptionOnUnloadedClasses = function ($className) {
         throw new Exception\ClassLoadingForReflectionFailedException('Required class "' . $className . '" could not be loaded properly for reflection, possibly requiring non-existent classes or using non-supported annotations.');
     };
     spl_autoload_register($throwExceptionOnUnloadedClasses);
     try {
         parent::__construct($classNameOrObject);
     } catch (\TYPO3\Flow\Reflection\Exception\ClassLoadingForReflectionFailedException $exception) {
         spl_autoload_unregister($throwExceptionOnUnloadedClasses);
         throw $exception;
     }
     spl_autoload_unregister($throwExceptionOnUnloadedClasses);
 }
 /**
  * Constructs a new ReflectionClass.
  *
  * @param string $classname
  *   The fully-qualified class name (FQCN) to reflect.
  * @param string $pathname
  *   The pathname of the file containing $classname. If omitted, a native
  *   \ReflectionClass will be instantiated.
  *
  * @throws \ReflectionException
  *   If the given $classname is not located in the given $pathname, or if
  *   $pathname does not exist.
  */
 public function __construct($classname, $pathname = NULL)
 {
     // If the pathname is unknown, it must be retrieved from \ReflectionClass.
     // If a class instance was passed then there's no point in omitting
     // \ReflectionClass, since code has been loaded already.
     if (!isset($pathname) || !is_string($classname)) {
         parent::__construct($classname);
         $this->classname = is_object($classname) ? get_class($classname) : $classname;
         $this->pathname = parent::getFileName();
     } else {
         $this->classname = $classname;
         $this->pathname = $pathname;
     }
     // Instantiating \ReflectionClass immediately triggers reflection; resemble
     // that.
     $this->info = $this->reflect();
 }
Beispiel #20
0
 /**
  * Return new ReflectionClass object
  * @param string|object $argument
  */
 public function __construct($argument)
 {
     parent::__construct($argument);
     $this->klass = $argument;
 }
 public function __construct($class)
 {
     parent::__construct($class);
     $this->annotations = $this->createAnnotationBuilder()->build($this);
 }
Beispiel #22
0
 public function __construct($class)
 {
     parent::__construct($class);
     $this->annotations = $this->createParser()->parse(AddendumCompatibility::getDocComment($this));
 }
Beispiel #23
0
 public function __construct($name)
 {
     parent::__construct($name);
 }
 /**
  * Constructor.
  *
  * @param string $className Class name
  * @param \TokenReflection\Broker $broker Reflection broker
  */
 public function __construct($className, Broker $broker)
 {
     parent::__construct($className);
     $this->broker = $broker;
 }
 /**
  * Implementation of internal reflection initialization
  *
  * @return void
  */
 protected function __initialize()
 {
     parent::__construct($this->getName());
 }
	    function __construct($name, $args = array())
	    {
	        parent::__construct($name);
	        $this->ConstructorArgs = $args;
	    }
Beispiel #27
0
 /**
  * Initializes the timed object with the passed data.
  *
  * @param object $object              The object to create the reflection object for
  * @param array  $annotationsToIgnore An array with annotations names we want to ignore when loaded
  * @param array  $annotationAliases   An array with annotation aliases used when create annotation instances
  */
 public function __construct($object, array $annotationsToIgnore = array(), array $annotationAliases = array())
 {
     parent::__construct(get_class($object), $annotationsToIgnore, $annotationAliases);
 }
 /**
  * Constructor
  *
  * sets the class name and calls the constructor of the reflectionClass
  *
  * @param string The class name
  * @return void
  */
 public function __construct($classname)
 {
     parent::__construct($classname);
     $this->classname = $classname;
     $this->parseComment();
 }
 /**
  * Constructor
  *
  * @param mixed $class Either a string containing the name of the class to reflect, or an object.
  * @access public
  * @return void
  */
 public function __construct($object)
 {
     parent::__construct($object);
     $parser = new AnnotationParser($this->getDocComment());
     $this->annotations = $parser->getAnnotationArray();
 }
Beispiel #30
0
 /**
  * Constructor
  *
  * Instantiate the code reflection object
  *
  * @param  string  $code
  * @return \Pop\Code\Reflection
  */
 public function __construct($code)
 {
     $this->code = $code;
     parent::__construct($code);
     $this->buildGenerator();
 }