original_string: public function transform($user)
      {
          $user = $this->entityToArray(User::class, $user);
          return [
              'id'        => (int) $user['id'],
              'email'     => $user['email'],
              'nick'      => $user['nick'],
              'firstName' => $user['first_name'],
              'lastName'  => $user['last_name'],
              'roles'     => !empty($user['roles']) ? $user['roles'] : []
          ];
      }
code: public function transform($user)
      {
          $user = $this->entityToArray(User::class, $user);
          return [
              'id'        => (int) $user['id'],
              'email'     => $user['email'],
              'nick'      => $user['nick'],
              'firstName' => $user['first_name'],
              'lastName'  => $user['last_name'],
              'roles'     => !empty($user['roles']) ? $user['roles'] : []
          ];
      }
code_tokens: public function transform ( $ user ) { $ user = $ this -> entityToArray ( User :: class , $ user ) ; return [ 'id' => ( int ) $ user [ 'id' ] , 'email' => $ user [ 'email' ] , 'nick' => $ user [ 'nick' ] , 'firstName' => $ user [ 'first_name' ] , 'lastName' => $ user [ 'last_name' ] , 'roles' => ! empty ( $ user [ 'roles' ] ) ? $ user [ 'roles' ] : [ ] ] ; }
docstring: Transforms user entity
  
  @param User|array $user User entity
  
  @return array
docstring_tokens: Transforms user entity