Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 2 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,24 @@
jobs:
# Check there is no syntax errors in the project
php-linter:
name: PHP Syntax check 5.6|7.4|8.1
name: PHP Syntax check 7.4|8.1
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2.0.0

- name: PHP syntax checker 5.6
uses: prestashop/github-action-php-lint/5.6@master
with:
folder-to-exclude: "! -path \"./.php-cs-fixer.dist.php\" ! -path \"./tests/*\" ! -path \"./vendor/*\""

- name: PHP syntax checker 7.4
uses: prestashop/github-action-php-lint/7.4@master
with:
folder-to-exclude: "! -path \"./.php-cs-fixer.dist.php\" ! -path \"./tests/*\" ! -path \"./vendor/*\""

- name: PHP syntax checker 8.1
uses: prestashop/github-action-php-lint/8.1@master
with:
folder-to-exclude: "! -path \"./.php-cs-fixer.dist.php\" ! -path \"./tests/*\" ! -path \"./vendor/*\""

# Check the PHP code follow the coding standards
php-cs-fixer-and-phpstan:

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
name: PHP-CS-AND-PHPSTAN
runs-on: ubuntu-latest
steps:
Expand All @@ -38,7 +33,7 @@
uses: actions/checkout@v2.0.0

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
uses: actions/checkout@v2.0.0

- name: Cache dependencies
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: vendor
key: php-${{ hashFiles('composer.lock') }}
Expand Down
Binary file added bridgesdk.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "202ecommerce/bridge-sdk",
"version": "1.0.0",
"version": "2.0.0",
"description": "Bridge API SDK",
"homepage": "https://docs.bridgeapi.io/",
"license": "AFL-3.0",
Expand Down
Binary file added gitrepo.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion src/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Client
/**
* @var string
*/
private $version = '2021-06-01';
private $version = '2025-01-15';

/**
* @var Stream
Expand Down
4 changes: 3 additions & 1 deletion src/Model/AbstractModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ public function jsonSerialize()
foreach ($getterName as $value) {
if ('get' === substr($value, 0, 3) && 'getAfterParam' !== $value) {
$key = lcfirst(substr($value, 3, \strlen($value)));
$gettableAttributes[$this->transformToPascalCase($key)] = $this->{$value}();
if (false === empty($this->{$value}())) {
$gettableAttributes[$this->transformToPascalCase($key)] = $this->{$value}();
}
}
}

Expand Down
202 changes: 8 additions & 194 deletions src/Model/Bank/Bank.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,21 +40,6 @@ class Bank extends AbstractModel
*/
protected $logoUrl;

/**
* @var null|bool
*/
protected $isHighlighted;

/**
* @var ?string
*/
protected $primaryColor;

/**
* @var ?string
*/
protected $secondaryColor;

/**
* @var ?string
*/
Expand All @@ -63,22 +48,7 @@ class Bank extends AbstractModel
/**
* @var array<string>
*/
protected $capabilities = [];

/**
* @var array<array>
*/
protected $form = [];

/**
* @var array<string>
*/
protected $channelType = [];

/**
* @var ?int
*/
protected $displayOrder;
protected $environments = [];

/**
* @return int
Expand Down Expand Up @@ -184,84 +154,6 @@ public function setLogoUrl($logoUrl)
);
}

/**
* @return null|bool
*/
public function isHighlighted()
{
return $this->isHighlighted;
}

/**
* @param null|bool $isHighlighted
*
* @return Bank
*/
public function setIsHighlighted($isHighlighted)
{
if (true === \is_bool($isHighlighted) || null === $isHighlighted) {
$this->isHighlighted = $isHighlighted;

return $this;
}

throw new InvalidArgumentException(
'Is highlighted must be a string or null, '.\gettype($isHighlighted).' is given.'
);
}

/**
* @return null|string
*/
public function getPrimaryColor()
{
return $this->primaryColor;
}

/**
* @param null|string $primaryColor
*
* @return Bank
*/
public function setPrimaryColor($primaryColor)
{
if (true === \is_string($primaryColor) || null === $primaryColor) {
$this->primaryColor = $primaryColor;

return $this;
}

throw new InvalidArgumentException(
'Primary color must be a string or null, '.\gettype($primaryColor).' is given.'
);
}

/**
* @return null|string
*/
public function getSecondaryColor()
{
return $this->secondaryColor;
}

/**
* @param null|string $secondaryColor
*
* @return Bank
*/
public function setSecondaryColor($secondaryColor)
{
if (true === \is_string($secondaryColor) || null === $secondaryColor) {
$this->secondaryColor = $secondaryColor;

return $this;
}

throw new InvalidArgumentException(
'Secondary color must be a string or null, '.\gettype($secondaryColor).' is given.'
);
}

/**
* @return null|string
*/
Expand Down Expand Up @@ -291,104 +183,26 @@ public function setParentName($parentName)
/**
* @return array<string>
*/
public function getCapabilities()
{
return $this->capabilities;
}

/**
* @param array<string> $capabilities
*
* @return Bank
*/
public function setCapabilities($capabilities)
{
if (true === \is_array($capabilities)) {
$this->capabilities = $capabilities;

return $this;
}

throw new InvalidArgumentException(
'Capabilities must be an array, '.\gettype($capabilities).' is given.'
);
}

/**
* @return array<array>
*/
public function getForm()
{
return $this->form;
}

/**
* @param array<array> $form
*
* @return Bank
*/
public function setForm($form)
{
if (true === \is_array($form)) {
$this->form = $form;

return $this;
}

throw new InvalidArgumentException(
'Form must be an array, '.\gettype($form).' is given.'
);
}

/**
* @return array<string>
*/
public function getChannelType()
{
return $this->channelType;
}

/**
* @param array<string> $channelType
*
* @return Bank
*/
public function setChannelType($channelType)
{
if (true === \is_array($channelType)) {
$this->channelType = $channelType;

return $this;
}

throw new InvalidArgumentException(
'Channel type must be an array, '.\gettype($channelType).' is given.'
);
}

/**
* @return null|int
*/
public function getDisplayOrder()
public function getEnvironments()
{
return $this->displayOrder;
return $this->environments;
}

/**
* @param null|int $displayOrder
* @param array<string> $environments
*
* @return Bank
*/
public function setDisplayOrder($displayOrder)
public function setEnvironments($environments)
{
if (true === \is_int($displayOrder) || null === $displayOrder) {
$this->displayOrder = $displayOrder;
if (true === \is_array($environments)) {
$this->environments = $environments;

return $this;
}

throw new InvalidArgumentException(
'Display order must be an int or null, '.\gettype($displayOrder).' is given.'
'Environments must be an array, '.\gettype($environments).' is given.'
);
}
}
Loading
Loading