src/Sulu/Bundle/SecurityBundle/UserManager/UserManager.php
public function delete()
    {
        $delete = function($id) {
            $user = $this->userRepository->findUserById($id);
            if (!$user) {
                throw new EntityNotFoundException($this->userRepository->getClassName(), $id);
            }

            $this->em->remove($user);
            $this->em->flush();
        };

        return $delete;
    }
public function delete()
    {
        $delete = function($id) {
            $user = $this->userRepository->findUserById($id);
            if (!$user) {
                throw new EntityNotFoundException($this->userRepository->getClassName(), $id);
            }

            $this->em->remove($user);
            $this->em->flush();
        };

        return $delete;
    }
public function delete ( ) { $ delete = function ( $ id ) { $ user = $ this -> userRepository -> findUserById ( $ id ) ; if ( ! $ user ) { throw new EntityNotFoundException ( $ this -> userRepository -> getClassName ( ) , $ id ) ; } $ this -> em -> remove ( $ user ) ; $ this -> em -> flush ( ) ; } ; return $ delete ; }
Deletes a user with the given id.

@return \Closure
Deletes a user with the given id .