src/Controller/ConfigurationController.php
public function changeNodeNameAction()
    {
        $nodeName = $this->bodyParam('node_name');

        if (! is_string($nodeName) || strlen($nodeName) < 3) {
            return new ApiProblemResponse(new ApiProblem(422, $this->translator->translate('The node name must be at least 3 characters long')));
        }

        $this->commandBus->dispatch(ChangeNodeName::to(
            NodeName::fromString($nodeName),
            ConfigLocation::fromPath(Definition::getSystemConfigDir())
        ));

        return ['success' => true];
    }
public function changeNodeNameAction()
    {
        $nodeName = $this->bodyParam('node_name');

        if (! is_string($nodeName) || strlen($nodeName) < 3) {
            return new ApiProblemResponse(new ApiProblem(422, $this->translator->translate('The node name must be at least 3 characters long')));
        }

        $this->commandBus->dispatch(ChangeNodeName::to(
            NodeName::fromString($nodeName),
            ConfigLocation::fromPath(Definition::getSystemConfigDir())
        ));

        return ['success' => true];
    }
public function changeNodeNameAction ( ) { $ nodeName = $ this -> bodyParam ( 'node_name' ) ; if ( ! is_string ( $ nodeName ) || strlen ( $ nodeName ) < 3 ) { return new ApiProblemResponse ( new ApiProblem ( 422 , $ this -> translator -> translate ( 'The node name must be at least 3 characters long' ) ) ) ; } $ this -> commandBus -> dispatch ( ChangeNodeName :: to ( NodeName :: fromString ( $ nodeName ) , ConfigLocation :: fromPath ( Definition :: getSystemConfigDir ( ) ) ) ) ; return [ 'success' => true ] ; }
Handles a POST request that want to change the node name
Handles a POST request that want to change the node name