1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace PhpOffice\PhpSpreadsheet\Worksheet; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet. |
7
|
|
|
* |
8
|
|
|
* This library is free software; you can redistribute it and/or |
9
|
|
|
* modify it under the terms of the GNU Lesser General Public |
10
|
|
|
* License as published by the Free Software Foundation; either |
11
|
|
|
* version 2.1 of the License, or (at your option) any later version. |
12
|
|
|
* |
13
|
|
|
* This library is distributed in the hope that it will be useful, |
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
16
|
|
|
* Lesser General Public License for more details. |
17
|
|
|
* |
18
|
|
|
* You should have received a copy of the GNU Lesser General Public |
19
|
|
|
* License along with this library; if not, write to the Free Software |
20
|
|
|
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
21
|
|
|
* |
22
|
|
|
* @category PhpSpreadsheet |
23
|
|
|
* |
24
|
|
|
* @copyright Copyright (c) 2006 - 2016 PhpSpreadsheet (https://github.com/PHPOffice/PhpSpreadsheet) |
25
|
|
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL |
26
|
|
|
*/ |
27
|
|
|
class Row |
28
|
|
|
{ |
29
|
|
|
/** |
30
|
|
|
* \PhpOffice\PhpSpreadsheet\Worksheet. |
31
|
|
|
* |
32
|
|
|
* @var \PhpOffice\PhpSpreadsheet\Worksheet |
33
|
|
|
*/ |
34
|
|
|
private $worksheet; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* Row index. |
38
|
|
|
* |
39
|
|
|
* @var int |
40
|
|
|
*/ |
41
|
|
|
private $rowIndex = 0; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* Create a new row. |
45
|
|
|
* |
46
|
|
|
* @param \PhpOffice\PhpSpreadsheet\Worksheet $parent |
|
|
|
|
47
|
|
|
* @param int $rowIndex |
48
|
|
|
*/ |
49
|
7 |
|
public function __construct(\PhpOffice\PhpSpreadsheet\Worksheet $worksheet = null, $rowIndex = 1) |
50
|
|
|
{ |
51
|
|
|
// Set parent and row index |
52
|
7 |
|
$this->worksheet = $worksheet; |
53
|
7 |
|
$this->rowIndex = $rowIndex; |
54
|
7 |
|
} |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Destructor. |
58
|
|
|
*/ |
59
|
7 |
|
public function __destruct() |
60
|
|
|
{ |
61
|
7 |
|
unset($this->worksheet); |
62
|
7 |
|
} |
63
|
|
|
|
64
|
|
|
/** |
65
|
|
|
* Get row index. |
66
|
|
|
* |
67
|
|
|
* @return int |
68
|
|
|
*/ |
69
|
4 |
|
public function getRowIndex() |
70
|
|
|
{ |
71
|
4 |
|
return $this->rowIndex; |
72
|
|
|
} |
73
|
|
|
|
74
|
|
|
/** |
75
|
|
|
* Get cell iterator. |
76
|
|
|
* |
77
|
|
|
* @param string $startColumn The column address at which to start iterating |
78
|
|
|
* @param string $endColumn Optionally, the column address at which to stop iterating |
79
|
|
|
* |
80
|
|
|
* @return RowCellIterator |
81
|
|
|
*/ |
82
|
2 |
|
public function getCellIterator($startColumn = 'A', $endColumn = null) |
83
|
|
|
{ |
84
|
2 |
|
return new RowCellIterator($this->worksheet, $this->rowIndex, $startColumn, $endColumn); |
85
|
|
|
} |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* Returns bound worksheet. |
89
|
|
|
* |
90
|
|
|
* @return Worksheet |
91
|
|
|
*/ |
92
|
|
|
public function getWorksheet() |
93
|
|
|
{ |
94
|
|
|
return $this->worksheet; |
95
|
|
|
} |
96
|
|
|
} |
97
|
|
|
|
This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.
Consider the following example. The parameter
$italy
is not defined by the methodfinale(...)
.The most likely cause is that the parameter was removed, but the annotation was not.