Skip to content

Commit

Permalink
Merge pull request #21 from zfegg/develop
Browse files Browse the repository at this point in the history
php 8.3 support, and update deps.
  • Loading branch information
Moln authored Aug 22, 2024
2 parents 64fc677 + 704f9ff commit 4c9fb62
Show file tree
Hide file tree
Showing 7 changed files with 10 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/qa.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
fail-fast: false
matrix:
operating-system: [ubuntu-latest]
php-versions: ['7.4', '8.0', '8.1', '8.2']
php-versions: ['7.4', '8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout
uses: actions/checkout@v2
Expand Down
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,12 @@
"ext-pdo": "*",
"doctrine/annotations": "^1.13",
"doctrine/cache": "^1.11",
"doctrine/orm": "^2.9",
"laminas/laminas-diactoros": "^2.5",
"doctrine/orm": "^2.9 || ^3.0",
"laminas/laminas-diactoros": "^2.0 || ^3.3.1",
"laminas/laminas-eventmanager": "^3.0",
"laminas/laminas-filter": "^2.11",
"laminas/laminas-servicemanager": "^3.7",
"laminas/laminas-servicemanager": "^3.7 || ^4.0",
"laminas/laminas-validator": "^2.0",
"mezzio/mezzio-router": "^3.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpunit/phpunit": "9.5.16",
Expand Down
2 changes: 1 addition & 1 deletion src/ContentValidationMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
}

$data = Helper::toJSON($data);
$result = $this->validator->validate($data, $schema);
$result = $this->validator->validate($data, $schema, $request->getAttributes());

if (! $result->isValid()) {
return ($this->invalidHandler)(
Expand Down
3 changes: 1 addition & 2 deletions src/Opis/Filter/DbalRecordExistsFilter.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,7 @@ public function validate(ValidationContext $context, Schema $schema, array $args
}

$exists = $args['exists'] ?? false;
$sth = $db->prepare($sql);
$row = $sth->executeQuery([$context->currentData()])->fetchNumeric();
$row = $db->executeQuery($sql, [$context->currentData()])->fetchNumeric();

return $row[0] == $exists;
}
Expand Down
5 changes: 1 addition & 4 deletions src/Opis/Keyword/TransformerKeyword.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,9 @@ public function validate(ValidationContext $context, Schema $schema): ?Validatio
}

$func = $filter->types[$type];

$args = [];
if ($filter->args) {
$args = (array)$filter->args->resolve($context->rootData(), $context->currentDataPath());
$args += $context->globals();
} else {
$args = $context->globals();
}

if ($func instanceof TransformerInterface) {
Expand Down
2 changes: 1 addition & 1 deletion src/Opis/Transformer/LaminasTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __construct(FilterPluginManager $filterManager, string $name)
/**
* @inheritDoc
*/
public function transform($data, ValidationContext $context, SchemaInfo $info, array $args)
public function transform($data, ValidationContext $context, SchemaInfo $info, array $args = [])
{
return $this->filters->get($this->name, $args)->filter($data);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Opis/Transformer/TransformerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ interface TransformerInterface
* @param mixed $data
* @return mixed
*/
public function transform($data, ValidationContext $context, SchemaInfo $info, array $args);
public function transform($data, ValidationContext $context, SchemaInfo $info, array $args = []);
}

0 comments on commit 4c9fb62

Please sign in to comment.