Skip to content

Commit

Permalink
Update dependency friendsofphp/php-cs-fixer to ^3.60.0 (#262)
Browse files Browse the repository at this point in the history
* Update dependency friendsofphp/php-cs-fixer to ^3.60.0

| datasource | package                   | from   | to     |
| ---------- | ------------------------- | ------ | ------ |
| packagist  | friendsofphp/php-cs-fixer | 3.59.3 | 3.60.0 |

* CS Fix

* CS Fix 2

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Filippo Tessarotto <zoeslam@gmail.com>
renovate[bot] and Slamdunk authored Jul 25, 2024
1 parent 96b2078 commit 02fe500
Showing 13 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
@@ -38,13 +38,13 @@
},
"require-dev": {
"ext-zlib": "*",
"friendsofphp/php-cs-fixer": "^3.59.3",
"friendsofphp/php-cs-fixer": "^3.60.0",
"infection/infection": "^0.29.6",
"phpbench/phpbench": "^1.3.1",
"phpstan/phpstan": "^1.11.8",
"phpstan/phpstan-phpunit": "^1.4.0",
"phpstan/phpstan-strict-rules": "^1.6.0",
"phpunit/phpunit": "^10.5.20 || ^11.2.2"
"phpunit/phpunit": "^10.5.20 || ^11.2.8"
},
"suggest": {
"ext-iconv": "To handle non UTF-8 CSV files (if \"php-mbstring\" is not already installed or is too limited)",
2 changes: 1 addition & 1 deletion src/Common/Helper/Escaper/XLSX.php
Original file line number Diff line number Diff line change
@@ -107,7 +107,7 @@ private function getControlCharactersEscapingMap(): array
$character = \chr($charValue);
if (1 === preg_match("/{$this->escapableControlCharactersPattern}/", $character)) {
$charHexValue = dechex($charValue);
$escapedChar = '_x'.sprintf('%04s', strtoupper($charHexValue)).'_';
$escapedChar = '_x'.\sprintf('%04s', strtoupper($charHexValue)).'_';
$controlCharactersEscapingMap[$escapedChar] = $character;
}
}
2 changes: 1 addition & 1 deletion src/Writer/Exception/Border/InvalidNameException.php
Original file line number Diff line number Diff line change
@@ -13,6 +13,6 @@ public function __construct(string $name)
{
$msg = '%s is not a valid name identifier for a border. Valid identifiers are: %s.';

parent::__construct(sprintf($msg, $name, implode(',', BorderPart::allowedNames)));
parent::__construct(\sprintf($msg, $name, implode(',', BorderPart::allowedNames)));
}
}
2 changes: 1 addition & 1 deletion src/Writer/Exception/Border/InvalidStyleException.php
Original file line number Diff line number Diff line change
@@ -13,6 +13,6 @@ public function __construct(string $name)
{
$msg = '%s is not a valid style identifier for a border. Valid identifiers are: %s.';

parent::__construct(sprintf($msg, $name, implode(',', BorderPart::allowedStyles)));
parent::__construct(\sprintf($msg, $name, implode(',', BorderPart::allowedStyles)));
}
}
2 changes: 1 addition & 1 deletion src/Writer/Exception/Border/InvalidWidthException.php
Original file line number Diff line number Diff line change
@@ -13,6 +13,6 @@ public function __construct(string $name)
{
$msg = '%s is not a valid width identifier for a border. Valid identifiers are: %s.';

parent::__construct(sprintf($msg, $name, implode(',', BorderPart::allowedWidths)));
parent::__construct(\sprintf($msg, $name, implode(',', BorderPart::allowedWidths)));
}
}
4 changes: 2 additions & 2 deletions src/Writer/ODS/Helper/BorderHelper.php
Original file line number Diff line number Diff line change
@@ -47,14 +47,14 @@ public static function serializeBorderPart(BorderPart $borderPart): string
$definition = 'fo:border-%s="%s"';

if (Border::STYLE_NONE === $borderPart->getStyle()) {
$borderPartDefinition = sprintf($definition, $borderPart->getName(), 'none');
$borderPartDefinition = \sprintf($definition, $borderPart->getName(), 'none');
} else {
$attributes = [
self::widthMap[$borderPart->getWidth()],
self::styleMap[$borderPart->getStyle()],
'#'.$borderPart->getColor(),
];
$borderPartDefinition = sprintf($definition, $borderPart->getName(), implode(' ', $attributes));
$borderPartDefinition = \sprintf($definition, $borderPart->getName(), implode(' ', $attributes));
}

return $borderPartDefinition;
8 changes: 4 additions & 4 deletions src/Writer/ODS/Manager/Style/StyleManager.php
Original file line number Diff line number Diff line change
@@ -336,7 +336,7 @@ private function getCellAlignmentSectionContent(Style $style): string
return '';
}

return sprintf(
return \sprintf(
' fo:text-align="%s" ',
$this->transformCellAlignment($style->getCellAlignment())
);
@@ -351,7 +351,7 @@ private function getCellVerticalAlignmentSectionContent(Style $style): string
return '';
}

return sprintf(
return \sprintf(
' fo:vertical-align="%s" ',
$this->transformCellVerticalAlignment($style->getCellVerticalAlignment())
);
@@ -423,14 +423,14 @@ private function getBorderXMLContent(Border $border): string
return BorderHelper::serializeBorderPart($borderPart);
}, $border->getParts());

return sprintf(' %s ', implode(' ', $borders));
return \sprintf(' %s ', implode(' ', $borders));
}

/**
* Returns the contents of the background color definition for the "<style:table-cell-properties>" section.
*/
private function getBackgroundColorXMLContent(string $bgColor): string
{
return sprintf(' fo:background-color="#%s" ', $bgColor);
return \sprintf(' fo:background-color="#%s" ', $bgColor);
}
}
2 changes: 1 addition & 1 deletion src/Writer/ODS/Manager/WorksheetManager.php
Original file line number Diff line number Diff line change
@@ -88,7 +88,7 @@ public function getTableDatabaseRangeElementAsString(Worksheet $worksheet): stri
$databaseRange = '';

if (null !== $autofilter = $externalSheet->getAutoFilter()) {
$rangeAddress = sprintf(
$rangeAddress = \sprintf(
'\'%s\'.%s%s:\'%s\'.%s%s',
$escapedSheetName,
CellHelper::getColumnLettersFromColumnIndex($autofilter->fromColumnIndex),
4 changes: 2 additions & 2 deletions src/Writer/XLSX/Helper/BorderHelper.php
Original file line number Diff line number Diff line change
@@ -48,8 +48,8 @@ public static function serializeBorderPart(?BorderPart $borderPart): string

$borderStyle = self::getBorderStyle($borderPart);

$colorEl = sprintf('<color rgb="%s"/>', $borderPart->getColor());
$partEl = sprintf(
$colorEl = \sprintf('<color rgb="%s"/>', $borderPart->getColor());
$partEl = \sprintf(
'<%s style="%s">%s</%s>',
$borderPart->getName(),
$borderStyle,
12 changes: 6 additions & 6 deletions src/Writer/XLSX/Helper/FileSystemHelper.php
Original file line number Diff line number Diff line change
@@ -212,7 +212,7 @@ public function createWorkbookFile(array $worksheets): self
$sheet = $worksheet->getExternalSheet();
if (null !== $autofilter = $sheet->getAutoFilter()) {
$worksheetName = $sheet->getName();
$name = sprintf(
$name = \sprintf(
'\'%s\'!$%s$%s:$%s$%s',
$this->escaper->escape($worksheetName),
CellHelper::getColumnLettersFromColumnIndex($autofilter->fromColumnIndex),
@@ -330,14 +330,14 @@ public function createContentFiles(Options $options, array $worksheets): self
} elseif (isset($pageSetup) && $pageSetup->fitToPage) {
fwrite($worksheetFilePointer, '<sheetPr><pageSetUpPr fitToPage="true"/></sheetPr>');
}
$sheetRange = sprintf(
$sheetRange = \sprintf(
'%s%s:%s%s',
CellHelper::getColumnLettersFromColumnIndex(0),
1,
CellHelper::getColumnLettersFromColumnIndex($worksheet->getMaxNumColumns() - 1),
$worksheet->getLastWrittenRowIndex()
);
fwrite($worksheetFilePointer, sprintf('<dimension ref="%s"/>', $sheetRange));
fwrite($worksheetFilePointer, \sprintf('<dimension ref="%s"/>', $sheetRange));
if (null !== ($sheetView = $sheet->getSheetView())) {
fwrite($worksheetFilePointer, '<sheetViews>'.$sheetView->getXml().'</sheetViews>');
}
@@ -351,14 +351,14 @@ public function createContentFiles(Options $options, array $worksheets): self

// AutoFilter tag
if (null !== $autofilter) {
$autoFilterRange = sprintf(
$autoFilterRange = \sprintf(
'%s%s:%s%s',
CellHelper::getColumnLettersFromColumnIndex($autofilter->fromColumnIndex),
$autofilter->fromRow,
CellHelper::getColumnLettersFromColumnIndex($autofilter->toColumnIndex),
$autofilter->toRow
);
fwrite($worksheetFilePointer, sprintf('<autoFilter ref="%s"/>', $autoFilterRange));
fwrite($worksheetFilePointer, \sprintf('<autoFilter ref="%s"/>', $autoFilterRange));
}

// create nodes for merge cells
@@ -371,7 +371,7 @@ public function createContentFiles(Options $options, array $worksheets): self
foreach ($mergeCells as $mergeCell) {
$topLeft = CellHelper::getColumnLettersFromColumnIndex($mergeCell->topLeftColumn).$mergeCell->topLeftRow;
$bottomRight = CellHelper::getColumnLettersFromColumnIndex($mergeCell->bottomRightColumn).$mergeCell->bottomRightRow;
$mergeCellString .= sprintf(
$mergeCellString .= \sprintf(
'<mergeCell ref="%s:%s"/>',
$topLeft,
$bottomRight
2 changes: 1 addition & 1 deletion src/Writer/XLSX/Manager/SharedStringsManager.php
Original file line number Diff line number Diff line change
@@ -79,7 +79,7 @@ public function close(): void

// Adding 1 to take into account the space between the last xml attribute and "count"
fseek($this->sharedStringsFilePointer, $firstPartHeaderLength + 1);
fwrite($this->sharedStringsFilePointer, sprintf("%-{$defaultStringsCountPartLength}s", 'count="'.$this->numSharedStrings.'" uniqueCount="'.$this->numSharedStrings.'"'));
fwrite($this->sharedStringsFilePointer, \sprintf("%-{$defaultStringsCountPartLength}s", 'count="'.$this->numSharedStrings.'" uniqueCount="'.$this->numSharedStrings.'"'));

fclose($this->sharedStringsFilePointer);
}
10 changes: 5 additions & 5 deletions src/Writer/XLSX/Manager/Style/StyleManager.php
Original file line number Diff line number Diff line change
@@ -147,7 +147,7 @@ private function getFillsSectionContent(): string

// Excel reserves two default fills
$fillsCount = \count($registeredFills) + 2;
$content = sprintf('<fills count="%d">', $fillsCount);
$content = \sprintf('<fills count="%d">', $fillsCount);

$content .= '<fill><patternFill patternType="none"/></fill>';
$content .= '<fill><patternFill patternType="gray125"/></fill>';
@@ -158,7 +158,7 @@ private function getFillsSectionContent(): string
$style = $this->styleRegistry->getStyleFromStyleId($styleId);

$backgroundColor = $style->getBackgroundColor();
$content .= sprintf(
$content .= \sprintf(
'<fill><patternFill patternType="solid"><fgColor rgb="%s"/></patternFill></fill>',
$backgroundColor
);
@@ -236,16 +236,16 @@ private function getCellXfsSectionContent(): string
$content .= ' applyFont="1"';
}

$content .= sprintf(' applyBorder="%d"', (bool) $style->getBorder());
$content .= \sprintf(' applyBorder="%d"', (bool) $style->getBorder());

if ($style->shouldApplyCellAlignment() || $style->shouldApplyCellVerticalAlignment() || $style->hasSetWrapText() || $style->shouldShrinkToFit()) {
$content .= ' applyAlignment="1">';
$content .= '<alignment';
if ($style->shouldApplyCellAlignment()) {
$content .= sprintf(' horizontal="%s"', $style->getCellAlignment());
$content .= \sprintf(' horizontal="%s"', $style->getCellAlignment());
}
if ($style->shouldApplyCellVerticalAlignment()) {
$content .= sprintf(' vertical="%s"', $style->getCellVerticalAlignment());
$content .= \sprintf(' vertical="%s"', $style->getCellVerticalAlignment());
}
if ($style->hasSetWrapText()) {
$content .= ' wrapText="'.($style->shouldWrapText() ? '1' : '0').'"';
4 changes: 2 additions & 2 deletions tests/Writer/ODS/WriterWithStyleTest.php
Original file line number Diff line number Diff line change
@@ -315,7 +315,7 @@ public function testBorders(): void
$widthMap = BorderHelper::widthMap;
$styleMap = BorderHelper::styleMap;

$expectedFirst = sprintf(
$expectedFirst = \sprintf(
'%s %s #%s',
$widthMap[Border::WIDTH_THICK],
$styleMap[Border::STYLE_SOLID],
@@ -330,7 +330,7 @@ public function testBorders(): void

self::assertSame($expectedFirst, $actualFirst);

$expectedThird = sprintf(
$expectedThird = \sprintf(
'%s %s #%s',
$widthMap[Border::WIDTH_THIN],
$styleMap[Border::STYLE_DASHED],

0 comments on commit 02fe500

Please sign in to comment.