-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
76 changed files
with
6,203 additions
and
2,686 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Data/Annotation/ColumnDimension.php → Annotation/ColumnDimension.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Data/Annotation/ColumnsAutoResize.php → Annotation/ColumnsAutoResize.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Data/Annotation/ContentStyle.php → Annotation/ContentStyle.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
Data/Annotation/GroupBorderStyle.php → Annotation/GroupBorderStyle.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace RichId\ExcelGeneratorBundle\Builder\Partials; | ||
|
||
use Symfony\Contracts\EventDispatcher\EventDispatcherInterface; | ||
|
||
/** | ||
* Class AbstractBuilder | ||
* | ||
* @package RichId\ExcelGeneratorBundle\Builder\Partials | ||
* @author Nicolas Guilloux <nicolas.guilloux@rich-id.fr> | ||
* @copyright 2014 - 2021 Rich ID (https://www.rich-id.fr) | ||
*/ | ||
abstract class AbstractBuilder | ||
{ | ||
/** @var EventDispatcherInterface */ | ||
protected $eventDispatcher; | ||
|
||
/** | ||
* @required | ||
*/ | ||
public function initAbstractBuilder(EventDispatcherInterface $eventDispatcher): void | ||
{ | ||
$this->eventDispatcher = $eventDispatcher; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
<?php declare(strict_types=1); | ||
|
||
namespace RichId\ExcelGeneratorBundle\Builder\Partials; | ||
|
||
use RichId\ExcelGeneratorBundle\ConfigurationExtractor\CellConfigurationsExtractor; | ||
use RichId\ExcelGeneratorBundle\ConfigurationExtractor\Model\CellConfiguration; | ||
use RichId\ExcelGeneratorBundle\Event\ExcelCellGeneratedEvent; | ||
use RichId\ExcelGeneratorBundle\Event\ExcelRowGeneratedEvent; | ||
use RichId\ExcelGeneratorBundle\Model\ExcelContent; | ||
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet; | ||
|
||
/** | ||
* Class SheetRowContentBuilder | ||
* | ||
* @package RichId\ExcelGeneratorBundle\Builder\Partials | ||
* @author Hugo Dumazeau <hugo.dumazeau@rich-id.fr> | ||
* @copyright 2014 - 2021 RichId (https://www.rich-id.fr) | ||
*/ | ||
class SheetRowContentBuilder extends AbstractBuilder | ||
{ | ||
/** @var CellConfigurationsExtractor */ | ||
protected $configurationExtractor; | ||
|
||
public function __construct(CellConfigurationsExtractor $configurationExtractor) | ||
{ | ||
$this->configurationExtractor = $configurationExtractor; | ||
} | ||
|
||
public function __invoke(Worksheet $worksheet, ExcelContent $excelContent): void | ||
{ | ||
$row = (int) $worksheet->getHighestRow(); | ||
$cellConfigurations = $this->configurationExtractor->getCellConfigurations($excelContent); | ||
|
||
foreach ($cellConfigurations as $index => $configuration) { | ||
$this->buildFromCellConfiguration($worksheet, $configuration, $index + 1, $row); | ||
} | ||
|
||
$event = new ExcelRowGeneratedEvent($worksheet, $cellConfigurations, $row, $excelContent); | ||
$this->eventDispatcher->dispatch($event); | ||
} | ||
|
||
public function buildFromCellConfiguration(Worksheet $worksheet, CellConfiguration $configuration, int $column, int $row): void | ||
{ | ||
$worksheet->setCellValueByColumnAndRow($column, $row, $configuration->getValue()); | ||
|
||
$event = new ExcelCellGeneratedEvent($worksheet, $configuration, $column, $row); | ||
$this->eventDispatcher->dispatch($event); | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.