src/Controller/ConfigurationController.php
public function configureJavascriptTickerAction()
    {
        $tickerEnabled = $this->bodyParam('enabled');
        $tickerInterval = $this->bodyParam('interval');

        if (! is_bool($tickerEnabled)) {
            return new ApiProblemResponse(new ApiProblem(422, $this->translator->translate('The enabled flag should be a boolean value')));
        }

        if (! is_int($tickerInterval) || $tickerInterval <= 0) {
            return new ApiProblemResponse(new ApiProblem(422, $this->translator->translate('The ticker interval should greater than zero')));
        }

        $this->commandBus->dispatch(
            ConfigureJavascriptTicker::set(
                $tickerEnabled,
                $tickerInterval,
                ConfigLocation::fromPath(Definition::getSystemConfigDir())
            )
        );

        return ['success' => true];
    }
public function configureJavascriptTickerAction()
    {
        $tickerEnabled = $this->bodyParam('enabled');
        $tickerInterval = $this->bodyParam('interval');

        if (! is_bool($tickerEnabled)) {
            return new ApiProblemResponse(new ApiProblem(422, $this->translator->translate('The enabled flag should be a boolean value')));
        }

        if (! is_int($tickerInterval) || $tickerInterval <= 0) {
            return new ApiProblemResponse(new ApiProblem(422, $this->translator->translate('The ticker interval should greater than zero')));
        }

        $this->commandBus->dispatch(
            ConfigureJavascriptTicker::set(
                $tickerEnabled,
                $tickerInterval,
                ConfigLocation::fromPath(Definition::getSystemConfigDir())
            )
        );

        return ['success' => true];
    }
public function configureJavascriptTickerAction ( ) { $ tickerEnabled = $ this -> bodyParam ( 'enabled' ) ; $ tickerInterval = $ this -> bodyParam ( 'interval' ) ; if ( ! is_bool ( $ tickerEnabled ) ) { return new ApiProblemResponse ( new ApiProblem ( 422 , $ this -> translator -> translate ( 'The enabled flag should be a boolean value' ) ) ) ; } if ( ! is_int ( $ tickerInterval ) || $ tickerInterval <= 0 ) { return new ApiProblemResponse ( new ApiProblem ( 422 , $ this -> translator -> translate ( 'The ticker interval should greater than zero' ) ) ) ; } $ this -> commandBus -> dispatch ( ConfigureJavascriptTicker :: set ( $ tickerEnabled , $ tickerInterval , ConfigLocation :: fromPath ( Definition :: getSystemConfigDir ( ) ) ) ) ; return [ 'success' => true ] ; }
Handles a POST request to configure the javascript ticker
Handles a POST request to configure the javascript ticker