Skip to content

Commit

Permalink
Merge pull request #148 from BinaryStudioAcademy/dev
Browse files Browse the repository at this point in the history
Release v1.2.0
  • Loading branch information
aLLeXUs authored Dec 19, 2021
2 parents 7fdf335 + b3c4cb4 commit 7897514
Show file tree
Hide file tree
Showing 160 changed files with 8,352 additions and 5,672 deletions.
2 changes: 1 addition & 1 deletion .styleci.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
preset: psr2
preset: psr12

risky: false

Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
language: php

php:
- 7.3
- 8.0

cache:
directories:
Expand Down
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
4 changes: 2 additions & 2 deletions backend/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

## Technologies

* PHP 7.3
* [Laravel 6](https://laravel.com)
* PHP 8.0
* [Laravel 8](https://laravel.com)
* [Docker](https://www.docker.com/)
* [Docker-compose](https://docs.docker.com/compose/)
* [Beanstalkd](https://github.com/beanstalkd/beanstalkd) - message queue (очередь сообщений для обработки тяжелых задач асинхронно)
Expand Down
17 changes: 5 additions & 12 deletions backend/app/Action/Auth/AuthenticationResponse.php
Original file line number Diff line number Diff line change
@@ -1,23 +1,16 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace App\Action\Auth;

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;
}
}
}
4 changes: 2 additions & 2 deletions backend/app/Action/Auth/GetAuthenticatedUserAction.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace App\Action\Auth;

Expand All @@ -12,4 +12,4 @@ public function execute(): GetAuthenticatedUserResponse
{
return new GetAuthenticatedUserResponse(Auth::user());
}
}
}
11 changes: 4 additions & 7 deletions backend/app/Action/Auth/GetAuthenticatedUserResponse.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

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;
}
}
}
4 changes: 2 additions & 2 deletions backend/app/Action/Auth/LoginAction.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace App\Action\Auth;

Expand All @@ -26,4 +26,4 @@ public function execute(LoginRequest $request): AuthenticationResponse
auth()->factory()->getTTL() * 60
);
}
}
}
13 changes: 4 additions & 9 deletions backend/app/Action/Auth/LoginRequest.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace App\Action\Auth;

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;
}
}
}
4 changes: 2 additions & 2 deletions backend/app/Action/Auth/LogoutAction.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace App\Action\Auth;

Expand All @@ -12,4 +12,4 @@ public function execute(): void
{
Auth::logout();
}
}
}
9 changes: 2 additions & 7 deletions backend/app/Action/Auth/RegisterAction.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace App\Action\Auth;

Expand All @@ -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
25 changes: 7 additions & 18 deletions backend/app/Action/Auth/RegisterRequest.php
Original file line number Diff line number Diff line change
@@ -1,29 +1,18 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace App\Action\Auth;

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;
}
}
}
9 changes: 3 additions & 6 deletions backend/app/Action/Auth/UpdateProfileAction.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace App\Action\Auth;

Expand All @@ -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);
}
}
}
21 changes: 6 additions & 15 deletions backend/app/Action/Auth/UpdateProfileRequest.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,17 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

namespace App\Action\Auth;

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;
}
}
}
11 changes: 4 additions & 7 deletions backend/app/Action/Auth/UpdateProfileResponse.php
Original file line number Diff line number Diff line change
@@ -1,22 +1,19 @@
<?php

declare(strict_types = 1);
declare(strict_types=1);

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
Loading

0 comments on commit 7897514

Please sign in to comment.