-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6b64592
commit 44f4668
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Enjin\Platform\FuelTanks\Models\Substrate; | ||
|
||
use Illuminate\Support\Arr; | ||
|
||
class MinimumInfusionParams extends FuelTankRules | ||
{ | ||
/** | ||
* Creates a new instance. | ||
*/ | ||
public function __construct(public string $min) {} | ||
|
||
/** | ||
* Creates a new instance from the given array. | ||
*/ | ||
public static function fromEncodable(array $params): self | ||
{ | ||
return new self( | ||
min: gmp_strval(Arr::get($params, 'MinimumInfusion')), | ||
); | ||
} | ||
|
||
/** | ||
* Returns the encodable representation of this instance. | ||
*/ | ||
public function toEncodable(): array | ||
{ | ||
return [ | ||
'MinimumInfusion' => $this->min, | ||
]; | ||
} | ||
|
||
public function toArray(): array | ||
{ | ||
return [ | ||
'MinimumInfusion' => $this->min, | ||
]; | ||
} | ||
|
||
public function validate(string $value): bool | ||
{ | ||
return true; | ||
} | ||
} |