A few more native return types

This commit is contained in:
Adrien Crivelli
2023-12-11 09:19:10 +01:00
parent bab6fc4e24
commit 161d82d2bc
4 changed files with 7 additions and 11 deletions
+3 -3
View File
@@ -233,7 +233,7 @@ class DataSeries
*
* @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)) {
@@ -258,7 +258,7 @@ class DataSeries
*
* @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)) {
@@ -305,7 +305,7 @@ class DataSeries
*
* @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)) {
+1 -3
View File
@@ -35,10 +35,8 @@ class Title
/**
* Get caption.
*
* @return array|RichText|string
*/
public function getCaption()
public function getCaption(): array|RichText|string
{
return $this->caption;
}
+1 -3
View File
@@ -86,10 +86,8 @@ class Escher
/**
* 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;
+2 -2
View File
@@ -1082,7 +1082,7 @@ class Spreadsheet implements JsonSerializable
*
* @return false|Style
*/
public function getCellXfByHashCode(string $hashcode)
public function getCellXfByHashCode(string $hashcode): bool|Style
{
foreach ($this->cellXfCollection as $cellXf) {
if ($cellXf->getHashCode() === $hashcode) {
@@ -1185,7 +1185,7 @@ class Spreadsheet implements JsonSerializable
*
* @return false|Style
*/
public function getCellStyleXfByHashCode(string $hashcode)
public function getCellStyleXfByHashCode(string $hashcode): bool|Style
{
foreach ($this->cellStyleXfCollection as $cellStyleXf) {
if ($cellStyleXf->getHashCode() === $hashcode) {