Completed
Push — develop ( a23f68...3723bb )
by Adrien
19:36
created

Row   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 70
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Test Coverage

Coverage 84.62%

Importance

Changes 0
Metric Value
dl 0
loc 70
ccs 11
cts 13
cp 0.8462
rs 10
c 0
b 0
f 0
wmc 5
lcom 1
cbo 1

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __destruct() 0 4 1
A getRowIndex() 0 4 1
A getCellIterator() 0 4 1
A getWorksheet() 0 4 1
A __construct() 0 6 1
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
0 ignored issues
show
Bug introduced by
There is no parameter named $parent. Was it maybe removed?

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 method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
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