@param array $data

@return User
760055
public function createUser(array $data) : User
    {
        $data['password'] = Hash::make($data['password']);
        return $this->create($data);
    }
1214057
public function batchSyncUser(array $data)
    {
        $result = $this->httpRaw(self::WECHAT_USER_BATCH_SYNC_PREFIX, $data, [
            'access_token' => $this->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'ok' ? $result['jobid'] : $this->dump($result);
    }
479107
public static function createFromArray(array $data)
    {
        $self = new self();

        if (isset($data['id'])) {
            $self->setId($data['id']);
        }
        if (isset($data['username'])) {
            $self->setUsername($data['username']);
        }
        if (isset($data['name'])) {
            $self->setName($data['name']);
        }

        return $self;
    }
1104237
public function create($data)
    {
        $descriptor = new AuthorDescriptor($data->getName());
        $descriptor->setDescription((string) $data);

        return $descriptor;
    }
625986
public static function create(array $data): Player
    {
        $player = new Player();
        parent::fill($data, $player);
        if (is_array($player->clan)) {
            $player->clan = Clan::create($player->clan);
        }
        if (is_array($player->league)) {
            $player->league = League::create($player->league);
        }
        return $player;
    }
1149858
private function prepareUsers(array $data)
    {
        $users = [];
        $now   = Carbon::now();

        foreach ($data as $user) {
            $users[] = [
                'username'     => $user['username'],
                'first_name'   => Arr::get($user, 'first_name', null),
                'last_name'    => Arr::get($user, 'last_name', null),
                'email'        => $user['email'],
                'password'     => bcrypt($user['password']),
                'is_admin'     => true,
                'created_at'   => $now,
                'updated_at'   => $now,
                'activated_at' => $user['activated_at'] ?? $now,
            ];
        }

        return $users;
    }
7448
public function instance($data)
    {
        $RagnarokUser = new SecUser();
        $this->userRagnarok = $RagnarokUser->populate($data);
        return $this->userRagnarok;
    }
646519
public function create(array $data)
    {
        $response = $this->ontraport->post(
            $this->getNamespace(), $this->toArray($data)
        );

        return $this->ontraport->item($this, $response);
    }
1272120
public function update(array $data): User
    {
        $user = wp_update_user(array_merge($data, [
            'ID' => $this->ID
        ]));

        if (is_a($user, 'WP_Error')) {
            throw new UserException($user->get_error_message());
        }

        return $this;
    }
599973
public function createRole(array $data = [])
    {
        $deferred = new Deferred();

        $rolePart = $this->factory->create(Role::class);

        $this->roles->save($rolePart)->then(
            function ($role) use ($deferred, $data) {
                $role->fill($data);

                $this->roles->save($role)->then(
                    function ($role) use ($deferred) {
                        $deferred->resolve($role);
                    },
                    \React\Partial\bind_right($this->reject, $deferred)
                );
            },
            \React\Partial\bind_right($this->reject, $deferred)
        );

        return $deferred->promise();
    }
38429
public function updateMemberCardUser(array $data)
    {
        $url = 'https://api.weixin.qq.com/card/membercard/updateuser?access_token=ACCESS_TOKEN';
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
619154
public function post(array $data) {
    // If 'email' key is not available.
    if (!isset($data['email'])) {
      $this->logger->error('Invalid data to delete customer.');
      $response['success'] = (bool) (FALSE);
      return (new ModifiedResourceResponse($response));
    }

    $email = $data['email'];
    $user = $this->myUserLoadByMail($email);

    // If there is user with given email.
    if ($user instanceof UserInterface) {
      try {
        $user->delete();

        $this->logger->info('Deleted user with uid %id and email %email.', [
          '%id' => $user->id(),
          '%email' => $email,
        ]);
      }
      catch (EntityStorageException $e) {
        $this->logger->error('Failed to delete user with email %email. Exception: @message', [
          '%email' => $email,
          '@message' => $e->getMessage(),
        ]);
      }
    }
    else {
      $this->logger->warning('User with email %email does not exist.', ['%email' => $email]);
    }

    // For exception or missing user we have added entries in logs.
    // We don't want ACM to try again if message is processed successfully.
    $response['success'] = TRUE;
    return (new ModifiedResourceResponse($response));
  }
1209129
public function createUser($data)
    {
        return DB::transaction(function() use ($data) {
            $user = User::create([
                'name' => $data['name'],
                'email' => $data['email'],
                'password' => bcrypt($data['password']),
            ]);

            return $this->service->create($user, $data['password']);
        });
    }
1296036
protected function create(array $data)
    {
        return User::create([
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => bcrypt($data['password']),
            'token' => $this->userRepository->createToken(),
            'active' => 1,
        ]);
    }
843220
protected function create(array $data)
    {
        $user = User::create([
            'uuid' => (string) Str::uuid(),
            'name' => $data['name'],
            'email' => $data['email'],
            'password' => Hash::make($data['password']),
        ]);

        return $user;
    }
594498
public function setActivateMemberCardUser(array $data)
    {
        $url = 'https://api.weixin.qq.com/card/membercard/activateuserform/set?access_token=ACCESS_TOKEN';
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
1096097
private static function getObjectFromArray($data): self
    {
        if (!isset($data['last_access'])) {
            $lastAccess = null;
        } else {
            $lastAccess = new \DateTime($data['last_access']);
        }

        return new self(
            $data['user_id'],
            $data['organization_id'],
            $data['roles'],
            $data['active'],
            $lastAccess
        );
    }