protected function checkExistingCustomerBasket($customerId)
    {
        $basket = $this->basketManager->findOneBy(['customer' => $customerId]);
        if ($basket instanceof BasketInterface) {
            throw new HttpException(400, sprintf('Customer (%d) already has a basket', $customerId));
        }
    }
protected function checkExistingCustomerBasket($customerId)
    {
        $basket = $this->basketManager->findOneBy(['customer' => $customerId]);
        if ($basket instanceof BasketInterface) {
            throw new HttpException(400, sprintf('Customer (%d) already has a basket', $customerId));
        }
    }
protected function checkExistingCustomerBasket ( $ customerId ) { $ basket = $ this -> basketManager -> findOneBy ( [ 'customer' => $ customerId ] ) ; if ( $ basket instanceof BasketInterface ) { throw new HttpException ( 400 , sprintf ( 'Customer (%d) already has a basket' , $ customerId ) ) ; } }
Throws an exception if it already exists a basket with a specific customer id.

@param $customerId

@throws \Symfony\Component\HttpKernel\Exception\HttpException
Throws an exception if it already exists a basket with a specific customer id .