-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from ray-di/psr6-null-module
Add Psr6NullModule and deprecate serializable cache component
- Loading branch information
Showing
9 changed files
with
105 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Ray\PsrCacheModule; | ||
|
||
use function serialize; | ||
use function unserialize; | ||
|
||
trait Php73BcSerializableTrait | ||
{ | ||
/** | ||
* {@inheritDoc} | ||
*/ | ||
final public function serialize() | ||
{ | ||
return serialize($this->__serialize()); | ||
} | ||
|
||
/** | ||
* @psalm-suppress all | ||
* | ||
* {@inheritDoc} | ||
*/ | ||
final public function unserialize($serializedData) | ||
{ | ||
$array = unserialize($serializedData); | ||
$this->__unserialize($array); // @phpstan-ignore-line | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Ray\PsrCacheModule; | ||
|
||
use Psr\Cache\CacheItemPoolInterface; | ||
use Ray\Di\AbstractModule; | ||
use Ray\Di\Scope; | ||
use Ray\PsrCacheModule\Annotation\Local; | ||
use Ray\PsrCacheModule\Annotation\Shared; | ||
use Symfony\Component\Cache\Adapter\NullAdapter; | ||
|
||
final class Psr6NullModule extends AbstractModule | ||
{ | ||
protected function configure(): void | ||
{ | ||
$this->bind(CacheItemPoolInterface::class)->annotatedWith(Local::class)->to(NullAdapter::class)->in(Scope::SINGLETON); | ||
$this->bind(CacheItemPoolInterface::class)->annotatedWith(Shared::class)->to(NullAdapter::class)->in(Scope::SINGLETON); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.