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.
   1  <?php
   2  
   3  namespace Box\Spout\Writer\Common\Manager;
   4  
   5  use Box\Spout\Common\Entity\Cell;
   6  use Box\Spout\Common\Entity\Style\Style;
   7  use Box\Spout\Writer\Common\Manager\Style\StyleMerger;
   8  
   9  class CellManager
  10  {
  11      /**
  12       * @var StyleMerger
  13       */
  14      protected $styleMerger;
  15  
  16      /**
  17       * @param StyleMerger $styleMerger
  18       */
  19      public function __construct(StyleMerger $styleMerger)
  20      {
  21          $this->styleMerger = $styleMerger;
  22      }
  23  
  24      /**
  25       * Merges a Style into a cell's Style.
  26       *
  27       * @param Cell $cell
  28       * @param Style $style
  29       * @return void
  30       */
  31      public function applyStyle(Cell $cell, Style $style)
  32      {
  33          $mergedStyle = $this->styleMerger->merge($cell->getStyle(), $style);
  34          $cell->setStyle($mergedStyle);
  35      }
  36  }