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 getters to filesystem repository #44
Conversation
👊 poke - this PR is blocking for Astrotomic/stancy#23 |
Hmm this doesn't really feel right... This is unusable if someone uses a different repository. If you need this information, maybe you're better of extracting it from the configuration? |
It's not part of the interface. So a simple instance of check is enough. |
Can I suggest an alternative?
So in essence, you need access to the same filesystem used by the sheets. I would rely on the dependency container to resolve the correct filesystem, eg. something like this:
(I haven't checked if this code is correct, but I'm sure you get what I mean) This way the container is doing what it's supposed to do: managing class instances, and we don't need to add these kinds of shortcuts on the repository class. I'd even go as far as manually configuring the sheet repository in your AppServiceProvider, manually passing it the Anyway, that's what I would do. |
Just to know: why don't you want the getters? 🤔 |
It's not the repository's responsibility to expose one of its dependencies to the outside world, that's the container's job 🙂 |
Okay, but the container also doesn't expose these two things. Only the config does but this also just optional. |
I've solved it in my package. |
I was actually about to say the same. Freek already does this in one or two packages, and I think it's a pattern we should use more. Maybe @sebastiandedeyne is open for that idea? |
Yes, the idea is from facade/ignition. Right now I've done it in two lines in my package. But would still like to adopt the config class or even provide a PR for it. |
Regarding the repository interface and the package implementation |
#45 is the follow up for custom repositories. |
fixes #43