-
-
Notifications
You must be signed in to change notification settings - Fork 73
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
Not easy to use outside symfony #175
Comments
For nelmio alice there is a native loader which should help out. For this library part though there's not been a need for it yet so you would indeed need to create everything yourself by hand or alternatively register the appropriate services to your container |
Thanks for the feedback, I've been checking the native loader and indeed it's a great way to have a pre-configured loader but it's not easy to customize except by extending it. I've finished recreating the object graph it's more or less 250 lines of code ^^ Would you consider a PR on alice introducing a builder for the loaders, something like: class LoaderBuilderTest extends TestCase
{
public function test_it_creates_a_prefconfigured_files_loader()
{
$loader = LoaderBuilder::simpleFilesLoader()
->getLoader();
$this->assertInstanceOf(SimpleFilesLoader::class, $loader);
}
public function test_it_can_change_property_accessor()
{
$loader = LoaderBuilder::simpleFilesLoader()
->withPropertyAccessory(new MyProperyAccessor())
->getLoader();
$this->assertInstanceOf(/** */);
}
} I don't know what king of meaningfull tests could be done here as the goal of the builder is to set the internals of the class ... |
@ktom would it be possible to have more details on what the graph looks like? I don't think you should have much from NelmioAlice as there is a But otherwise I think it's a tedious task as it would require a native loader for different bridges (ORM, ODM, PHPCR, Eloquent...) |
Hello,
I've been trying to use the lib outside of a symfony project, in a package using doctrine.
Following the basic exemple from the doc i've been trying to do something like
I gave up on the huge object graph part :'(
Do you have any exemple of how to use the lib outside of SF or any advice on how I could achieve this ?
Thank you in advance
The text was updated successfully, but these errors were encountered: