Automated native_function_invocation fixes

This commit is contained in:
drowe authored and Adrien Loison committed 2019-11-18 12:17:27 +01:00
1 parent 94b654175c
commit eb88bb4c3a
62 files changed
+237 -237

No files matched your search

@@ -42,7 +42,7 @@ class OptionsManager extends OptionsManagerAbstract
*/
protected function setDefaultOptions()
{
$this->setOption(Options::TEMP_FOLDER, sys_get_temp_dir());
$this->setOption(Options::TEMP_FOLDER, \sys_get_temp_dir());
$this->setOption(Options::DEFAULT_ROW_STYLE, $this->styleBuilder->build());
$this->setOption(Options::SHOULD_CREATE_NEW_SHEETS_AUTOMATICALLY, true);
}
@@ -295,7 +295,7 @@ EOD;
*/
private function getCellAlignmentSectionContent($style)
{
return sprintf(
return \sprintf(
' fo:text-align="%s" ',
$this->transformCellAlignment($style->getCellAlignment())
);
@@ -364,11 +364,11 @@ EOD;
*/
private function getBorderXMLContent($style)
{
$borders = array_map(function (BorderPart $borderPart) {
$borders = \array_map(function (BorderPart $borderPart) {
return BorderHelper::serializeBorderPart($borderPart);
}, $style->getBorder()->getParts());
return sprintf(' %s ', implode(' ', $borders));
return \sprintf(' %s ', \implode(' ', $borders));
}
/**
@@ -379,6 +379,6 @@ EOD;
*/
private function getBackgroundColorXMLContent($style)
{
return sprintf(' fo:background-color="#%s" ', $style->getBackgroundColor());
return \sprintf(' fo:background-color="#%s" ', $style->getBackgroundColor());
}
}
@@ -33,6 +33,6 @@ class StyleRegistry extends \Box\Spout\Writer\Common\Manager\Style\StyleRegistry
*/
public function getUsedFonts()
{
return array_keys($this->usedFontsSet);
return \array_keys($this->usedFontsSet);
}
}
@@ -56,7 +56,7 @@ class WorkbookManager extends WorkbookManagerAbstract
protected function writeAllFilesToDiskAndZipThem($finalFilePointer)
{
$worksheets = $this->getWorksheets();
$numWorksheets = count($worksheets);
$numWorksheets = \count($worksheets);
$this->fileSystemHelper
->createContentFile($this->worksheetManager, $this->styleManager, $worksheets)
@@ -61,7 +61,7 @@ class WorksheetManager implements WorksheetManagerInterface
*/
public function startSheet(Worksheet $worksheet)
{
$sheetFilePointer = fopen($worksheet->getFilePath(), 'w');
$sheetFilePointer = \fopen($worksheet->getFilePath(), 'w');
$this->throwIfSheetFilePointerIsNotAvailable($sheetFilePointer);
$worksheet->setFilePointer($sheetFilePointer);
@@ -134,7 +134,7 @@ class WorksheetManager implements WorksheetManagerInterface
$data .= '</table:table-row>';
$wasWriteSuccessful = fwrite($worksheet->getFilePointer(), $data);
$wasWriteSuccessful = \fwrite($worksheet->getFilePointer(), $data);
if ($wasWriteSuccessful === false) {
throw new IOException("Unable to write data in {$worksheet->getFilePath()}");
}
@@ -190,7 +190,7 @@ class WorksheetManager implements WorksheetManagerInterface
if ($cell->isString()) {
$data .= ' office:value-type="string" calcext:value-type="string">';
$cellValueLines = explode("\n", $cell->getValue());
$cellValueLines = \explode("\n", $cell->getValue());
foreach ($cellValueLines as $cellValueLine) {
$data .= '<text:p>' . $this->stringsEscaper->escape($cellValueLine) . '</text:p>';
}
@@ -207,7 +207,7 @@ class WorksheetManager implements WorksheetManagerInterface
} elseif ($cell->isEmpty()) {
$data .= '/>';
} else {
throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . gettype($cell->getValue()));
throw new InvalidArgumentException('Trying to add a value with an unsupported type: ' . \gettype($cell->getValue()));
}
return $data;
@@ -223,10 +223,10 @@ class WorksheetManager implements WorksheetManagerInterface
{
$worksheetFilePointer = $worksheet->getFilePointer();
if (!is_resource($worksheetFilePointer)) {
if (!\is_resource($worksheetFilePointer)) {
return;
}
fclose($worksheetFilePointer);
\fclose($worksheetFilePointer);
}
}