/** * @param mixed $data * @return void */ public function output($data) { if (is_array($data)) { lineOut(__METHOD__); $dataString = Arr::flatten($data); $dataString = array_unique($dataString); $dataString = implode(",", $dataString); Emitter::emit('test.output', $dataString); lineOut($dataString); } lineOut(__METHOD__ . ' - original;'); lineOut($data); }
/** * @uses $this->regex * @param mixed $data * @return array matches */ protected function get($data) { $dataExtended = $data; if (is_array($data)) { $dataExtended = implode(" ", $data); } $matches = pregMatchAll($dataExtended, $this->regex); if (is_array($matches)) { $matches = Arr::flatten($matches); } if (is_array($matches) && count($matches) === 0 && $this->outPorts['error']->isAttached()) { $this->outPorts['error']->send($matches); } Emitter::emit('regex.inout', $matches, static::class); return $matches; }
/** * @example * array<array('in')> && array<'in'> # are the same * array<[('in', 'delimiter')], ['out', 'out']> # in-delimiter port & an out-out port * * @param array $ports * @return void */ protected function addPort($port) { $portType = $this->portType($port); $portSubType = $this->portSubType($port, $portType); $this->errorTest($portType); // example `inPorts` $portTypeMethod = $portType . 'Ports'; if ($portTypeMethod !== 'inPorts' && $portTypeMethod !== 'outPorts') { return; } // able to be used in debugging Emitter::emit('flocomponent.addingPort', ['class' => static::class, $port]); // example `$this->inPorts['delimiter'] = new Port` if (isset($port[2])) { $this->{$portTypeMethod}[$portSubType] = new ExtendedFloArrayPort(); } else { $this->{$portTypeMethod}[$portSubType] = new ExtendedFloPort(); } }
/** * Initializes context. * Every scenario gets its own context object. * * @param array $params context params (behat.yml) */ public function __construct($params = []) { $this->networkFactory = new NetworkFactory(); $this->planckFactory = new PlanckFactory(); $adapter = new Local(__DIR__ . ''); $this->filesystem = new Filesystem($adapter); $this->memoryFilesystem = new Filesystem(new MemoryAdapter()); lineOut("\n<hr>___________________________________________________________________________"); OriginalAndPlanckMap::reset(); Plancks::reset(); $me = $this; Emitter::addListener('testing.output', function ($event, $param = null) use($me) { $me->output = $param; }); }
/** * @param mixed $data * @return void */ public function output($data) { lineOut(__METHOD__); lineOut($data); Emitter::emit('testing.output', $data); }