Skip to content

Commit

Permalink
Merge 15a2475 into 00025dc
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasGuilloux committed May 27, 2021
2 parents 00025dc + 15a2475 commit 0b15d03
Show file tree
Hide file tree
Showing 76 changed files with 6,203 additions and 2,686 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,10 @@ jobs:
- name: Install the dependencies 🔧
run: |
docker-compose exec -T application composer install --prefer-dist --no-interaction --no-progress
docker-compose exec -T application php -d zend_extension=xdebug.so ./bin/phpunit --configuration phpunit.xml.dist --dump-xdebug-filter phpunit-filter.php
- name: Execute the tests 🔧
run: |
docker-compose exec -T application php -d zend_extension=xdebug.so ./bin/phpunit --prepend phpunit-filter.php --configuration phpunit.xml.dist --colors=never --coverage-clover build/logs/clover.xml
docker-compose exec -T application php -d extension=pcov.so ./bin/phpunit --configuration phpunit.xml.dist --colors=never --coverage-clover build/logs/clover.xml --coverage-text
- name: Upload results to Coveralls 🚀
env:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace RichId\ExcelGeneratorBundle\Data\Annotation;
namespace RichId\ExcelGeneratorBundle\Annotation;

/**
* Class BorderStyle
*
* @package RichId\ExcelGeneratorBundle\Data\Annotation
* @package RichId\ExcelGeneratorBundle\Annotation
* @author Hugo Dumazeau <hugo.dumazeau@rich-id.fr>
* @copyright 2014 - 2021 RichId (https://www.rich-id.fr)
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace RichId\ExcelGeneratorBundle\Data\Annotation;
namespace RichId\ExcelGeneratorBundle\Annotation;

/**
* Class ColumnDimension
*
* @package RichId\ExcelGeneratorBundle\Data\Annotation
* @package RichId\ExcelGeneratorBundle\Annotation
* @author Hugo Dumazeau <hugo.dumazeau@rich-id.fr>
* @copyright 2014 - 2021 RichId (https://www.rich-id.fr)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace RichId\ExcelGeneratorBundle\Data\Annotation;
namespace RichId\ExcelGeneratorBundle\Annotation;

/**
* Class ColumnMerge
*
* @package RichId\ExcelGeneratorBundle\Data\Annotation
* @package RichId\ExcelGeneratorBundle\Annotation
* @author Hugo Dumazeau <hugo.dumazeau@rich-id.fr>
* @copyright 2014 - 2021 RichId (https://www.rich-id.fr)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace RichId\ExcelGeneratorBundle\Data\Annotation;
namespace RichId\ExcelGeneratorBundle\Annotation;

/**
* Class ColumnsAutoResize
*
* @package RichId\ExcelGeneratorBundle\Data\Annotation
* @package RichId\ExcelGeneratorBundle\Annotation
* @author Hugo Dumazeau <hugo.dumazeau@rich-id.fr>
* @copyright 2014 - 2021 RichId (https://www.rich-id.fr)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace RichId\ExcelGeneratorBundle\Data\Annotation;
namespace RichId\ExcelGeneratorBundle\Annotation;

/**
* Class ContentStyle
*
* @package RichId\ExcelGeneratorBundle\Data\Annotation
* @package RichId\ExcelGeneratorBundle\Annotation
* @author Hugo Dumazeau <hugo.dumazeau@rich-id.fr>
* @copyright 2014 - 2021 RichId (https://www.rich-id.fr)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace RichId\ExcelGeneratorBundle\Data\Annotation;
namespace RichId\ExcelGeneratorBundle\Annotation;

/**
* Class GroupBorderStyle
*
* @package RichId\ExcelGeneratorBundle\Data\Annotation
* @package RichId\ExcelGeneratorBundle\Annotation
* @author Hugo Dumazeau <hugo.dumazeau@rich-id.fr>
* @copyright 2014 - 2021 RichId (https://www.rich-id.fr)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace RichId\ExcelGeneratorBundle\Data\Annotation;
namespace RichId\ExcelGeneratorBundle\Annotation;

/**
* Class HeaderStyle
*
* @package RichId\ExcelGeneratorBundle\Data\Annotation
* @package RichId\ExcelGeneratorBundle\Annotation
* @author Hugo Dumazeau <hugo.dumazeau@rich-id.fr>
* @copyright 2014 - 2021 RichId (https://www.rich-id.fr)
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace RichId\ExcelGeneratorBundle\Data\Annotation;
namespace RichId\ExcelGeneratorBundle\Annotation;

/**
* Class HeaderTitle
*
* @package RichId\ExcelGeneratorBundle\Data\Annotation
* @package RichId\ExcelGeneratorBundle\Annotation
* @author Hugo Dumazeau <hugo.dumazeau@rich-id.fr>
* @copyright 2014 - 2021 RichId (https://www.rich-id.fr)
*
Expand Down
4 changes: 2 additions & 2 deletions Data/Annotation/Style.php → Annotation/Style.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php declare(strict_types=1);

namespace RichId\ExcelGeneratorBundle\Data\Annotation;
namespace RichId\ExcelGeneratorBundle\Annotation;

/**
* Class Style
*
* @package RichId\ExcelGeneratorBundle\Data\Annotation
* @package RichId\ExcelGeneratorBundle\Annotation
* @author Hugo Dumazeau <hugo.dumazeau@rich-id.fr>
* @copyright 2014 - 2021 RichId (https://www.rich-id.fr)
*/
Expand Down
26 changes: 26 additions & 0 deletions Builder/Partials/AbstractBuilder.php
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;
}
}
49 changes: 49 additions & 0 deletions Builder/Partials/SheetRowContentBuilder.php
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);
}
}
66 changes: 0 additions & 66 deletions Builder/SheetColumnsSizeBuilder.php

This file was deleted.

87 changes: 0 additions & 87 deletions Builder/SheetHeaderBuilder.php

This file was deleted.

0 comments on commit 0b15d03

Please sign in to comment.