Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for psr/cache 2 and 3 versions #216

Closed
wants to merge 22 commits into from

Conversation

rimvislt
Copy link

No description provided.

@Ocramius
Copy link
Member

FWIW, let's drop PHP 7.4 as part of this? It has a shelf life of ~2 months left.

.laminas-ci.json Outdated Show resolved Hide resolved
Copy link
Member

@boesing boesing left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for working on this.
Just a few things but overall, good work 👍🏼

.laminas-ci.json Outdated Show resolved Hide resolved
@@ -106,7 +106,7 @@ public function setIsHit(bool $isHit): self
/**
* {@inheritdoc}
*/
public function set($value): CacheItemInterface
public function set($value): static
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add argument types so we are aligned with the interface?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added (needed to drop "psr/cache": "^1.0 for it to work)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@boesing if you want the parameter types to match the interface, we will need a new major version here.

If we can keep psr/cache:^1 and BC, then we can release a minor.

src/Psr/CacheItemPool/CacheItem.php Show resolved Hide resolved
src/Psr/CacheItemPool/CacheItem.php Show resolved Hide resolved
@@ -84,7 +83,7 @@ public function __destruct()
/**
* {@inheritdoc}
*/
public function getItem($key)
public function getItem($key): CacheItemInterface
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also add argument types so we are aligned with the interface?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added (needed to drop "psr/cache": "^1.0 for it to work)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adding the return type here is still a BC break :|

We're still in a "new major target" scenario, I fear...

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most likely previously it was just return type in documentation but support for psr/cache v2 and v3 it needs to be added.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup: not blaming your changes, just saying that the lack of final has exposed us to BC issues here, since the dependency change leads to a transitive BC break.

Copy link
Member

@boesing boesing Sep 2, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, I've expected the decorators to be final since v3.
Seems that I forgot these...

I would be open for having a new major but only if we also add support for psr/simple-cache in its newer versions.

In the next major we can add final to the decorators as well.

So we do have to drop v1 support of the psr packages as well in the next major? bummer...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would be open for having a new major but only if we also add support for psr/simple-cache in its newer versions.

👍🏻

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what is the plan with this one? Does it mean that v4 will happen in September?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not give an ETA but I will take care that this lands in v4.

Since that requires all supported adapters to support v4 as well plus the fact that there are some other things I've planned for v4, I dont think this will happen in september.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for your response let me know how I can help with v4.

If you will create v4 branch I will create new pr against it and will fix this code for it.

renovate bot and others added 19 commits September 1, 2022 19:24
Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
…idArgument exceptions

Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Renovate Bot <bot@renovateapp.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
… feature/psr-cache3

� Conflicts:
�	composer.lock
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
@rimvislt rimvislt requested a review from boesing September 1, 2022 18:32
src/Psr/CacheItemPool/CacheItemPoolDecorator.php Outdated Show resolved Hide resolved
phpcs.xml Show resolved Hide resolved
@Ocramius Ocramius added this to the 4.0.0 milestone Sep 1, 2022
Signed-off-by: Rimvydas Zilinskas <rimvydas@loftdigital.com>
@rimvislt rimvislt requested review from Ocramius and froschdesign and removed request for boesing, Ocramius and froschdesign September 1, 2022 20:32
@boesing boesing linked an issue Nov 11, 2022 that may be closed by this pull request
@Ocramius Ocramius changed the base branch from 3.5.x to 3.9.x December 5, 2022 14:41
@rogervila
Copy link

Hi @rimvislt could you please fix the branch conflicts? Let me know if I can help on fixing this branch!

@rimvislt
Copy link
Author

I think above was decided that we will not use this pr and will be new version of it, so not sure if it is a point to fix it.

@boesing
Copy link
Member

boesing commented Feb 12, 2023

Yah, this PR provides a lot of changes which are not only related to psr/cache v3.

We will support psr/cache v2 & v3 and psr/simple-cache v2 & v3 with one of the next major versions as there is no way of introducing these versions without breaking BC.


I'd love to get some prepared PRs so I can simply merge them once we are creating the next major version(s). This will most likely happen after we created laminas-servicemanager v4 - even tho there is no official ETA for servicemanager, I am planning to create a release in the first quarter of 2023.

The changes in the PRs (please create dedicated PRs for both PSR packages) should contain:

  • interface adaptions (i.e. added argument types along with return types - including mixed) within the delegator
  • composer.json + composer.lock changes regarding the psr-package, this includes both require and provides keys

Thanks!

@boesing boesing closed this Feb 12, 2023
@boesing boesing removed this from the 4.0.0 milestone Feb 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants