Skip to content

Commit

Permalink
A few more native return types
Browse files Browse the repository at this point in the history
  • Loading branch information
PowerKiKi committed Dec 11, 2023
1 parent bab6fc4 commit 161d82d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/PhpSpreadsheet/Chart/DataSeries.php
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ public function getPlotLabels(): array
*
* @return DataSeriesValues|false
*/
public function getPlotLabelByIndex(mixed $index)
public function getPlotLabelByIndex(mixed $index): bool|DataSeriesValues
{
$keys = array_keys($this->plotLabel);
if (in_array($index, $keys)) {
Expand All @@ -258,7 +258,7 @@ public function getPlotCategories(): array
*
* @return DataSeriesValues|false
*/
public function getPlotCategoryByIndex(mixed $index)
public function getPlotCategoryByIndex(mixed $index): bool|DataSeriesValues
{
$keys = array_keys($this->plotCategory);
if (in_array($index, $keys)) {
Expand Down Expand Up @@ -305,7 +305,7 @@ public function getPlotValues(): array
*
* @return DataSeriesValues|false
*/
public function getPlotValuesByIndex(mixed $index)
public function getPlotValuesByIndex(mixed $index): bool|DataSeriesValues
{
$keys = array_keys($this->plotValues);
if (in_array($index, $keys)) {
Expand Down
4 changes: 1 addition & 3 deletions src/PhpSpreadsheet/Chart/Title.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,8 @@ public function __construct(array|RichText|string $caption = '', ?Layout $layout

/**
* Get caption.
*
* @return array|RichText|string
*/
public function getCaption()
public function getCaption(): array|RichText|string
{
return $this->caption;
}
Expand Down
4 changes: 1 addition & 3 deletions src/PhpSpreadsheet/Reader/Xls/Escher.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,8 @@ public function __construct(mixed $object)

/**
* Load Escher stream data. May be a partial Escher stream.
*
* @return BSE|BstoreContainer|DgContainer|DggContainer|\PhpOffice\PhpSpreadsheet\Shared\Escher|SpContainer|SpgrContainer
*/
public function load(string $data)
public function load(string $data): BSE|BstoreContainer|DgContainer|DggContainer|\PhpOffice\PhpSpreadsheet\Shared\Escher|SpContainer|SpgrContainer
{
$this->data = $data;

Expand Down
4 changes: 2 additions & 2 deletions src/PhpSpreadsheet/Spreadsheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ public function getCellXfByIndex(int $cellStyleIndex): Style
*
* @return false|Style
*/
public function getCellXfByHashCode(string $hashcode)
public function getCellXfByHashCode(string $hashcode): bool|Style
{
foreach ($this->cellXfCollection as $cellXf) {
if ($cellXf->getHashCode() === $hashcode) {
Expand Down Expand Up @@ -1185,7 +1185,7 @@ public function getCellStyleXfByIndex(int $cellStyleIndex): Style
*
* @return false|Style
*/
public function getCellStyleXfByHashCode(string $hashcode)
public function getCellStyleXfByHashCode(string $hashcode): bool|Style
{
foreach ($this->cellStyleXfCollection as $cellStyleXf) {
if ($cellStyleXf->getHashCode() === $hashcode) {
Expand Down

0 comments on commit 161d82d

Please sign in to comment.