mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-15 04:26:25 +00:00
A few more native return types
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -35,10 +35,8 @@ class Title
|
||||
|
||||
/**
|
||||
* Get caption.
|
||||
*
|
||||
* @return array|RichText|string
|
||||
*/
|
||||
public function getCaption()
|
||||
public function getCaption(): array|RichText|string
|
||||
{
|
||||
return $this->caption;
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user