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

[5.5] [PSR-16] Implement SimpleCache #20194

Merged
merged 4 commits into from
Jul 26, 2017
Merged

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

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.

I'm doing here the same thing I did in psr-11: https://github.com/laravel/framework/pull/19822/files#diff-51bfc610692c3ed3388dec0ec04bd3baR8 for consistency

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 :)

return $this->many($keys);
}

$default = collect($default);
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.

None yet

5 participants