Skip to content

Commit

Permalink
qa: add new template types to adapter options
Browse files Browse the repository at this point in the history
This also bumps the minimum version of `laminas/laminas-stdlib` as
templates were introduced in more recent versions.

Signed-off-by: Maximilian Bösing <2189546+boesing@users.noreply.github.com>
  • Loading branch information
boesing committed Apr 23, 2024
1 parent 06c033c commit c4e57c9
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"php": "~8.1.0 || ~8.2.0 || ~8.3.0",
"laminas/laminas-json": "^3.1",
"laminas/laminas-servicemanager": "^4.1",
"laminas/laminas-stdlib": "^3.2"
"laminas/laminas-stdlib": "^3.19"
},
"require-dev": {
"laminas/laminas-coding-standard": "~2.5.0",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions src/Adapter/AbstractAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ abstract class AbstractAdapter implements AdapterInterface
{
protected AdapterOptions|null $options = null;

/**
* @param iterable<string,mixed>|AdapterOptions|null $options
*/
public function __construct(iterable|AdapterOptions|null $options = null)
{
if ($options !== null) {
Expand All @@ -17,6 +20,8 @@ public function __construct(iterable|AdapterOptions|null $options = null)

/**
* Set adapter options
*
* @param iterable<string,mixed>|AdapterOptions $options
*/
public function setOptions(iterable|AdapterOptions $options): void
{
Expand Down
3 changes: 3 additions & 0 deletions src/Adapter/AdapterOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@

use Laminas\Stdlib\AbstractOptions;

/**
* @template-extends AbstractOptions<mixed>
*/
class AdapterOptions extends AbstractOptions
{
}
2 changes: 1 addition & 1 deletion src/Adapter/Json.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ final class Json extends AbstractAdapter
/**
* Set options
*
* @param iterable|JsonOptions $options
* @param iterable<string,mixed>|JsonOptions $options
*/
public function setOptions(iterable|AdapterOptions $options): void
{
Expand Down
5 changes: 4 additions & 1 deletion src/Adapter/PhpSerialize.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ final class PhpSerialize extends AbstractAdapter
/** @var PhpSerializeOptions|null */
protected AdapterOptions|null $options = null;

/**
* @param iterable<string,mixed>|PhpSerializeOptions|null $options
*/
public function __construct(iterable|PhpSerializeOptions|null $options = null)
{
// needed to check if a returned false is based on a serialize false
Expand All @@ -39,7 +42,7 @@ public function __construct(iterable|PhpSerializeOptions|null $options = null)
/**
* Set options
*
* @param iterable|PhpSerializeOptions $options
* @param iterable<string,mixed>|PhpSerializeOptions $options
*/
public function setOptions(iterable|AdapterOptions $options): void
{
Expand Down

0 comments on commit c4e57c9

Please sign in to comment.