Updated classes fromArray signatures (in-progress)
This commit is contained in:
parent
59f6875edf
commit
dfb812237b
43 changed files with 288 additions and 75 deletions
|
@ -37,8 +37,13 @@ class BackgroundFillFreeformGradient extends BackgroundFill implements ObjectTyp
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): BackgroundFill
|
||||
public static function fromArray(?array $data): ?BackgroundFillFreeformGradient
|
||||
{
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
|
||||
$object->type = BackgroundFillType::FREEFORM_GRADIENT;
|
||||
|
|
|
@ -57,8 +57,13 @@ class BackgroundFillGradient extends BackgroundFill implements ObjectTypeInterfa
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): BackgroundFillGradient
|
||||
public static function fromArray(?array $data): ?BackgroundFillGradient
|
||||
{
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = $data['type'] ?? null;
|
||||
$object->top_color = $data['top_color'] ?? 0;
|
||||
|
|
|
@ -34,10 +34,14 @@ class BackgroundFillSolid extends BackgroundFill implements ObjectTypeInterface
|
|||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public static function fromArray(array $data): BackgroundFill
|
||||
public static function fromArray(?array $data): ?BackgroundFillSolid
|
||||
{
|
||||
$object = new self();
|
||||
if($data === null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$object = new self();
|
||||
$object->type = BackgroundFillType::SOLID;
|
||||
$object->color = $data['color'];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue