Parse the $user parameter of the functions.

@param int|UserService|UserEntity|'current' $user

@return UserEntity|null
554322
public function getUserEntity($user)
    {
        $result = null;
        if ($user instanceof UserEntity) {
            $result = $user;
        } else {
            $u = $this->getUser($user);
            if ($u !== null) {
                $result = $this->app->make(EntityManager::class)->find(UserEntity::class, $u->getUserID());
            }
        }

        return $result;
    }
853395
public function findUserList(User $user)
    {
        $dql = 'SELECT e FROM Phraseanet:UsrListEntry e
            WHERE e.user = :usr_id';

        $params = [
            'usr_id' => $user->getId(),
        ];

        $query = $this->_em->createQuery($dql);
        $query->setParameters($params);

        return $query->getResult();
    }
565630
protected function loadAPIUser(SyliusUserInterface $user)
    {
        $eZSyliusUser = $this->eZUserRepository->findOneBy(
            array(
                'syliusUserId' => $user->getId(),
                'syliusUserType' => $this->syliusUserType,
            )
        );

        if (!$eZSyliusUser instanceof EzSyliusUser) {
            return null;
        }

        try {
            return $this->repository->getUserService()->loadUser(
                $eZSyliusUser->getEzUserId()
            );
        } catch (NotFoundException $e) {
            return null;
        }
    }
1050431
public function forUser($user)
    {
        return new static(
            $this->container,
            function () use ($user) {
                return $user;
            },
            $this->abilities,
            $this->policies,
            $this->beforeCallbacks
        );
    }
428412
private function get_api_user_scope_by_user( FS_User $user ) {
            return FS_Api::instance(
                $this->_module_id,
                'user',
                $user->id,
                $user->public_key,
                ! $this->is_live(),
                $user->secret_key
            );
        }
195246
public static function getRecent($user)
    {
        $records = static::where('user_id', $user->id)
            ->orderBy('created_at', 'desc')
            ->limit(2)
            ->get()
        ;

        if (!count($records)) {
            return null;
        }

        $first = $records->first();

        return !$first->created_at->isToday() ? $first : $records->pop();
    }
248866
public static function getCurrentUser()
    {
        if (static::$currentUser instanceof AVUser)
        {
            return static::$currentUser;
        }
        $storage = AVClient::getStorage();
        $userData = $storage->get("user");
        if ($userData instanceof AVUser)
        {
            static::$currentUser = $userData;

            return $userData;
        }
        if (isset($userData["id"]) && isset($userData["_sessionToken"]))
        {
            $user = AVUser::create("_User", $userData["id"]);
            unset($userData["id"]);
            $user->_sessionToken = $userData["_sessionToken"];
            unset($userData["_sessionToken"]);
            foreach ($userData as $key => $value)
            {
                $user->set($key, $value);
            }
            $user->_opSetQueue = array();
            static::$currentUser = $user;

            return $user;
        }

        return null;
    }
792486
protected function getNewValues(User $user)
    {
        $newProps = new UserUpdater();
        $this->logger->section('Editing user ' . $user->getEmail() . ' (' . $user->getUsername() . ')');
        $this->logger->comment('leave empty to keep unchanged');
        $newProps->setUsername($this->ask(new Question('Username', $user->getUsername())));
        $newProps->setEmail($this->ask(new Question('E-mail address', $user->getEmail())));
        $password = $this->ask(new Question('Password', '***'));
        // replace default *** value if empty is given
        $newProps->setPassword($password !== '***' ? $password : '');

        return $newProps;
    }
56144
private function fetchFromCache(User $user)
    {
        return $this->hasCache($user) ? self::$cache[$user->getId()] : null;
    }
781442
public function user($user, $pass = null)
    {
        if ($pass)
        {
            $this->pass = $pass;
        }

        $this->user = $user;

        return $this;
    }
427745
public function getUser($user)
    {
        $params = [
            'name' => $user,
        ];

        $body = $this->request(self::URI_AUTH_USER_GET, $params);
        if ($this->pretty && isset($body['roles'])) {
            return $body['roles'];
        }

        return $body;
    }
750540
function resolve($user) {
        if($user instanceof \CharlotteDunois\Yasmin\Models\User) {
            return $user;
        }
        
        if($user instanceof \CharlotteDunois\Yasmin\Models\GuildMember) {
            return $user->user;
        }
        
        if(\is_int($user)) {
            $user = (string) $user;
        }
        
        if(\is_string($user) && parent::has($user)) {
            return parent::get($user);
        }
        
        throw new \InvalidArgumentException('Unable to resolve unknown user');
    }
965086
public function deserializeFromString($user)
    {
        $base64EncodedUserValues = json_decode(base64_decode($user), true);
        if (!is_array($base64EncodedUserValues)) {
            return null;
        }

        if (empty($base64EncodedUserValues)) {
            return null;
        }

        $expectedKeys = [
            self::SERIALIZED_USER_USERNAME_KEY,
            self::SERIALIZED_USER_PASSWORD_KEY,
            self::SERIALIZED_USER_KEY_KEY,
        ];

        foreach ($expectedKeys as $expectedKey) {
            if (!isset($base64EncodedUserValues[$expectedKey])) {
                return null;
            }
        }

        $userValues = [];

        foreach ($base64EncodedUserValues as $key => $value) {
            $base64DecodedValue = base64_decode($value);
            if ($base64DecodedValue == '') {
                return null;
            }

            $userValues[$key] = $base64DecodedValue;
        }

        return $this->deserialize($userValues);
    }
233355
public function getUserEntity($user)
    {
        if (is_numeric($user)) {
            $userEntity = $this->entityTypeManager
                ->getStorage('user')
                ->load($user);
        } else {
            $userEntities = $this->entityTypeManager
                ->getStorage('user')
                ->loadByProperties(['name' => $user]);
            $userEntity = reset($userEntities);
        }

        return $userEntity;
    }
619191
public static function last($user = null)
    {
        if (!User::isValid($user)) {
            throw new InvalidParamException('User Invalid.');
        }
        return static::find()->createdBy($user)->orderByCreatedAt(SORT_DESC)->one();
    }
458023
public function loadUser($user)
    {

        $now = time();
        $user->created = $now;
        $user->updated = $now;

        return true;

    }
655277
protected function getUserName(User $user): string
    {
        $contentInfo = $this->repository->sudo(
            function (Repository $repository) use ($user): ContentInfo {
                return $this->loadService->loadContent($user->id)->contentInfo;
            }
        );

        return $contentInfo->name;
    }