Skip to content

Commit

Permalink
feature: Support PHP ^8.0 (#69)
Browse files Browse the repository at this point in the history
* feature: Support PHP ^8.0

* feature: Support PHP ^8.0
  • Loading branch information
fibble authored Apr 25, 2024
1 parent fa56bc7 commit 8e62453
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ jobs:
security:
uses: dvsa/.github/.github/workflows/php-library-security.yml@main
with:
php-versions: '["8.0"]'
php-versions: '["8.0","8.1","8.2","8.3"]'
secrets:
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

Expand All @@ -21,5 +21,5 @@ jobs:
tests:
uses: dvsa/.github/.github/workflows/php-library-tests.yml@main
with:
php-versions: '["8.0"]'
php-versions: '["8.0","8.1","8.2","8.3"]'
fail-fast: false
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "olcs/olcs-transfer",
"description": "OLCS Transfer",
"require": {
"php": "~8.0.0",
"php": "^8.0",
"ext-openssl": "*",
"laminas/laminas-stdlib": "^3.0",
"laminas/laminas-filter": "^2.30",
Expand Down Expand Up @@ -59,7 +59,7 @@
"bamarni/composer-bin-plugin": true
},
"platform": {
"ext-redis": "4.3"
"ext-redis": "5.0.2"
}
}
}
2 changes: 1 addition & 1 deletion src/Util/StructuredInput.php
Original file line number Diff line number Diff line change
Expand Up @@ -495,7 +495,7 @@ public function getMessages()
*
* @return int
*/
public function count()
public function count(): int
{
return count($this->inputs);
}
Expand Down
5 changes: 5 additions & 0 deletions src/Validators/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,11 @@ class Order extends \Laminas\Validator\AbstractValidator

public function isValid($value)
{
if (!is_string($value)) {
$this->error(self::NOT_ASC_OR_DESC);
return false;
}

$values = explode(',', $value);
foreach ($values as $order) {
$order = trim(strtoupper($order));
Expand Down
5 changes: 5 additions & 0 deletions src/Validators/Sort.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ class Sort extends \Laminas\Validator\AbstractValidator

public function isValid($value)
{
if (!is_string($value)) {
$this->error(self::INVALID_SORT);
return false;
}

if (preg_match('/[^a-zA-Z0-9 \.\-_,]/', $value) !== 0) {
$this->error(self::INVALID_SORT);
return false;
Expand Down

0 comments on commit 8e62453

Please sign in to comment.