Skip to content

Commit

Permalink
chore: refactor construct private
Browse files Browse the repository at this point in the history
  • Loading branch information
WailanTirajoh committed Apr 9, 2024
1 parent f41bf71 commit d846019
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 38 deletions.
8 changes: 3 additions & 5 deletions app/Http/Controllers/CustomerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,9 @@

class CustomerController extends Controller
{
private CustomerRepositoryInterface $customerRepository;

public function __construct(CustomerRepositoryInterface $customerRepository)
{
$this->customerRepository = $customerRepository;
public function __construct(
private CustomerRepositoryInterface $customerRepository
) {
}

public function index(Request $request)
Expand Down
8 changes: 3 additions & 5 deletions app/Http/Controllers/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@

class ImageController extends Controller
{
private ImageRepositoryInterface $imageRepository;

public function __construct(ImageRepositoryInterface $imageRepository)
{
$this->imageRepository = $imageRepository;
public function __construct(
private ImageRepositoryInterface $imageRepository
) {
}

public function store(StoreImageRequest $request, Room $room)
Expand Down
8 changes: 3 additions & 5 deletions app/Http/Controllers/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@

class PaymentController extends Controller
{
private PaymentRepositoryInterface $paymentRepository;

public function __construct(PaymentRepositoryInterface $paymentRepository)
{
$this->paymentRepository = $paymentRepository;
public function __construct(
private PaymentRepositoryInterface $paymentRepository
) {
}

public function index()
Expand Down
8 changes: 3 additions & 5 deletions app/Http/Controllers/RoomStatusController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@

class RoomStatusController extends Controller
{
private RoomStatusRepositoryInterface $roomStatusRepository;

public function __construct(RoomStatusRepositoryInterface $roomStatusRepository)
{
$this->roomStatusRepository = $roomStatusRepository;
public function __construct(
private RoomStatusRepositoryInterface $roomStatusRepository
) {
}

public function index(Request $request)
Expand Down
8 changes: 3 additions & 5 deletions app/Http/Controllers/TransactionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@

class TransactionController extends Controller
{
private TransactionRepositoryInterface $transactionRepository;

public function __construct(TransactionRepositoryInterface $transactionRepository)
{
$this->transactionRepository = $transactionRepository;
public function __construct(
private TransactionRepositoryInterface $transactionRepository
) {
}

public function index(Request $request)
Expand Down
8 changes: 3 additions & 5 deletions app/Http/Controllers/TransactionRoomReservationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@

class TransactionRoomReservationController extends Controller
{
private ReservationRepositoryInterface $reservationRepository;

public function __construct(ReservationRepositoryInterface $reservationRepository)
{
$this->reservationRepository = $reservationRepository;
public function __construct(
private ReservationRepositoryInterface $reservationRepository
) {
}

public function pickFromCustomer(Request $request, CustomerRepositoryInterface $customerRepository)
Expand Down
7 changes: 3 additions & 4 deletions app/Http/Controllers/TypeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@

class TypeController extends Controller
{
private TypeRepositoryInterface $typeRepository;

public function __construct(TypeRepositoryInterface $typeRepository)
{
public function __construct(
private TypeRepositoryInterface $typeRepository
) {
$this->typeRepository = $typeRepository;
}

Expand Down
7 changes: 3 additions & 4 deletions app/Http/Controllers/UserController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@

class UserController extends Controller
{
private UserRepositoryInterface $userRepository;

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

Expand Down

0 comments on commit d846019

Please sign in to comment.