コード例 #1
0
 /**
  * Returns this pointer bound to closure.
  *
  * @return null
  */
 public function getClosureThis()
 {
     return PHP_VERSION >= 50400 ? parent::getClosureThis() : null;
 }
コード例 #2
0
 /**
  * Returns class methods.
  *
  * @param integer $filter Methods filter
  * @return array
  */
 public function getMethods($filter = null)
 {
     if (null === $this->methods) {
         $broker = $this->broker;
         $this->methods = array_map(function (InternalReflectionMethod $method) use($broker) {
             return ReflectionMethod::create($method, $broker);
         }, parent::getMethods());
     }
     if (null === $filter) {
         return $this->methods;
     }
     return array_filter($this->methods, function (ReflectionMethod $method) use($filter) {
         return (bool) ($method->getModifiers() & $filter);
     });
 }
コード例 #3
0
 /**
  * Returns if the method is variadic.
  *
  * @return boolean
  */
 public function isVariadic()
 {
     return PHP_VERSION_ID >= 50600 ? parent::isVariadic() : null;
 }
コード例 #4
0
 /**
  * Returns class constructor reflection.
  *
  * @return \TokenReflection\Php\ReflectionClass|null
  */
 public function getConstructor()
 {
     return ReflectionMethod::create(parent::getConstructor(), $this->broker);
 }