Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.x is supported too.
   1  <?php
   2  
   3  declare(strict_types=1);
   4  
   5  namespace OpenSpout\Common\Entity\Style;
   6  
   7  final class Border
   8  {
   9      public const LEFT = 'left';
  10      public const RIGHT = 'right';
  11      public const TOP = 'top';
  12      public const BOTTOM = 'bottom';
  13  
  14      public const STYLE_NONE = 'none';
  15      public const STYLE_SOLID = 'solid';
  16      public const STYLE_DASHED = 'dashed';
  17      public const STYLE_DOTTED = 'dotted';
  18      public const STYLE_DOUBLE = 'double';
  19  
  20      public const WIDTH_THIN = 'thin';
  21      public const WIDTH_MEDIUM = 'medium';
  22      public const WIDTH_THICK = 'thick';
  23  
  24      /** @var array<string, BorderPart> */
  25      private array $parts;
  26  
  27      public function __construct(BorderPart ...$borderParts)
  28      {
  29          foreach ($borderParts as $borderPart) {
  30              $this->parts[$borderPart->getName()] = $borderPart;
  31          }
  32      }
  33  
  34      public function getPart(string $name): ?BorderPart
  35      {
  36          return $this->parts[$name] ?? null;
  37      }
  38  
  39      /**
  40       * @return array<string, BorderPart>
  41       */
  42      public function getParts(): array
  43      {
  44          return $this->parts;
  45      }
  46  }