Ejemplo n.º 1
0
 /**
  * Initializes Prophet.
  *
  * @param null|Doubler           $doubler
  * @param null|RevealerInterface $revealer
  * @param null|StringUtil        $util
  */
 public function __construct(Doubler $doubler = null, RevealerInterface $revealer = null, StringUtil $util = null)
 {
     if (null === $doubler) {
         $doubler = new Doubler();
         $doubler->registerClassPatch(new ClassPatch\SplFileInfoPatch());
         $doubler->registerClassPatch(new ClassPatch\TraversablePatch());
         $doubler->registerClassPatch(new ClassPatch\DisableConstructorPatch());
         $doubler->registerClassPatch(new ClassPatch\ProphecySubjectPatch());
         $doubler->registerClassPatch(new ClassPatch\ReflectionClassNewInstancePatch());
         $doubler->registerClassPatch(new ClassPatch\HhvmExceptionPatch());
         $doubler->registerClassPatch(new ClassPatch\MagicCallPatch());
         $doubler->registerClassPatch(new ClassPatch\KeywordPatch());
     }
     $this->doubler = $doubler;
     $this->revealer = $revealer ?: new Revealer();
     $this->util = $util ?: new StringUtil();
 }
 /**
  * {@inheritdoc}
  */
 public function registerClassPatch(ClassPatch\ClassPatchInterface $patch)
 {
     $this->classes[] = array();
     parent::registerClassPatch($patch);
 }