Fix code style
This commit is contained in:
1 parent
740fcfb8c1
commit
b968513cb9
171 files changed
+517
-792
No files matched your search
@@ -5,8 +5,6 @@ namespace Box\Spout\Common\Helper\Escaper;
|
||||
/**
|
||||
* Class CSV
|
||||
* Provides functions to escape and unescape data for CSV files
|
||||
*
|
||||
* @package Box\Spout\Common\Helper\Escaper
|
||||
*/
|
||||
class CSV implements EscaperInterface
|
||||
{
|
||||
|
||||
@@ -4,8 +4,6 @@ namespace Box\Spout\Common\Helper\Escaper;
|
||||
|
||||
/**
|
||||
* Interface EscaperInterface
|
||||
*
|
||||
* @package Box\Spout\Common\Helper\Escaper
|
||||
*/
|
||||
interface EscaperInterface
|
||||
{
|
||||
|
||||
@@ -5,8 +5,6 @@ namespace Box\Spout\Common\Helper\Escaper;
|
||||
/**
|
||||
* Class ODS
|
||||
* Provides functions to escape and unescape data for ODS files
|
||||
*
|
||||
* @package Box\Spout\Common\Helper\Escaper
|
||||
*/
|
||||
class ODS implements EscaperInterface
|
||||
{
|
||||
|
||||
@@ -5,8 +5,6 @@ namespace Box\Spout\Common\Helper\Escaper;
|
||||
/**
|
||||
* Class XLSX
|
||||
* Provides functions to escape and unescape data for XLSX files
|
||||
*
|
||||
* @package Box\Spout\Common\Helper\Escaper
|
||||
*/
|
||||
class XLSX implements EscaperInterface
|
||||
{
|
||||
@@ -95,7 +93,7 @@ class XLSX implements EscaperInterface
|
||||
* "\t", "\r" and "\n" don't need to be escaped.
|
||||
*
|
||||
* NOTE: the logic has been adapted from the XlsxWriter library (BSD License)
|
||||
* @link https://github.com/jmcnamara/XlsxWriter/blob/f1e610f29/xlsxwriter/sharedstrings.py#L89
|
||||
* @see https://github.com/jmcnamara/XlsxWriter/blob/f1e610f29/xlsxwriter/sharedstrings.py#L89
|
||||
*
|
||||
* @return string[]
|
||||
*/
|
||||
@@ -108,7 +106,7 @@ class XLSX implements EscaperInterface
|
||||
$character = chr($charValue);
|
||||
if (preg_match("/{$this->escapableControlCharactersPattern}/", $character)) {
|
||||
$charHexValue = dechex($charValue);
|
||||
$escapedChar = '_x' . sprintf('%04s' , strtoupper($charHexValue)) . '_';
|
||||
$escapedChar = '_x' . sprintf('%04s', strtoupper($charHexValue)) . '_';
|
||||
$controlCharactersEscapingMap[$escapedChar] = $character;
|
||||
}
|
||||
}
|
||||
@@ -124,7 +122,7 @@ class XLSX implements EscaperInterface
|
||||
* So "\0" -> _x0000_ and "_x0000_" -> _x005F_x0000_.
|
||||
*
|
||||
* NOTE: the logic has been adapted from the XlsxWriter library (BSD License)
|
||||
* @link https://github.com/jmcnamara/XlsxWriter/blob/f1e610f29/xlsxwriter/sharedstrings.py#L89
|
||||
* @see https://github.com/jmcnamara/XlsxWriter/blob/f1e610f29/xlsxwriter/sharedstrings.py#L89
|
||||
*
|
||||
* @param string $string String to escape
|
||||
* @return string
|
||||
@@ -138,7 +136,7 @@ class XLSX implements EscaperInterface
|
||||
return $escapedString;
|
||||
}
|
||||
|
||||
return preg_replace_callback("/({$this->escapableControlCharactersPattern})/", function($matches) {
|
||||
return preg_replace_callback("/({$this->escapableControlCharactersPattern})/", function ($matches) {
|
||||
return $this->controlCharactersEscapingReverseMap[$matches[0]];
|
||||
}, $escapedString);
|
||||
}
|
||||
@@ -162,7 +160,7 @@ class XLSX implements EscaperInterface
|
||||
* So "_x0000_" -> "\0" and "_x005F_x0000_" -> "_x0000_"
|
||||
*
|
||||
* NOTE: the logic has been adapted from the XlsxWriter library (BSD License)
|
||||
* @link https://github.com/jmcnamara/XlsxWriter/blob/f1e610f29/xlsxwriter/sharedstrings.py#L89
|
||||
* @see https://github.com/jmcnamara/XlsxWriter/blob/f1e610f29/xlsxwriter/sharedstrings.py#L89
|
||||
*
|
||||
* @param string $string String to unescape
|
||||
* @return string
|
||||
|
||||
Reference in new issue
Block a user