Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.

Differences Between: [Versions 310 and 311] [Versions 39 and 311]

   1  <?php
   2  
   3  /**
   4   * This file is part of FPDI
   5   *
   6   * @package   setasign\Fpdi
   7   * @copyright Copyright (c) 2020 Setasign GmbH & Co. KG (https://www.setasign.com)
   8   * @license   http://opensource.org/licenses/mit-license The MIT License
   9   */
  10  
  11  namespace setasign\Fpdi\PdfParser\Type;
  12  
  13  /**
  14   * Class representing a boolean PDF object
  15   */
  16  class PdfBoolean extends PdfType
  17  {
  18      /**
  19       * Helper method to create an instance.
  20       *
  21       * @param bool $value
  22       * @return self
  23       */
  24      public static function create($value)
  25      {
  26          $v = new self();
  27          $v->value = (bool) $value;
  28          return $v;
  29      }
  30  
  31      /**
  32       * Ensures that the passed value is a PdfBoolean instance.
  33       *
  34       * @param mixed $value
  35       * @return self
  36       * @throws PdfTypeException
  37       */
  38      public static function ensure($value)
  39      {
  40          return PdfType::ensureType(self::class, $value, 'Boolean value expected.');
  41      }
  42  }