| 1 |  |  | <?php | 
            
                                                                                                            
                            
            
                                    
            
            
                | 2 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 3 |  |  |  * LoadUserData Données User de l'application GLSR. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 4 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 5 |  |  |  * PHP Version 7 | 
            
                                                                                                            
                            
            
                                    
            
            
                | 6 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 7 |  |  |  * @author    Quétier Laurent <[email protected]> | 
            
                                                                                                            
                            
            
                                    
            
            
                | 8 |  |  |  * @copyright 2018 Dev-Int GLSR | 
            
                                                                                                            
                            
            
                                    
            
            
                | 9 |  |  |  * @license   http://opensource.org/licenses/gpl-license.php GNU Public License | 
            
                                                                                                            
                            
            
                                    
            
            
                | 10 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 11 |  |  |  * @version GIT: $Id$ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 12 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 13 |  |  |  * @see https://github.com/Dev-Int/glsr | 
            
                                                                                                            
                            
            
                                    
            
            
                | 14 |  |  |  */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 15 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 16 |  |  | namespace App\DataFixtures\ORM; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 17 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 18 |  |  | use Doctrine\Common\DataFixtures\AbstractFixture; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 19 |  |  | use Doctrine\Common\DataFixtures\OrderedFixtureInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 20 |  |  | use Doctrine\Common\Persistence\ObjectManager; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 21 |  |  | use App\Entity\User; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 22 |  |  | use Symfony\Component\Security\Core\Encoder\UserPasswordEncoderInterface; | 
            
                                                                                                            
                            
            
                                    
            
            
                | 23 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 24 |  |  | /** | 
            
                                                                                                            
                            
            
                                    
            
            
                | 25 |  |  |  * LoadUser Data. | 
            
                                                                                                            
                            
            
                                    
            
            
                | 26 |  |  |  * | 
            
                                                                                                            
                            
            
                                    
            
            
                | 27 |  |  |  * @category DataFixtures | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 28 |  |  |  */ | 
            
                                                                        
                            
            
                                    
            
            
                | 29 |  |  | class LoadUserData extends AbstractFixture implements OrderedFixtureInterface | 
            
                                                                        
                            
            
                                    
            
            
                | 30 |  |  | { | 
            
                                                                        
                            
            
                                    
            
            
                | 31 |  |  |     protected $encoder; | 
            
                                                                        
                            
            
                                    
            
            
                | 32 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 33 |  |  |     public function __construct(UserPasswordEncoderInterface $encoder) | 
            
                                                                        
                            
            
                                    
            
            
                | 34 |  |  |     { | 
            
                                                                        
                            
            
                                    
            
            
                | 35 |  |  |         $this->encoder = $encoder; | 
            
                                                                        
                            
            
                                    
            
            
                | 36 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 37 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 38 |  |  |     /** | 
            
                                                                        
                            
            
                                    
            
            
                | 39 |  |  |      * Load data fixtures with the passed EntityManager. | 
            
                                                                        
                            
            
                                    
            
            
                | 40 |  |  |      * | 
            
                                                                        
                            
            
                                    
            
            
                | 41 |  |  |      * @param ObjectManager $manager | 
            
                                                                        
                            
            
                                    
            
            
                | 42 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 43 |  |  |     public function load(ObjectManager $manager) | 
            
                                                                                                            
                            
            
                                    
            
            
                | 44 |  |  |     { | 
            
                                                                                                            
                            
            
                                    
            
            
                | 45 |  |  |         $userAdmin = new User(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 46 |  |  |         $userAdmin->setUsername('Admin'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 47 |  |  |         $userAdmin->setEmail('admin@localhost'); | 
                            
                    |  |  |  | 
                                                                                        
                                                                                     | 
            
                                                                                                            
                            
            
                                    
            
            
                | 48 |  |  |         $userAdmin->setEnabled(true); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 49 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 50 |  |  |         $password = $this->encoder->encodePassword($userAdmin, 'adminadmin'); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 51 |  |  |         $userAdmin->setPassword($password); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 52 |  |  |         $userAdmin->setRoles(['ROLE_SUPER_ADMIN']); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 53 |  |  |  | 
            
                                                                                                            
                            
            
                                    
            
            
                | 54 |  |  |         $manager->persist($userAdmin); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 55 |  |  |         $manager->flush(); | 
            
                                                                                                            
                            
            
                                    
            
            
                | 56 |  |  |  | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 57 |  |  |         $this->addReference('admin-user', $userAdmin); | 
            
                                                                        
                            
            
                                    
            
            
                | 58 |  |  |     } | 
            
                                                                        
                            
            
                                    
            
            
                | 59 |  |  |  | 
            
                                                                        
                            
            
                                    
            
            
                | 60 |  |  |     /** | 
            
                                                                        
                            
            
                                    
            
            
                | 61 |  |  |      * Get the order of this fixture. | 
            
                                                                        
                            
            
                                    
            
            
                | 62 |  |  |      * | 
            
                                                                        
                            
            
                                    
            
            
                | 63 |  |  |      * @return int | 
            
                                                                        
                            
            
                                    
            
            
                | 64 |  |  |      */ | 
            
                                                                                                            
                            
            
                                    
            
            
                | 65 |  |  |     public function getOrder() | 
            
                                                                                                            
                            
            
                                    
            
            
                | 66 |  |  |     { | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 67 |  |  |         return 1; | 
            
                                                                        
                                                                
            
                                    
            
            
                | 68 |  |  |     } | 
            
                                                                                                            
                                                                
            
                                    
            
            
                | 69 |  |  | } | 
            
                                                        
            
                                    
            
            
                | 70 |  |  |  | 
            
                        
This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.
This is most likely a typographical error or the method has been renamed.