Skip to content

Commit 94963f4

Browse files
author
MarkBaker
committed
Type and return tpe cleanups
1 parent 198878b commit 94963f4

File tree

2 files changed

+41
-88
lines changed

2 files changed

+41
-88
lines changed

phpstan-baseline.neon

Lines changed: 0 additions & 70 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,76 +1160,6 @@ parameters:
11601160
count: 1
11611161
path: src/PhpSpreadsheet/Chart/Chart.php
11621162

1163-
-
1164-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:getBottomRightXOffset\\(\\) has no return type specified\\.$#"
1165-
count: 1
1166-
path: src/PhpSpreadsheet/Chart/Chart.php
1167-
1168-
-
1169-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:getBottomRightYOffset\\(\\) has no return type specified\\.$#"
1170-
count: 1
1171-
path: src/PhpSpreadsheet/Chart/Chart.php
1172-
1173-
-
1174-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:getTopLeftXOffset\\(\\) has no return type specified\\.$#"
1175-
count: 1
1176-
path: src/PhpSpreadsheet/Chart/Chart.php
1177-
1178-
-
1179-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:getTopLeftYOffset\\(\\) has no return type specified\\.$#"
1180-
count: 1
1181-
path: src/PhpSpreadsheet/Chart/Chart.php
1182-
1183-
-
1184-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:setBottomRightCell\\(\\) has no return type specified\\.$#"
1185-
count: 1
1186-
path: src/PhpSpreadsheet/Chart/Chart.php
1187-
1188-
-
1189-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:setBottomRightCell\\(\\) has parameter \\$cell with no type specified\\.$#"
1190-
count: 1
1191-
path: src/PhpSpreadsheet/Chart/Chart.php
1192-
1193-
-
1194-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:setBottomRightXOffset\\(\\) has no return type specified\\.$#"
1195-
count: 1
1196-
path: src/PhpSpreadsheet/Chart/Chart.php
1197-
1198-
-
1199-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:setBottomRightXOffset\\(\\) has parameter \\$xOffset with no type specified\\.$#"
1200-
count: 1
1201-
path: src/PhpSpreadsheet/Chart/Chart.php
1202-
1203-
-
1204-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:setBottomRightYOffset\\(\\) has no return type specified\\.$#"
1205-
count: 1
1206-
path: src/PhpSpreadsheet/Chart/Chart.php
1207-
1208-
-
1209-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:setBottomRightYOffset\\(\\) has parameter \\$yOffset with no type specified\\.$#"
1210-
count: 1
1211-
path: src/PhpSpreadsheet/Chart/Chart.php
1212-
1213-
-
1214-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:setTopLeftXOffset\\(\\) has no return type specified\\.$#"
1215-
count: 1
1216-
path: src/PhpSpreadsheet/Chart/Chart.php
1217-
1218-
-
1219-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:setTopLeftXOffset\\(\\) has parameter \\$xOffset with no type specified\\.$#"
1220-
count: 1
1221-
path: src/PhpSpreadsheet/Chart/Chart.php
1222-
1223-
-
1224-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:setTopLeftYOffset\\(\\) has no return type specified\\.$#"
1225-
count: 1
1226-
path: src/PhpSpreadsheet/Chart/Chart.php
1227-
1228-
-
1229-
message: "#^Method PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:setTopLeftYOffset\\(\\) has parameter \\$yOffset with no type specified\\.$#"
1230-
count: 1
1231-
path: src/PhpSpreadsheet/Chart/Chart.php
1232-
12331163
-
12341164
message: "#^Property PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Chart\\:\\:\\$legend \\(PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Legend\\) does not accept PhpOffice\\\\PhpSpreadsheet\\\\Chart\\\\Legend\\|null\\.$#"
12351165
count: 1

src/PhpSpreadsheet/Chart/Chart.php

Lines changed: 41 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -400,15 +400,15 @@ public function getMinorGridlines()
400400
/**
401401
* Set the Top Left position for the chart.
402402
*
403-
* @param string $cell
403+
* @param string $cellAddress
404404
* @param int $xOffset
405405
* @param int $yOffset
406406
*
407407
* @return $this
408408
*/
409-
public function setTopLeftPosition($cell, $xOffset = null, $yOffset = null)
409+
public function setTopLeftPosition($cellAddress, $xOffset = null, $yOffset = null)
410410
{
411-
$this->topLeftCellRef = $cell;
411+
$this->topLeftCellRef = $cellAddress;
412412
if ($xOffset !== null) {
413413
$this->setTopLeftXOffset($xOffset);
414414
}
@@ -446,13 +446,13 @@ public function getTopLeftCell()
446446
/**
447447
* Set the Top Left cell position for the chart.
448448
*
449-
* @param string $cell
449+
* @param string $cellAddress
450450
*
451451
* @return $this
452452
*/
453-
public function setTopLeftCell($cell)
453+
public function setTopLeftCell($cellAddress)
454454
{
455-
$this->topLeftCellRef = $cell;
455+
$this->topLeftCellRef = $cellAddress;
456456

457457
return $this;
458458
}
@@ -491,42 +491,52 @@ public function getTopLeftOffset()
491491
];
492492
}
493493

494+
/**
495+
* @param int $xOffset
496+
*
497+
* @return $this
498+
*/
494499
public function setTopLeftXOffset($xOffset)
495500
{
496501
$this->topLeftXOffset = $xOffset;
497502

498503
return $this;
499504
}
500505

501-
public function getTopLeftXOffset()
506+
public function getTopLeftXOffset(): int
502507
{
503508
return $this->topLeftXOffset;
504509
}
505510

511+
/**
512+
* @param int $yOffset
513+
*
514+
* @return $this
515+
*/
506516
public function setTopLeftYOffset($yOffset)
507517
{
508518
$this->topLeftYOffset = $yOffset;
509519

510520
return $this;
511521
}
512522

513-
public function getTopLeftYOffset()
523+
public function getTopLeftYOffset(): int
514524
{
515525
return $this->topLeftYOffset;
516526
}
517527

518528
/**
519529
* Set the Bottom Right position of the chart.
520530
*
521-
* @param string $cell
531+
* @param string $cellAddress
522532
* @param int $xOffset
523533
* @param int $yOffset
524534
*
525535
* @return $this
526536
*/
527-
public function setBottomRightPosition($cell = '', $xOffset = null, $yOffset = null)
537+
public function setBottomRightPosition($cellAddress = '', $xOffset = null, $yOffset = null)
528538
{
529-
$this->bottomRightCellRef = $cell;
539+
$this->bottomRightCellRef = $cellAddress;
530540
if ($xOffset !== null) {
531541
$this->setBottomRightXOffset($xOffset);
532542
}
@@ -551,19 +561,22 @@ public function getBottomRightPosition()
551561
];
552562
}
553563

554-
public function setBottomRightCell($cell)
564+
/**
565+
* Set the Bottom Right cell for the chart.
566+
*
567+
* @return $this
568+
*/
569+
public function setBottomRightCell(string $cellAddress = '')
555570
{
556-
$this->bottomRightCellRef = $cell;
571+
$this->bottomRightCellRef = $cellAddress;
557572

558573
return $this;
559574
}
560575

561576
/**
562577
* Get the cell address where the bottom right of the chart is fixed.
563-
*
564-
* @return string
565578
*/
566-
public function getBottomRightCell()
579+
public function getBottomRightCell(): string
567580
{
568581
return $this->bottomRightCellRef;
569582
}
@@ -602,26 +615,36 @@ public function getBottomRightOffset()
602615
];
603616
}
604617

618+
/**
619+
* @param int $xOffset
620+
*
621+
* @return $this
622+
*/
605623
public function setBottomRightXOffset($xOffset)
606624
{
607625
$this->bottomRightXOffset = $xOffset;
608626

609627
return $this;
610628
}
611629

612-
public function getBottomRightXOffset()
630+
public function getBottomRightXOffset(): int
613631
{
614632
return $this->bottomRightXOffset;
615633
}
616634

635+
/**
636+
* @param int $yOffset
637+
*
638+
* @return $this
639+
*/
617640
public function setBottomRightYOffset($yOffset)
618641
{
619642
$this->bottomRightYOffset = $yOffset;
620643

621644
return $this;
622645
}
623646

624-
public function getBottomRightYOffset()
647+
public function getBottomRightYOffset(): int
625648
{
626649
return $this->bottomRightYOffset;
627650
}

0 commit comments

Comments
 (0)