Fix code before applying PHP CS Fixer
This commit is contained in:
parent
554ebf987b
commit
740fcfb8c1
@ -30,7 +30,7 @@ class GlobalFunctionsHelper
|
|||||||
* @see fgets()
|
* @see fgets()
|
||||||
*
|
*
|
||||||
* @param resource $handle
|
* @param resource $handle
|
||||||
* @param int|void $length
|
* @param int|null $length
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function fgets($handle, $length = null)
|
public function fgets($handle, $length = null)
|
||||||
@ -81,9 +81,9 @@ class GlobalFunctionsHelper
|
|||||||
* @see fgetcsv()
|
* @see fgetcsv()
|
||||||
*
|
*
|
||||||
* @param resource $handle
|
* @param resource $handle
|
||||||
* @param int|void $length
|
* @param int|null $length
|
||||||
* @param string|void $delimiter
|
* @param string|null $delimiter
|
||||||
* @param string|void $enclosure
|
* @param string|null $enclosure
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public function fgetcsv($handle, $length = null, $delimiter = null, $enclosure = null)
|
public function fgetcsv($handle, $length = null, $delimiter = null, $enclosure = null)
|
||||||
@ -97,8 +97,8 @@ class GlobalFunctionsHelper
|
|||||||
*
|
*
|
||||||
* @param resource $handle
|
* @param resource $handle
|
||||||
* @param array $fields
|
* @param array $fields
|
||||||
* @param string|void $delimiter
|
* @param string|null $delimiter
|
||||||
* @param string|void $enclosure
|
* @param string|null $enclosure
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
public function fputcsv($handle, array $fields, $delimiter = null, $enclosure = null)
|
public function fputcsv($handle, array $fields, $delimiter = null, $enclosure = null)
|
||||||
@ -207,7 +207,7 @@ class GlobalFunctionsHelper
|
|||||||
* Wrapper around global function feof()
|
* Wrapper around global function feof()
|
||||||
* @see feof()
|
* @see feof()
|
||||||
*
|
*
|
||||||
* @param resource
|
* @param resource $handle
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function feof($handle)
|
public function feof($handle)
|
||||||
@ -232,7 +232,7 @@ class GlobalFunctionsHelper
|
|||||||
* @see basename()
|
* @see basename()
|
||||||
*
|
*
|
||||||
* @param string $path
|
* @param string $path
|
||||||
* @param string|void $suffix
|
* @param string|null $suffix
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function basename($path, $suffix = null)
|
public function basename($path, $suffix = null)
|
||||||
|
@ -127,8 +127,8 @@ class CellValueFormatter
|
|||||||
{
|
{
|
||||||
$nodeValue = $node->getAttribute(self::XML_ATTRIBUTE_VALUE);
|
$nodeValue = $node->getAttribute(self::XML_ATTRIBUTE_VALUE);
|
||||||
$nodeIntValue = intval($nodeValue);
|
$nodeIntValue = intval($nodeValue);
|
||||||
// The "==" is intentionally not a "===" because only the value matters, not the type
|
$nodeFloatValue = (float) $nodeValue;
|
||||||
$cellValue = ($nodeIntValue == $nodeValue) ? $nodeIntValue : floatval($nodeValue);
|
$cellValue = ((float) $nodeIntValue === $nodeFloatValue) ? $nodeIntValue : $nodeFloatValue;
|
||||||
return $cellValue;
|
return $cellValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,9 +141,7 @@ class CellValueFormatter
|
|||||||
protected function formatBooleanCellValue($node)
|
protected function formatBooleanCellValue($node)
|
||||||
{
|
{
|
||||||
$nodeValue = $node->getAttribute(self::XML_ATTRIBUTE_BOOLEAN_VALUE);
|
$nodeValue = $node->getAttribute(self::XML_ATTRIBUTE_BOOLEAN_VALUE);
|
||||||
// !! is similar to boolval()
|
return (bool) $nodeValue;
|
||||||
$cellValue = !!$nodeValue;
|
|
||||||
return $cellValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -162,16 +160,18 @@ class CellValueFormatter
|
|||||||
if ($this->shouldFormatDates) {
|
if ($this->shouldFormatDates) {
|
||||||
// The date is already formatted in the "p" tag
|
// The date is already formatted in the "p" tag
|
||||||
$nodeWithValueAlreadyFormatted = $node->getElementsByTagName(self::XML_NODE_P)->item(0);
|
$nodeWithValueAlreadyFormatted = $node->getElementsByTagName(self::XML_NODE_P)->item(0);
|
||||||
return $nodeWithValueAlreadyFormatted->nodeValue;
|
$cellValue = $nodeWithValueAlreadyFormatted->nodeValue;
|
||||||
} else {
|
} else {
|
||||||
// otherwise, get it from the "date-value" attribute
|
// otherwise, get it from the "date-value" attribute
|
||||||
try {
|
try {
|
||||||
$nodeValue = $node->getAttribute(self::XML_ATTRIBUTE_DATE_VALUE);
|
$nodeValue = $node->getAttribute(self::XML_ATTRIBUTE_DATE_VALUE);
|
||||||
return new \DateTime($nodeValue);
|
$cellValue = new \DateTime($nodeValue);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return null;
|
$cellValue = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $cellValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -190,16 +190,18 @@ class CellValueFormatter
|
|||||||
if ($this->shouldFormatDates) {
|
if ($this->shouldFormatDates) {
|
||||||
// The date is already formatted in the "p" tag
|
// The date is already formatted in the "p" tag
|
||||||
$nodeWithValueAlreadyFormatted = $node->getElementsByTagName(self::XML_NODE_P)->item(0);
|
$nodeWithValueAlreadyFormatted = $node->getElementsByTagName(self::XML_NODE_P)->item(0);
|
||||||
return $nodeWithValueAlreadyFormatted->nodeValue;
|
$cellValue = $nodeWithValueAlreadyFormatted->nodeValue;
|
||||||
} else {
|
} else {
|
||||||
// otherwise, get it from the "time-value" attribute
|
// otherwise, get it from the "time-value" attribute
|
||||||
try {
|
try {
|
||||||
$nodeValue = $node->getAttribute(self::XML_ATTRIBUTE_TIME_VALUE);
|
$nodeValue = $node->getAttribute(self::XML_ATTRIBUTE_TIME_VALUE);
|
||||||
return new \DateInterval($nodeValue);
|
$cellValue = new \DateInterval($nodeValue);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return null;
|
$cellValue = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $cellValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -311,7 +311,7 @@ class RowIterator implements IteratorInterface
|
|||||||
* row data yet (as we still need to apply the "num-columns-repeated" attribute).
|
* row data yet (as we still need to apply the "num-columns-repeated" attribute).
|
||||||
*
|
*
|
||||||
* @param array $rowData
|
* @param array $rowData
|
||||||
* @param string|int|float|bool|\DateTime|\DateInterval|null The value of the last read cell
|
* @param string|int|float|bool|\DateTime|\DateInterval|null $lastReadCellValue The value of the last read cell
|
||||||
* @return bool Whether the row is empty
|
* @return bool Whether the row is empty
|
||||||
*/
|
*/
|
||||||
protected function isEmptyRow($rowData, $lastReadCellValue)
|
protected function isEmptyRow($rowData, $lastReadCellValue)
|
||||||
|
@ -136,7 +136,7 @@ class SheetIterator implements IteratorInterface
|
|||||||
*
|
*
|
||||||
* @param string $sheetName Name of the current sheet
|
* @param string $sheetName Name of the current sheet
|
||||||
* @param int $sheetIndex Index of the current sheet
|
* @param int $sheetIndex Index of the current sheet
|
||||||
* @param string|null Name of the sheet that was defined as active or NULL if none defined
|
* @param string|null $activeSheetName Name of the sheet that was defined as active or NULL if none defined
|
||||||
* @return bool Whether the current sheet was defined as the active one
|
* @return bool Whether the current sheet was defined as the active one
|
||||||
*/
|
*/
|
||||||
private function isActiveSheet($sheetName, $sheetIndex, $activeSheetName)
|
private function isActiveSheet($sheetName, $sheetIndex, $activeSheetName)
|
||||||
|
@ -115,7 +115,7 @@ class XMLReader extends \XMLReader
|
|||||||
* Move cursor to next node skipping all subtrees
|
* Move cursor to next node skipping all subtrees
|
||||||
* @see \XMLReader::next
|
* @see \XMLReader::next
|
||||||
*
|
*
|
||||||
* @param string|void $localName The name of the next node to move to
|
* @param string|null $localName The name of the next node to move to
|
||||||
* @return bool TRUE on success or FALSE on failure
|
* @return bool TRUE on success or FALSE on failure
|
||||||
* @throws \Box\Spout\Reader\Exception\XMLProcessingException If an error/warning occurred
|
* @throws \Box\Spout\Reader\Exception\XMLProcessingException If an error/warning occurred
|
||||||
*/
|
*/
|
||||||
|
@ -26,7 +26,7 @@ class CellHelper
|
|||||||
* Calling fillMissingArrayIndexes($dataArray, 'FILL') will return this array: ['FILL', 1, 'FILL', 3]
|
* Calling fillMissingArrayIndexes($dataArray, 'FILL') will return this array: ['FILL', 1, 'FILL', 3]
|
||||||
*
|
*
|
||||||
* @param array $dataArray The array to fill
|
* @param array $dataArray The array to fill
|
||||||
* @param string|void $fillValue optional
|
* @param string $fillValue optional
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function fillMissingArrayIndexes($dataArray, $fillValue = '')
|
public static function fillMissingArrayIndexes($dataArray, $fillValue = '')
|
||||||
|
@ -175,11 +175,14 @@ class CellValueFormatter
|
|||||||
$shouldFormatAsDate = $this->styleManager->shouldFormatNumericValueAsDate($cellStyleId);
|
$shouldFormatAsDate = $this->styleManager->shouldFormatNumericValueAsDate($cellStyleId);
|
||||||
|
|
||||||
if ($shouldFormatAsDate) {
|
if ($shouldFormatAsDate) {
|
||||||
return $this->formatExcelTimestampValue(floatval($nodeValue), $cellStyleId);
|
$cellValue = $this->formatExcelTimestampValue(floatval($nodeValue), $cellStyleId);
|
||||||
} else {
|
} else {
|
||||||
$nodeIntValue = intval($nodeValue);
|
$nodeIntValue = intval($nodeValue);
|
||||||
return ($nodeIntValue == $nodeValue) ? $nodeIntValue : floatval($nodeValue);
|
$nodeFloatValue = (float) $nodeValue;
|
||||||
|
$cellValue = ((float) $nodeIntValue === $nodeFloatValue) ? $nodeIntValue : $nodeFloatValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $cellValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -200,14 +203,16 @@ class CellValueFormatter
|
|||||||
|
|
||||||
if ($nodeValue >= 1) {
|
if ($nodeValue >= 1) {
|
||||||
// Values greater than 1 represent "dates". The value 1.0 representing the "base" date: 1900-01-01.
|
// Values greater than 1 represent "dates". The value 1.0 representing the "base" date: 1900-01-01.
|
||||||
return $this->formatExcelTimestampValueAsDateValue($nodeValue, $cellStyleId);
|
$cellValue = $this->formatExcelTimestampValueAsDateValue($nodeValue, $cellStyleId);
|
||||||
} else if ($nodeValue >= 0) {
|
} else if ($nodeValue >= 0) {
|
||||||
// Values between 0 and 1 represent "times".
|
// Values between 0 and 1 represent "times".
|
||||||
return $this->formatExcelTimestampValueAsTimeValue($nodeValue, $cellStyleId);
|
$cellValue = $this->formatExcelTimestampValueAsTimeValue($nodeValue, $cellStyleId);
|
||||||
} else {
|
} else {
|
||||||
// invalid date
|
// invalid date
|
||||||
return null;
|
$cellValue = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $cellValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -232,10 +237,12 @@ class CellValueFormatter
|
|||||||
if ($this->shouldFormatDates) {
|
if ($this->shouldFormatDates) {
|
||||||
$styleNumberFormatCode = $this->styleManager->getNumberFormatCode($cellStyleId);
|
$styleNumberFormatCode = $this->styleManager->getNumberFormatCode($cellStyleId);
|
||||||
$phpDateFormat = DateFormatHelper::toPHPDateFormat($styleNumberFormatCode);
|
$phpDateFormat = DateFormatHelper::toPHPDateFormat($styleNumberFormatCode);
|
||||||
return $dateObj->format($phpDateFormat);
|
$cellValue = $dateObj->format($phpDateFormat);
|
||||||
} else {
|
} else {
|
||||||
return $dateObj;
|
$cellValue = $dateObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $cellValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -261,13 +268,15 @@ class CellValueFormatter
|
|||||||
if ($this->shouldFormatDates) {
|
if ($this->shouldFormatDates) {
|
||||||
$styleNumberFormatCode = $this->styleManager->getNumberFormatCode($cellStyleId);
|
$styleNumberFormatCode = $this->styleManager->getNumberFormatCode($cellStyleId);
|
||||||
$phpDateFormat = DateFormatHelper::toPHPDateFormat($styleNumberFormatCode);
|
$phpDateFormat = DateFormatHelper::toPHPDateFormat($styleNumberFormatCode);
|
||||||
return $dateObj->format($phpDateFormat);
|
$cellValue = $dateObj->format($phpDateFormat);
|
||||||
} else {
|
} else {
|
||||||
return $dateObj;
|
$cellValue = $dateObj;
|
||||||
}
|
}
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return null;
|
$cellValue = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $cellValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -278,9 +287,7 @@ class CellValueFormatter
|
|||||||
*/
|
*/
|
||||||
protected function formatBooleanCellValue($nodeValue)
|
protected function formatBooleanCellValue($nodeValue)
|
||||||
{
|
{
|
||||||
// !! is similar to boolval()
|
return (bool) $nodeValue;
|
||||||
$cellValue = !!$nodeValue;
|
|
||||||
return $cellValue;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -294,9 +301,11 @@ class CellValueFormatter
|
|||||||
{
|
{
|
||||||
// Mitigate thrown Exception on invalid date-time format (http://php.net/manual/en/datetime.construct.php)
|
// Mitigate thrown Exception on invalid date-time format (http://php.net/manual/en/datetime.construct.php)
|
||||||
try {
|
try {
|
||||||
return ($this->shouldFormatDates) ? $nodeValue : new \DateTime($nodeValue);
|
$cellValue = ($this->shouldFormatDates) ? $nodeValue : new \DateTime($nodeValue);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
return null;
|
$cellValue = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $cellValue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -89,11 +89,13 @@ class CachingStrategyFactory
|
|||||||
|
|
||||||
if ($memoryAvailable === -1) {
|
if ($memoryAvailable === -1) {
|
||||||
// if cannot get memory limit or if memory limit set as unlimited, don't trust and play safe
|
// if cannot get memory limit or if memory limit set as unlimited, don't trust and play safe
|
||||||
return ($sharedStringsUniqueCount < self::MAX_NUM_STRINGS_PER_TEMP_FILE);
|
$isInMemoryStrategyUsageSafe = ($sharedStringsUniqueCount < self::MAX_NUM_STRINGS_PER_TEMP_FILE);
|
||||||
} else {
|
} else {
|
||||||
$memoryNeeded = $sharedStringsUniqueCount * self::AMOUNT_MEMORY_NEEDED_PER_STRING_IN_KB;
|
$memoryNeeded = $sharedStringsUniqueCount * self::AMOUNT_MEMORY_NEEDED_PER_STRING_IN_KB;
|
||||||
return ($memoryAvailable > $memoryNeeded);
|
$isInMemoryStrategyUsageSafe = ($memoryAvailable > $memoryNeeded);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return $isInMemoryStrategyUsageSafe;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -52,7 +52,7 @@ class SheetManager
|
|||||||
/**
|
/**
|
||||||
* @param string $filePath Path of the XLSX file being read
|
* @param string $filePath Path of the XLSX file being read
|
||||||
* @param \Box\Spout\Common\Manager\OptionsManagerInterface $optionsManager Reader's options manager
|
* @param \Box\Spout\Common\Manager\OptionsManagerInterface $optionsManager Reader's options manager
|
||||||
* @param \Box\Spout\Reader\XLSX\Manager\SharedStringsManager Manages shared strings
|
* @param \Box\Spout\Reader\XLSX\Manager\SharedStringsManager $sharedStringsManager Manages shared strings
|
||||||
* @param \Box\Spout\Common\Helper\Escaper\XLSX $escaper Used to unescape XML data
|
* @param \Box\Spout\Common\Helper\Escaper\XLSX $escaper Used to unescape XML data
|
||||||
* @param EntityFactory $entityFactory Factory to create entities
|
* @param EntityFactory $entityFactory Factory to create entities
|
||||||
*/
|
*/
|
||||||
|
@ -24,9 +24,9 @@ class BorderBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|void $color Border A RGB color code
|
* @param string $color Border A RGB color code
|
||||||
* @param string|void $width Border width @see BorderPart::allowedWidths
|
* @param string $width Border width @see BorderPart::allowedWidths
|
||||||
* @param string|void $style Border style @see BorderPart::allowedStyles
|
* @param string $style Border style @see BorderPart::allowedStyles
|
||||||
* @return BorderBuilder
|
* @return BorderBuilder
|
||||||
*/
|
*/
|
||||||
public function setBorderTop($color = Color::BLACK, $width = Border::WIDTH_MEDIUM, $style = Border::STYLE_SOLID)
|
public function setBorderTop($color = Color::BLACK, $width = Border::WIDTH_MEDIUM, $style = Border::STYLE_SOLID)
|
||||||
@ -36,9 +36,9 @@ class BorderBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|void $color Border A RGB color code
|
* @param string $color Border A RGB color code
|
||||||
* @param string|void $width Border width @see BorderPart::allowedWidths
|
* @param string $width Border width @see BorderPart::allowedWidths
|
||||||
* @param string|void $style Border style @see BorderPart::allowedStyles
|
* @param string $style Border style @see BorderPart::allowedStyles
|
||||||
* @return BorderBuilder
|
* @return BorderBuilder
|
||||||
*/
|
*/
|
||||||
public function setBorderRight($color = Color::BLACK, $width = Border::WIDTH_MEDIUM, $style = Border::STYLE_SOLID)
|
public function setBorderRight($color = Color::BLACK, $width = Border::WIDTH_MEDIUM, $style = Border::STYLE_SOLID)
|
||||||
@ -48,9 +48,9 @@ class BorderBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|void $color Border A RGB color code
|
* @param string $color Border A RGB color code
|
||||||
* @param string|void $width Border width @see BorderPart::allowedWidths
|
* @param string $width Border width @see BorderPart::allowedWidths
|
||||||
* @param string|void $style Border style @see BorderPart::allowedStyles
|
* @param string $style Border style @see BorderPart::allowedStyles
|
||||||
* @return BorderBuilder
|
* @return BorderBuilder
|
||||||
*/
|
*/
|
||||||
public function setBorderBottom($color = Color::BLACK, $width = Border::WIDTH_MEDIUM, $style = Border::STYLE_SOLID)
|
public function setBorderBottom($color = Color::BLACK, $width = Border::WIDTH_MEDIUM, $style = Border::STYLE_SOLID)
|
||||||
@ -60,9 +60,9 @@ class BorderBuilder
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string|void $color Border A RGB color code
|
* @param string $color Border A RGB color code
|
||||||
* @param string|void $width Border width @see BorderPart::allowedWidths
|
* @param string $width Border width @see BorderPart::allowedWidths
|
||||||
* @param string|void $style Border style @see BorderPart::allowedStyles
|
* @param string $style Border style @see BorderPart::allowedStyles
|
||||||
* @return BorderBuilder
|
* @return BorderBuilder
|
||||||
*/
|
*/
|
||||||
public function setBorderLeft($color = Color::BLACK, $width = Border::WIDTH_MEDIUM, $style = Border::STYLE_SOLID)
|
public function setBorderLeft($color = Color::BLACK, $width = Border::WIDTH_MEDIUM, $style = Border::STYLE_SOLID)
|
||||||
|
@ -97,15 +97,18 @@ class Cell
|
|||||||
{
|
{
|
||||||
if (CellHelper::isBoolean($value)) {
|
if (CellHelper::isBoolean($value)) {
|
||||||
return self::TYPE_BOOLEAN;
|
return self::TYPE_BOOLEAN;
|
||||||
} elseif (CellHelper::isEmpty($value)) {
|
|
||||||
return self::TYPE_EMPTY;
|
|
||||||
} elseif (CellHelper::isNumeric($this->getValue())) {
|
|
||||||
return self::TYPE_NUMERIC;
|
|
||||||
} elseif (CellHelper::isNonEmptyString($value)) {
|
|
||||||
return self::TYPE_STRING;
|
|
||||||
} else {
|
|
||||||
return self::TYPE_ERROR;
|
|
||||||
}
|
}
|
||||||
|
if (CellHelper::isEmpty($value)) {
|
||||||
|
return self::TYPE_EMPTY;
|
||||||
|
}
|
||||||
|
if (CellHelper::isNumeric($this->getValue())) {
|
||||||
|
return self::TYPE_NUMERIC;
|
||||||
|
}
|
||||||
|
if (CellHelper::isNonEmptyString($value)) {
|
||||||
|
return self::TYPE_STRING;
|
||||||
|
}
|
||||||
|
|
||||||
|
return self::TYPE_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -28,7 +28,7 @@ class Border
|
|||||||
private $parts = [];
|
private $parts = [];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array|void $borderParts
|
* @param array $borderParts
|
||||||
*/
|
*/
|
||||||
public function __construct(array $borderParts = [])
|
public function __construct(array $borderParts = [])
|
||||||
{
|
{
|
||||||
|
@ -322,7 +322,7 @@ class Style
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param bool|void $shouldWrap Should the text be wrapped
|
* @param bool $shouldWrap Should the text be wrapped
|
||||||
* @return Style
|
* @return Style
|
||||||
*/
|
*/
|
||||||
public function setShouldWrapText($shouldWrap = true)
|
public function setShouldWrapText($shouldWrap = true)
|
||||||
|
@ -65,7 +65,7 @@ class ZipHelper
|
|||||||
* @param \ZipArchive $zip An opened zip archive object
|
* @param \ZipArchive $zip An opened zip archive object
|
||||||
* @param string $rootFolderPath Path of the root folder that will be ignored in the archive tree.
|
* @param string $rootFolderPath Path of the root folder that will be ignored in the archive tree.
|
||||||
* @param string $localFilePath Path of the file to be added, under the root folder
|
* @param string $localFilePath Path of the file to be added, under the root folder
|
||||||
* @param string|void $existingFileMode Controls what to do when trying to add an existing file
|
* @param string $existingFileMode Controls what to do when trying to add an existing file
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addFileToArchive($zip, $rootFolderPath, $localFilePath, $existingFileMode = self::EXISTING_FILES_OVERWRITE)
|
public function addFileToArchive($zip, $rootFolderPath, $localFilePath, $existingFileMode = self::EXISTING_FILES_OVERWRITE)
|
||||||
@ -90,7 +90,7 @@ class ZipHelper
|
|||||||
* @param \ZipArchive $zip An opened zip archive object
|
* @param \ZipArchive $zip An opened zip archive object
|
||||||
* @param string $rootFolderPath Path of the root folder that will be ignored in the archive tree.
|
* @param string $rootFolderPath Path of the root folder that will be ignored in the archive tree.
|
||||||
* @param string $localFilePath Path of the file to be added, under the root folder
|
* @param string $localFilePath Path of the file to be added, under the root folder
|
||||||
* @param string|void $existingFileMode Controls what to do when trying to add an existing file
|
* @param string $existingFileMode Controls what to do when trying to add an existing file
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addUncompressedFileToArchive($zip, $rootFolderPath, $localFilePath, $existingFileMode = self::EXISTING_FILES_OVERWRITE)
|
public function addUncompressedFileToArchive($zip, $rootFolderPath, $localFilePath, $existingFileMode = self::EXISTING_FILES_OVERWRITE)
|
||||||
@ -143,7 +143,7 @@ class ZipHelper
|
|||||||
/**
|
/**
|
||||||
* @param \ZipArchive $zip An opened zip archive object
|
* @param \ZipArchive $zip An opened zip archive object
|
||||||
* @param string $folderPath Path to the folder to be zipped
|
* @param string $folderPath Path to the folder to be zipped
|
||||||
* @param string|void $existingFileMode Controls what to do when trying to add an existing file
|
* @param string $existingFileMode Controls what to do when trying to add an existing file
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public function addFolderToArchive($zip, $folderPath, $existingFileMode = self::EXISTING_FILES_OVERWRITE)
|
public function addFolderToArchive($zip, $folderPath, $existingFileMode = self::EXISTING_FILES_OVERWRITE)
|
||||||
|
@ -479,10 +479,10 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $fileName
|
* @param string $fileName
|
||||||
* @param string|void $fieldDelimiter
|
* @param string $fieldDelimiter
|
||||||
* @param string|void $fieldEnclosure
|
* @param string $fieldEnclosure
|
||||||
* @param string|void $encoding
|
* @param string $encoding
|
||||||
* @param bool|void $shouldPreserveEmptyRows
|
* @param bool $shouldPreserveEmptyRows
|
||||||
* @return array All the read rows the given file
|
* @return array All the read rows the given file
|
||||||
*/
|
*/
|
||||||
private function getAllRowsForFile(
|
private function getAllRowsForFile(
|
||||||
|
@ -81,7 +81,7 @@ class SpoutTestStream
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $offset
|
* @param int $offset
|
||||||
* @param int|void $whence
|
* @param int $whence
|
||||||
* @return bool
|
* @return bool
|
||||||
*/
|
*/
|
||||||
public function stream_seek($offset, $whence = SEEK_SET)
|
public function stream_seek($offset, $whence = SEEK_SET)
|
||||||
|
@ -521,8 +521,8 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $fileName
|
* @param string $fileName
|
||||||
* @param bool|void $shouldFormatDates
|
* @param bool $shouldFormatDates
|
||||||
* @param bool|void $shouldPreserveEmptyRows
|
* @param bool $shouldPreserveEmptyRows
|
||||||
* @return array All the read rows the given file
|
* @return array All the read rows the given file
|
||||||
*/
|
*/
|
||||||
private function getAllRowsForFile($fileName, $shouldFormatDates = false, $shouldPreserveEmptyRows = false)
|
private function getAllRowsForFile($fileName, $shouldFormatDates = false, $shouldPreserveEmptyRows = false)
|
||||||
|
@ -16,8 +16,8 @@ class StyleManagerTest extends \PHPUnit_Framework_TestCase
|
|||||||
{
|
{
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array|void $styleAttributes
|
* @param array $styleAttributes
|
||||||
* @param array|void $customNumberFormats
|
* @param array $customNumberFormats
|
||||||
* @return StyleManager
|
* @return StyleManager
|
||||||
*/
|
*/
|
||||||
private function getStyleManagerMock($styleAttributes = [], $customNumberFormats = [])
|
private function getStyleManagerMock($styleAttributes = [], $customNumberFormats = [])
|
||||||
|
@ -621,8 +621,8 @@ class ReaderTest extends \PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $fileName
|
* @param string $fileName
|
||||||
* @param bool|void $shouldFormatDates
|
* @param bool $shouldFormatDates
|
||||||
* @param bool|void $shouldPreserveEmptyRows
|
* @param bool $shouldPreserveEmptyRows
|
||||||
* @return array All the read rows the given file
|
* @return array All the read rows the given file
|
||||||
*/
|
*/
|
||||||
private function getAllRowsForFile($fileName, $shouldFormatDates = false, $shouldPreserveEmptyRows = false)
|
private function getAllRowsForFile($fileName, $shouldFormatDates = false, $shouldPreserveEmptyRows = false)
|
||||||
|
@ -51,7 +51,7 @@ class ReflectionHelper
|
|||||||
* @param string $class
|
* @param string $class
|
||||||
* @param string $valueName
|
* @param string $valueName
|
||||||
* @param mixed|null $value
|
* @param mixed|null $value
|
||||||
* @param bool|void $saveOriginalValue
|
* @param bool $saveOriginalValue
|
||||||
* @return void
|
* @return void
|
||||||
*/
|
*/
|
||||||
public static function setStaticValue($class, $valueName, $value, $saveOriginalValue = true)
|
public static function setStaticValue($class, $valueName, $value, $saveOriginalValue = true)
|
||||||
|
@ -504,7 +504,8 @@ class WriterWithStyleTest extends \PHPUnit_Framework_TestCase
|
|||||||
$bordersApplied = 0;
|
$bordersApplied = 0;
|
||||||
/** @var \DOMElement $node */
|
/** @var \DOMElement $node */
|
||||||
foreach ($styleXfsElements->childNodes as $node) {
|
foreach ($styleXfsElements->childNodes as $node) {
|
||||||
if ($node->getAttribute('applyBorder') == 1) {
|
$shouldApplyBorder = ((int) $node->getAttribute('applyBorder') === 1);
|
||||||
|
if ($shouldApplyBorder) {
|
||||||
$bordersApplied++;
|
$bordersApplied++;
|
||||||
$this->assertTrue((int)$node->getAttribute('borderId') > 0, 'BorderId is greater than 0');
|
$this->assertTrue((int)$node->getAttribute('borderId') > 0, 'BorderId is greater than 0');
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user