Skip to content

Commit 161d82d

Browse files
committed
A few more native return types
1 parent bab6fc4 commit 161d82d

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

src/PhpSpreadsheet/Chart/DataSeries.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ public function getPlotLabels(): array
233233
*
234234
* @return DataSeriesValues|false
235235
*/
236-
public function getPlotLabelByIndex(mixed $index)
236+
public function getPlotLabelByIndex(mixed $index): bool|DataSeriesValues
237237
{
238238
$keys = array_keys($this->plotLabel);
239239
if (in_array($index, $keys)) {
@@ -258,7 +258,7 @@ public function getPlotCategories(): array
258258
*
259259
* @return DataSeriesValues|false
260260
*/
261-
public function getPlotCategoryByIndex(mixed $index)
261+
public function getPlotCategoryByIndex(mixed $index): bool|DataSeriesValues
262262
{
263263
$keys = array_keys($this->plotCategory);
264264
if (in_array($index, $keys)) {
@@ -305,7 +305,7 @@ public function getPlotValues(): array
305305
*
306306
* @return DataSeriesValues|false
307307
*/
308-
public function getPlotValuesByIndex(mixed $index)
308+
public function getPlotValuesByIndex(mixed $index): bool|DataSeriesValues
309309
{
310310
$keys = array_keys($this->plotValues);
311311
if (in_array($index, $keys)) {

src/PhpSpreadsheet/Chart/Title.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,8 @@ public function __construct(array|RichText|string $caption = '', ?Layout $layout
3535

3636
/**
3737
* Get caption.
38-
*
39-
* @return array|RichText|string
4038
*/
41-
public function getCaption()
39+
public function getCaption(): array|RichText|string
4240
{
4341
return $this->caption;
4442
}

src/PhpSpreadsheet/Reader/Xls/Escher.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,10 +86,8 @@ public function __construct(mixed $object)
8686

8787
/**
8888
* Load Escher stream data. May be a partial Escher stream.
89-
*
90-
* @return BSE|BstoreContainer|DgContainer|DggContainer|\PhpOffice\PhpSpreadsheet\Shared\Escher|SpContainer|SpgrContainer
9189
*/
92-
public function load(string $data)
90+
public function load(string $data): BSE|BstoreContainer|DgContainer|DggContainer|\PhpOffice\PhpSpreadsheet\Shared\Escher|SpContainer|SpgrContainer
9391
{
9492
$this->data = $data;
9593

src/PhpSpreadsheet/Spreadsheet.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1082,7 +1082,7 @@ public function getCellXfByIndex(int $cellStyleIndex): Style
10821082
*
10831083
* @return false|Style
10841084
*/
1085-
public function getCellXfByHashCode(string $hashcode)
1085+
public function getCellXfByHashCode(string $hashcode): bool|Style
10861086
{
10871087
foreach ($this->cellXfCollection as $cellXf) {
10881088
if ($cellXf->getHashCode() === $hashcode) {
@@ -1185,7 +1185,7 @@ public function getCellStyleXfByIndex(int $cellStyleIndex): Style
11851185
*
11861186
* @return false|Style
11871187
*/
1188-
public function getCellStyleXfByHashCode(string $hashcode)
1188+
public function getCellStyleXfByHashCode(string $hashcode): bool|Style
11891189
{
11901190
foreach ($this->cellStyleXfCollection as $cellStyleXf) {
11911191
if ($cellStyleXf->getHashCode() === $hashcode) {

0 commit comments

Comments
 (0)