/** * @inheritDoc */ public function addPropertyGhost(string $property, string $objectType, array $params = []) : Ghost { $params['objectType'] = $objectType; $ghost = DefaultGraphedGhost::build($params); $this->addProperty($property, $ghost); return $ghost; }
/** * @inheritDoc */ public static function build(array $params) : Ghost { $ghost = parent::build($params); /** @var MethodTestGhost $ghost */ $ghost->addProperty('testedMethod', $params['testedMethod']); $ghost->addProperty('sample', DefaultGraphedGhost::build($params['sample'])); return $ghost; }
/** * @inheritDoc */ public static function build(array $params) : Ghost { /** @var TestGhost $testGhost */ $testGhost = parent::build($params); $setPoints = $testGhost->addPropertyGhost('setPoints', SetPointCollection::class); $testGhost->addPropertyGhost('box', MethodBox::class); if (isset($params['setPoints'])) { foreach ($params['setPoints'] as $setPointParams) { $setPointClass = $setPointParams['type']; $setPoint = $setPoints->addPropertyGhost('setPoints', $setPointClass, [], DefaultGhost::class); $setPoint->addProperty('monitoredData', $setPointParams['monitoredData']); $setPoint->addProperty('name', $setPointParams['name']); } } if (isset($params['generator'])) { $generatorGhost = $testGhost->addPropertyGhost('generator', $params['generator']['type']); $generatorGhost->addProperty('data', $params['generator']['data']); } $testGhost->addProperty('name', $params['name']); return $testGhost; }