Skip to content

Commit

Permalink
feat: add CapabilityStatus
Browse files Browse the repository at this point in the history
  • Loading branch information
Naoray committed Feb 11, 2025
1 parent dcf9563 commit cd01928
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/Endpoints/CapabilityEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function get(string $name, array $parameters = [])
* @return CapabilityCollection
* @throws ApiException
*/
public function list(array $parameters = [])
public function all(array $parameters = [])
{
return parent::rest_list(null, null, $parameters);
}
Expand Down
8 changes: 5 additions & 3 deletions src/Resources/Capability.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Mollie\Api\Resources;

use Mollie\Api\Types\CapabilityStatus;

class Capability extends BaseResource
{
/**
Expand Down Expand Up @@ -49,16 +51,16 @@ class Capability extends BaseResource

public function isEnabled()
{
return $this->status === 'enabled';
return $this->status === CapabilityStatus::ENABLED;
}

public function isPending()
{
return $this->status === 'pending';
return $this->status === CapabilityStatus::PENDING;
}

public function isDisabled()
{
return $this->status === 'disabled';
return $this->status === CapabilityStatus::DISABLED;
}
}
10 changes: 10 additions & 0 deletions src/Types/CapabilityStatus.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Mollie\Api\Types;

class CapabilityStatus
{
public const ENABLED = 'enabled';
public const PENDING = 'pending';
public const DISABLED = 'disabled';
}

0 comments on commit cd01928

Please sign in to comment.