當前位置: 首頁>>代碼示例>>PHP>>正文


PHP ReflectionClass::__construct方法代碼示例

本文整理匯總了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;
     }
 }
開發者ID:tonirenner,項目名稱:entity-service,代碼行數:18,代碼來源:ReflectionClass.php

示例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());
     }
 }
開發者ID:cawaphp,項目名稱:module-swagger-server,代碼行數:12,代碼來源:Model.php

示例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();
 }
開發者ID:tharos,項目名稱:leanmapper,代碼行數:11,代碼來源:EntityReflection.php

示例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);
 }
開發者ID:bozerkins,項目名稱:octo-broccoli-json-reflector,代碼行數:12,代碼來源:ReflectionRegistration.php

示例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;
     }
 }
開發者ID:nicolas-grekas,項目名稱:Patchwork-sandbox,代碼行數:25,代碼來源:ReflectionClass.php

示例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();
 }
開發者ID:shgysk8zer0,項目名稱:core,代碼行數:11,代碼來源:unit_test.php

示例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);
 }
開發者ID:mseshachalam,項目名稱:reflection,代碼行數:15,代碼來源:ReflectionClass.php

示例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;
		}
	}
開發者ID:nyroDev,項目名稱:nyroFwk,代碼行數:14,代碼來源:nReflection.class.php

示例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;
 }
開發者ID:YepFoundation,項目名稱:reflection,代碼行數:8,代碼來源:ReflectionClass.php

示例10: __construct

 public function __construct($class)
 {
     parent::__construct($class);
     $this->annotations = array();
     $this->annotations["class"] = array();
     $this->annotations["properties"] = array();
     $this->extractAnnotations();
 }
開發者ID:BGCX067,項目名稱:fajax-svn-to-git,代碼行數:8,代碼來源:class.AnnotationClass.php

示例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, '\\', '/')), '/');
 }
開發者ID:darsyn,項目名稱:class-finder,代碼行數:15,代碼來源:ReflectionClass.php

示例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()];
 }
開發者ID:Primetron,項目名稱:Edusoft,代碼行數:15,代碼來源:BulkSMS.php

示例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;
 }
開發者ID:jstewmc,項目名稱:refraction,代碼行數:17,代碼來源:RefractionClass.php

示例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());
 }
開發者ID:zetacomponents,項目名稱:reflection,代碼行數:18,代碼來源:class.php

示例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();
 }
開發者ID:Nnadozieomeonu,項目名稱:lacecart,代碼行數:19,代碼來源:Reflection.php


注:本文中的ReflectionClass::__construct方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。