Skip to content

Commit 0e6f413

Browse files
committed
Rector TypedPropertyFromStrictGetterMethodReturnTypeRector
1 parent b35dd8d commit 0e6f413

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+134
-378
lines changed

src/PhpSpreadsheet/Calculation/Engine/BranchPruner.php

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,11 @@ class BranchPruner
4747
*/
4848
protected $braceDepthMap = [];
4949

50-
/**
51-
* @var null|string
52-
*/
53-
protected $currentCondition;
50+
protected ?string $currentCondition = null;
5451

55-
/**
56-
* @var null|string
57-
*/
58-
protected $currentOnlyIf;
52+
protected ?string $currentOnlyIf = null;
5953

60-
/**
61-
* @var null|string
62-
*/
63-
protected $currentOnlyIfNot;
54+
protected ?string $currentOnlyIfNot = null;
6455

6556
/**
6657
* @var null|string

src/PhpSpreadsheet/Calculation/Financial/CashFlow/Constant/Periodic/InterestAndPrincipal.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
class InterestAndPrincipal
88
{
9-
/** @var float */
10-
protected $interest;
9+
protected float $interest;
1110

1211
protected float $principal;
1312

src/PhpSpreadsheet/Cell/CellAddress.php

Lines changed: 4 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,25 +9,13 @@ class CellAddress
99
{
1010
protected ?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $worksheet;
1111

12-
/**
13-
* @var string
14-
*/
15-
protected $cellAddress;
12+
protected string $cellAddress;
1613

17-
/**
18-
* @var string
19-
*/
20-
protected $columnName;
14+
protected string $columnName = '';
2115

22-
/**
23-
* @var int
24-
*/
25-
protected $columnId;
16+
protected int $columnId;
2617

27-
/**
28-
* @var int
29-
*/
30-
protected $rowId;
18+
protected int $rowId;
3119

3220
public function __construct(string $cellAddress, ?Worksheet $worksheet = null)
3321
{

src/PhpSpreadsheet/Cell/ColumnRange.php

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ class ColumnRange implements AddressRange
88
{
99
protected ?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $worksheet;
1010

11-
/**
12-
* @var int
13-
*/
14-
protected $from;
11+
protected int $from;
1512

16-
/**
17-
* @var int
18-
*/
19-
protected $to;
13+
protected int $to;
2014

2115
public function __construct(string $from, ?string $to = null, ?Worksheet $worksheet = null)
2216
{

src/PhpSpreadsheet/Cell/DataValidation.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -480,8 +480,7 @@ public function __clone()
480480
}
481481
}
482482

483-
/** @var ?string */
484-
private $sqref;
483+
private ?string $sqref = null;
485484

486485
public function getSqref(): ?string
487486
{

src/PhpSpreadsheet/Cell/RowRange.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,9 @@ class RowRange implements AddressRange
88
{
99
protected ?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $worksheet;
1010

11-
/**
12-
* @var int
13-
*/
14-
protected $from;
15-
16-
/**
17-
* @var int
18-
*/
19-
protected $to;
11+
protected int $from;
12+
13+
protected int $to;
2014

2115
public function __construct(int $from, ?int $to = null, ?Worksheet $worksheet = null)
2216
{

src/PhpSpreadsheet/CellReferenceHelper.php

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77

88
class CellReferenceHelper
99
{
10-
/**
11-
* @var string
12-
*/
13-
protected $beforeCellAddress;
10+
protected string $beforeCellAddress;
1411

1512
protected int $beforeColumn;
1613

src/PhpSpreadsheet/Chart/Axis.php

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,13 @@ public function __construct()
2626

2727
/**
2828
* Chart Major Gridlines as.
29-
*
30-
* @var ?GridLines
3129
*/
32-
private $majorGridlines;
30+
private ?\PhpOffice\PhpSpreadsheet\Chart\GridLines $majorGridlines = null;
3331

3432
/**
3533
* Chart Minor Gridlines as.
36-
*
37-
* @var ?GridLines
3834
*/
39-
private $minorGridlines;
35+
private ?\PhpOffice\PhpSpreadsheet\Chart\GridLines $minorGridlines = null;
4036

4137
/**
4238
* Axis Number.
@@ -49,11 +45,9 @@ public function __construct()
4945
'numeric' => null,
5046
];
5147

52-
/** @var string */
53-
private $axisType = '';
48+
private string $axisType = '';
5449

55-
/** @var ?AxisText */
56-
private $axisText;
50+
private ?\PhpOffice\PhpSpreadsheet\Chart\AxisText $axisText = null;
5751

5852
/**
5953
* Axis Options.
@@ -265,8 +259,7 @@ public function getLineProperty($propertyName)
265259
return $this->getLineColorProperty($propertyName);
266260
}
267261

268-
/** @var string */
269-
private $crossBetween = ''; // 'between' or 'midCat' might be better
262+
private string $crossBetween = ''; // 'between' or 'midCat' might be better
270263

271264
public function setCrossBetween(string $crossBetween): self
272265
{

src/PhpSpreadsheet/Chart/AxisText.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@
66

77
class AxisText extends Properties
88
{
9-
/** @var ?int */
10-
private $rotation;
9+
private ?int $rotation = null;
1110

1211
private \PhpOffice\PhpSpreadsheet\Style\Font $font;
1312

src/PhpSpreadsheet/Chart/Chart.php

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,8 @@ class Chart
1616

1717
/**
1818
* Worksheet.
19-
*
20-
* @var ?Worksheet
2119
*/
22-
private $worksheet;
20+
private ?\PhpOffice\PhpSpreadsheet\Worksheet\Worksheet $worksheet = null;
2321

2422
/**
2523
* Chart Title.
@@ -93,10 +91,8 @@ class Chart
9391

9492
/**
9593
* Bottom-Right Cell Position.
96-
*
97-
* @var string
9894
*/
99-
private $bottomRightCellRef = '';
95+
private string $bottomRightCellRef = '';
10096

10197
/**
10298
* Bottom-Right X-Offset.
@@ -112,17 +108,13 @@ class Chart
112108
*/
113109
private $bottomRightYOffset = 10;
114110

115-
/** @var ?int */
116-
private $rotX;
111+
private ?int $rotX = null;
117112

118-
/** @var ?int */
119-
private $rotY;
113+
private ?int $rotY = null;
120114

121-
/** @var ?int */
122-
private $rAngAx;
115+
private ?int $rAngAx = null;
123116

124-
/** @var ?int */
125-
private $perspective;
117+
private ?int $perspective = null;
126118

127119
/** @var bool */
128120
private $oneCellAnchor = false;

0 commit comments

Comments
 (0)