You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 16, 2021. It is now read-only.
Was getting started on working with the CMF today and got around till the 2nd chapter of the guide, to find a strange typo in a code snippet here.
The argument is named $documentManager, the class DocumentManager gets imported, but ObjectManager is actually used as the type hint...?
There are some 10+ similar cases of these in the documentation, which made me think if this perhaps is not a typo but just a wrong interpretation on my hand; that ObjectManager should have been imported instead?
I then wondered if a similar thing is happening in the DemoBundle, and it is:
namespaceAcme\DemoBundle\DataFixtures\PHPCR;
useDoctrine\ODM\PHPCR\DocumentManager;
// ...useDoctrine\Common\Persistence\ObjectManager;
// .../** * Loads the initial demo data of the demo website. */class LoadDemoData implements FixtureInterface
{
/** * Load data fixtures with the passed DocumentManager * * @param DocumentManager $manager */publicfunction load(ObjectManager$manager)
// ... only ObjectManager used here
}
}
The PHPDoc tells me it's a DocumentManager, the argument says ObjectManager, both get imported, but only the ObjectManager is actually used in the rest of the class.
I was making a PR of the documentation cases, thinking it was only a documentation error. But I realized more than just the documentation is affected; so perhaps this is all just a misunderstanding on my end, and some things just need some more clarification.
If any of you want to give me some pointers on how all of this project's load() examples should be named and imported consistently (i.e. as you imagine it), including that of AcmeDemoBundle's, I'm happy to make a larger PR for that as well.