Comments (2)
What is goal? Because is out of our dicussion.
ad 1. only move parameters from method get() to entity. What do you do with other parameters (tags, minutes, log)?
ad 2. here you define what strategy prefer and use it, this looks like as nette/cache where storeage is defined per Cache instance and you cannot change it. I think, here you lost the benefit (choose strategy)
I don't like either solution.
I think, here is missing one level. I image Storage | Cache | Strategy, You have Storage&Cache and try create Cache&Strategy, I think these three objects must be divided.
Did you thinking about implement PSR6/16?
from larastrict.
@h4kuna I do not prefer the psr6/16 proposal you did because it is harder to use. The goal is to provide simple way of using the default cache in Laravel and simple get
method with a closure + DI support with additional "fixes" of the cache layer provided by Laravel.
Like if you use RedisCache you are missing memory cache layer when you access the same key multiple times per request.
This solves the issue - you have the option to use only memory layer or memory layer with your default cache (redis / memcache / other). Thats the main goal. Of course I could get rid of the strategy and just use memory + repository.
The goal is not to provide multiple cache layers, if you want this control then CacheManager
is way to go :) But makes more code we need to use.
$cacheManager->store('array')->get/set
Not that fancy.
In some cases you need to use set/get (most of your usage, probably because yo don't like the get closure feature). To make it bug free proof we need a holder that holds selected strategy and a key that is shared with set/get. This is the propsal of this issue.
Scope of larastrict is not to provide cross framework solutions, but an extension of Laravel features. Thats why I have not explored PSR6/16 due the need of more code.
from larastrict.
Related Issues (20)
- Expectation: use $_message instead of $message HOT 1
- Expectation: Add option to use assertStringStartsWith
- PHPStan: check if view can be resolved
- Commands: Extract interface, update service provider binding, generate assert
- Command: Testing expectation - support closures HOT 1
- PHPStan: when using assert expectations in test case check if AssertExpectationTestCase is used HOT 1
- PHPStan: Force to migrate casts from string float/bool to custom casts
- Deprecate AssertProviderBindings in favor of phpstan rule
- Automatically prune failed jobs
- CacheMe namespace support
- SoftDeletes interface
- Find the interface / contract automatically by attributte
- PHPStan: Container make - Check if class has interface and warn that you should use it
- giveTaggedImplementation - propose to Laravel code base
- PHPStan: check whereBetween
- PHPStan: check if extending AbstractServiceProvider
- TestingContainer: $makeBindings phpdocs to phpstan-type
- Migration job - command
- Change default template of Laravel migration to ours
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from larastrict.