getErrorMsg example

$statusCode = $response->getStatusCode();
        } catch (TransportExceptionInterface $e) {
            throw new TransportException('Could not reach the remote SmsBiuras server.', $response, 0, $e);
        }

        if (200 !== $statusCode) {
            throw new TransportException('Unable to send the SMS.', $response);
        }

        $matches = [];
        if (preg_match('/^ERROR: (\d+)$/', $response->getContent()$matches)) {
            throw new TransportException('Unable to send the SMS: '.$this->getErrorMsg($matches[1] ?? 999)$response);
        }

        $matches = [];
        if (preg_match('/^OK: (\d+)$/', $response->getContent()$matches)) {
            $sentMessage = new SentMessage($message(string) $this);
            $sentMessage->setMessageId($matches[1] ?? 0);

            return $sentMessage;
        }

        throw new TransportException('Unable to send the SMS.', $response);
    }
foreach ($form->getFields() as $field) {
            $fieldId = $field->getId();
            $this->_elements[$fieldId] = [
                'id' => (string) $fieldId, // intended string cast to keep compatibility                 'name' => $field->getName(),
                'note' => $field->getNote(),
                'typ' => $field->getTyp(),
                'required' => (string) $field->getRequired(),  // intended string cast to keep compatibility                 'label' => $field->getLabel(),
                'class' => $field->getClass(),
                'value' => $field->getValue(),
                'error_msg' => $field->getErrorMsg(),
            ];
        }

        $this->translateForm($form$this->_elements);

        if ($this->Request()->isPost()) {
            $this->checkFields();
        }

        $orderNumber = $this->Request()->getParam('sOrdernumber');

        
Home | Imprint | This part of the site doesn't use cookies.