Example #1
0
 /**
  * Get the static instance of this generator.
  *
  * @return MockGenerator The static generator.
  */
 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new self(Sequencer::sequence('mock-class-label'), FunctionSignatureInspector::instance(), FeatureDetector::instance());
     }
     return self::$instance;
 }
Example #2
0
 /**
  * Get the static instance of this manager.
  *
  * @return FunctionHookManager The static manager.
  */
 public static function instance()
 {
     if (!self::$instance) {
         self::$instance = new self(FunctionSignatureInspector::instance(), FunctionHookGenerator::instance());
     }
     return self::$instance;
 }
 /**
  * Construct a new function signature inspector.
  *
  * @param InvocableInspector $invocableInspector The invocable inspector to use.
  * @param FeatureDetector    $featureDetector    The feature detector to use.
  */
 public function __construct(InvocableInspector $invocableInspector, FeatureDetector $featureDetector)
 {
     parent::__construct($invocableInspector);
     $this->isExportReferenceSupported = $featureDetector->isSupported('reflection.function.export.reference');
     $this->isVariadicParameterSupported = $featureDetector->isSupported('parameter.variadic');
     $this->isScalarTypeHintSupported = $featureDetector->isSupported('parameter.hint.scalar');
     $this->isCallableTypeHintSupported = $featureDetector->isSupported('type.callable');
     $this->isIterableTypeHintSupported = $featureDetector->isSupported('type.iterable');
 }
 /**
  * Construct a new function signature inspector.
  *
  * @param InvocableInspector $invocableInspector The invocable inspector to use.
  * @param FeatureDetector    $featureDetector    The feature detector to use.
  */
 public function __construct(InvocableInspector $invocableInspector, FeatureDetector $featureDetector)
 {
     parent::__construct($invocableInspector);
     $this->isVariadicParameterSupported = $featureDetector->isSupported('parameter.variadic');
     $this->isIterableTypeHintSupported = $featureDetector->isSupported('type.iterable');
 }