Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade dependencies to latest versions #145

Merged
merged 7 commits into from
Dec 19, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions backend/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_DEPRECATIONS_CHANNEL=null
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
Expand All @@ -15,15 +17,18 @@ DB_PASSWORD=secret

BROADCAST_DRIVER=log
CACHE_DRIVER=file
FILESYSTEM_DRIVER=public
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_MAILER=smtp
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
Expand All @@ -36,6 +41,7 @@ AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=
AWS_USE_PATH_STYLE_ENDPOINT=false

PUSHER_APP_ID=
PUSHER_APP_KEY=
Expand All @@ -52,4 +58,3 @@ APP_PORT=7777
MYSQL_PORT_TEST_DB=33062

BEANSTALKD_HOST=
FILESYSTEM_DRIVER=public
5 changes: 3 additions & 2 deletions backend/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
/vendor
.env
.phpunit.result.cache
docker-compose.override.yml
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.idea
.vscode
/.idea
/.vscode
.mysqldata
_ide_helper.php
.phpstorm.meta.php
15 changes: 4 additions & 11 deletions backend/app/Action/Auth/AuthenticationResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,11 @@

final class AuthenticationResponse
{
private $accessToken;
private $tokenType;
private $expiresIn;

public function __construct(
string $accessToken,
string $tokenType,
int $expiresIn
private string $accessToken,
private string $tokenType,
private int $expiresIn
) {
$this->accessToken = $accessToken;
$this->tokenType = $tokenType;
$this->expiresIn = $expiresIn;
}

public function getAccessToken(): string
Expand All @@ -34,4 +27,4 @@ public function getExpiresIn(): int
{
return $this->expiresIn;
}
}
}
9 changes: 3 additions & 6 deletions backend/app/Action/Auth/GetAuthenticatedUserResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@

namespace App\Action\Auth;

use App\Entity\User;
use App\Models\User;

final class GetAuthenticatedUserResponse
{
private $user;

public function __construct(User $user)
public function __construct(private User $user)
{
$this->user = $user;
}

public function getUser(): User
{
return $this->user;
}
}
}
11 changes: 3 additions & 8 deletions backend/app/Action/Auth/LoginRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@

final class LoginRequest
{
private $email;
private $password;

public function __construct(
string $email,
string $password
private string $email,
private string $password
) {
$this->email = $email;
$this->password = $password;
}

public function getEmail(): string
Expand All @@ -26,4 +21,4 @@ public function getPassword(): string
{
return $this->password;
}
}
}
7 changes: 1 addition & 6 deletions backend/app/Action/Auth/RegisterAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@

final class RegisterAction
{
private $userRepository;
private $mailer;

public function __construct(UserRepository $userRepository, Mailer $mailer)
public function __construct(private UserRepository $userRepository, private Mailer $mailer)
{
$this->userRepository = $userRepository;
$this->mailer = $mailer;
}

public function execute(RegisterRequest $request): AuthenticationResponse
Expand Down
23 changes: 6 additions & 17 deletions backend/app/Action/Auth/RegisterRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,13 @@

final class RegisterRequest
{
private $email;
private $password;
private $firstName;
private $lastName;
private $nickname;

public function __construct(
string $email,
string $password,
string $firstName,
string $lastName,
string $nickname
private string $email,
private string $password,
private string $firstName,
private string $lastName,
private string $nickname
) {
$this->email = $email;
$this->password = $password;
$this->firstName = $firstName;
$this->lastName = $lastName;
$this->nickname = $nickname;
}

public function getEmail(): string
Expand All @@ -50,4 +39,4 @@ public function getNickname(): string
{
return $this->nickname;
}
}
}
7 changes: 2 additions & 5 deletions backend/app/Action/Auth/UpdateProfileAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@

final class UpdateProfileAction
{
private $userRepository;

public function __construct(UserRepository $userRepository)
public function __construct(private UserRepository $userRepository)
{
$this->userRepository = $userRepository;
}

public function execute(UpdateProfileRequest $request): UpdateProfileResponse
Expand All @@ -29,4 +26,4 @@ public function execute(UpdateProfileRequest $request): UpdateProfileResponse

return new UpdateProfileResponse($user);
}
}
}
19 changes: 5 additions & 14 deletions backend/app/Action/Auth/UpdateProfileRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,12 @@

final class UpdateProfileRequest
{
private $email;
private $firstName;
private $lastName;
private $nickname;

public function __construct(
?string $email,
?string $firstName,
?string $lastName,
?string $nickname
private ?string $email,
private ?string $firstName,
private ?string $lastName,
private ?string $nickname
) {
$this->email = $email;
$this->firstName = $firstName;
$this->lastName = $lastName;
$this->nickname = $nickname;
}

public function getEmail(): ?string
Expand All @@ -42,4 +33,4 @@ public function getNickname(): ?string
{
return $this->nickname;
}
}
}
9 changes: 3 additions & 6 deletions backend/app/Action/Auth/UpdateProfileResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@

namespace App\Action\Auth;

use App\Entity\User;
use App\Models\User;

final class UpdateProfileResponse
{
private $user;

public function __construct(User $user)
public function __construct(private User $user)
{
$this->user = $user;
}

public function getUser(): User
{
return $this->user;
}
}
}
5 changes: 1 addition & 4 deletions backend/app/Action/Auth/UploadProfileImageAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@

final class UploadProfileImageAction
{
private $userRepository;

public function __construct(UserRepository $userRepository)
public function __construct(private UserRepository $userRepository)
{
$this->userRepository = $userRepository;
}

public function execute(UploadProfileImageRequest $request): UploadProfileImageResponse
Expand Down
5 changes: 1 addition & 4 deletions backend/app/Action/Auth/UploadProfileImageRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@

final class UploadProfileImageRequest
{
private $image;

public function __construct(UploadedFile $image)
public function __construct(private UploadedFile $image)
{
$this->image = $image;
}

public function getImage(): UploadedFile
Expand Down
9 changes: 3 additions & 6 deletions backend/app/Action/Auth/UploadProfileImageResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,16 @@

namespace App\Action\Auth;

use App\Entity\User;
use App\Models\User;

final class UploadProfileImageResponse
{
private $user;

public function __construct(User $user)
public function __construct(private User $user)
{
$this->user = $user;
}

public function getUser(): User
{
return $this->user;
}
}
}
13 changes: 4 additions & 9 deletions backend/app/Action/Comment/AddCommentAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace App\Action\Comment;

use App\Entity\Comment;
use App\Models\Comment;
use App\Exceptions\TweetNotFoundException;
use App\Repository\CommentRepository;
use App\Repository\TweetRepository;
Expand All @@ -13,22 +13,17 @@

final class AddCommentAction
{
private $tweetRepository;
private $commentRepository;

public function __construct(
TweetRepository $tweetRepository,
CommentRepository $commentRepository
private TweetRepository $tweetRepository,
private CommentRepository $commentRepository
) {
$this->tweetRepository = $tweetRepository;
$this->commentRepository = $commentRepository;
}

public function execute(AddCommentRequest $request): AddCommentResponse
{
try {
$this->tweetRepository->getById($request->getTweetId());
} catch (ModelNotFoundException $ex) {
} catch (ModelNotFoundException) {
throw new TweetNotFoundException();
}

Expand Down
7 changes: 1 addition & 6 deletions backend/app/Action/Comment/AddCommentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,8 @@

final class AddCommentRequest
{
private $body;
private $tweetId;

public function __construct(string $body, int $tweetId)
public function __construct(private string $body, private int $tweetId)
{
$this->body = $body;
$this->tweetId = $tweetId;
}

public function getBody(): string
Expand Down
7 changes: 2 additions & 5 deletions backend/app/Action/Comment/AddCommentResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@

namespace App\Action\Comment;

use App\Entity\Comment;
use App\Models\Comment;

final class AddCommentResponse
{
private $comment;

public function __construct(Comment $comment)
public function __construct(private Comment $comment)
{
$this->comment = $comment;
}

public function getComment(): Comment
Expand Down
Loading