Skip to content

Conversation

@deleugpn
Copy link
Contributor

Make Laravel 5.5 compliant with PSR-16

@deleugpn deleugpn changed the title [PSR-16] Implement SimpleCache [5.5] [PSR-16] Implement SimpleCache Jul 20, 2017
use Psr\SimpleCache\CacheInterface;

interface Repository
interface Repository extends CacheInterface
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel that this should be \Illuminate\Cache\Repository that implements Psr\SimpleCache\CacheInterface

Copy link
Contributor Author

@deleugpn deleugpn Jul 20, 2017

Choose a reason for hiding this comment

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

Copy link
Contributor

@lucasmichot lucasmichot Jul 20, 2017

Choose a reason for hiding this comment

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

Yeah true, it' weird. I had a look at \Illuminate\Contracts\Container\Container too, which extends \Psr\Container\ContainerInterface

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevertheless @deleugpn make sure to add this "psr/simple-cache": "~1.0" in Illuminate/Contracts/composer.json too 😉

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done :)

if (is_null($default)) {
return $this->many($keys);
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just using an array ?

@taylorotwell
Copy link
Member

What benefits will this provide in terms of interop right now. Which libraries are using PSR-16?

@lucasmichot
Copy link
Contributor

Some 120 packages : https://packagist.org/packages/psr/simple-cache/dependents

@garygreen
Copy link
Contributor

Sigh, another PSR that no one is going to care about 😄

@devcircus
Copy link
Contributor

I appreciate the efforts. In then environment I work in, these interoperability patches really come in handy.

@deleugpn
Copy link
Contributor Author

I guess I cannot really answer to the question about interop. My proposal came from reading the survey from the PSR (which Laravel was included) and noticed that it was just a few steps away from becoming fully compatible:

https://docs.google.com/spreadsheet/ccc?key=0Ak2JdGialLildEM2UjlOdnA4ekg3R1Bfeng5eGlZc1E#gid=0

@garygreen
Copy link
Contributor

In then environment I work in, these interoperability patches really come in handy.

Examples?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants