Controller/CartController.php
protected function validateStep($step)
    {
        $stepGroups = [
            'information' => ['ekyna_cart_index',        ['Default', 'Cart']],
            'shipment'    => ['ekyna_cart_informations', ['Default', 'Cart', 'Information']],
            'payment'     => ['ekyna_cart_shipment',     ['Default', 'Cart', 'Information', 'Shipment']],
        ];
        if (!array_key_exists($step, $stepGroups)) {
            throw new \InvalidArgumentException(sprintf('Undefined step "%s".', $step));
        }

        $cart = $this->getCart();
        $errorList = $this->get('validator')->validate($cart, $stepGroups[$step][1]);
        if (0 != $errorList->count()) {
            return $this->redirect($this->generateUrl($stepGroups[$step][0]));
        }

        return null;
    }
protected function validateStep($step)
    {
        $stepGroups = [
            'information' => ['ekyna_cart_index',        ['Default', 'Cart']],
            'shipment'    => ['ekyna_cart_informations', ['Default', 'Cart', 'Information']],
            'payment'     => ['ekyna_cart_shipment',     ['Default', 'Cart', 'Information', 'Shipment']],
        ];
        if (!array_key_exists($step, $stepGroups)) {
            throw new \InvalidArgumentException(sprintf('Undefined step "%s".', $step));
        }

        $cart = $this->getCart();
        $errorList = $this->get('validator')->validate($cart, $stepGroups[$step][1]);
        if (0 != $errorList->count()) {
            return $this->redirect($this->generateUrl($stepGroups[$step][0]));
        }

        return null;
    }
protected function validateStep ( $ step ) { $ stepGroups = [ 'information' => [ 'ekyna_cart_index' , [ 'Default' , 'Cart' ] ] , 'shipment' => [ 'ekyna_cart_informations' , [ 'Default' , 'Cart' , 'Information' ] ] , 'payment' => [ 'ekyna_cart_shipment' , [ 'Default' , 'Cart' , 'Information' , 'Shipment' ] ] , ] ; if ( ! array_key_exists ( $ step , $ stepGroups ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Undefined step "%s".' , $ step ) ) ; } $ cart = $ this -> getCart ( ) ; $ errorList = $ this -> get ( 'validator' ) -> validate ( $ cart , $ stepGroups [ $ step ] [ 1 ] ) ; if ( 0 != $ errorList -> count ( ) ) { return $ this -> redirect ( $ this -> generateUrl ( $ stepGroups [ $ step ] [ 0 ] ) ) ; } return null ; }
Validates the cart for the given step name.

@param string $step
@return null|\Symfony\Component\HttpFoundation\RedirectResponse
Validates the cart for the given step name .