src/Processor/CollectiveProcessor.php
public function run(ProcessListener $listener, array $data)
    {
        try {
            if (empty($data)) {
                throw new Exception\InvalidArgumentException('Invalid method arguments.');
            }
            $validator = null;
            $values    = null;
            if (isset($data['cid'])) {
                $model     = MemoryTests::findOrNew($data['cid']);
                $params    = unserialize($model->value);
                $validator = new $params['validator'];
                $values    = !empty($params['controls']) ? $params['controls'] : array_get($params, 'data');
            }
            if (isset($data['validator'])) {
                $validator = new $data['validator'];
                $values    = $data;
            }
            $response = $validator($values)->getResponse();
            $return   = view('antares/tester::admin.partials._messages')->with(['response' => $response]);
        } catch (\Exception $e) {
            Log::emergency($e);
            $return = view('antares/tester::admin.partials._error')->with(['message' => $e->getMessage(), 'code' => $e->getCode()]);
        }

        return $listener->render($return);
    }
public function run(ProcessListener $listener, array $data)
    {
        try {
            if (empty($data)) {
                throw new Exception\InvalidArgumentException('Invalid method arguments.');
            }
            $validator = null;
            $values    = null;
            if (isset($data['cid'])) {
                $model     = MemoryTests::findOrNew($data['cid']);
                $params    = unserialize($model->value);
                $validator = new $params['validator'];
                $values    = !empty($params['controls']) ? $params['controls'] : array_get($params, 'data');
            }
            if (isset($data['validator'])) {
                $validator = new $data['validator'];
                $values    = $data;
            }
            $response = $validator($values)->getResponse();
            $return   = view('antares/tester::admin.partials._messages')->with(['response' => $response]);
        } catch (\Exception $e) {
            Log::emergency($e);
            $return = view('antares/tester::admin.partials._error')->with(['message' => $e->getMessage(), 'code' => $e->getCode()]);
        }

        return $listener->render($return);
    }
public function run ( ProcessListener $ listener , array $ data ) { try { if ( empty ( $ data ) ) { throw new Exception \ InvalidArgumentException ( 'Invalid method arguments.' ) ; } $ validator = null ; $ values = null ; if ( isset ( $ data [ 'cid' ] ) ) { $ model = MemoryTests :: findOrNew ( $ data [ 'cid' ] ) ; $ params = unserialize ( $ model -> value ) ; $ validator = new $ params [ 'validator' ] ; $ values = ! empty ( $ params [ 'controls' ] ) ? $ params [ 'controls' ] : array_get ( $ params , 'data' ) ; } if ( isset ( $ data [ 'validator' ] ) ) { $ validator = new $ data [ 'validator' ] ; $ values = $ data ; } $ response = $ validator ( $ values ) -> getResponse ( ) ; $ return = view ( 'antares/tester::admin.partials._messages' ) -> with ( [ 'response' => $ response ] ) ; } catch ( \ Exception $ e ) { Log :: emergency ( $ e ) ; $ return = view ( 'antares/tester::admin.partials._error' ) -> with ( [ 'message' => $ e -> getMessage ( ) , 'code' => $ e -> getCode ( ) ] ) ; } return $ listener -> render ( $ return ) ; }
run validation of partial module configuration

@param array $data
@return Illuminate\Support\Facades\Response
run validation of partial module configuration