Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Allow psr/container v2 [BC Break] #34

Merged
merged 2 commits into from
Jul 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
"ext-mbstring": "*",
"laminas/laminas-math": "^3.4",
"laminas/laminas-stdlib": "^3.8",
"psr/container": "^1.1"
"psr/container": "^1.1 || ^2.0"
},
"require-dev": {
"laminas/laminas-coding-standard": "~2.4.0",
Expand Down
6 changes: 3 additions & 3 deletions composer.lock

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

10 changes: 3 additions & 7 deletions src/Symmetric/PaddingPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Padding\PaddingInterface. Additionally, it registers a number of default
* padding adapters available.
*/
class PaddingPluginManager implements ContainerInterface
final class PaddingPluginManager implements ContainerInterface
{
/** @var array<string, string> */
private $paddings = [
Expand All @@ -25,22 +25,18 @@ class PaddingPluginManager implements ContainerInterface

/**
* Do we have the padding plugin?
*
* @param string $id
* @return bool
*/
public function has($id)
public function has(string $id): bool
{
return array_key_exists($id, $this->paddings);
}

/**
* Retrieve the padding plugin
*
* @param string $id
* @return Padding\PaddingInterface
*/
public function get($id)
public function get(string $id)
{
if (! $this->has($id)) {
throw new Exception\NotFoundException(sprintf(
Expand Down
10 changes: 3 additions & 7 deletions src/SymmetricPluginManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* Symmetric\SymmetricInterface. Additionally, it registers a number of default
* symmetric adapters available.
*/
class SymmetricPluginManager implements ContainerInterface
final class SymmetricPluginManager implements ContainerInterface
{
/**
* Default set of symmetric adapters
Expand All @@ -28,22 +28,18 @@ class SymmetricPluginManager implements ContainerInterface

/**
* Do we have the symmetric plugin?
*
* @param string $id
* @return bool
*/
public function has($id)
public function has(string $id): bool
{
return array_key_exists($id, $this->symmetric);
}

/**
* Retrieve the symmetric plugin
*
* @param string $id
* @return Symmetric\SymmetricInterface
*/
public function get($id)
public function get(string $id)
{
if (! $this->has($id)) {
throw new Exception\NotFoundException(sprintf(
Expand Down
Loading