Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. BrokenPostRequestException.php

class BrokenPostRequestException

Defines an exception used, when the POST HTTP body is broken.

Hierarchy

  • class \Symfony\Component\HttpKernel\Exception\HttpException extends \Symfony\Component\HttpKernel\Exception\RuntimeException implements \Symfony\Component\HttpKernel\Exception\HttpExceptionInterface
    • class \Symfony\Component\HttpKernel\Exception\BadRequestHttpException extends \Symfony\Component\HttpKernel\Exception\HttpException
      • class \Drupal\Core\Form\Exception\BrokenPostRequestException extends \Symfony\Component\HttpKernel\Exception\BadRequestHttpException

Expanded class hierarchy of BrokenPostRequestException

2 files declare their use of BrokenPostRequestException
FormAjaxSubscriber.php in core/lib/Drupal/Core/Form/EventSubscriber/FormAjaxSubscriber.php
FormBuilder.php in core/lib/Drupal/Core/Form/FormBuilder.php

File

core/lib/Drupal/Core/Form/Exception/BrokenPostRequestException.php, line 12

Namespace

Drupal\Core\Form\Exception
View source
class BrokenPostRequestException extends BadRequestHttpException {
    
    /**
     * The maximum upload size.
     *
     * @var int
     */
    protected int $size;
    
    /**
     * Constructs a new BrokenPostRequestException.
     *
     * @param int $max_upload_size
     *   The size of the maximum upload size in bytes.
     * @param string $message
     *   The internal exception message.
     * @param \Exception|null $previous
     *   The previous exception.
     * @param int $code
     *   The internal exception code.
     */
    public function __construct(int $max_upload_size, string $message = '', ?\Exception $previous = NULL, int $code = 0) {
        parent::__construct($message, $previous, $code);
        $this->size = $max_upload_size;
    }
    
    /**
     * Returns the maximum upload size in bytes.
     *
     * @return int
     *   The file size limit in bytes based on the PHP upload_max_filesize and
     *   post_max_size.
     */
    public function getSize() : int {
        return $this->size;
    }

}

Members

Title Sort descending Modifiers Object type Summary Overriden Title
BrokenPostRequestException::$size protected property The maximum upload size.
BrokenPostRequestException::getSize public function Returns the maximum upload size in bytes.
BrokenPostRequestException::__construct public function Constructs a new BrokenPostRequestException. Overrides BadRequestHttpException::__construct
HttpException::fromStatusCode public static function
HttpException::getHeaders public function Returns response headers. Overrides HttpExceptionInterface::getHeaders
HttpException::getStatusCode public function Returns the status code. Overrides HttpExceptionInterface::getStatusCode
HttpException::setHeaders public function

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal