@@ -43,7 +43,6 @@ discard block |
||
43 | 43 | /** |
44 | 44 | * Create a new row. |
45 | 45 | * |
46 | - * @param \PhpOffice\PhpSpreadsheet\Worksheet $parent |
|
47 | 46 | * @param int $rowIndex |
48 | 47 | */ |
49 | 48 | public function __construct(\PhpOffice\PhpSpreadsheet\Worksheet $worksheet = null, $rowIndex = 1) |
@@ -87,7 +86,7 @@ discard block |
||
87 | 86 | /** |
88 | 87 | * Returns bound worksheet |
89 | 88 | * |
90 | - * @return Worksheet |
|
89 | + * @return |
|
91 | 90 | */ |
92 | 91 | public function getWorksheet() |
93 | 92 | { |
@@ -41,7 +41,7 @@ |
||
41 | 41 | echo '<b>Custom Properties: </b><br />'; |
42 | 42 | /* Loop through the list of custom properties **/ |
43 | 43 | foreach ($customPropertyList as $customPropertyName) { |
44 | - echo '<b>',$customPropertyName,': </b>'; |
|
44 | + echo '<b>', $customPropertyName, ': </b>'; |
|
45 | 45 | /* Retrieve the property value **/ |
46 | 46 | $propertyValue = $spreadsheet->getProperties()->getCustomPropertyValue($customPropertyName); |
47 | 47 | /* Retrieve the property type **/ |
@@ -32,7 +32,7 @@ |
||
32 | 32 | // $inputFileType = 'Gnumeric'; |
33 | 33 | $inputFileName = './sampleData/example1.xls'; |
34 | 34 | |
35 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
35 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
36 | 36 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
37 | 37 | echo 'Turning Formatting off for Load<br />'; |
38 | 38 | $objReader->setReadDataOnly(true); |
@@ -30,11 +30,11 @@ |
||
30 | 30 | |
31 | 31 | $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); |
32 | 32 | $inputFileName = array_shift($inputFileNames); |
33 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
33 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #1 using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
34 | 34 | $spreadsheet = $reader->load($inputFileName); |
35 | 35 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
36 | 36 | foreach ($inputFileNames as $sheet => $inputFileName) { |
37 | - echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #',($sheet + 2),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
37 | + echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #', ($sheet + 2), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
38 | 38 | $reader->setSheetIndex($sheet + 1); |
39 | 39 | $reader->loadIntoExisting($inputFileName, $spreadsheet); |
40 | 40 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
@@ -32,7 +32,7 @@ |
||
32 | 32 | // $inputFileType = 'Gnumeric'; |
33 | 33 | $inputFileName = './sampleData/example1.xls'; |
34 | 34 | |
35 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
35 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
36 | 36 | $objReader = PHPExcel_IOFactory::createReader($inputFileType); |
37 | 37 | echo 'Turning Formatting off for Load<br />'; |
38 | 38 | $objReader->setReadDataOnly(true); |
@@ -26,17 +26,17 @@ |
||
26 | 26 | $inputFileName = './sampleData/example1.tsv'; |
27 | 27 | |
28 | 28 | $reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType); |
29 | -echo 'Loading file ',pathinfo($inputFileName, PATHINFO_BASENAME),' into WorkSheet #1 using IOFactory with a defined reader type of ',$inputFileType,'<br />'; |
|
29 | +echo 'Loading file ', pathinfo($inputFileName, PATHINFO_BASENAME), ' into WorkSheet #1 using IOFactory with a defined reader type of ', $inputFileType, '<br />'; |
|
30 | 30 | $reader->setDelimiter("\t"); |
31 | 31 | $spreadsheet = $reader->load($inputFileName); |
32 | 32 | $spreadsheet->getActiveSheet()->setTitle(pathinfo($inputFileName, PATHINFO_BASENAME)); |
33 | 33 | |
34 | 34 | echo '<hr />'; |
35 | 35 | |
36 | -echo $spreadsheet->getSheetCount(),' worksheet',(($spreadsheet->getSheetCount() == 1) ? '' : 's'),' loaded<br /><br />'; |
|
36 | +echo $spreadsheet->getSheetCount(), ' worksheet', (($spreadsheet->getSheetCount() == 1) ? '' : 's'), ' loaded<br /><br />'; |
|
37 | 37 | $loadedSheetNames = $spreadsheet->getSheetNames(); |
38 | 38 | foreach ($loadedSheetNames as $sheetIndex => $loadedSheetName) { |
39 | - echo '<b>Worksheet #',$sheetIndex,' -> ',$loadedSheetName,' (Formatted)</b><br />'; |
|
39 | + echo '<b>Worksheet #', $sheetIndex, ' -> ', $loadedSheetName, ' (Formatted)</b><br />'; |
|
40 | 40 | $spreadsheet->setActiveSheetIndexByName($loadedSheetName); |
41 | 41 | $sheetData = $spreadsheet->getActiveSheet()->toArray(null, true, true, true); |
42 | 42 | var_dump($sheetData); |
@@ -285,6 +285,11 @@ discard block |
||
285 | 285 | return isset($c->v) ? (string) $c->v : null; |
286 | 286 | } |
287 | 287 | |
288 | + /** |
|
289 | + * @param string $r |
|
290 | + * @param string $cellDataType |
|
291 | + * @param string $castBaseType |
|
292 | + */ |
|
288 | 293 | private function castToFormula($c, $r, &$cellDataType, &$value, &$calculatedValue, &$sharedFormulas, $castBaseType) |
289 | 294 | { |
290 | 295 | $cellDataType = 'f'; |
@@ -2004,6 +2009,9 @@ discard block |
||
2004 | 2009 | } |
2005 | 2010 | } |
2006 | 2011 | |
2012 | + /** |
|
2013 | + * @param Style\Border $docBorder |
|
2014 | + */ |
|
2007 | 2015 | private static function readBorder($docBorder, $eleBorder) |
2008 | 2016 | { |
2009 | 2017 | if (isset($eleBorder['style'])) { |
@@ -2128,6 +2136,9 @@ discard block |
||
2128 | 2136 | return preg_replace('~[^/]+/\.\./~', '', dirname($base) . "/$add"); |
2129 | 2137 | } |
2130 | 2138 | |
2139 | + /** |
|
2140 | + * @param string $style |
|
2141 | + */ |
|
2131 | 2142 | private static function toCSSArray($style) |
2132 | 2143 | { |
2133 | 2144 | $style = str_replace(["\r", "\n"], '', $style); |