Skip to content

Commit

Permalink
Merge pull request #11 from whitecube/php8.1
Browse files Browse the repository at this point in the history
Add PHP 8.1 compatibility & Fix minimum PHP version to 7.4
  • Loading branch information
toonvandenbos authored Jan 17, 2022
2 parents ddaf693 + 9834958 commit 0c72dd6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
"minimum-stability": "dev",
"prefer-stable": true,
"require": {
"php": "^7.4|^8.0",
"brick/money": "0.5.*"
},
"require-dev": {
Expand Down
6 changes: 5 additions & 1 deletion src/Formatting/CustomFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class CustomFormatter extends Formatter
protected $name;

/**
* The custom formatter function
* The custom formatter function
*
* @var callable
*/
Expand Down Expand Up @@ -52,6 +52,10 @@ public function name(string $name)
*/
public function is($name = null)
{
if (is_null($name)) {
return is_null($this->name);
}

return strtolower($name) === strtolower($this->name);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Price.php
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ public function __toString()
*
* @return array
*/
public function jsonSerialize()
public function jsonSerialize(): array
{
$excl = $this->exclusive();
$incl = $this->inclusive();
Expand Down

0 comments on commit 0c72dd6

Please sign in to comment.