private function actionPasswordReplace(SymfonyStyle $helper)
    {
        if (false === $helper->confirm('Are you sure? Only use this for development purposes!', false)) {
            return null;
        }

        $userClass = $this->getUserEntityClass();
        if (null === $userClass) {
            throw new \RuntimeException('User entity not found');
        }

        $password = $helper->ask('New password', 'login123');
        $userManager = $this->getContainer()->get('fos_user.user_manager');

        /** @var User $user */
        foreach ($this->getDoctrine()->getRepository($userClass)->findAll() as $user) {
            $user->setPlainPassword($password);
            $userManager->updateUser($user);
        }

        return null;
    }
private function actionPasswordReplace(SymfonyStyle $helper)
    {
        if (false === $helper->confirm('Are you sure? Only use this for development purposes!', false)) {
            return null;
        }

        $userClass = $this->getUserEntityClass();
        if (null === $userClass) {
            throw new \RuntimeException('User entity not found');
        }

        $password = $helper->ask('New password', 'login123');
        $userManager = $this->getContainer()->get('fos_user.user_manager');

        /** @var User $user */
        foreach ($this->getDoctrine()->getRepository($userClass)->findAll() as $user) {
            $user->setPlainPassword($password);
            $userManager->updateUser($user);
        }

        return null;
    }
private function actionPasswordReplace ( SymfonyStyle $ helper ) { if ( false === $ helper -> confirm ( 'Are you sure? Only use this for development purposes!' , false ) ) { return null ; } $ userClass = $ this -> getUserEntityClass ( ) ; if ( null === $ userClass ) { throw new \ RuntimeException ( 'User entity not found' ) ; } $ password = $ helper -> ask ( 'New password' , 'login123' ) ; $ userManager = $ this -> getContainer ( ) -> get ( 'fos_user.user_manager' ) ; /** @var User $user */ foreach ( $ this -> getDoctrine ( ) -> getRepository ( $ userClass ) -> findAll ( ) as $ user ) { $ user -> setPlainPassword ( $ password ) ; $ userManager -> updateUser ( $ user ) ; } return null ; }
Password Replace action

@param SymfonyStyle $helper

@return null
Password Replace action