Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 4.1.x will end 13 November 2023 (12 months).
  • Bug fixes for security issues in 4.1.x will end 10 November 2025 (36 months).
  • PHP version: minimum PHP 7.4.0 Note: minimum PHP version has increased since Moodle 4.0. PHP 8.0.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  }