You are here

private function ClassMirror::reflectClassToNode in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php \Prophecy\Doubler\Generator\ClassMirror::reflectClassToNode()
1 call to ClassMirror::reflectClassToNode()
ClassMirror::reflect in vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php
Reflects provided arguments into class node.

File

vendor/phpspec/prophecy/src/Prophecy/Doubler/Generator/ClassMirror.php, line 87

Class

ClassMirror
Class mirror. Core doubler class. Mirrors specific class and/or interfaces into class node tree.

Namespace

Prophecy\Doubler\Generator

Code

private function reflectClassToNode(ReflectionClass $class, Node\ClassNode $node) {
  if (true === $class
    ->isFinal()) {
    throw new ClassMirrorException(sprintf('Could not reflect class %s as it is marked final.', $class
      ->getName()), $class);
  }
  $node
    ->setParentClass($class
    ->getName());
  foreach ($class
    ->getMethods(ReflectionMethod::IS_ABSTRACT) as $method) {
    if (false === $method
      ->isProtected()) {
      continue;
    }
    $this
      ->reflectMethodToNode($method, $node);
  }
  foreach ($class
    ->getMethods(ReflectionMethod::IS_PUBLIC) as $method) {
    if (0 === strpos($method
      ->getName(), '_') && !in_array($method
      ->getName(), self::$reflectableMethods)) {
      continue;
    }
    if (true === $method
      ->isFinal()) {
      continue;
    }
    $this
      ->reflectMethodToNode($method, $node);
  }
}