From 74416ac5f30e84e952bd575d247cbd53963b876a Mon Sep 17 00:00:00 2001 From: jitendra Date: Fri, 1 Apr 2022 20:27:11 +0530 Subject: [PATCH] Used PHP 8 Constructor Property Promotion --- .../Admin/src/DataGrids/AddressDataGrid.php | 11 +- .../Admin/src/DataGrids/ChannelDataGrid.php | 13 +-- .../Admin/src/Exports/DataGridExport.php | 10 +- .../Controllers/ConfigurationController.php | 11 +- .../Customer/AddressController.php | 27 +---- .../Customer/CustomerController.php | 47 +------- .../Customer/CustomerGroupController.php | 11 +- .../Http/Controllers/DashboardController.php | 58 ++-------- .../Controllers/Sales/InvoiceController.php | 25 +---- .../Controllers/Sales/OrderController.php | 22 +--- .../Controllers/Sales/RefundController.php | 36 +----- .../Controllers/Sales/ShipmentController.php | 36 +----- .../Sales/TransactionController.php | 35 +----- .../Admin/src/Http/Middleware/Locale.php | 14 +-- .../src/Mail/CancelOrderAdminNotification.php | 8 +- .../src/Mail/CancelOrderNotification.php | 8 +- .../src/Mail/DuplicateInvoiceNotification.php | 25 +---- .../Admin/src/Mail/InvoiceOverdueReminder.php | 24 +--- .../Admin/src/Mail/NewAdminNotification.php | 10 +- .../src/Mail/NewCustomerNotification.php | 21 +--- .../Mail/NewInventorySourceNotification.php | 10 +- .../Admin/src/Mail/NewInvoiceNotification.php | 10 +- .../Admin/src/Mail/NewOrderNotification.php | 10 +- .../Admin/src/Mail/NewRefundNotification.php | 10 +- .../src/Mail/NewShipmentNotification.php | 10 +- .../src/Mail/OrderCommentNotification.php | 10 +- .../Validations/ProductCategoryUniqueSlug.php | 22 +--- .../Http/Controllers/AttributeController.php | 11 +- .../Controllers/AttributeFamilyController.php | 25 +---- .../AttributeFamilyRepository.php | 22 +--- .../src/Repositories/AttributeRepository.php | 14 +-- .../BookingProduct/src/Helpers/Booking.php | 22 +--- .../Controllers/Admin/BookingController.php | 11 +- .../Shop/BookingProductController.php | 2 +- .../BookingProduct/src/Listeners/Order.php | 10 +- .../BookingProduct/src/Type/Booking.php | 28 ++--- .../Http/Controllers/Admin/PageController.php | 11 +- .../Shop/PagePresenterController.php | 10 +- .../Webkul/CartRule/src/Helpers/CartRule.php | 65 +---------- .../Http/Controllers/CartRuleController.php | 16 +-- .../Controllers/CartRuleCouponController.php | 10 +- .../Webkul/CartRule/src/Listeners/Cart.php | 10 +- .../Webkul/CartRule/src/Listeners/Order.php | 43 +------ .../src/Repositories/CartRuleRepository.php | 80 ++----------- .../src/Console/Commands/PriceRuleIndex.php | 11 +- .../src/Helpers/CatalogRuleIndex.php | 32 +----- .../src/Helpers/CatalogRuleProduct.php | 43 +------ .../src/Helpers/CatalogRuleProductPrice.php | 32 +----- .../Controllers/CatalogRuleController.php | 25 +---- .../CatalogRule/src/Listeners/Product.php | 10 +- .../Repositories/CatalogRuleRepository.php | 47 +------- .../Http/Controllers/CategoryController.php | 25 +---- packages/Webkul/Checkout/src/Cart.php | 79 ++----------- packages/Webkul/Core/src/Core.php | 104 +++-------------- .../src/Helpers/Exchange/ExchangeRates.php | 24 +--- .../src/Helpers/Exchange/FixerExchange.php | 22 +--- .../Http/Controllers/ChannelController.php | 11 +- .../Controllers/CountryStateController.php | 24 +--- .../Http/Controllers/CurrencyController.php | 11 +- .../Controllers/ExchangeRateController.php | 25 +---- .../src/Http/Controllers/LocaleController.php | 11 +- .../src/Http/Controllers/SliderController.php | 18 +-- .../Controllers/SubscriptionController.php | 11 +- .../src/Repositories/SliderRepository.php | 14 +-- .../Http/Controllers/AddressController.php | 11 +- .../Http/Controllers/CustomerController.php | 36 +----- .../Controllers/RegistrationController.php | 36 +----- .../Http/Controllers/WishlistController.php | 25 +---- .../Customer/src/Mail/RegistrationEmail.php | 12 +- .../Customer/src/Mail/VerificationEmail.php | 8 +- .../Notifications/CustomerUpdatePassword.php | 10 +- .../Controllers/InventorySourceController.php | 11 +- .../src/Console/Commands/EmailsCommand.php | 11 +- .../Webkul/Marketing/src/Helpers/Campaign.php | 35 +----- .../Http/Controllers/CampaignController.php | 11 +- .../src/Http/Controllers/EventController.php | 11 +- .../Http/Controllers/TemplateController.php | 11 +- .../Marketing/src/Mail/NewsletterMail.php | 20 +--- .../src/Events/UpdateOrderNotification.php | 5 +- .../Admin/NotificationController.php | 11 +- .../Notification/src/Listeners/Order.php | 10 +- .../Payment/src/Listeners/GenerateInvoice.php | 26 +---- packages/Webkul/Paypal/src/Helpers/Ipn.php | 33 +----- .../Controllers/SmartButtonController.php | 32 +----- .../Http/Controllers/StandardController.php | 21 +--- .../Paypal/src/Listeners/Transaction.php | 23 +--- .../src/Console/Commands/PriceUpdate.php | 11 +- .../Product/src/Helpers/GenerateProduct.php | 22 +--- .../Http/Controllers/ProductController.php | 105 +++--------------- .../src/Http/Controllers/ReviewController.php | 11 +- .../Product/src/Http/Requests/ProductForm.php | 26 +---- .../Product/src/Listeners/ProductFlat.php | 43 +------ packages/Webkul/Product/src/ProductImage.php | 13 +-- .../ProductAttributeValueRepository.php | 11 +- .../ProductBundleOptionRepository.php | 11 +- .../Repositories/ProductFlatRepository.php | 7 +- .../Repositories/ProductImageRepository.php | 18 +-- .../src/Repositories/ProductRepository.php | 14 +-- .../ProductReviewImageRepository.php | 3 +- .../src/Repositories/SearchRepository.php | 20 +--- .../Webkul/Product/src/Type/AbstractType.php | 80 +++---------- packages/Webkul/Product/src/Type/Bundle.php | 38 +------ .../Webkul/Product/src/Type/Downloadable.php | 43 +++---- packages/Webkul/Product/src/Type/Grouped.php | 26 ++--- .../DownloadableLinkPurchasedRepository.php | 12 +- .../src/Repositories/InvoiceRepository.php | 49 +------- .../src/Repositories/OrderRepository.php | 25 +---- .../src/Repositories/RefundRepository.php | 47 +------- .../src/Repositories/ShipmentRepository.php | 36 +----- .../src/Http/Controllers/CartController.php | 25 +---- .../Http/Controllers/CategoryController.php | 11 +- .../DownloadableProductController.php | 13 +-- .../src/Http/Controllers/HomeController.php | 25 +---- .../Http/Controllers/OnepageController.php | 25 +---- .../src/Http/Controllers/OrderController.php | 32 +----- .../Http/Controllers/ProductController.php | 69 ++---------- .../ProductsCategoriesProxyController.php | 36 +----- .../src/Http/Controllers/ReviewController.php | 36 +----- .../src/Http/Controllers/SearchController.php | 15 +-- .../Controllers/SubscriptionController.php | 11 +- .../Shop/src/Http/Middleware/Currency.php | 10 +- .../Shop/src/Http/Middleware/Locale.php | 10 +- .../Shop/src/Mail/SubscriptionEmail.php | 5 +- .../Controllers/Admin/SitemapController.php | 4 +- .../src/Http/Controllers/LoginController.php | 13 +-- .../CustomerSocialAccountRepository.php | 24 +--- .../Controllers/TaxCategoryController.php | 25 +---- .../Http/Controllers/TaxRateController.php | 13 +-- packages/Webkul/Theme/src/Theme.php | 39 +------ .../src/Http/Controllers/RoleController.php | 25 +---- .../src/Http/Controllers/UserController.php | 25 +---- .../src/Notifications/AdminUpdatePassword.php | 12 +- .../Velocity/src/Helpers/AdminHelper.php | 10 +- .../Webkul/Velocity/src/Helpers/Helper.php | 89 +++------------ .../Controllers/Admin/CategoryController.php | 25 +---- .../Admin/ConfigurationController.php | 31 ++---- .../Controllers/Admin/ContentController.php | 25 +---- .../Http/Controllers/Shop/CartController.php | 6 +- .../src/Http/Controllers/Shop/Controller.php | 93 +++------------- .../src/Repositories/CategoryRepository.php | 11 +- .../src/Repositories/ContentRepository.php | 11 +- .../Product/ProductRepository.php | 11 +- packages/Webkul/Velocity/src/Velocity.php | 10 +- 143 files changed, 483 insertions(+), 2925 deletions(-) diff --git a/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php b/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php index 076ee5b00..d57ef5e7d 100644 --- a/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/AddressDataGrid.php @@ -23,23 +23,14 @@ class AddressDataGrid extends DataGrid */ protected $sortOrder = 'desc'; - /** - * Customer repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerRepository - */ - protected $customerRepository; - /** * Create a new datagrid instance. * * @param \Webkul\Customer\Repositories\CustomerRepository $customerRepository * @return void */ - public function __construct(CustomerRepository $customerRepository) + public function __construct(protected CustomerRepository $customerRepository) { - $this->customerRepository = $customerRepository; - parent::__construct(); } diff --git a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php index 2540b3081..d5ed8274e 100755 --- a/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php +++ b/packages/Webkul/Admin/src/DataGrids/ChannelDataGrid.php @@ -22,28 +22,17 @@ class ChannelDataGrid extends DataGrid */ protected $locale; - /** - * ChannelRepository $channelRepository - * - * @var \Webkul\Core\Repositories\ChannelRepository - */ - protected $channelRepository; - /** * Create a new datagrid instance. * * @param \Webkul\Core\Repositories\ChannelRepository $channelRepository * @return void */ - public function __construct( - ChannelRepository $channelRepository - ) + public function __construct(protected ChannelRepository $channelRepository) { parent::__construct(); $this->locale = core()->getRequestedLocaleCode(); - - $this->channelRepository = $channelRepository; } public function prepareQueryBuilder() diff --git a/packages/Webkul/Admin/src/Exports/DataGridExport.php b/packages/Webkul/Admin/src/Exports/DataGridExport.php index 42a7d1974..d4a716b3c 100755 --- a/packages/Webkul/Admin/src/Exports/DataGridExport.php +++ b/packages/Webkul/Admin/src/Exports/DataGridExport.php @@ -8,22 +8,14 @@ use Maatwebsite\Excel\Concerns\ShouldAutoSize; class DataGridExport implements FromView, ShouldAutoSize { - /** - * DataGrid instance - * - * @var mixed - */ - protected $gridData = []; - /** * Create a new instance. * * @param mixed DataGrid * @return void */ - public function __construct($gridData) + public function __construct(protected $gridData = []) { - $this->gridData = $gridData; } /** diff --git a/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php b/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php index fe923d913..3927e54a8 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/ConfigurationController.php @@ -16,13 +16,6 @@ class ConfigurationController extends Controller */ protected $_config; - /** - * Core config repository instance. - * - * @var \Webkul\Core\Repositories\CoreConfigRepository - */ - protected $coreConfigRepository; - /** * Tree instance. * @@ -36,10 +29,8 @@ class ConfigurationController extends Controller * @param \Webkul\Core\Repositories\CoreConfigRepository $coreConfigRepository * @return void */ - public function __construct(CoreConfigRepository $coreConfigRepository) + public function __construct(protected CoreConfigRepository $coreConfigRepository) { - $this->coreConfigRepository = $coreConfigRepository; - $this->_config = request('_config'); $this->prepareConfigTree(); diff --git a/packages/Webkul/Admin/src/Http/Controllers/Customer/AddressController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/AddressController.php index 127b4a3b8..d9534868b 100644 --- a/packages/Webkul/Admin/src/Http/Controllers/Customer/AddressController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/AddressController.php @@ -17,35 +17,18 @@ class AddressController extends Controller */ protected $_config; - /** - * CustomerRepository object - * - * @var \Webkul\Customer\Repositories\CustomerRepository - */ - protected $customerRepository; - - /** - * CustomerAddressRepository object - * - * @var \Webkul\Customer\Repositories\CustomerAddressRepository - */ - protected $customerAddressRepository; - /** * Create a new controller instance. * - * @param \Webkul\Customer\Repositories\CustomerRepository $customerRepository + * @param \Webkul\Customer\Repositories\CustomerRepository $customerRepository * @param \Webkul\Customer\Repositories\CustomerAddressRepository $customerAddressRepository * @return void */ public function __construct( - CustomerRepository $customerRepository, - CustomerAddressRepository $customerAddressRepository - ) { - $this->customerRepository = $customerRepository; - - $this->customerAddressRepository = $customerAddressRepository; - + protected CustomerRepository $customerRepository, + protected CustomerAddressRepository $customerAddressRepository + ) + { $this->_config = request('_config'); } diff --git a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php index 2f85e4f1c..29a564394 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerController.php @@ -22,34 +22,6 @@ class CustomerController extends Controller */ protected $_config; - /** - * Customer repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerRepository - */ - protected $customerRepository; - - /** - * Customer address repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerAddressRepository - */ - protected $customerAddressRepository; - - /** - * Customer group repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerGroupRepository - */ - protected $customerGroupRepository; - - /** - * Channel repository instance. - * - * @var \Webkul\Core\Repositories\ChannelRepository - */ - protected $channelRepository; - /** * Create a new controller instance. * @@ -59,20 +31,13 @@ class CustomerController extends Controller * @param \Webkul\Core\Repositories\ChannelRepository $channelRepository */ public function __construct( - CustomerRepository $customerRepository, - CustomerAddressRepository $customerAddressRepository, - CustomerGroupRepository $customerGroupRepository, - ChannelRepository $channelRepository - ) { + protected CustomerRepository $customerRepository, + protected CustomerAddressRepository $customerAddressRepository, + protected CustomerGroupRepository $customerGroupRepository, + protected ChannelRepository $channelRepository + ) + { $this->_config = request('_config'); - - $this->customerRepository = $customerRepository; - - $this->customerAddressRepository = $customerAddressRepository; - - $this->customerGroupRepository = $customerGroupRepository; - - $this->channelRepository = $channelRepository; } /** diff --git a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php index f3c43802e..d43ad4fee 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Customer/CustomerGroupController.php @@ -15,24 +15,15 @@ class CustomerGroupController extends Controller */ protected $_config; - /** - * Customer group repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerGroupRepository - */ - protected $customerGroupRepository; - /** * Create a new controller instance. * * @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository; * @return void */ - public function __construct(CustomerGroupRepository $customerGroupRepository) + public function __construct(protected CustomerGroupRepository $customerGroupRepository) { $this->_config = request('_config'); - - $this->customerGroupRepository = $customerGroupRepository; } /** diff --git a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php index 7159d4809..25515e40a 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/DashboardController.php @@ -19,41 +19,6 @@ class DashboardController extends Controller */ protected $_config; - /** - * Order repository instance. - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * Order item repository instance. - * - * @var \Webkul\Sales\Repositories\OrderItemRepository - */ - protected $orderItemRepository; - - /** - * Invoice repository instance. - * - * @var \Webkul\Sales\Repositories\InvoiceRepository - */ - protected $invoiceRepository; - - /** - * Customer repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerRepository - */ - protected $customerRepository; - - /** - * Product inventory repository instance. - * - * @var \Webkul\Product\Repositories\ProductInventoryRepository - */ - protected $productInventoryRepository; - /** * Start date. * @@ -92,23 +57,14 @@ class DashboardController extends Controller * @return void */ public function __construct( - OrderRepository $orderRepository, - OrderItemRepository $orderItemRepository, - InvoiceRepository $invoiceRepository, - CustomerRepository $customerRepository, - ProductInventoryRepository $productInventoryRepository - ) { + protected OrderRepository $orderRepository, + protected OrderItemRepository $orderItemRepository, + protected InvoiceRepository $invoiceRepository, + protected CustomerRepository $customerRepository, + protected ProductInventoryRepository $productInventoryRepository + ) + { $this->_config = request('_config'); - - $this->orderRepository = $orderRepository; - - $this->orderItemRepository = $orderItemRepository; - - $this->invoiceRepository = $invoiceRepository; - - $this->customerRepository = $customerRepository; - - $this->productInventoryRepository = $productInventoryRepository; } /** diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php index 41939d3bb..ff21aa646 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/InvoiceController.php @@ -22,20 +22,6 @@ class InvoiceController extends Controller */ protected $_config; - /** - * Order repository instance. - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * Invoice repository instance. - * - * @var \Webkul\Sales\Repositories\InvoiceRepository - */ - protected $invoiceRepository; - /** * Create a new controller instance. * @@ -44,14 +30,11 @@ class InvoiceController extends Controller * @return void */ public function __construct( - OrderRepository $orderRepository, - InvoiceRepository $invoiceRepository - ) { + protected OrderRepository $orderRepository, + protected InvoiceRepository $invoiceRepository + ) + { $this->_config = request('_config'); - - $this->orderRepository = $orderRepository; - - $this->invoiceRepository = $invoiceRepository; } /** diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php index 24b194a65..7708bffe6 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/OrderController.php @@ -17,20 +17,6 @@ class OrderController extends Controller */ protected $_config; - /** - * OrderRepository object - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * OrderCommentRepository object - * - * @var \Webkul\Sales\Repositories\OrderCommentRepository - */ - protected $orderCommentRepository; - /** * Create a new controller instance. * @@ -39,15 +25,11 @@ class OrderController extends Controller * @return void */ public function __construct( - OrderRepository $orderRepository, - OrderCommentRepository $orderCommentRepository + protected OrderRepository $orderRepository, + protected OrderCommentRepository $orderCommentRepository ) { $this->_config = request('_config'); - - $this->orderRepository = $orderRepository; - - $this->orderCommentRepository = $orderCommentRepository; } /** diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/RefundController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/RefundController.php index 6eac08f66..218d03912 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/RefundController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/RefundController.php @@ -17,27 +17,6 @@ class RefundController extends Controller */ protected $_config; - /** - * Order repository instance. - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * Order item repository instance. - * - * @var \Webkul\Sales\Repositories\OrderItemRepository - */ - protected $orderItemRepository; - - /** - * Refund repository instance. - * - * @var \Webkul\Sales\Repositories\RefundRepository - */ - protected $refundRepository; - /** * Create a new controller instance. * @@ -47,17 +26,12 @@ class RefundController extends Controller * @return void */ public function __construct( - OrderRepository $orderRepository, - OrderItemRepository $orderItemRepository, - RefundRepository $refundRepository - ) { + protected OrderRepository $orderRepository, + protected OrderItemRepository $orderItemRepository, + protected RefundRepository $refundRepository + ) + { $this->_config = request('_config'); - - $this->orderRepository = $orderRepository; - - $this->orderItemRepository = $orderItemRepository; - - $this->refundRepository = $refundRepository; } /** diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php index 04dbcae8c..feae119ba 100755 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/ShipmentController.php @@ -17,27 +17,6 @@ class ShipmentController extends Controller */ protected $_config; - /** - * Order repository instance. - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * Order item repository instance. - * - * @var \Webkul\Sales\Repositories\OrderItemRepository - */ - protected $orderItemRepository; - - /** - * Shipment repository instance. - * - * @var \Webkul\Sales\Repositories\ShipmentRepository - */ - protected $shipmentRepository; - /** * Create a new controller instance. * @@ -47,17 +26,12 @@ class ShipmentController extends Controller * @return void */ public function __construct( - ShipmentRepository $shipmentRepository, - OrderRepository $orderRepository, - OrderItemRepository $orderItemRepository - ) { + protected ShipmentRepository $shipmentRepository, + protected OrderRepository $orderRepository, + protected OrderItemRepository $orderItemRepository + ) + { $this->_config = request('_config'); - - $this->orderRepository = $orderRepository; - - $this->orderItemRepository = $orderItemRepository; - - $this->shipmentRepository = $shipmentRepository; } /** diff --git a/packages/Webkul/Admin/src/Http/Controllers/Sales/TransactionController.php b/packages/Webkul/Admin/src/Http/Controllers/Sales/TransactionController.php index 589d6af29..c1b9c335a 100644 --- a/packages/Webkul/Admin/src/Http/Controllers/Sales/TransactionController.php +++ b/packages/Webkul/Admin/src/Http/Controllers/Sales/TransactionController.php @@ -19,27 +19,6 @@ class TransactionController extends Controller */ protected $_config; - /** - * Order repository instance. - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * Order transaction repository instance. - * - * @var \Webkul\Sales\Repositories\OrderTransactionRepository - */ - protected $orderTransactionRepository; - - /** - * Invoice repository instance. - * - * @var \Webkul\Sales\Repositories\InvoiceRepository - */ - protected $invoiceRepository; - /** * Create a new controller instance. * @@ -49,16 +28,12 @@ class TransactionController extends Controller * @return void */ public function __construct( - OrderRepository $orderRepository, - OrderTransactionRepository $orderTransactionRepository, - InvoiceRepository $invoiceRepository) { + protected OrderRepository $orderRepository, + protected OrderTransactionRepository $orderTransactionRepository, + protected InvoiceRepository $invoiceRepository + ) + { $this->_config = request('_config'); - - $this->orderRepository = $orderRepository; - - $this->orderTransactionRepository = $orderTransactionRepository; - - $this->invoiceRepository = $invoiceRepository; } /** diff --git a/packages/Webkul/Admin/src/Http/Middleware/Locale.php b/packages/Webkul/Admin/src/Http/Middleware/Locale.php index 08cddd09d..d6cd273d6 100755 --- a/packages/Webkul/Admin/src/Http/Middleware/Locale.php +++ b/packages/Webkul/Admin/src/Http/Middleware/Locale.php @@ -7,21 +7,13 @@ use Webkul\Core\Repositories\LocaleRepository; class Locale { - /** - * Locale repository. - * - * @var LocaleRepository - */ - protected $locale; - /** * Create a new middleware instance. * - * @param \Webkul\Core\Repositories\LocaleRepository $locale + * @param \Webkul\Core\Repositories\LocaleRepository $localeRepository */ - public function __construct(LocaleRepository $locale) + public function __construct(protected LocaleRepository $localeRepository) { - $this->locale = $locale; } /** @@ -36,7 +28,7 @@ class Locale $locale = request()->get('admin_locale'); if ($locale) { - if ($this->locale->findOneByField('code', $locale)) { + if ($this->localeRepository->findOneByField('code', $locale)) { app()->setLocale($locale); session()->put('admin_locale', $locale); diff --git a/packages/Webkul/Admin/src/Mail/CancelOrderAdminNotification.php b/packages/Webkul/Admin/src/Mail/CancelOrderAdminNotification.php index 81f308bf2..b7f671107 100644 --- a/packages/Webkul/Admin/src/Mail/CancelOrderAdminNotification.php +++ b/packages/Webkul/Admin/src/Mail/CancelOrderAdminNotification.php @@ -10,18 +10,12 @@ class CancelOrderAdminNotification extends Mailable { use Queueable, SerializesModels; - /** - * @var \Webkul\Sales\Contracts\Order - */ - public $order; - /** * @param \Webkul\Sales\Contracts\Order $order * @return void */ - public function __construct($order) + public function __construct(public $order) { - $this->order = $order; } public function build() diff --git a/packages/Webkul/Admin/src/Mail/CancelOrderNotification.php b/packages/Webkul/Admin/src/Mail/CancelOrderNotification.php index d934817d5..2cb0810a0 100644 --- a/packages/Webkul/Admin/src/Mail/CancelOrderNotification.php +++ b/packages/Webkul/Admin/src/Mail/CancelOrderNotification.php @@ -11,18 +11,12 @@ class CancelOrderNotification extends Mailable { use Queueable, SerializesModels; - /** - * @var \Webkul\Sales\Contracts\Order - */ - public $order; - /** * @param \Webkul\Sales\Contracts\Order $order * @return void */ - public function __construct($order) + public function __construct(public $order) { - $this->order = $order; } public function build() diff --git a/packages/Webkul/Admin/src/Mail/DuplicateInvoiceNotification.php b/packages/Webkul/Admin/src/Mail/DuplicateInvoiceNotification.php index da2473c29..dda983a65 100755 --- a/packages/Webkul/Admin/src/Mail/DuplicateInvoiceNotification.php +++ b/packages/Webkul/Admin/src/Mail/DuplicateInvoiceNotification.php @@ -10,20 +10,6 @@ class DuplicateInvoiceNotification extends Mailable { use Queueable, SerializesModels; - /** - * The invoice instance. - * - * @var \Webkul\Customer\Contracts\Invoice - */ - public $invoice; - - /** - * Customer email. - * - * @var string - */ - public $customerEmail; - /** * Create a new message instance. * @@ -31,12 +17,11 @@ class DuplicateInvoiceNotification extends Mailable * @param string $customerEmail * @return void */ - public function __construct($invoice, $customerEmail) - { - $this->invoice = $invoice; - - $this->customerEmail = $customerEmail; - } + public function __construct( + public $invoice, + public $customerEmail + ) + {} /** * Build the message. diff --git a/packages/Webkul/Admin/src/Mail/InvoiceOverdueReminder.php b/packages/Webkul/Admin/src/Mail/InvoiceOverdueReminder.php index dabe48271..ecf78ed9d 100644 --- a/packages/Webkul/Admin/src/Mail/InvoiceOverdueReminder.php +++ b/packages/Webkul/Admin/src/Mail/InvoiceOverdueReminder.php @@ -11,20 +11,6 @@ class InvoiceOverdueReminder extends Mailable { use Queueable, SerializesModels; - /** - * The customer instance. - * - * @var \Webkul\Customer\Contracts\Customer - */ - public $customer; - - /** - * The invoice instance. - * - * @var \Webkul\Sales\Contracts\Invoice - */ - public $invoice; - /** * Create a new message instance. * @@ -32,14 +18,10 @@ class InvoiceOverdueReminder extends Mailable * @param \Webkul\Sales\Contracts\Invoice $invoice */ public function __construct( - $customer, - $invoice + public $customer, + public $invoice ) - { - $this->customer = $customer; - - $this->invoice = $invoice; - } + {} /** * Build the message. diff --git a/packages/Webkul/Admin/src/Mail/NewAdminNotification.php b/packages/Webkul/Admin/src/Mail/NewAdminNotification.php index d3cbb6303..48698f43d 100644 --- a/packages/Webkul/Admin/src/Mail/NewAdminNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewAdminNotification.php @@ -11,22 +11,14 @@ class NewAdminNotification extends Mailable { use Queueable, SerializesModels; - /** - * The order instance. - * - * @var \Webkul\Sales\Contracts\Order - */ - public $order; - /** * Create a new message instance. * * @param \Webkul\Sales\Contracts\Order $order * @return void */ - public function __construct($order) + public function __construct(public $order) { - $this->order = $order; } /** diff --git a/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php b/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php index 71cffe6c1..a18d67d4d 100644 --- a/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewCustomerNotification.php @@ -11,20 +11,6 @@ class NewCustomerNotification extends Mailable { use Queueable, SerializesModels; - /** - * The customer instance. - * - * @var \Webkul\Customer\Contracts\Customer - */ - public $customer; - - /** - * The password instance. - * - * @var string - */ - public $password; - /** * Create a new message instance. * @@ -33,13 +19,10 @@ class NewCustomerNotification extends Mailable * @return void */ public function __construct( - $customer, - $password + public $customer, + public $password ) { - $this->customer = $customer; - - $this->password = $password; } /** diff --git a/packages/Webkul/Admin/src/Mail/NewInventorySourceNotification.php b/packages/Webkul/Admin/src/Mail/NewInventorySourceNotification.php index e75d820dd..69ed8ec76 100644 --- a/packages/Webkul/Admin/src/Mail/NewInventorySourceNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewInventorySourceNotification.php @@ -11,22 +11,14 @@ class NewInventorySourceNotification extends Mailable { use Queueable, SerializesModels; - /** - * The shipment instance. - * - * @var \Webkul\Customer\Contracts\Shipment - */ - public $shipment; - /** * Create a new message instance. * * @param \Webkul\Customer\Contracts\Shipment $shipment * @return void */ - public function __construct($shipment) + public function __construct(public $shipment) { - $this->shipment = $shipment; } /** diff --git a/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php b/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php index bea555d7d..1b65ed80b 100755 --- a/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewInvoiceNotification.php @@ -11,22 +11,14 @@ class NewInvoiceNotification extends Mailable { use Queueable, SerializesModels; - /** - * The invoice instance. - * - * @param \Webkul\Customer\Contracts\Invoice $invoice - */ - public $invoice; - /** * Create a new message instance. * * @param \Webkul\Customer\Contracts\Invoice $invoice * @return void */ - public function __construct($invoice) + public function __construct(public $invoice) { - $this->invoice = $invoice; } /** diff --git a/packages/Webkul/Admin/src/Mail/NewOrderNotification.php b/packages/Webkul/Admin/src/Mail/NewOrderNotification.php index e98a5fc9a..a9d8a2f35 100755 --- a/packages/Webkul/Admin/src/Mail/NewOrderNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewOrderNotification.php @@ -11,22 +11,14 @@ class NewOrderNotification extends Mailable { use Queueable, SerializesModels; - /** - * The order instance. - * - * @var \Webkul\Sales\Contracts\Order $order - */ - public $order; - /** * Create a new message instance. * * @param \Webkul\Sales\Contracts\Order $order * @return void */ - public function __construct($order) + public function __construct(public $order) { - $this->order = $order; } /** diff --git a/packages/Webkul/Admin/src/Mail/NewRefundNotification.php b/packages/Webkul/Admin/src/Mail/NewRefundNotification.php index 3da428348..9b9ecd59b 100644 --- a/packages/Webkul/Admin/src/Mail/NewRefundNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewRefundNotification.php @@ -11,22 +11,14 @@ class NewRefundNotification extends Mailable { use Queueable, SerializesModels; - /** - * The refund instance. - * - * @var \Webkul\Sales\Contracts\Refund - */ - public $refund; - /** * Create a new message instance. * * @param \Webkul\Sales\Contracts\Refund $refund * @return void */ - public function __construct($refund) + public function __construct(public $refund) { - $this->refund = $refund; } /** diff --git a/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php b/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php index c19460c1c..a2fda88ea 100755 --- a/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php +++ b/packages/Webkul/Admin/src/Mail/NewShipmentNotification.php @@ -11,22 +11,14 @@ class NewShipmentNotification extends Mailable { use Queueable, SerializesModels; - /** - * The shipment instance. - * - * @var \Webkul\Sales\Contracts\Shipment - */ - public $shipment; - /** * Create a new message instance. * * @param \Webkul\Sales\Contracts\Shipment $shipment * @return void */ - public function __construct($shipment) + public function __construct(public $shipment) { - $this->shipment = $shipment; } /** diff --git a/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php b/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php index 09ffdaa16..8f1bb23fe 100644 --- a/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php +++ b/packages/Webkul/Admin/src/Mail/OrderCommentNotification.php @@ -11,22 +11,14 @@ class OrderCommentNotification extends Mailable { use Queueable, SerializesModels; - /** - * The order comment instance. - * - * @var \Webkul\Sales\Contracts\OrderComment $comment - */ - public $comment; - /** * Create a new message instance. * * @param \Webkul\Sales\Contracts\OrderComment $comment * @return void */ - public function __construct($comment) + public function __construct(public $comment) { - $this->comment = $comment; } /** diff --git a/packages/Webkul/Admin/src/Validations/ProductCategoryUniqueSlug.php b/packages/Webkul/Admin/src/Validations/ProductCategoryUniqueSlug.php index a75a66733..3b4573639 100755 --- a/packages/Webkul/Admin/src/Validations/ProductCategoryUniqueSlug.php +++ b/packages/Webkul/Admin/src/Validations/ProductCategoryUniqueSlug.php @@ -25,31 +25,17 @@ class ProductCategoryUniqueSlug implements Rule */ protected $isSlugReserved = false; - /** - * Table name. - * - * @var string - */ - protected $tableName; - - /** - * Table id. - * - * @var string - */ - protected $id; - /** * Constructor. * * @param string $tableName * @param string $id */ - public function __construct($tableName = null, $id = null) + public function __construct( + protected $tableName = null, + protected $id = null + ) { - $this->tableName = $tableName; - - $this->id = $id; } /** diff --git a/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php b/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php index 94f809c0b..5f7d344fb 100755 --- a/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php +++ b/packages/Webkul/Attribute/src/Http/Controllers/AttributeController.php @@ -14,23 +14,14 @@ class AttributeController extends Controller */ protected $_config; - /** - * Attribute repository instance. - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - /** * Create a new controller instance. * * @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository * @return void */ - public function __construct(AttributeRepository $attributeRepository) + public function __construct(protected AttributeRepository $attributeRepository) { - $this->attributeRepository = $attributeRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Attribute/src/Http/Controllers/AttributeFamilyController.php b/packages/Webkul/Attribute/src/Http/Controllers/AttributeFamilyController.php index bb31f5ec0..f712a0a85 100755 --- a/packages/Webkul/Attribute/src/Http/Controllers/AttributeFamilyController.php +++ b/packages/Webkul/Attribute/src/Http/Controllers/AttributeFamilyController.php @@ -15,20 +15,6 @@ class AttributeFamilyController extends Controller */ protected $_config; - /** - * Attribute family repository instance. - * - * @var \Webkul\Attribute\Repositories\AttributeFamilyRepository - */ - protected $attributeFamilyRepository; - - /** - * Attribute repository instance. - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - /** * Create a new controller instance. * @@ -37,13 +23,10 @@ class AttributeFamilyController extends Controller * @return void */ public function __construct( - AttributeFamilyRepository $attributeFamilyRepository, - AttributeRepository $attributeRepository - ) { - $this->attributeFamilyRepository = $attributeFamilyRepository; - - $this->attributeRepository = $attributeRepository; - + protected AttributeFamilyRepository $attributeFamilyRepository, + protected AttributeRepository $attributeRepository + ) + { $this->_config = request('_config'); } diff --git a/packages/Webkul/Attribute/src/Repositories/AttributeFamilyRepository.php b/packages/Webkul/Attribute/src/Repositories/AttributeFamilyRepository.php index 608b7122c..ee816ead4 100755 --- a/packages/Webkul/Attribute/src/Repositories/AttributeFamilyRepository.php +++ b/packages/Webkul/Attribute/src/Repositories/AttributeFamilyRepository.php @@ -11,20 +11,6 @@ use Illuminate\Support\Str; class AttributeFamilyRepository extends Repository { - /** - * AttributeRepository object - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - - /** - * AttributeGroupRepository object - * - * @var \Webkul\Attribute\Repositories\AttributeGroupRepository - */ - protected $attributeGroupRepository; - /** * Create a new controller instance. * @@ -33,15 +19,11 @@ class AttributeFamilyRepository extends Repository * @return void */ public function __construct( - AttributeRepository $attributeRepository, - AttributeGroupRepository $attributeGroupRepository, + protected AttributeRepository $attributeRepository, + protected AttributeGroupRepository $attributeGroupRepository, App $app ) { - $this->attributeRepository = $attributeRepository; - - $this->attributeGroupRepository = $attributeGroupRepository; - parent::__construct($app); } diff --git a/packages/Webkul/Attribute/src/Repositories/AttributeRepository.php b/packages/Webkul/Attribute/src/Repositories/AttributeRepository.php index 652b7caec..883dca91f 100755 --- a/packages/Webkul/Attribute/src/Repositories/AttributeRepository.php +++ b/packages/Webkul/Attribute/src/Repositories/AttributeRepository.php @@ -9,13 +9,6 @@ use Webkul\Core\Eloquent\Repository; class AttributeRepository extends Repository { - /** - * Attribute option repository instance. - * - * @var \Webkul\Attribute\Repositories\AttributeOptionRepository - */ - protected $attributeOptionRepository; - /** * Create a new repository instance. * @@ -23,11 +16,10 @@ class AttributeRepository extends Repository * @return void */ public function __construct( - AttributeOptionRepository $attributeOptionRepository, + protected AttributeOptionRepository $attributeOptionRepository, App $app - ) { - $this->attributeOptionRepository = $attributeOptionRepository; - + ) + { parent::__construct($app); } diff --git a/packages/Webkul/BookingProduct/src/Helpers/Booking.php b/packages/Webkul/BookingProduct/src/Helpers/Booking.php index 54f1de0d5..bf8a31ff0 100644 --- a/packages/Webkul/BookingProduct/src/Helpers/Booking.php +++ b/packages/Webkul/BookingProduct/src/Helpers/Booking.php @@ -18,25 +18,11 @@ use Webkul\Checkout\Models\CartItem; class Booking { - /** - * BookingProductRepository - * - * @return \Webkul\BookingProduct\Repositories\BookingProductRepository - */ - protected $bookingProductRepository; - /** * @return array */ protected $typeRepositories = []; - /** - * BookingRepository - * - * @return \Webkul\BookingProduct\Repositories\BookingRepository - */ - protected $bookingRepository; - /** * @return array */ @@ -66,17 +52,15 @@ class Booking * @return void */ public function __construct( - BookingProductRepository $bookingProductRepository, + protected BookingProductRepository $bookingProductRepository, + protected BookingRepository $bookingRepository, BookingProductDefaultSlotRepository $bookingProductDefaultSlotRepository, BookingProductAppointmentSlotRepository $bookingProductAppointmentSlotRepository, BookingProductEventTicketRepository $bookingProductEventTicketRepository, BookingProductRentalSlotRepository $bookingProductRentalSlotRepository, BookingProductTableSlotRepository $bookingProductTableSlotRepository, - BookingRepository $bookingRepository ) { - $this->bookingProductRepository = $bookingProductRepository; - $this->typeRepositories['default'] = $bookingProductDefaultSlotRepository; $this->typeRepositories['appointment'] = $bookingProductAppointmentSlotRepository; @@ -86,8 +70,6 @@ class Booking $this->typeRepositories['rental'] = $bookingProductRentalSlotRepository; $this->typeRepositories['table'] = $bookingProductTableSlotRepository; - - $this->bookingRepository = $bookingRepository; } /** diff --git a/packages/Webkul/BookingProduct/src/Http/Controllers/Admin/BookingController.php b/packages/Webkul/BookingProduct/src/Http/Controllers/Admin/BookingController.php index 60342638b..1ca3e8614 100644 --- a/packages/Webkul/BookingProduct/src/Http/Controllers/Admin/BookingController.php +++ b/packages/Webkul/BookingProduct/src/Http/Controllers/Admin/BookingController.php @@ -16,22 +16,13 @@ class BookingController extends Controller */ protected $_config; - /** - * BookingRepository object - * - * @var \Webkul\BookingProduct\Repositories\BookingRepository - */ - protected $bookingRepository; - /** * Create a new controller instance. * * @return void */ - public function __construct(BookingRepository $bookingRepository) + public function __construct(protected BookingRepository $bookingRepository) { - $this->bookingRepository = $bookingRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/BookingProduct/src/Http/Controllers/Shop/BookingProductController.php b/packages/Webkul/BookingProduct/src/Http/Controllers/Shop/BookingProductController.php index 749d46086..f15e512b0 100644 --- a/packages/Webkul/BookingProduct/src/Http/Controllers/Shop/BookingProductController.php +++ b/packages/Webkul/BookingProduct/src/Http/Controllers/Shop/BookingProductController.php @@ -29,7 +29,7 @@ class BookingProductController extends Controller * @return void */ public function __construct( - BookingProductRepository $bookingProductRepository, + protected BookingProductRepository $bookingProductRepository, DefaultSlotHelper $defaultSlotHelper, AppointmentSlotHelper $appointmentSlotHelper, RentalSlotHelper $rentalSlotHelper, diff --git a/packages/Webkul/BookingProduct/src/Listeners/Order.php b/packages/Webkul/BookingProduct/src/Listeners/Order.php index b73ddec40..261bea343 100644 --- a/packages/Webkul/BookingProduct/src/Listeners/Order.php +++ b/packages/Webkul/BookingProduct/src/Listeners/Order.php @@ -6,22 +6,14 @@ use Webkul\BookingProduct\Repositories\BookingRepository; class Order { - /** - * BookingRepository Object - * - * @var \Webkul\BookingProduct\Repositories\BookingRepository - */ - protected $bookingRepository; - /** * Create a new listener instance. * * @param \Webkul\Booking\Repositories\BookingRepository $bookingRepository * @return void */ - public function __construct(BookingRepository $bookingRepository) + public function __construct(protected BookingRepository $bookingRepository) { - $this->bookingRepository = $bookingRepository; } /** diff --git a/packages/Webkul/BookingProduct/src/Type/Booking.php b/packages/Webkul/BookingProduct/src/Type/Booking.php index 647d7645e..4c11c7504 100644 --- a/packages/Webkul/BookingProduct/src/Type/Booking.php +++ b/packages/Webkul/BookingProduct/src/Type/Booking.php @@ -18,21 +18,11 @@ use Webkul\Product\Type\Virtual; class Booking extends Virtual { - /** - * BookingProductRepository instance - * - * @var \Webkul\BookingProduct\Repositories\BookingProductRepository + /** @var bool + * + * do not allow booking products to be copied, it would be too complicated. + * */ - protected $bookingProductRepository; - - /** - * Booking helper instance - * - * @var \Webkul\BookingProduct\Helpers\Booking - */ - protected $bookingHelper; - - /** @var bool do not allow booking products to be copied, it would be too complicated. */ protected $canBeCopied = false; /** @@ -66,9 +56,9 @@ class Booking extends Virtual ProductAttributeValueRepository $attributeValueRepository, ProductInventoryRepository $productInventoryRepository, ProductImageRepository $productImageRepository, - BookingProductRepository $bookingProductRepository, - BookingHelper $bookingHelper, - ProductVideoRepository $productVideoRepository + ProductVideoRepository $productVideoRepository, + protected BookingProductRepository $bookingProductRepository, + protected BookingHelper $bookingHelper ) { parent::__construct( @@ -79,10 +69,6 @@ class Booking extends Virtual $productImageRepository, $productVideoRepository ); - - $this->bookingProductRepository = $bookingProductRepository; - - $this->bookingHelper = $bookingHelper; } /** diff --git a/packages/Webkul/CMS/src/Http/Controllers/Admin/PageController.php b/packages/Webkul/CMS/src/Http/Controllers/Admin/PageController.php index 7139c35bf..24ad45c8a 100644 --- a/packages/Webkul/CMS/src/Http/Controllers/Admin/PageController.php +++ b/packages/Webkul/CMS/src/Http/Controllers/Admin/PageController.php @@ -15,23 +15,14 @@ class PageController extends Controller */ protected $_config; - /** - * To hold the CMS repository instance. - * - * @var \Webkul\CMS\Repositories\CmsRepository - */ - protected $cmsRepository; - /** * Create a new controller instance. * * @param \Webkul\CMS\Repositories\CmsRepository $cmsRepository * @return void */ - public function __construct(CmsRepository $cmsRepository) + public function __construct(protected CmsRepository $cmsRepository) { - $this->cmsRepository = $cmsRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/CMS/src/Http/Controllers/Shop/PagePresenterController.php b/packages/Webkul/CMS/src/Http/Controllers/Shop/PagePresenterController.php index 8bdd55d24..1c8eecb08 100644 --- a/packages/Webkul/CMS/src/Http/Controllers/Shop/PagePresenterController.php +++ b/packages/Webkul/CMS/src/Http/Controllers/Shop/PagePresenterController.php @@ -7,22 +7,14 @@ use Webkul\CMS\Repositories\CmsRepository; class PagePresenterController extends Controller { - /** - * CmsRepository object - * - * @var \Webkul\CMS\Repositories\CmsRepository - */ - protected $cmsRepository; - /** * Create a new controller instance. * * @param \Webkul\CMS\Repositories\CmsRepository $cmsRepository * @return void */ - public function __construct(CmsRepository $cmsRepository) + public function __construct(protected CmsRepository $cmsRepository) { - $this->cmsRepository = $cmsRepository; } /** diff --git a/packages/Webkul/CartRule/src/Helpers/CartRule.php b/packages/Webkul/CartRule/src/Helpers/CartRule.php index 3d1825522..52b36e100 100644 --- a/packages/Webkul/CartRule/src/Helpers/CartRule.php +++ b/packages/Webkul/CartRule/src/Helpers/CartRule.php @@ -15,48 +15,6 @@ use Webkul\CartRule\Repositories\CartRuleCouponUsageRepository; class CartRule { - /** - * CartRuleRepository object - * - * @var \Webkul\CartRule\Repositories\CartRuleRepository - */ - protected $cartRuleRepository; - - /** - * CartRuleCouponRepository object - * - * @var \Webkul\CartRule\Repositories\CartRuleCouponRepository - */ - protected $cartRuleCouponRepository; - - /** - * CartRuleCouponUsageRepository object - * - * @var \Webkul\CartRule\Repositories\CartRuleCouponUsageRepository - */ - protected $cartRuleCouponUsageRepository; - - /** - * CartRuleCustomerRepository object - * - * @var \Webkul\CartRule\Repositories\CartRuleCustomerRepository - */ - protected $cartRuleCustomerRepository; - - /** - * CustomerGroupRepository object - * - * @var \Webkul\Customer\Repositories\CustomerGroupRepository - */ - protected $customerGroupRepository; - - /** - * Validator object - * - * @var \Webkul\Rule\Helpers\Validator - */ - protected $validator; - /** * @var array */ @@ -75,25 +33,14 @@ class CartRule * @return void */ public function __construct( - CartRuleRepository $cartRuleRepository, - CartRuleCouponRepository $cartRuleCouponRepository, - CartRuleCouponUsageRepository $cartRuleCouponUsageRepository, - CartRuleCustomerRepository $cartRuleCustomerRepository, - CustomerGroupRepository $customerGroupRepository, - Validator $validator + protected CartRuleRepository $cartRuleRepository, + protected CartRuleCouponRepository $cartRuleCouponRepository, + protected CartRuleCouponUsageRepository $cartRuleCouponUsageRepository, + protected CartRuleCustomerRepository $cartRuleCustomerRepository, + protected CustomerGroupRepository $customerGroupRepository, + protected Validator $validator ) { - $this->cartRuleRepository = $cartRuleRepository; - - $this->cartRuleCouponRepository = $cartRuleCouponRepository; - - $this->cartRuleCouponUsageRepository = $cartRuleCouponUsageRepository; - - $this->cartRuleCustomerRepository = $cartRuleCustomerRepository; - - $this->customerGroupRepository = $customerGroupRepository; - - $this->validator = $validator; } /** diff --git a/packages/Webkul/CartRule/src/Http/Controllers/CartRuleController.php b/packages/Webkul/CartRule/src/Http/Controllers/CartRuleController.php index 8ddc3052c..66ca7f168 100644 --- a/packages/Webkul/CartRule/src/Http/Controllers/CartRuleController.php +++ b/packages/Webkul/CartRule/src/Http/Controllers/CartRuleController.php @@ -18,25 +18,15 @@ class CartRuleController extends Controller */ protected $_config; - /** - * To hold cart repository instance. - * - * @var \Webkul\CartRule\Repositories\CartRuleRepository - */ - protected $cartRuleRepository; - /** * Create a new controller instance. * - * @param \Webkul\CartRule\Repositories\CartRuleRepository $cartRuleRepository + * @param \Webkul\CartRule\Repositories\CartRuleRepository $cartRuleRepository * @return void */ - public function __construct( - CartRuleRepository $cartRuleRepository - ) { + public function __construct(protected CartRuleRepository $cartRuleRepository) + { $this->_config = request('_config'); - - $this->cartRuleRepository = $cartRuleRepository; } /** diff --git a/packages/Webkul/CartRule/src/Http/Controllers/CartRuleCouponController.php b/packages/Webkul/CartRule/src/Http/Controllers/CartRuleCouponController.php index b73771806..dd314a29d 100644 --- a/packages/Webkul/CartRule/src/Http/Controllers/CartRuleCouponController.php +++ b/packages/Webkul/CartRule/src/Http/Controllers/CartRuleCouponController.php @@ -7,22 +7,14 @@ use Webkul\CartRule\Repositories\CartRuleCouponRepository; class CartRuleCouponController extends Controller { - /** - * To hold cart rule coupon repository instance. - * - * @var \Webkul\CartRule\Repositories\CartRuleCouponRepository - */ - protected $cartRuleCouponRepository; - /** * Create a new controller instance. * * @param \Webkul\CartRule\Repositories\CartRuleCouponRepository $cartRuleCouponRepository * @return void */ - public function __construct(CartRuleCouponRepository $cartRuleCouponRepository) + public function __construct(protected CartRuleCouponRepository $cartRuleCouponRepository) { - $this->cartRuleCouponRepository = $cartRuleCouponRepository; } /** diff --git a/packages/Webkul/CartRule/src/Listeners/Cart.php b/packages/Webkul/CartRule/src/Listeners/Cart.php index a8362d017..9b0de3ca2 100644 --- a/packages/Webkul/CartRule/src/Listeners/Cart.php +++ b/packages/Webkul/CartRule/src/Listeners/Cart.php @@ -6,22 +6,14 @@ use Webkul\CartRule\Helpers\CartRule; class Cart { - /** - * CartRule object - * - * @var \Webkul\CartRule\Helpers\CartRule - */ - protected $cartRuleHepler; - /** * Create a new listener instance. * * @param \Webkul\CartRule\Repositories\CartRule $cartRuleHepler * @return void */ - public function __construct(CartRule $cartRuleHepler) + public function __construct(protected CartRule $cartRuleHepler) { - $this->cartRuleHepler = $cartRuleHepler; } /** diff --git a/packages/Webkul/CartRule/src/Listeners/Order.php b/packages/Webkul/CartRule/src/Listeners/Order.php index b52e1e8b0..4d02c1872 100755 --- a/packages/Webkul/CartRule/src/Listeners/Order.php +++ b/packages/Webkul/CartRule/src/Listeners/Order.php @@ -9,34 +9,6 @@ use Webkul\CartRule\Repositories\CartRuleCouponUsageRepository; class Order { - /** - * CartRuleRepository object - * - * @var \Webkul\CartRule\Repositories\CartRuleRepository - */ - protected $cartRuleRepository; - - /** - * CartRuleCustomerRepository object - * - * @var \Webkul\CartRule\Repositories\CartRuleCustomerRepository - */ - protected $cartRuleCustomerRepository; - - /** - * CartRuleCouponRepository object - * - * @var \Webkul\CartRule\Repositories\CartRuleCouponRepository - */ - protected $cartRuleCouponRepository; - - /** - * CartRuleCouponUsageRepository object - * - * @var \Webkul\CartRule\Repositories\CartRuleCouponUsageRepository - */ - protected $cartRuleCouponUsageRepository; - /** * Create a new listener instance. * @@ -47,19 +19,12 @@ class Order * @return void */ public function __construct( - CartRuleRepository $cartRuleRepository, - CartRuleCustomerRepository $cartRuleCustomerRepository, - CartRuleCouponRepository $cartRuleCouponRepository, - CartRuleCouponUsageRepository $cartRuleCouponUsageRepository + protected CartRuleRepository $cartRuleRepository, + protected CartRuleCustomerRepository $cartRuleCustomerRepository, + protected CartRuleCouponRepository $cartRuleCouponRepository, + protected CartRuleCouponUsageRepository $cartRuleCouponUsageRepository ) { - $this->cartRuleRepository = $cartRuleRepository; - - $this->cartRuleCustomerRepository = $cartRuleCustomerRepository; - - $this->cartRuleCouponRepository = $cartRuleCouponRepository; - - $this->cartRuleCouponUsageRepository = $cartRuleCouponUsageRepository; } /** diff --git a/packages/Webkul/CartRule/src/Repositories/CartRuleRepository.php b/packages/Webkul/CartRule/src/Repositories/CartRuleRepository.php index 0b3b45097..9e8038301 100755 --- a/packages/Webkul/CartRule/src/Repositories/CartRuleRepository.php +++ b/packages/Webkul/CartRule/src/Repositories/CartRuleRepository.php @@ -14,55 +14,6 @@ use Webkul\Tax\Repositories\TaxCategoryRepository; class CartRuleRepository extends Repository { - /** - * Attribute family repository instance. - * - * @var \Webkul\Attribute\Repositories\AttributeFamilyRepository - */ - protected $attributeFamilyRepository; - - /** - * Attribute repository instance. - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - - /** - * Category repository instance. - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - - /** - * Cart rule coupon repository instance. - * - * @var \Webkul\CartRule\Repositories\CartRuleCouponRepository - */ - protected $cartRuleCouponRepository; - - /** - * Tax category repository instance. - * - * @var \Webkul\Tax\Repositories\TaxCategoryRepository - */ - protected $taxCategoryRepository; - - /** - * Country repository instance. - * - * @var \Webkul\Core\Repositories\CountryRepository - */ - protected $countryRepository; - - /** - * Country state repository instance. - * - * @var \Webkul\Core\Repositories\CountryStateRepository - */ - protected $countryStateRepository; - /** * Create a new repository instance. * @@ -77,29 +28,16 @@ class CartRuleRepository extends Repository * @return void */ public function __construct( - AttributeFamilyRepository $attributeFamilyRepository, - AttributeRepository $attributeRepository, - CategoryRepository $categoryRepository, - CartRuleCouponRepository $cartRuleCouponRepository, - TaxCategoryRepository $taxCategoryRepository, - CountryRepository $countryRepository, - CountryStateRepository $countryStateRepository, + protected AttributeFamilyRepository $attributeFamilyRepository, + protected AttributeRepository $attributeRepository, + protected CategoryRepository $categoryRepository, + protected CartRuleCouponRepository $cartRuleCouponRepository, + protected TaxCategoryRepository $taxCategoryRepository, + protected CountryRepository $countryRepository, + protected CountryStateRepository $countryStateRepository, App $app - ) { - $this->attributeFamilyRepository = $attributeFamilyRepository; - - $this->attributeRepository = $attributeRepository; - - $this->categoryRepository = $categoryRepository; - - $this->cartRuleCouponRepository = $cartRuleCouponRepository; - - $this->taxCategoryRepository = $taxCategoryRepository; - - $this->countryRepository = $countryRepository; - - $this->countryStateRepository = $countryStateRepository; - + ) + { parent::__construct($app); } diff --git a/packages/Webkul/CatalogRule/src/Console/Commands/PriceRuleIndex.php b/packages/Webkul/CatalogRule/src/Console/Commands/PriceRuleIndex.php index 53f7e7d43..1ace78019 100644 --- a/packages/Webkul/CatalogRule/src/Console/Commands/PriceRuleIndex.php +++ b/packages/Webkul/CatalogRule/src/Console/Commands/PriceRuleIndex.php @@ -21,23 +21,14 @@ class PriceRuleIndex extends Command */ protected $description = 'Automatically updates catalog rule price index information (eg. rule_price)'; - /** - * CatalogRuleIndex object - * - * @var \Webkul\CatalogRule\Helpers\CatalogRuleIndex - */ - protected $catalogRuleIndexHelper; - /** * Create a new command instance. * * @param \Webkul\CatalogRuleProduct\Helpers\CatalogRuleIndex $catalogRuleIndexHelper * @return void */ - public function __construct(CatalogRuleIndex $catalogRuleIndexHelper) + public function __construct(protected CatalogRuleIndex $catalogRuleIndexHelper) { - $this->catalogRuleIndexHelper = $catalogRuleIndexHelper; - parent::__construct(); } diff --git a/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleIndex.php b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleIndex.php index b470194fd..144ebe75e 100644 --- a/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleIndex.php +++ b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleIndex.php @@ -7,27 +7,6 @@ use Webkul\CatalogRule\Repositories\CatalogRuleRepository; class CatalogRuleIndex { - /** - * CatalogRuleRepository object - * - * @var \Webkul\CatalogRule\Repositories\CatalogRuleRepository - */ - protected $catalogRuleRepository; - - /** - * CatalogRuleProduct object - * - * @var \Webkul\CatalogRule\Helpers\CatalogRuleProduct - */ - protected $catalogRuleHelper; - - /** - * CatalogRuleProductPrice object - * - * @var \Webkul\CatalogRule\Helpers\CatalogRuleProductPrice - */ - protected $catalogRuleProductPriceHelper; - /** * Create a new helper instance. * @@ -37,16 +16,11 @@ class CatalogRuleIndex * @return void */ public function __construct( - CatalogRuleRepository $catalogRuleRepository, - CatalogRuleProduct $catalogRuleProductHelper, - CatalogRuleProductPrice $catalogRuleProductPriceHelper + protected CatalogRuleRepository $catalogRuleRepository, + protected CatalogRuleProduct $catalogRuleProductHelper, + protected CatalogRuleProductPrice $catalogRuleProductPriceHelper ) { - $this->catalogRuleRepository = $catalogRuleRepository; - - $this->catalogRuleProductHelper = $catalogRuleProductHelper; - - $this->catalogRuleProductPriceHelper = $catalogRuleProductPriceHelper; } /** diff --git a/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProduct.php b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProduct.php index da7d689c4..bc9025350 100644 --- a/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProduct.php +++ b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProduct.php @@ -11,34 +11,6 @@ use Webkul\Rule\Helpers\Validator; class CatalogRuleProduct { - /** - * AttributeRepository object - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - - /** - * ProductRepository object - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * CatalogRuleProductRepository object - * - * @var \Webkul\CatalogRule\Repositories\CatalogRuleProductRepository - */ - protected $catalogRuleProductRepository; - - /** - * Validator object - * - * @var \Webkul\Rule\Helpers\ValidatorValidator - */ - protected $validator; - /** * Create a new helper instance. * @@ -49,19 +21,12 @@ class CatalogRuleProduct * @return void */ public function __construct( - AttributeRepository $attributeRepository, - ProductRepository $productRepository, - CatalogRuleProductRepository $catalogRuleProductRepository, - Validator $validator + protected AttributeRepository $attributeRepository, + protected ProductRepository $productRepository, + protected CatalogRuleProductRepository $catalogRuleProductRepository, + protected Validator $validator ) { - $this->attributeRepository = $attributeRepository; - - $this->productRepository = $productRepository; - - $this->catalogRuleProductRepository = $catalogRuleProductRepository; - - $this->validator = $validator; } /** diff --git a/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProductPrice.php b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProductPrice.php index 70a391056..e01f98c27 100644 --- a/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProductPrice.php +++ b/packages/Webkul/CatalogRule/src/Helpers/CatalogRuleProductPrice.php @@ -8,27 +8,6 @@ use Webkul\CatalogRule\Repositories\CatalogRuleProductPriceRepository; class CatalogRuleProductPrice { - /** - * CatalogRuleProductPriceRepository object - * - * @var \Webkul\CatalogRule\Repositories\CatalogRuleProductPriceRepository - */ - protected $catalogRuleProductPriceRepository; - - /** - * CatalogRuleProduct object - * - * @var \Webkul\CatalogRule\Helpers\CatalogRuleProduct - */ - protected $catalogRuleProductHelper; - - /** - * CustomerGroupRepository object - * - * @var \Webkul\Customer\Repositories\CustomerGroupRepository - */ - protected $customerGroupRepository; - /** * Create a new helper instance. * @@ -38,16 +17,11 @@ class CatalogRuleProductPrice * @return void */ public function __construct( - CatalogRuleProductPriceRepository $catalogRuleProductPriceRepository, - CatalogRuleProduct $catalogRuleProductHelper, - CustomerGroupRepository $customerGroupRepository + protected CatalogRuleProductPriceRepository $catalogRuleProductPriceRepository, + protected CatalogRuleProduct $catalogRuleProductHelper, + protected CustomerGroupRepository $customerGroupRepository ) { - $this->catalogRuleProductPriceRepository = $catalogRuleProductPriceRepository; - - $this->catalogRuleProductHelper = $catalogRuleProductHelper; - - $this->customerGroupRepository = $customerGroupRepository; } /** diff --git a/packages/Webkul/CatalogRule/src/Http/Controllers/CatalogRuleController.php b/packages/Webkul/CatalogRule/src/Http/Controllers/CatalogRuleController.php index 68a9bc5cc..1516f2741 100644 --- a/packages/Webkul/CatalogRule/src/Http/Controllers/CatalogRuleController.php +++ b/packages/Webkul/CatalogRule/src/Http/Controllers/CatalogRuleController.php @@ -16,20 +16,6 @@ class CatalogRuleController extends Controller */ protected $_config; - /** - * To hold catalog repository instance. - * - * @var \Webkul\CatalogRule\Repositories\CatalogRuleRepository - */ - protected $catalogRuleRepository; - - /** - * Catalog rule index. - * - * @var \Webkul\CatalogRule\Helpers\CatalogRuleIndex - */ - protected $catalogRuleIndexHelper; - /** * Create a new controller instance. * @@ -38,14 +24,11 @@ class CatalogRuleController extends Controller * @return void */ public function __construct( - CatalogRuleRepository $catalogRuleRepository, - CatalogRuleIndex $catalogRuleIndexHelper - ) { + protected CatalogRuleRepository $catalogRuleRepository, + protected CatalogRuleIndex $catalogRuleIndexHelper + ) + { $this->_config = request('_config'); - - $this->catalogRuleRepository = $catalogRuleRepository; - - $this->catalogRuleIndexHelper = $catalogRuleIndexHelper; } /** diff --git a/packages/Webkul/CatalogRule/src/Listeners/Product.php b/packages/Webkul/CatalogRule/src/Listeners/Product.php index b7f6360de..725cfae32 100755 --- a/packages/Webkul/CatalogRule/src/Listeners/Product.php +++ b/packages/Webkul/CatalogRule/src/Listeners/Product.php @@ -6,22 +6,14 @@ use Webkul\CatalogRule\Helpers\CatalogRuleIndex; class Product { - /** - * Product Repository Object - * - * @var \Webkul\CatalogRule\Helpers\CatalogRuleIndex - */ - protected $catalogRuleIndexHelper; - /** * Create a new listener instance. * * @param \Webkul\CatalogRule\Helpers\CatalogRuleIndex $catalogRuleIndexHelper * @return void */ - public function __construct(CatalogRuleIndex $catalogRuleIndexHelper) + public function __construct(protected CatalogRuleIndex $catalogRuleIndexHelper) { - $this->catalogRuleIndexHelper = $catalogRuleIndexHelper; } /** diff --git a/packages/Webkul/CatalogRule/src/Repositories/CatalogRuleRepository.php b/packages/Webkul/CatalogRule/src/Repositories/CatalogRuleRepository.php index 9abde56c3..c581e6a70 100644 --- a/packages/Webkul/CatalogRule/src/Repositories/CatalogRuleRepository.php +++ b/packages/Webkul/CatalogRule/src/Repositories/CatalogRuleRepository.php @@ -12,34 +12,6 @@ use Webkul\Tax\Repositories\TaxCategoryRepository; class CatalogRuleRepository extends Repository { - /** - * Attribute family repository instance. - * - * @var \Webkul\Attribute\Repositories\AttributeFamilyRepository - */ - protected $attributeFamilyRepository; - - /** - * Attribute repository instance. - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - - /** - * Category repository instance. - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - - /** - * Tax category repository instance. - * - * @var \Webkul\CaTaxtegory\Repositories\axCategoryRepository - */ - protected $taxCategoryRepository; - /** * Create a new repository instance. * @@ -51,20 +23,13 @@ class CatalogRuleRepository extends Repository * @return void */ public function __construct( - AttributeFamilyRepository $attributeFamilyRepository, - AttributeRepository $attributeRepository, - CategoryRepository $categoryRepository, - TaxCategoryRepository $taxCategoryRepository, + protected AttributeFamilyRepository $attributeFamilyRepository, + protected AttributeRepository $attributeRepository, + protected CategoryRepository $categoryRepository, + protected TaxCategoryRepository $taxCategoryRepository, App $app - ) { - $this->attributeFamilyRepository = $attributeFamilyRepository; - - $this->attributeRepository = $attributeRepository; - - $this->categoryRepository = $categoryRepository; - - $this->taxCategoryRepository = $taxCategoryRepository; - + ) + { parent::__construct($app); } diff --git a/packages/Webkul/Category/src/Http/Controllers/CategoryController.php b/packages/Webkul/Category/src/Http/Controllers/CategoryController.php index 83d444f21..cfc99bf1b 100755 --- a/packages/Webkul/Category/src/Http/Controllers/CategoryController.php +++ b/packages/Webkul/Category/src/Http/Controllers/CategoryController.php @@ -18,20 +18,6 @@ class CategoryController extends Controller */ protected $_config; - /** - * Category repository instance. - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - - /** - * Attribute repository instance. - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - /** * Create a new controller instance. * @@ -40,13 +26,10 @@ class CategoryController extends Controller * @return void */ public function __construct( - CategoryRepository $categoryRepository, - AttributeRepository $attributeRepository - ) { - $this->categoryRepository = $categoryRepository; - - $this->attributeRepository = $attributeRepository; - + protected CategoryRepository $categoryRepository, + protected AttributeRepository $attributeRepository + ) + { $this->_config = request('_config'); } diff --git a/packages/Webkul/Checkout/src/Cart.php b/packages/Webkul/Checkout/src/Cart.php index 413f8880a..e69e47693 100755 --- a/packages/Webkul/Checkout/src/Cart.php +++ b/packages/Webkul/Checkout/src/Cart.php @@ -25,55 +25,6 @@ class Cart { use CartCoupons, CartTools, CartValidators; - /** - * Cart repository instance. - * - * @var \Webkul\Checkout\Repositories\CartRepository - */ - protected $cartRepository; - - /** - * Cart item repository instance. - * - * @var \Webkul\Checkout\Repositories\CartItemRepository - */ - protected $cartItemRepository; - - /** - * Cart address repository instance. - * - * @var \Webkul\Checkout\Repositories\CartAddressRepository - */ - protected $cartAddressRepository; - - /** - * Product repository instance. - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * Tax category repository instance. - * - * @var \Webkul\Tax\Repositories\TaxCategoryRepository - */ - protected $taxCategoryRepository; - - /** - * Wishlist repository instance. - * - * @var \Webkul\Customer\Repositories\WishlistRepository - */ - protected $wishlistRepository; - - /** - * Customer address repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerAddressRepository - */ - protected $customerAddressRepository; - /** * Create a new class instance. * @@ -87,27 +38,15 @@ class Cart * @return void */ public function __construct( - CartRepository $cartRepository, - CartItemRepository $cartItemRepository, - CartAddressRepository $cartAddressRepository, - ProductRepository $productRepository, - TaxCategoryRepository $taxCategoryRepository, - WishlistRepository $wishlistRepository, - CustomerAddressRepository $customerAddressRepository - ) { - $this->cartRepository = $cartRepository; - - $this->cartItemRepository = $cartItemRepository; - - $this->cartAddressRepository = $cartAddressRepository; - - $this->productRepository = $productRepository; - - $this->taxCategoryRepository = $taxCategoryRepository; - - $this->wishlistRepository = $wishlistRepository; - - $this->customerAddressRepository = $customerAddressRepository; + protected CartRepository $cartRepository, + protected CartItemRepository $cartItemRepository, + protected CartAddressRepository $cartAddressRepository, + protected ProductRepository $productRepository, + protected TaxCategoryRepository $taxCategoryRepository, + protected WishlistRepository $wishlistRepository, + protected CustomerAddressRepository $customerAddressRepository + ) + { } /** diff --git a/packages/Webkul/Core/src/Core.php b/packages/Webkul/Core/src/Core.php index ce2198cdc..995d79842 100755 --- a/packages/Webkul/Core/src/Core.php +++ b/packages/Webkul/Core/src/Core.php @@ -23,62 +23,6 @@ class Core */ const BAGISTO_VERSION = '1.x-dev'; - /** - * Channel repository instance. - * - * @var \Webkul\Core\Repositories\ChannelRepository - */ - protected $channelRepository; - - /** - * Currency repository instance. - * - * @var \Webkul\Core\Repositories\CurrencyRepository - */ - protected $currencyRepository; - - /** - * Exchange rate repository instance. - * - * @var \Webkul\Core\Repositories\ExchangeRateRepository - */ - protected $exchangeRateRepository; - - /** - * Country repository instance. - * - * @var \Webkul\Core\Repositories\CountryRepository - */ - protected $countryRepository; - - /** - * Country state repository instance. - * - * @var \Webkul\Core\Repositories\CountryStateRepository - */ - protected $countryStateRepository; - - /** - * Locale repository instance. - * - * @var \Webkul\Core\Repositories\LocaleRepository - */ - protected $localeRepository; - - /** - * Customer group repository instance. - * - * @var CustomerGroupRepository - */ - protected $customerGroupRepository; - - /** - * Core config repository instance. - * - * @var \Webkul\Core\Repositories\CoreConfigRepository - */ - protected $coreConfigRepository; - /** * Channel. * @@ -105,41 +49,27 @@ class Core /** * Create a new instance. * - * @param \Webkul\Core\Repositories\ChannelRepository $channelRepository - * @param \Webkul\Core\Repositories\CurrencyRepository $currencyRepository - * @param \Webkul\Core\Repositories\ExchangeRateRepository $exchangeRateRepository - * @param \Webkul\Core\Repositories\CountryRepository $countryRepository - * @param \Webkul\Core\Repositories\CountryStateRepository $countryStateRepository - * @param \Webkul\Core\Repositories\LocaleRepository $localeRepository + * @param \Webkul\Core\Repositories\ChannelRepository $channelRepository + * @param \Webkul\Core\Repositories\CurrencyRepository $currencyRepository + * @param \Webkul\Core\Repositories\ExchangeRateRepository $exchangeRateRepository + * @param \Webkul\Core\Repositories\CountryRepository $countryRepository + * @param \Webkul\Core\Repositories\CountryStateRepository $countryStateRepository + * @param \Webkul\Core\Repositories\LocaleRepository $localeRepository * @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository - * @param \Webkul\Core\Repositories\CoreConfigRepository $coreConfigRepository + * @param \Webkul\Core\Repositories\CoreConfigRepository $coreConfigRepository * @return void */ public function __construct( - ChannelRepository $channelRepository, - CurrencyRepository $currencyRepository, - ExchangeRateRepository $exchangeRateRepository, - CountryRepository $countryRepository, - CountryStateRepository $countryStateRepository, - LocaleRepository $localeRepository, - CustomerGroupRepository $customerGroupRepository, - CoreConfigRepository $coreConfigRepository - ) { - $this->channelRepository = $channelRepository; - - $this->currencyRepository = $currencyRepository; - - $this->exchangeRateRepository = $exchangeRateRepository; - - $this->countryRepository = $countryRepository; - - $this->countryStateRepository = $countryStateRepository; - - $this->localeRepository = $localeRepository; - - $this->customerGroupRepository = $customerGroupRepository; - - $this->coreConfigRepository = $coreConfigRepository; + protected ChannelRepository $channelRepository, + protected CurrencyRepository $currencyRepository, + protected ExchangeRateRepository $exchangeRateRepository, + protected CountryRepository $countryRepository, + protected CountryStateRepository $countryStateRepository, + protected LocaleRepository $localeRepository, + protected CustomerGroupRepository $customerGroupRepository, + protected CoreConfigRepository $coreConfigRepository + ) + { } /** diff --git a/packages/Webkul/Core/src/Helpers/Exchange/ExchangeRates.php b/packages/Webkul/Core/src/Helpers/Exchange/ExchangeRates.php index 0aa9ffb1d..9b4c8408d 100644 --- a/packages/Webkul/Core/src/Helpers/Exchange/ExchangeRates.php +++ b/packages/Webkul/Core/src/Helpers/Exchange/ExchangeRates.php @@ -22,36 +22,18 @@ class ExchangeRates extends ExchangeRate */ protected $apiEndPoint; - /** - * CurrencyRepository $currencyRepository - * - * @var \Webkul\Core\Repositories\CurrencyRepository - */ - protected $currencyRepository; - - /** - * ExchangeRateRepository $exchangeRateRepository - * - * @var \Webkul\Core\Repositories\ExchangeRateRepository - */ - protected $exchangeRateRepository; - /** * Create a new helper instance. * - * @param \Webkul\Core\Repositories\CurrencyRepository $currencyRepository + * @param \Webkul\Core\Repositories\CurrencyRepository $currencyRepository * @param \Webkul\Core\Repositories\ExchangeRateRepository $exchangeRateRepository * @return void */ public function __construct( - CurrencyRepository $currencyRepository, - ExchangeRateRepository $exchangeRateRepository + protected CurrencyRepository $currencyRepository, + protected ExchangeRateRepository $exchangeRateRepository ) { - $this->currencyRepository = $currencyRepository; - - $this->exchangeRateRepository = $exchangeRateRepository; - $this->apiEndPoint = 'https://api.exchangeratesapi.io/latest'; $this->apiKey = config('services.exchange-api.exchange_rates.key'); diff --git a/packages/Webkul/Core/src/Helpers/Exchange/FixerExchange.php b/packages/Webkul/Core/src/Helpers/Exchange/FixerExchange.php index 8e69a06b3..346bfe3c0 100644 --- a/packages/Webkul/Core/src/Helpers/Exchange/FixerExchange.php +++ b/packages/Webkul/Core/src/Helpers/Exchange/FixerExchange.php @@ -22,20 +22,6 @@ class FixerExchange extends ExchangeRate */ protected $apiEndPoint; - /** - * Holds CurrencyRepository instance - * - * @var \Webkul\Core\Repositories\CurrencyRepository - */ - protected $currencyRepository; - - /** - * Holds ExchangeRateRepository instance - * - * @var \Webkul\Core\Repositories\ExchangeRateRepository - */ - protected $exchangeRateRepository; - /** * Create a new helper instance. * @@ -44,14 +30,10 @@ class FixerExchange extends ExchangeRate * @return void */ public function __construct( - CurrencyRepository $currencyRepository, - ExchangeRateRepository $exchangeRateRepository + protected CurrencyRepository $currencyRepository, + protected ExchangeRateRepository $exchangeRateRepository ) { - $this->currencyRepository = $currencyRepository; - - $this->exchangeRateRepository = $exchangeRateRepository; - $this->apiEndPoint = 'http://data.fixer.io/api'; $this->apiKey = config('services.exchange-api')['fixer']['key']; diff --git a/packages/Webkul/Core/src/Http/Controllers/ChannelController.php b/packages/Webkul/Core/src/Http/Controllers/ChannelController.php index 1739684f2..c51413d4a 100755 --- a/packages/Webkul/Core/src/Http/Controllers/ChannelController.php +++ b/packages/Webkul/Core/src/Http/Controllers/ChannelController.php @@ -14,23 +14,14 @@ class ChannelController extends Controller */ protected $_config; - /** - * Channel repository instance. - * - * @var \Webkul\Core\Repositories\ChannelRepository - */ - protected $channelRepository; - /** * Create a new controller instance. * * @param \Webkul\Core\Repositories\ChannelRepository $channelRepository * @return void */ - public function __construct(ChannelRepository $channelRepository) + public function __construct(protected ChannelRepository $channelRepository) { - $this->channelRepository = $channelRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Core/src/Http/Controllers/CountryStateController.php b/packages/Webkul/Core/src/Http/Controllers/CountryStateController.php index 106b683e4..4dabc2228 100755 --- a/packages/Webkul/Core/src/Http/Controllers/CountryStateController.php +++ b/packages/Webkul/Core/src/Http/Controllers/CountryStateController.php @@ -14,36 +14,18 @@ class CountryStateController extends Controller */ protected $_config; - /** - * CountryRepository object - * - * @var \Webkul\Core\Repositories\CountryRepository - */ - protected $countryRepository; - - /** - * CountryStateRepository object - * - * @var Webkul\Core\Repositories\CountryStateRepository - */ - protected $countryStateRepository; - /** * Create a new controller instance. * - * @param \Webkul\Core\Repositories\CountryRepository $countryRepository + * @param \Webkul\Core\Repositories\CountryRepository $countryRepository * @param \Webkul\Core\Repositories\CountryStateRepository $countryStateRepository * @return void */ public function __construct( - CountryRepository $countryRepository, - CountryStateRepository $countryStateRepository + protected CountryRepository $countryRepository, + protected CountryStateRepository $countryStateRepository ) { - $this->countryRepository = $countryRepository; - - $this->countryStateRepository = $countryStateRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Core/src/Http/Controllers/CurrencyController.php b/packages/Webkul/Core/src/Http/Controllers/CurrencyController.php index f820ad1ea..b6549b4de 100755 --- a/packages/Webkul/Core/src/Http/Controllers/CurrencyController.php +++ b/packages/Webkul/Core/src/Http/Controllers/CurrencyController.php @@ -14,23 +14,14 @@ class CurrencyController extends Controller */ protected $_config; - /** - * Currency repository instance. - * - * @var \Webkul\Core\Repositories\CurrencyRepository - */ - protected $currencyRepository; - /** * Create a new controller instance. * * @param \Webkul\Core\Repositories\CurrencyRepository $currencyRepository * @return void */ - public function __construct(CurrencyRepository $currencyRepository) + public function __construct(protected CurrencyRepository $currencyRepository) { - $this->currencyRepository = $currencyRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Core/src/Http/Controllers/ExchangeRateController.php b/packages/Webkul/Core/src/Http/Controllers/ExchangeRateController.php index 0829ae730..4eeecd3b6 100755 --- a/packages/Webkul/Core/src/Http/Controllers/ExchangeRateController.php +++ b/packages/Webkul/Core/src/Http/Controllers/ExchangeRateController.php @@ -15,20 +15,6 @@ class ExchangeRateController extends Controller */ protected $_config; - /** - * Exchange rate repository instance. - * - * @var \Webkul\Core\Repositories\ExchangeRateRepository - */ - protected $exchangeRateRepository; - - /** - * Currency repository instance. - * - * @var \Webkul\Core\Repositories\CurrencyRepository - */ - protected $currencyRepository; - /** * Create a new controller instance. * @@ -37,13 +23,10 @@ class ExchangeRateController extends Controller * @return void */ public function __construct( - ExchangeRateRepository $exchangeRateRepository, - CurrencyRepository $currencyRepository - ) { - $this->exchangeRateRepository = $exchangeRateRepository; - - $this->currencyRepository = $currencyRepository; - + protected ExchangeRateRepository $exchangeRateRepository, + protected CurrencyRepository $currencyRepository + ) + { $this->_config = request('_config'); } diff --git a/packages/Webkul/Core/src/Http/Controllers/LocaleController.php b/packages/Webkul/Core/src/Http/Controllers/LocaleController.php index d3a28bfda..437534435 100755 --- a/packages/Webkul/Core/src/Http/Controllers/LocaleController.php +++ b/packages/Webkul/Core/src/Http/Controllers/LocaleController.php @@ -14,23 +14,14 @@ class LocaleController extends Controller */ protected $_config; - /** - * Locale repository instance. - * - * @var \Webkul\Core\Repositories\LocaleRepository - */ - protected $localeRepository; - /** * Create a new controller instance. * * @param \Webkul\Core\Repositories\LocaleRepository $localeRepository * @return void */ - public function __construct(LocaleRepository $localeRepository) + public function __construct(protected LocaleRepository $localeRepository) { - $this->localeRepository = $localeRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Core/src/Http/Controllers/SliderController.php b/packages/Webkul/Core/src/Http/Controllers/SliderController.php index 4d3373bf6..66100667f 100755 --- a/packages/Webkul/Core/src/Http/Controllers/SliderController.php +++ b/packages/Webkul/Core/src/Http/Controllers/SliderController.php @@ -14,30 +14,14 @@ class SliderController extends Controller */ protected $_config; - /** - * Slider repository instance. - * - * @var \Webkul\Core\Repositories\SliderRepository - */ - protected $sliderRepository; - - /** - * Channels. - * - * @var array - */ - protected $channels; - /** * Create a new controller instance. * * @param \Webkul\Core\Repositories\SliderRepository $sliderRepository * @return void */ - public function __construct(SliderRepository $sliderRepository) + public function __construct(protected SliderRepository $sliderRepository) { - $this->sliderRepository = $sliderRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Core/src/Http/Controllers/SubscriptionController.php b/packages/Webkul/Core/src/Http/Controllers/SubscriptionController.php index c97bb0785..e6d6277f8 100755 --- a/packages/Webkul/Core/src/Http/Controllers/SubscriptionController.php +++ b/packages/Webkul/Core/src/Http/Controllers/SubscriptionController.php @@ -14,23 +14,14 @@ class SubscriptionController extends Controller */ protected $_config; - /** - * Subscribers list repository. - * - * @var \Webkul\Core\Repositories\SubscribersListRepository - */ - protected $subscribersListRepository; - /** * Create a new controller instance. * * @param \Webkul\Core\Repositories\SubscribersListRepository $subscribersListRepository * @return void */ - public function __construct(SubscribersListRepository $subscribersListRepository) + public function __construct(protected SubscribersListRepository $subscribersListRepository) { - $this->subscribersListRepository = $subscribersListRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Core/src/Repositories/SliderRepository.php b/packages/Webkul/Core/src/Repositories/SliderRepository.php index d7f156c45..d14efcf8b 100755 --- a/packages/Webkul/Core/src/Repositories/SliderRepository.php +++ b/packages/Webkul/Core/src/Repositories/SliderRepository.php @@ -14,13 +14,6 @@ class SliderRepository extends Repository { use CacheableRepository; - /** - * Channel repository instance. - * - * @var \Webkul\Core\Repositories\ChannelRepository - */ - protected $channelRepository; - /** * Create a new repository instance. * @@ -29,11 +22,10 @@ class SliderRepository extends Repository * @return void */ public function __construct( - ChannelRepository $channelRepository, + protected ChannelRepository $channelRepository, App $app - ) { - $this->channelRepository = $channelRepository; - + ) + { parent::__construct($app); } diff --git a/packages/Webkul/Customer/src/Http/Controllers/AddressController.php b/packages/Webkul/Customer/src/Http/Controllers/AddressController.php index ac49fcb93..cd6f9e9c2 100755 --- a/packages/Webkul/Customer/src/Http/Controllers/AddressController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/AddressController.php @@ -21,26 +21,17 @@ class AddressController extends Controller */ protected $customer; - /** - * Customer address repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerAddressRepository - */ - protected $customerAddressRepository; - /** * Create a new controller instance. * * @param \Webkul\Customer\Repositories\CustomerAddressRepository $customerAddressRepository * @return void */ - public function __construct(CustomerAddressRepository $customerAddressRepository) + public function __construct(protected CustomerAddressRepository $customerAddressRepository) { $this->_config = request('_config'); $this->customer = auth()->guard('customer')->user(); - - $this->customerAddressRepository = $customerAddressRepository; } /** diff --git a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php index 61378bc59..8af558530 100755 --- a/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/CustomerController.php @@ -20,27 +20,6 @@ class CustomerController extends Controller */ protected $_config; - /** - * Customer repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerRepository - */ - protected $customerRepository; - - /** - * Product review repository instance. - * - * @var \Webkul\Customer\Repositories\ProductReviewRepository - */ - protected $productReviewRepository; - - /** - * Subscribers list repository instance. - * - * @var \Webkul\Core\Repositories\SubscribersListRepository - */ - protected $subscriptionRepository; - /** * Create a new controller instance. * @@ -50,17 +29,12 @@ class CustomerController extends Controller * @return void */ public function __construct( - CustomerRepository $customerRepository, - ProductReviewRepository $productReviewRepository, - SubscribersListRepository $subscriptionRepository - ) { + protected CustomerRepository $customerRepository, + protected ProductReviewRepository $productReviewRepository, + protected SubscribersListRepository $subscriptionRepository + ) + { $this->_config = request('_config'); - - $this->customerRepository = $customerRepository; - - $this->productReviewRepository = $productReviewRepository; - - $this->subscriptionRepository = $subscriptionRepository; } /** diff --git a/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php b/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php index 5aad2ef83..0b4d72eed 100755 --- a/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/RegistrationController.php @@ -23,27 +23,6 @@ class RegistrationController extends Controller */ protected $_config; - /** - * Customer repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerRepository - */ - protected $customerRepository; - - /** - * Customer group repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerGroupRepository - */ - protected $customerGroupRepository; - - /** - * Subscribers list repository instance. - * - * @var \Webkul\Core\Repositories\SubscribersListRepository - */ - protected $subscriptionRepository; - /** * Create a new controller instance. * @@ -53,17 +32,12 @@ class RegistrationController extends Controller * @return void */ public function __construct( - CustomerRepository $customerRepository, - CustomerGroupRepository $customerGroupRepository, - SubscribersListRepository $subscriptionRepository - ) { + protected CustomerRepository $customerRepository, + protected CustomerGroupRepository $customerGroupRepository, + protected SubscribersListRepository $subscriptionRepository + ) + { $this->_config = request('_config'); - - $this->customerRepository = $customerRepository; - - $this->customerGroupRepository = $customerGroupRepository; - - $this->subscriptionRepository = $subscriptionRepository; } /** diff --git a/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php b/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php index ea53c0bfa..1599a5239 100755 --- a/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php +++ b/packages/Webkul/Customer/src/Http/Controllers/WishlistController.php @@ -23,20 +23,6 @@ class WishlistController extends Controller */ protected $currentCustomer; - /** - * Product repository instance. - * - * @var \Webkul\Customer\Repositories\WishlistRepository - */ - protected $wishlistRepository; - - /** - * Wishlist repository instance. - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - /** * Create a new controller instance. * @@ -45,15 +31,12 @@ class WishlistController extends Controller * @return void */ public function __construct( - WishlistRepository $wishlistRepository, - ProductRepository $productRepository - ) { + protected WishlistRepository $wishlistRepository, + protected ProductRepository $productRepository + ) + { $this->_config = request('_config'); - $this->wishlistRepository = $wishlistRepository; - - $this->productRepository = $productRepository; - $this->currentCustomer = auth()->guard('customer')->user(); } diff --git a/packages/Webkul/Customer/src/Mail/RegistrationEmail.php b/packages/Webkul/Customer/src/Mail/RegistrationEmail.php index 2d249d4a3..c6f92b9fd 100644 --- a/packages/Webkul/Customer/src/Mail/RegistrationEmail.php +++ b/packages/Webkul/Customer/src/Mail/RegistrationEmail.php @@ -24,13 +24,6 @@ class RegistrationEmail extends Mailable */ public $selectedMailType; - /** - * Request data. - * - * @var array - */ - public $data; - /** * Create a new mailable instance. * @@ -38,7 +31,10 @@ class RegistrationEmail extends Mailable * @param string $mailType * @return void */ - public function __construct($data, $mailType) + public function __construct( + public $data, + $mailType + ) { $this->data = $data; diff --git a/packages/Webkul/Customer/src/Mail/VerificationEmail.php b/packages/Webkul/Customer/src/Mail/VerificationEmail.php index 0e27a3ca6..f0e368f51 100755 --- a/packages/Webkul/Customer/src/Mail/VerificationEmail.php +++ b/packages/Webkul/Customer/src/Mail/VerificationEmail.php @@ -11,20 +11,14 @@ class VerificationEmail extends Mailable { use Queueable, SerializesModels; - /** - * @var array - */ - public $verificationData; - /** * Create a new mailable instance. * * @param array $verificationData * @return void */ - public function __construct($verificationData) + public function __construct(public $verificationData) { - $this->verificationData = $verificationData; } /** diff --git a/packages/Webkul/Customer/src/Notifications/CustomerUpdatePassword.php b/packages/Webkul/Customer/src/Notifications/CustomerUpdatePassword.php index 28ce81693..e8ba2fbd8 100644 --- a/packages/Webkul/Customer/src/Notifications/CustomerUpdatePassword.php +++ b/packages/Webkul/Customer/src/Notifications/CustomerUpdatePassword.php @@ -10,22 +10,14 @@ class CustomerUpdatePassword extends Mailable { use Queueable, SerializesModels; - /** - * The customer instance. - * - * @var \Webkul\Customer\Models\Customer $customer - */ - public $customer; - /** * Create a new message instance. * * @param \Webkul\Customer\Models\Customer $customer * @return void */ - public function __construct($customer) + public function __construct(public $customer) { - $this->customer = $customer; } /** diff --git a/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php b/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php index 8e8759f88..d0e495150 100755 --- a/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php +++ b/packages/Webkul/Inventory/src/Http/Controllers/InventorySourceController.php @@ -15,23 +15,14 @@ class InventorySourceController extends Controller */ protected $_config; - /** - * Inventory source repository instance. - * - * @var \Webkul\Inventory\Repositories\InventorySourceRepository - */ - protected $inventorySourceRepository; - /** * Create a new controller instance. * * @param \Webkul\Inventory\Repositories\InventorySourceRepository $inventorySourceRepository * @return void */ - public function __construct(InventorySourceRepository $inventorySourceRepository) + public function __construct(protected InventorySourceRepository $inventorySourceRepository) { - $this->inventorySourceRepository = $inventorySourceRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Marketing/src/Console/Commands/EmailsCommand.php b/packages/Webkul/Marketing/src/Console/Commands/EmailsCommand.php index 021280df6..adf825430 100644 --- a/packages/Webkul/Marketing/src/Console/Commands/EmailsCommand.php +++ b/packages/Webkul/Marketing/src/Console/Commands/EmailsCommand.php @@ -21,23 +21,14 @@ class EmailsCommand extends Command */ protected $description = 'Process campaigns and send emails to the subscribed customers.'; - /** - * Campaign object - * - * @var \Webkul\Marketing\Helpers\Campaign - */ - protected $campaignHelper; - /** * Create a new command instance. * * @param \Webkul\Marketing\Repositories\Campaign $campaignHelper * @return void */ - public function __construct(Campaign $campaignHelper) + public function __construct(protected Campaign $campaignHelper) { - $this->campaignHelper = $campaignHelper; - parent::__construct(); } diff --git a/packages/Webkul/Marketing/src/Helpers/Campaign.php b/packages/Webkul/Marketing/src/Helpers/Campaign.php index 4c1369e10..98b1c9bad 100644 --- a/packages/Webkul/Marketing/src/Helpers/Campaign.php +++ b/packages/Webkul/Marketing/src/Helpers/Campaign.php @@ -11,27 +11,6 @@ use Webkul\Marketing\Repositories\EventRepository; class Campaign { - /** - * EventRepository object - * - * @var \Webkul\Marketing\Repositories\EventRepository - */ - protected $eventRepository; - - /** - * CampaignRepository object - * - * @var \Webkul\Marketing\Repositories\CampaignRepository - */ - protected $campaignRepository; - - /** - * TemplateRepository object - * - * @var \Webkul\Marketing\Repositories\TemplateRepository - */ - protected $templateRepository; - /** * Create a new helper instance. * @@ -42,15 +21,11 @@ class Campaign * @return void */ public function __construct( - EventRepository $eventRepository, - CampaignRepository $campaignRepository, - CampaignRepository $templateRepository - ) { - $this->eventRepository = $eventRepository; - - $this->campaignRepository = $campaignRepository; - - $this->templateRepository = $templateRepository; + protected EventRepository $eventRepository, + protected CampaignRepository $campaignRepository, + protected CampaignRepository $templateRepository + ) + { } /** diff --git a/packages/Webkul/Marketing/src/Http/Controllers/CampaignController.php b/packages/Webkul/Marketing/src/Http/Controllers/CampaignController.php index fe9279b2b..d9d28b85f 100644 --- a/packages/Webkul/Marketing/src/Http/Controllers/CampaignController.php +++ b/packages/Webkul/Marketing/src/Http/Controllers/CampaignController.php @@ -14,23 +14,14 @@ class CampaignController extends Controller */ protected $_config; - /** - * Campaign repository instance. - * - * @var \Webkul\Marketing\Repositories\CampaignRepository - */ - protected $campaignRepository; - /** * Create a new controller instance. * * @param \Webkul\Marketing\Repositories\CampaignRepository $campaignRepository * @return void */ - public function __construct(CampaignRepository $campaignRepository) + public function __construct(protected CampaignRepository $campaignRepository) { - $this->campaignRepository = $campaignRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Marketing/src/Http/Controllers/EventController.php b/packages/Webkul/Marketing/src/Http/Controllers/EventController.php index fcd2f704f..143336539 100644 --- a/packages/Webkul/Marketing/src/Http/Controllers/EventController.php +++ b/packages/Webkul/Marketing/src/Http/Controllers/EventController.php @@ -14,23 +14,14 @@ class EventController extends Controller */ protected $_config; - /** - * Event repository instance. - * - * @var \Webkul\Marketing\Repositories\EventRepository - */ - protected $eventRepository; - /** * Create a new controller instance. * * @param \Webkul\Marketing\Repositories\EventRepository $eventRepository * @return void */ - public function __construct(EventRepository $eventRepository) + public function __construct(protected EventRepository $eventRepository) { - $this->eventRepository = $eventRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Marketing/src/Http/Controllers/TemplateController.php b/packages/Webkul/Marketing/src/Http/Controllers/TemplateController.php index 7d38a4e25..82783e35b 100644 --- a/packages/Webkul/Marketing/src/Http/Controllers/TemplateController.php +++ b/packages/Webkul/Marketing/src/Http/Controllers/TemplateController.php @@ -14,23 +14,14 @@ class TemplateController extends Controller */ protected $_config; - /** - * Template repository instance. - * - * @var \Webkul\Marketing\Repositories\TemplateRepository - */ - protected $templateRepository; - /** * Create a new controller instance. * * @param \Webkul\Marketing\Repositories\TemplateRepository $templateRepository * @return void */ - public function __construct(TemplateRepository $templateRepository) + public function __construct(protected TemplateRepository $templateRepository) { - $this->templateRepository = $templateRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Marketing/src/Mail/NewsletterMail.php b/packages/Webkul/Marketing/src/Mail/NewsletterMail.php index 991c32ab7..73ae00b3f 100644 --- a/packages/Webkul/Marketing/src/Mail/NewsletterMail.php +++ b/packages/Webkul/Marketing/src/Mail/NewsletterMail.php @@ -11,18 +11,6 @@ class NewsletterMail extends Mailable { use Queueable, SerializesModels; - /** - * @var string - */ - public $email; - - /** - * The campaign instance. - * - * @var \Webkul\Marketing\Contracts\Campaign - */ - public $campaign; - /** * Create a new message instance. * @@ -30,11 +18,11 @@ class NewsletterMail extends Mailable * @param \Webkul\Marketing\Contracts\Campaign $campaign * @return void */ - public function __construct($email, $campaign) + public function __construct( + public $email, + public $campaign + ) { - $this->email = $email; - - $this->campaign = $campaign; } /** diff --git a/packages/Webkul/Notification/src/Events/UpdateOrderNotification.php b/packages/Webkul/Notification/src/Events/UpdateOrderNotification.php index 7d5a8a88b..f1fcd9dea 100644 --- a/packages/Webkul/Notification/src/Events/UpdateOrderNotification.php +++ b/packages/Webkul/Notification/src/Events/UpdateOrderNotification.php @@ -12,16 +12,13 @@ class UpdateOrderNotification implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; - protected $data; - /** * Create a new event instance. * * @return void */ - public function __construct($data) + public function __construct(protected $data) { - $this->data = $data; } /** diff --git a/packages/Webkul/Notification/src/Http/Controllers/Admin/NotificationController.php b/packages/Webkul/Notification/src/Http/Controllers/Admin/NotificationController.php index 85dfcdcaf..96ffe3882 100644 --- a/packages/Webkul/Notification/src/Http/Controllers/Admin/NotificationController.php +++ b/packages/Webkul/Notification/src/Http/Controllers/Admin/NotificationController.php @@ -14,22 +14,13 @@ class NotificationController extends Controller */ protected $_config; - /** - * Notification repository instance. - * - * @var object - */ - protected $notificationRepository; - /** * Create a new controller instance. * * @return void */ - public function __construct(NotificationRepository $notificationRepository) + public function __construct(protected NotificationRepository $notificationRepository) { - $this->notificationRepository = $notificationRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Notification/src/Listeners/Order.php b/packages/Webkul/Notification/src/Listeners/Order.php index a793a225c..6c21f6e1d 100644 --- a/packages/Webkul/Notification/src/Listeners/Order.php +++ b/packages/Webkul/Notification/src/Listeners/Order.php @@ -9,21 +9,13 @@ use Webkul\Notification\Events\UpdateOrderNotification; class Order { - /** - * NotificationRepository - * - * @var object - */ - protected $notificationRepository; - /** * Create a new listener instance. * * @return void */ - public function __construct(NotificationRepository $notificationRepository) + public function __construct(protected NotificationRepository $notificationRepository) { - $this->notificationRepository = $notificationRepository; } /** diff --git a/packages/Webkul/Payment/src/Listeners/GenerateInvoice.php b/packages/Webkul/Payment/src/Listeners/GenerateInvoice.php index cd352fa88..0fdde3689 100644 --- a/packages/Webkul/Payment/src/Listeners/GenerateInvoice.php +++ b/packages/Webkul/Payment/src/Listeners/GenerateInvoice.php @@ -13,20 +13,6 @@ use Webkul\Sales\Repositories\InvoiceRepository; */ class GenerateInvoice { - /** - * OrderRepository object - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * InvoiceRepository object - * - * @var \Webkul\Sales\Repositories\InvoiceRepository - */ - protected $invoiceRepository; - /** * Create the event listener. * @@ -35,13 +21,11 @@ class GenerateInvoice * @return void */ public function __construct( - OrderRepository $orderRepository, - InvoiceRepository $invoiceRepository - ) - { - $this->orderRepository = $orderRepository; - $this->invoiceRepository = $invoiceRepository; - } + protected OrderRepository $orderRepository, + protected InvoiceRepository $invoiceRepository + ) + { + } /** * Generate a new invoice. diff --git a/packages/Webkul/Paypal/src/Helpers/Ipn.php b/packages/Webkul/Paypal/src/Helpers/Ipn.php index b2706d05c..6e49a7180 100755 --- a/packages/Webkul/Paypal/src/Helpers/Ipn.php +++ b/packages/Webkul/Paypal/src/Helpers/Ipn.php @@ -15,34 +15,12 @@ class Ipn */ protected $post; - /** - * Standard $paypalStandard - * - * @var \Webkul\Paypal\Payment\Standard - */ - protected $paypalStandard; - /** * Order $order * * @var \Webkul\Sales\Contracts\Order */ protected $order; - - /** - * OrderRepository $orderRepository - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * InvoiceRepository $invoiceRepository - * - * @var \Webkul\Sales\Repositories\InvoiceRepository - */ - protected $invoiceRepository; - /** * Create a new helper instance. * @@ -52,16 +30,11 @@ class Ipn * @return void */ public function __construct( - Standard $paypalStandard, - OrderRepository $orderRepository, - InvoiceRepository $invoiceRepository + protected Standard $paypalStandard, + protected OrderRepository $orderRepository, + protected InvoiceRepository $invoiceRepository ) { - $this->paypalStandard = $paypalStandard; - - $this->orderRepository = $orderRepository; - - $this->invoiceRepository = $invoiceRepository; } /** diff --git a/packages/Webkul/Paypal/src/Http/Controllers/SmartButtonController.php b/packages/Webkul/Paypal/src/Http/Controllers/SmartButtonController.php index b8007334b..b9f33e301 100755 --- a/packages/Webkul/Paypal/src/Http/Controllers/SmartButtonController.php +++ b/packages/Webkul/Paypal/src/Http/Controllers/SmartButtonController.php @@ -9,27 +9,6 @@ use Webkul\Sales\Repositories\InvoiceRepository; class SmartButtonController extends Controller { - /** - * SmartButton $smartButton - * - * @var \Webkul\Paypal\Payment\SmartButton - */ - protected $smartButton; - - /** - * OrderRepository $orderRepository - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * InvoiceRepository $invoiceRepository - * - * @var \Webkul\Sales\Repositories\InvoiceRepository - */ - protected $invoiceRepository; - /** * Create a new controller instance. * @@ -39,16 +18,11 @@ class SmartButtonController extends Controller * @return void */ public function __construct( - SmartButton $smartButton, - OrderRepository $orderRepository, - InvoiceRepository $invoiceRepository + protected SmartButton $smartButton, + protected OrderRepository $orderRepository, + protected InvoiceRepository $invoiceRepository ) { - $this->smartButton = $smartButton; - - $this->orderRepository = $orderRepository; - - $this->invoiceRepository = $invoiceRepository; } /** diff --git a/packages/Webkul/Paypal/src/Http/Controllers/StandardController.php b/packages/Webkul/Paypal/src/Http/Controllers/StandardController.php index 1174a1efe..6b8eb66ca 100755 --- a/packages/Webkul/Paypal/src/Http/Controllers/StandardController.php +++ b/packages/Webkul/Paypal/src/Http/Controllers/StandardController.php @@ -8,20 +8,6 @@ use Webkul\Sales\Repositories\OrderRepository; class StandardController extends Controller { - /** - * OrderRepository $orderRepository - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * IPN $ipnHelper - * - * @var \Webkul\Paypal\Helpers\Ipn - */ - protected $ipnHelper; - /** * Create a new controller instance. * @@ -30,13 +16,10 @@ class StandardController extends Controller * @return void */ public function __construct( - OrderRepository $orderRepository, - Ipn $ipnHelper + protected OrderRepository $orderRepository, + protected Ipn $ipnHelper ) { - $this->orderRepository = $orderRepository; - - $this->ipnHelper = $ipnHelper; } /** diff --git a/packages/Webkul/Paypal/src/Listeners/Transaction.php b/packages/Webkul/Paypal/src/Listeners/Transaction.php index 122d58882..191debc11 100644 --- a/packages/Webkul/Paypal/src/Listeners/Transaction.php +++ b/packages/Webkul/Paypal/src/Listeners/Transaction.php @@ -7,35 +7,18 @@ use Webkul\Sales\Repositories\OrderTransactionRepository; class Transaction { - /** - * SmartButton $smartButton - * - * @var \Webkul\Paypal\Payment\SmartButton - */ - protected $smartButton; - - /** - * OrderTransactionRepository object - * - * @var \Webkul\Sales\Repositories\OrderTransactionRepository - */ - protected $orderTransactionRepository; - /** * Create a new listener instance. * - * @param \Webkul\Paypal\Payment\SmartButton $smartButton + * @param \Webkul\Paypal\Payment\SmartButton $smartButton * @param \Webkul\Sales\Repositories\OrderTransactionRepository $orderTransactionRepository * @return void */ public function __construct( - SmartButton $smartButton, - OrderTransactionRepository $orderTransactionRepository + protected SmartButton $smartButton, + protected OrderTransactionRepository $orderTransactionRepository ) { - $this->smartButton = $smartButton; - - $this->orderTransactionRepository = $orderTransactionRepository; } /** diff --git a/packages/Webkul/Product/src/Console/Commands/PriceUpdate.php b/packages/Webkul/Product/src/Console/Commands/PriceUpdate.php index 2fc1df235..394bd6bd1 100644 --- a/packages/Webkul/Product/src/Console/Commands/PriceUpdate.php +++ b/packages/Webkul/Product/src/Console/Commands/PriceUpdate.php @@ -21,23 +21,14 @@ class PriceUpdate extends Command */ protected $description = 'Automatically updates product information (eg. min_price and max_price)'; - /** - * ProductFlatRepository object - * - * @var \Webkul\Product\Repositories\ProductFlatRepository - */ - protected $productFlatRepository; - /** * Create a new command instance. * * @param ]Webkul\Product\Repositories\ProductFlatRepository $productFlatRepository * @return void */ - public function __construct(ProductFlatRepository $productFlatRepository) + public function __construct(protected ProductFlatRepository $productFlatRepository) { - $this->productFlatRepository = $productFlatRepository; - parent::__construct(); } diff --git a/packages/Webkul/Product/src/Helpers/GenerateProduct.php b/packages/Webkul/Product/src/Helpers/GenerateProduct.php index 786cb51a4..ff42fee8f 100644 --- a/packages/Webkul/Product/src/Helpers/GenerateProduct.php +++ b/packages/Webkul/Product/src/Helpers/GenerateProduct.php @@ -15,20 +15,6 @@ use Illuminate\Support\Str; */ class GenerateProduct { - /** - * Product Repository instance - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * AttributeFamily Repository instance - * - * @var \Webkul\Product\Repositories\AttributeFamilyRepository - */ - protected $attributeFamilyRepository; - /** * Product Attribute Types * @@ -44,14 +30,10 @@ class GenerateProduct * @return void */ public function __construct( - ProductRepository $productRepository, - AttributeFamilyRepository $attributeFamilyRepository + protected ProductRepository $productRepository, + protected AttributeFamilyRepository $attributeFamilyRepository ) { - $this->productRepository = $productRepository; - - $this->attributeFamilyRepository = $attributeFamilyRepository; - $this->types = [ 'text', 'textarea', diff --git a/packages/Webkul/Product/src/Http/Controllers/ProductController.php b/packages/Webkul/Product/src/Http/Controllers/ProductController.php index 2d5709329..08111cbf3 100755 --- a/packages/Webkul/Product/src/Http/Controllers/ProductController.php +++ b/packages/Webkul/Product/src/Http/Controllers/ProductController.php @@ -28,101 +28,30 @@ class ProductController extends Controller */ protected $_config; - /** - * Category repository instance. - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - - /** - * Product repository instance. - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * Product downloadable link repository instance. - * - * @var \Webkul\Product\Repositories\ProductDownloadableLinkRepository - */ - protected $productDownloadableLinkRepository; - - /** - * Product downloadable sample repository instance. - * - * @var \Webkul\Product\Repositories\ProductDownloadableSampleRepository - */ - protected $productDownloadableSampleRepository; - - /** - * Attribute family repository instance. - * - * @var \Webkul\Attribute\Repositories\AttributeFamilyRepository - */ - protected $attributeFamilyRepository; - - /** - * Inventory source repository instance. - * - * @var \Webkul\Inventory\Repositories\InventorySourceRepository - */ - protected $inventorySourceRepository; - - /** - * Product attribute value repository instance. - * - * @var \Webkul\Product\Repositories\ProductAttributeValueRepository - */ - protected $productAttributeValueRepository; - - /** - * Product inventory repository instance. - * - * @var \Webkul\Product\Repositories\ProductInventoryRepository - */ - protected $productInventoryRepository; - /** * Create a new controller instance. * - * @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository - * @param \Webkul\Product\Repositories\ProductRepository $productRepository - * @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository - * @param \Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository - * @param \Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamilyRepository - * @param \Webkul\Inventory\Repositories\InventorySourceRepository $inventorySourceRepository - * @param \Webkul\Product\Repositories\ProductAttributeValueRepository $productAttributeValueRepository + * @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository + * @param \Webkul\Product\Repositories\ProductRepository $productRepository + * @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository + * @param \Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository + * @param \Webkul\Attribute\Repositories\AttributeFamilyRepository $attributeFamilyRepository + * @param \Webkul\Inventory\Repositories\InventorySourceRepository $inventorySourceRepository + * @param \Webkul\Product\Repositories\ProductAttributeValueRepository $productAttributeValueRepository * @return void */ public function __construct( - CategoryRepository $categoryRepository, - ProductRepository $productRepository, - ProductDownloadableLinkRepository $productDownloadableLinkRepository, - ProductDownloadableSampleRepository $productDownloadableSampleRepository, - AttributeFamilyRepository $attributeFamilyRepository, - InventorySourceRepository $inventorySourceRepository, - ProductAttributeValueRepository $productAttributeValueRepository, - ProductInventoryRepository $productInventoryRepository - ) { + protected CategoryRepository $categoryRepository, + protected ProductRepository $productRepository, + protected ProductDownloadableLinkRepository $productDownloadableLinkRepository, + protected ProductDownloadableSampleRepository $productDownloadableSampleRepository, + protected AttributeFamilyRepository $attributeFamilyRepository, + protected InventorySourceRepository $inventorySourceRepository, + protected ProductAttributeValueRepository $productAttributeValueRepository, + protected ProductInventoryRepository $productInventoryRepository + ) + { $this->_config = request('_config'); - - $this->categoryRepository = $categoryRepository; - - $this->productRepository = $productRepository; - - $this->productDownloadableLinkRepository = $productDownloadableLinkRepository; - - $this->productDownloadableSampleRepository = $productDownloadableSampleRepository; - - $this->attributeFamilyRepository = $attributeFamilyRepository; - - $this->inventorySourceRepository = $inventorySourceRepository; - - $this->productAttributeValueRepository = $productAttributeValueRepository; - - $this->productInventoryRepository = $productInventoryRepository; } /** diff --git a/packages/Webkul/Product/src/Http/Controllers/ReviewController.php b/packages/Webkul/Product/src/Http/Controllers/ReviewController.php index 791dbff33..4e472b32e 100755 --- a/packages/Webkul/Product/src/Http/Controllers/ReviewController.php +++ b/packages/Webkul/Product/src/Http/Controllers/ReviewController.php @@ -15,23 +15,14 @@ class ReviewController extends Controller */ protected $_config; - /** - * Product review repository instance. - * - * @var \Webkul\Product\Repositories\ProductReviewRepository - */ - protected $productReviewRepository; - /** * Create a new controller instance. * * @param \Webkul\Product\Repositories\ProductReviewRepository $productReview * @return void */ - public function __construct(ProductReviewRepository $productReviewRepository) + public function __construct(protected ProductReviewRepository $productReviewRepository) { - $this->productReviewRepository = $productReviewRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Product/src/Http/Requests/ProductForm.php b/packages/Webkul/Product/src/Http/Requests/ProductForm.php index 9a2200d64..d27288942 100755 --- a/packages/Webkul/Product/src/Http/Requests/ProductForm.php +++ b/packages/Webkul/Product/src/Http/Requests/ProductForm.php @@ -12,20 +12,6 @@ use Webkul\Product\Repositories\ProductRepository; class ProductForm extends FormRequest { - /** - * Product repository instance. - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * Product attribute value repository instnace. - * - * @var \Webkul\Product\Repositories\ProductAttributeValueRepository - */ - protected $productAttributeValueRepository; - /** * Rules. * @@ -37,16 +23,14 @@ class ProductForm extends FormRequest * Create a new form request instance. * * @param \Webkul\Product\Repositories\ProductRepository $productRepository - * @param \Webkul\Product\Repositories\ProductAttributeValueRepository $productAttributeValueRepository + * @param \Webkul\Product\Repositories\ProductAttributeValueRepository $productAttributeValueRepository * @return void */ public function __construct( - ProductRepository $productRepository, - ProductAttributeValueRepository $productAttributeValueRepository - ) { - $this->productRepository = $productRepository; - - $this->productAttributeValueRepository = $productAttributeValueRepository; + protected ProductRepository $productRepository, + protected ProductAttributeValueRepository $productAttributeValueRepository + ) + { } /** diff --git a/packages/Webkul/Product/src/Listeners/ProductFlat.php b/packages/Webkul/Product/src/Listeners/ProductFlat.php index e555d8ceb..029fa086d 100644 --- a/packages/Webkul/Product/src/Listeners/ProductFlat.php +++ b/packages/Webkul/Product/src/Listeners/ProductFlat.php @@ -13,34 +13,6 @@ use Webkul\Product\Models\ProductAttributeValue; class ProductFlat { - /** - * AttributeRepository Repository Object - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - - /** - * AttributeOptionRepository Repository Object - * - * @var \Webkul\Attribute\Repositories\AttributeOptionRepository - */ - protected $attributeOptionRepository; - - /** - * ProductFlatRepository Repository Object - * - * @var \Webkul\Product\Repositories\ProductFlatRepository - */ - protected $productFlatRepository; - - /** - * ProductAttributeValueRepository Repository Object - * - * @var \Webkul\Product\Repositories\ProductAttributeValueRepository - */ - protected $productAttributeValueRepository; - /** * Attribute Object * @@ -88,19 +60,12 @@ class ProductFlat * @return void */ public function __construct( - AttributeRepository $attributeRepository, - AttributeOptionRepository $attributeOptionRepository, - ProductFlatRepository $productFlatRepository, - ProductAttributeValueRepository $productAttributeValueRepository + protected AttributeRepository $attributeRepository, + protected AttributeOptionRepository $attributeOptionRepository, + protected ProductFlatRepository $productFlatRepository, + protected ProductAttributeValueRepository $productAttributeValueRepository ) { - $this->attributeRepository = $attributeRepository; - - $this->attributeOptionRepository = $attributeOptionRepository; - - $this->productAttributeValueRepository = $productAttributeValueRepository; - - $this->productFlatRepository = $productFlatRepository; } /** diff --git a/packages/Webkul/Product/src/ProductImage.php b/packages/Webkul/Product/src/ProductImage.php index fb21ce01e..b49fa3b89 100644 --- a/packages/Webkul/Product/src/ProductImage.php +++ b/packages/Webkul/Product/src/ProductImage.php @@ -8,23 +8,14 @@ use Webkul\Product\Repositories\ProductRepository; class ProductImage extends AbstractProduct { - /** - * Product repository instance. - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - /** * Create a new helper instance. * * @param \Webkul\Product\Repositories\ProductRepository $productRepository * @return void */ - public function __construct( - ProductRepository $productRepository - ) { - $this->productRepository = $productRepository; + public function __construct(protected ProductRepository $productRepository) + { } /** diff --git a/packages/Webkul/Product/src/Repositories/ProductAttributeValueRepository.php b/packages/Webkul/Product/src/Repositories/ProductAttributeValueRepository.php index f26344d63..594e668c0 100755 --- a/packages/Webkul/Product/src/Repositories/ProductAttributeValueRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductAttributeValueRepository.php @@ -9,13 +9,6 @@ use Webkul\Product\Models\ProductAttributeValueProxy; class ProductAttributeValueRepository extends Repository { - /** - * AttributeRepository object - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - /** * Create a new reposotory instance. * @@ -24,12 +17,10 @@ class ProductAttributeValueRepository extends Repository * @return void */ public function __construct( - AttributeRepository $attributeRepository, + protected AttributeRepository $attributeRepository, App $app ) { - $this->attributeRepository = $attributeRepository; - parent::__construct($app); } diff --git a/packages/Webkul/Product/src/Repositories/ProductBundleOptionRepository.php b/packages/Webkul/Product/src/Repositories/ProductBundleOptionRepository.php index 17a81f4dc..db6fe6306 100644 --- a/packages/Webkul/Product/src/Repositories/ProductBundleOptionRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductBundleOptionRepository.php @@ -8,13 +8,6 @@ use Illuminate\Support\Str; class ProductBundleOptionRepository extends Repository { - /** - * ProductBundleOptionProductRepository object - * - * @var \Webkul\Product\Repositories\ProductBundleOptionProductRepository - */ - protected $productBundleOptionProductRepository; - /** * Create a new repository instance. * @@ -23,12 +16,10 @@ class ProductBundleOptionRepository extends Repository * @return void */ public function __construct( - ProductBundleOptionProductRepository $productBundleOptionProductRepository, + protected ProductBundleOptionProductRepository $productBundleOptionProductRepository, App $app ) { - $this->productBundleOptionProductRepository = $productBundleOptionProductRepository; - parent::__construct($app); } diff --git a/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php b/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php index ec480b57c..566b5dae2 100644 --- a/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductFlatRepository.php @@ -16,11 +16,10 @@ class ProductFlatRepository extends Repository * @return void */ public function __construct( - AttributeRepository $attributeRepository, + protected AttributeRepository $attributeRepository, App $app - ) { - $this->attributeRepository = $attributeRepository; - + ) + { parent::__construct($app); } diff --git a/packages/Webkul/Product/src/Repositories/ProductImageRepository.php b/packages/Webkul/Product/src/Repositories/ProductImageRepository.php index f7b4c72ef..954f43ea9 100755 --- a/packages/Webkul/Product/src/Repositories/ProductImageRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductImageRepository.php @@ -7,27 +7,19 @@ use Webkul\Product\Repositories\ProductRepository; class ProductImageRepository extends ProductMediaRepository { - /** - * Product repository object. - * - * @var Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - /** * Create a new repository instance. * - * @param \Webkul\Product\Repositories\ProductRepository $productRepository - * @param \Illuminate\Container\Container $app + * @param \Webkul\Product\Repositories\ProductRepository $productRepository + * @param \Illuminate\Container\Container $app * @return void */ public function __construct( - ProductRepository $productRepository, + protected ProductRepository $productRepository, App $app - ) { + ) + { parent::__construct($app); - - $this->productRepository = $productRepository; } /** diff --git a/packages/Webkul/Product/src/Repositories/ProductRepository.php b/packages/Webkul/Product/src/Repositories/ProductRepository.php index 130933e28..dc2bc0f7c 100755 --- a/packages/Webkul/Product/src/Repositories/ProductRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductRepository.php @@ -20,13 +20,6 @@ use Webkul\Product\Models\ProductFlat; class ProductRepository extends Repository { - /** - * Attribute repository instance, - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - /** * Create a new repository instance. * @@ -36,11 +29,10 @@ class ProductRepository extends Repository * @return void */ public function __construct( - AttributeRepository $attributeRepository, + protected AttributeRepository $attributeRepository, App $app - ) { - $this->attributeRepository = $attributeRepository; - + ) + { parent::__construct($app); } diff --git a/packages/Webkul/Product/src/Repositories/ProductReviewImageRepository.php b/packages/Webkul/Product/src/Repositories/ProductReviewImageRepository.php index da5cffb02..012a5c05e 100644 --- a/packages/Webkul/Product/src/Repositories/ProductReviewImageRepository.php +++ b/packages/Webkul/Product/src/Repositories/ProductReviewImageRepository.php @@ -15,7 +15,8 @@ class ProductReviewImageRepository extends Repository * * @return void */ - public function __construct(App $app) { + public function __construct(App $app) + { parent::__construct($app); } diff --git a/packages/Webkul/Product/src/Repositories/SearchRepository.php b/packages/Webkul/Product/src/Repositories/SearchRepository.php index 5dbd5f291..8b525da60 100755 --- a/packages/Webkul/Product/src/Repositories/SearchRepository.php +++ b/packages/Webkul/Product/src/Repositories/SearchRepository.php @@ -11,29 +11,19 @@ use Webkul\Product\Repositories\ProductRepository; class SearchRepository extends Repository { use Sanitizer; - - /** - * ProductRepository object - * - * @return Object - */ - protected $productRepository; - /** * Create a new repository instance. * - * @param \Webkul\Product\Repositories\ProductRepository $productRepository - * @param \Illuminate\Container\Container $app - * + * @param \Webkul\Product\Repositories\ProductRepository $productRepository + * @param \Illuminate\Container\Container $app * @return void */ public function __construct( - ProductRepository $productRepository, + protected ProductRepository $productRepository, App $app - ) { + ) + { parent::__construct($app); - - $this->productRepository = $productRepository; } function model() diff --git a/packages/Webkul/Product/src/Type/AbstractType.php b/packages/Webkul/Product/src/Type/AbstractType.php index f0d6e76d7..b6953819a 100644 --- a/packages/Webkul/Product/src/Type/AbstractType.php +++ b/packages/Webkul/Product/src/Type/AbstractType.php @@ -22,48 +22,6 @@ use Webkul\Tax\Repositories\TaxCategoryRepository; abstract class AbstractType { - /** - * Attribute repository instance. - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - - /** - * Product repository instance. - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * Product attribute value repository instance. - * - * @var \Webkul\Product\Repositories\ProductAttributeValueRepository - */ - protected $attributeValueRepository; - - /** - * Product inventory repository instance. - * - * @var ProductInventoryRepository - */ - protected $productInventoryRepository; - - /** - * Product image repository instance. - * - * @var \Webkul\Product\Repositories\productImageRepository - */ - protected $productImageRepository; - - /** - * Product video repository instance. - * - * @var \Webkul\Product\Repositories\productVideoRepository - */ - protected $productVideoRepository; - /** * Product instance. * @@ -158,33 +116,23 @@ abstract class AbstractType /** * Create a new product type instance. * - * @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository - * @param \Webkul\Product\Repositories\ProductRepository $productRepository - * @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository - * @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository - * @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository - * @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository + * @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository + * @param \Webkul\Product\Repositories\ProductRepository $productRepository + * @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository + * @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository + * @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository + * @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository * @return void */ public function __construct( - AttributeRepository $attributeRepository, - ProductRepository $productRepository, - ProductAttributeValueRepository $attributeValueRepository, - ProductInventoryRepository $productInventoryRepository, - ProductImageRepository $productImageRepository, - ProductVideoRepository $productVideoRepository - ) { - $this->attributeRepository = $attributeRepository; - - $this->productRepository = $productRepository; - - $this->attributeValueRepository = $attributeValueRepository; - - $this->productInventoryRepository = $productInventoryRepository; - - $this->productImageRepository = $productImageRepository; - - $this->productVideoRepository = $productVideoRepository; + protected AttributeRepository $attributeRepository, + protected ProductRepository $productRepository, + protected ProductAttributeValueRepository $attributeValueRepository, + protected ProductInventoryRepository $productInventoryRepository, + protected ProductImageRepository $productImageRepository, + protected ProductVideoRepository $productVideoRepository + ) + { } /** diff --git a/packages/Webkul/Product/src/Type/Bundle.php b/packages/Webkul/Product/src/Type/Bundle.php index c701f475d..e58acb739 100644 --- a/packages/Webkul/Product/src/Type/Bundle.php +++ b/packages/Webkul/Product/src/Type/Bundle.php @@ -16,27 +16,6 @@ use Webkul\Product\Repositories\ProductVideoRepository; class Bundle extends AbstractType { - /** - * Product bundle option repository instance. - * - * @var \Webkul\Product\Repositories\ProductBundleOptionRepository - */ - protected $productBundleOptionRepository; - - /** - * Product bundle option product repository instance. - * - * @var \Webkul\Product\Repositories\ProductBundleOptionProductRepository - */ - protected $productBundleOptionProductRepository; - - /** - * Bundle Option helper instance. - * - * @var \Webkul\Product\Helpers\BundleOption - */ - protected $bundleOptionHelper; - /** * Skip attribute for Bundle product type. * @@ -99,11 +78,12 @@ class Bundle extends AbstractType ProductAttributeValueRepository $attributeValueRepository, ProductInventoryRepository $productInventoryRepository, ProductImageRepository $productImageRepository, - ProductBundleOptionRepository $productBundleOptionRepository, - ProductBundleOptionProductRepository $productBundleOptionProductRepository, - BundleOption $bundleOptionHelper, - ProductVideoRepository $productVideoRepository - ) { + ProductVideoRepository $productVideoRepository, + protected ProductBundleOptionRepository $productBundleOptionRepository, + protected ProductBundleOptionProductRepository $productBundleOptionProductRepository, + protected BundleOption $bundleOptionHelper + ) + { parent::__construct( $attributeRepository, $productRepository, @@ -112,12 +92,6 @@ class Bundle extends AbstractType $productImageRepository, $productVideoRepository ); - - $this->productBundleOptionRepository = $productBundleOptionRepository; - - $this->productBundleOptionProductRepository = $productBundleOptionProductRepository; - - $this->bundleOptionHelper = $bundleOptionHelper; } /** diff --git a/packages/Webkul/Product/src/Type/Downloadable.php b/packages/Webkul/Product/src/Type/Downloadable.php index 86e8bd59f..a794f5e55 100644 --- a/packages/Webkul/Product/src/Type/Downloadable.php +++ b/packages/Webkul/Product/src/Type/Downloadable.php @@ -15,20 +15,6 @@ use Webkul\Product\Repositories\ProductVideoRepository; class Downloadable extends AbstractType { - /** - * Product downloadable link repository instance. - * - * @var \Webkul\Product\Repositories\ProductDownloadableLinkRepository - */ - protected $productDownloadableLinkRepository; - - /** - * Product downloadable sample repository instance. - * - * @var \Webkul\Product\Repositories\ProductDownloadableSampleRepository - */ - protected $productDownloadableSampleRepository; - /** * Skip attribute for downloadable product type. * @@ -74,14 +60,14 @@ class Downloadable extends AbstractType /** * Create a new product type instance. * - * @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository - * @param \Webkul\Product\Repositories\ProductRepository $productRepository - * @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository - * @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository - * @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository - * @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository - * @param \Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository - * @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository + * @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository + * @param \Webkul\Product\Repositories\ProductRepository $productRepository + * @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository + * @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository + * @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository + * @param \Webkul\Product\Repositories\ProductDownloadableLinkRepository $productDownloadableLinkRepository + * @param \Webkul\Product\Repositories\ProductDownloadableSampleRepository $productDownloadableSampleRepository + * @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository * @return void */ public function __construct( @@ -90,10 +76,11 @@ class Downloadable extends AbstractType ProductAttributeValueRepository $attributeValueRepository, ProductInventoryRepository $productInventoryRepository, productImageRepository $productImageRepository, - ProductDownloadableLinkRepository $productDownloadableLinkRepository, - ProductDownloadableSampleRepository $productDownloadableSampleRepository, - ProductVideoRepository $productVideoRepository - ) { + ProductVideoRepository $productVideoRepository, + protected ProductDownloadableLinkRepository $productDownloadableLinkRepository, + protected ProductDownloadableSampleRepository $productDownloadableSampleRepository + ) + { parent::__construct( $attributeRepository, $productRepository, @@ -102,10 +89,6 @@ class Downloadable extends AbstractType $productImageRepository, $productVideoRepository ); - - $this->productDownloadableLinkRepository = $productDownloadableLinkRepository; - - $this->productDownloadableSampleRepository = $productDownloadableSampleRepository; } /** diff --git a/packages/Webkul/Product/src/Type/Grouped.php b/packages/Webkul/Product/src/Type/Grouped.php index 27cf002b9..057226cc0 100644 --- a/packages/Webkul/Product/src/Type/Grouped.php +++ b/packages/Webkul/Product/src/Type/Grouped.php @@ -13,13 +13,6 @@ use Webkul\Product\Repositories\ProductVideoRepository; class Grouped extends AbstractType { - /** - * Product grouped product repository instance. - * - * @var \Webkul\Product\Repositories\ProductGroupedProductRepository - */ - protected $productGroupedProductRepository; - /** * Skip attribute for downloadable product type. * @@ -51,13 +44,13 @@ class Grouped extends AbstractType /** * Create a new product type instance. * - * @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository - * @param \Webkul\Product\Repositories\ProductRepository $productRepository + * @param \Webkul\Attribute\Repositories\AttributeRepository $attributeRepository + * @param \Webkul\Product\Repositories\ProductRepository $productRepository * @param \Webkul\Product\Repositories\ProductAttributeValueRepository $attributeValueRepository - * @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository - * @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository + * @param \Webkul\Product\Repositories\ProductInventoryRepository $productInventoryRepository + * @param \Webkul\Product\Repositories\ProductImageRepository $productImageRepository * @param \Webkul\Product\Repositories\ProductGroupedProductRepository $productGroupedProductRepository - * @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository + * @param \Webkul\Product\Repositories\ProductVideoRepository $productVideoRepository * @return void */ public function __construct( @@ -66,9 +59,10 @@ class Grouped extends AbstractType ProductAttributeValueRepository $attributeValueRepository, ProductInventoryRepository $productInventoryRepository, ProductImageRepository $productImageRepository, - ProductGroupedProductRepository $productGroupedProductRepository, - ProductVideoRepository $productVideoRepository - ) { + ProductVideoRepository $productVideoRepository, + protected ProductGroupedProductRepository $productGroupedProductRepository + ) + { parent::__construct( $attributeRepository, $productRepository, @@ -77,8 +71,6 @@ class Grouped extends AbstractType $productImageRepository, $productVideoRepository ); - - $this->productGroupedProductRepository = $productGroupedProductRepository; } /** diff --git a/packages/Webkul/Sales/src/Repositories/DownloadableLinkPurchasedRepository.php b/packages/Webkul/Sales/src/Repositories/DownloadableLinkPurchasedRepository.php index af88726dd..1a9347a23 100644 --- a/packages/Webkul/Sales/src/Repositories/DownloadableLinkPurchasedRepository.php +++ b/packages/Webkul/Sales/src/Repositories/DownloadableLinkPurchasedRepository.php @@ -9,14 +9,6 @@ use Webkul\Product\Repositories\ProductDownloadableLinkRepository; class DownloadableLinkPurchasedRepository extends Repository { - - /** - * ProductDownloadableLinkRepository object - * - * @var \Webkul\Product\Repositories\ProductDownloadableLinkRepository - */ - protected $productDownloadableLinkRepository; - /** * Create a new repository instance. * @@ -24,12 +16,10 @@ class DownloadableLinkPurchasedRepository extends Repository * @return void */ public function __construct( - ProductDownloadableLinkRepository $productDownloadableLinkRepository, + protected ProductDownloadableLinkRepository $productDownloadableLinkRepository, App $app ) { - $this->productDownloadableLinkRepository = $productDownloadableLinkRepository; - parent::__construct($app); } diff --git a/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php b/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php index fc1036c3e..d4139e493 100755 --- a/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php +++ b/packages/Webkul/Sales/src/Repositories/InvoiceRepository.php @@ -11,34 +11,6 @@ use Webkul\Sales\Generators\InvoiceSequencer; class InvoiceRepository extends Repository { - /** - * Order repository instance. - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * Order's item repository instance. - * - * @var \Webkul\Sales\Repositories\OrderItemRepository - */ - protected $orderItemRepository; - - /** - * Invoice's item repository instance. - * - * @var \Webkul\Sales\Repositories\InvoiceItemRepository - */ - protected $invoiceItemRepository; - - /** - * Downloadable link purchased repository instance. - * - * @var \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository - */ - protected $downloadableLinkPurchasedRepository; - /** * Create a new repository instance. * @@ -50,22 +22,13 @@ class InvoiceRepository extends Repository * @return void */ public function __construct( - OrderRepository $orderRepository, - OrderItemRepository $orderItemRepository, - InvoiceItemRepository $invoiceItemRepository, - DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository, + protected OrderRepository $orderRepository, + protected OrderItemRepository $orderItemRepository, + protected InvoiceItemRepository $invoiceItemRepository, + protected DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository, App $app - ) { - $this->orderRepository = $orderRepository; - - $this->orderItemRepository = $orderItemRepository; - - $this->invoiceItemRepository = $invoiceItemRepository; - - $this->invoiceItemRepository = $invoiceItemRepository; - - $this->downloadableLinkPurchasedRepository = $downloadableLinkPurchasedRepository; - + ) + { parent::__construct($app); } diff --git a/packages/Webkul/Sales/src/Repositories/OrderRepository.php b/packages/Webkul/Sales/src/Repositories/OrderRepository.php index 455db8acc..63e6bead1 100755 --- a/packages/Webkul/Sales/src/Repositories/OrderRepository.php +++ b/packages/Webkul/Sales/src/Repositories/OrderRepository.php @@ -13,20 +13,6 @@ use Webkul\Sales\Models\Order as OrderModel; class OrderRepository extends Repository { - /** - * Order item repository instance. - * - * @var \Webkul\Sales\Repositories\OrderItemRepository - */ - protected $orderItemRepository; - - /** - * Downloadable link purchased repository instance. - * - * @var \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository - */ - protected $downloadableLinkPurchasedRepository; - /** * Create a new repository instance. * @@ -36,14 +22,11 @@ class OrderRepository extends Repository * @return void */ public function __construct( - OrderItemRepository $orderItemRepository, - DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository, + protected OrderItemRepository $orderItemRepository, + protected DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository, App $app - ) { - $this->orderItemRepository = $orderItemRepository; - - $this->downloadableLinkPurchasedRepository = $downloadableLinkPurchasedRepository; - + ) + { parent::__construct($app); } diff --git a/packages/Webkul/Sales/src/Repositories/RefundRepository.php b/packages/Webkul/Sales/src/Repositories/RefundRepository.php index b0c4292bd..b6fe27bcf 100644 --- a/packages/Webkul/Sales/src/Repositories/RefundRepository.php +++ b/packages/Webkul/Sales/src/Repositories/RefundRepository.php @@ -10,34 +10,6 @@ use Webkul\Sales\Contracts\Refund; class RefundRepository extends Repository { - /** - * Order repository instance. - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * Order item repository instance. - * - * @var \Webkul\Sales\Repositories\OrderItemRepository - */ - protected $orderItemRepository; - - /** - * Refund item repository instance. - * - * @var \Webkul\Sales\Repositories\RefundItemRepository - */ - protected $refundItemRepository; - - /** - * Downloadable link purchased repository instance. - * - * @var \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository - */ - protected $downloadableLinkPurchasedRepository; - /** * Create a new repository instance. * @@ -48,20 +20,13 @@ class RefundRepository extends Repository * @param \Illuminate\Container\Container $app */ public function __construct( - OrderRepository $orderRepository, - OrderItemRepository $orderItemRepository, - RefundItemRepository $refundItemRepository, - DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository, + protected OrderRepository $orderRepository, + protected OrderItemRepository $orderItemRepository, + protected RefundItemRepository $refundItemRepository, + protected DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository, App $app - ) { - $this->orderRepository = $orderRepository; - - $this->orderItemRepository = $orderItemRepository; - - $this->refundItemRepository = $refundItemRepository; - - $this->downloadableLinkPurchasedRepository = $downloadableLinkPurchasedRepository; - + ) + { parent::__construct($app); } diff --git a/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php b/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php index 251c27bd7..45baab9b4 100755 --- a/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php +++ b/packages/Webkul/Sales/src/Repositories/ShipmentRepository.php @@ -13,27 +13,6 @@ use Webkul\Sales\Repositories\ShipmentItemRepository; class ShipmentRepository extends Repository { - /** - * Order repository instance. - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * Order item repository instance. - * - * @var \Webkul\Sales\Repositories\OrderItemRepository - */ - protected $orderItemRepository; - - /** - * Shipment item repository instance. - * - * @var \Webkul\Sales\Repositories\ShipmentItemRepository - */ - protected $shipmentItemRepository; - /** * Create a new repository instance. * @@ -43,17 +22,12 @@ class ShipmentRepository extends Repository * @return void */ public function __construct( - OrderRepository $orderRepository, - OrderItemRepository $orderItemRepository, - ShipmentItemRepository $shipmentItemRepository, + protected OrderRepository $orderRepository, + protected OrderItemRepository $orderItemRepository, + protected ShipmentItemRepository $shipmentItemRepository, App $app - ) { - $this->orderRepository = $orderRepository; - - $this->orderItemRepository = $orderItemRepository; - - $this->shipmentItemRepository = $shipmentItemRepository; - + ) + { parent::__construct($app); } diff --git a/packages/Webkul/Shop/src/Http/Controllers/CartController.php b/packages/Webkul/Shop/src/Http/Controllers/CartController.php index f885ad43e..98fea5dad 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/CartController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/CartController.php @@ -11,20 +11,6 @@ use Webkul\Product\Repositories\ProductRepository; class CartController extends Controller { - /** - * Wishlist repository instance. - * - * @var \Webkul\Customer\Repositories\WishlistRepository - */ - protected $wishlistRepository; - - /** - * Product repository instance. - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - /** * Create a new controller instance. * @@ -33,17 +19,14 @@ class CartController extends Controller * @return void */ public function __construct( - WishlistRepository $wishlistRepository, - ProductRepository $productRepository - ) { + protected WishlistRepository $wishlistRepository, + protected ProductRepository $productRepository + ) + { $this->middleware('throttle:5,1')->only('applyCoupon'); $this->middleware('customer')->only('moveToWishlist'); - $this->wishlistRepository = $wishlistRepository; - - $this->productRepository = $productRepository; - parent::__construct(); } diff --git a/packages/Webkul/Shop/src/Http/Controllers/CategoryController.php b/packages/Webkul/Shop/src/Http/Controllers/CategoryController.php index e01f25972..168c5657a 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/CategoryController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/CategoryController.php @@ -6,23 +6,14 @@ use Webkul\Category\Repositories\CategoryRepository; class CategoryController extends Controller { - /** - * CategoryRepository object - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - /** * Create a new controller instance. * * @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository * @return void */ - public function __construct(CategoryRepository $categoryRepository) + public function __construct(protected CategoryRepository $categoryRepository) { - $this->categoryRepository = $categoryRepository; - parent::__construct(); } } diff --git a/packages/Webkul/Shop/src/Http/Controllers/DownloadableProductController.php b/packages/Webkul/Shop/src/Http/Controllers/DownloadableProductController.php index a24c4fdf0..14fdf4b4a 100644 --- a/packages/Webkul/Shop/src/Http/Controllers/DownloadableProductController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/DownloadableProductController.php @@ -8,25 +8,14 @@ use Webkul\Shop\DataGrids\DownloadableProductDataGrid; class DownloadableProductController extends Controller { - /** - * DownloadableLinkPurchasedRepository object - * - * @var \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository - */ - protected $downloadableLinkPurchasedRepository; - /** * Create a new controller instance. * * @param \Webkul\Sales\Repositories\DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository * @return void */ - public function __construct( - DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository - ) + public function __construct(protected DownloadableLinkPurchasedRepository $downloadableLinkPurchasedRepository) { - $this->downloadableLinkPurchasedRepository = $downloadableLinkPurchasedRepository; - parent::__construct(); } diff --git a/packages/Webkul/Shop/src/Http/Controllers/HomeController.php b/packages/Webkul/Shop/src/Http/Controllers/HomeController.php index efe0e0cbb..5efc33a63 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/HomeController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/HomeController.php @@ -8,20 +8,6 @@ use Webkul\Product\Repositories\SearchRepository; class HomeController extends Controller { - /** - * Slider repository instance. - * - * @var \Webkul\Core\Repositories\SliderRepository - */ - protected $sliderRepository; - - /** - * Search repository instance. - * - * @var \Webkul\Core\Repositories\SearchRepository - */ - protected $searchRepository; - /** * Create a new controller instance. * @@ -30,13 +16,10 @@ class HomeController extends Controller * @return void */ public function __construct( - SliderRepository $sliderRepository, - SearchRepository $searchRepository - ) { - $this->sliderRepository = $sliderRepository; - - $this->searchRepository = $searchRepository; - + protected SliderRepository $sliderRepository, + protected SearchRepository $searchRepository + ) + { parent::__construct(); } diff --git a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php index c2935c6d4..635e387da 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/OnepageController.php @@ -13,20 +13,6 @@ use Webkul\Shop\Http\Controllers\Controller; class OnepageController extends Controller { - /** - * Order repository instance. - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * Customer repository instance. - * - * @var \Webkul\Customer\Repositories\CustomerRepository - */ - protected $customerRepository; - /** * Create a new controller instance. * @@ -35,13 +21,10 @@ class OnepageController extends Controller * @return void */ public function __construct( - OrderRepository $orderRepository, - CustomerRepository $customerRepository - ) { - $this->orderRepository = $orderRepository; - - $this->customerRepository = $customerRepository; - + protected OrderRepository $orderRepository, + protected CustomerRepository $customerRepository + ) + { parent::__construct(); } diff --git a/packages/Webkul/Shop/src/Http/Controllers/OrderController.php b/packages/Webkul/Shop/src/Http/Controllers/OrderController.php index 9f29a2792..09a4b353b 100644 --- a/packages/Webkul/Shop/src/Http/Controllers/OrderController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/OrderController.php @@ -11,27 +11,6 @@ class OrderController extends Controller { use PDFHandler; - /** - * Current customer. - * - * @var \Webkul\Customer\Contracts\Customer - */ - protected $currentCustomer; - - /** - * OrderrRepository object - * - * @var \Webkul\Sales\Repositories\OrderRepository - */ - protected $orderRepository; - - /** - * InvoiceRepository object - * - * @var \Webkul\Sales\Repositories\InvoiceRepository - */ - protected $invoiceRepository; - /** * Create a new controller instance. * @@ -40,15 +19,12 @@ class OrderController extends Controller * @return void */ public function __construct( - OrderRepository $orderRepository, - InvoiceRepository $invoiceRepository - ) { + protected OrderRepository $orderRepository, + protected InvoiceRepository $invoiceRepository + ) + { $this->currentCustomer = auth()->guard('customer')->user(); - $this->orderRepository = $orderRepository; - - $this->invoiceRepository = $invoiceRepository; - parent::__construct(); } diff --git a/packages/Webkul/Shop/src/Http/Controllers/ProductController.php b/packages/Webkul/Shop/src/Http/Controllers/ProductController.php index b9372082f..49918b145 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/ProductController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/ProductController.php @@ -13,48 +13,6 @@ use Webkul\Product\Repositories\ProductRepository; class ProductController extends Controller { - /** - * Product repository instance. - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * Product flat repository instance. - * - * @var \Webkul\Product\Repositories\ProductFlatRepository - */ - protected $productFlatRepository; - - /** - * Product attribute value repository instance. - * - * @var \Webkul\Product\Repositories\ProductAttributeValueRepository - */ - protected $productAttributeValueRepository; - - /** - * Product downloadable sample repository instance. - * - * @var \Webkul\Product\Repositories\ProductDownloadableSampleRepository - */ - protected $productDownloadableSampleRepository; - - /** - * Product downloadable link repository instance. - * - * @var \Webkul\Product\Repositories\ProductDownloadableLinkRepository - */ - protected $productDownloadableLinkRepository; - - /** - * Category repository instance. - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - /** * Create a new controller instance. * @@ -67,25 +25,14 @@ class ProductController extends Controller * @return void */ public function __construct( - ProductRepository $productRepository, - ProductFlatRepository $productFlatRepository, - ProductAttributeValueRepository $productAttributeValueRepository, - ProductDownloadableSampleRepository $productDownloadableSampleRepository, - ProductDownloadableLinkRepository $productDownloadableLinkRepository, - CategoryRepository $categoryRepository - ) { - $this->productRepository = $productRepository; - - $this->productFlatRepository = $productFlatRepository; - - $this->productAttributeValueRepository = $productAttributeValueRepository; - - $this->productDownloadableSampleRepository = $productDownloadableSampleRepository; - - $this->productDownloadableLinkRepository = $productDownloadableLinkRepository; - - $this->categoryRepository = $categoryRepository; - + protected ProductRepository $productRepository, + protected ProductFlatRepository $productFlatRepository, + protected ProductAttributeValueRepository $productAttributeValueRepository, + protected ProductDownloadableSampleRepository $productDownloadableSampleRepository, + protected ProductDownloadableLinkRepository $productDownloadableLinkRepository, + protected CategoryRepository $categoryRepository + ) + { parent::__construct(); } diff --git a/packages/Webkul/Shop/src/Http/Controllers/ProductsCategoriesProxyController.php b/packages/Webkul/Shop/src/Http/Controllers/ProductsCategoriesProxyController.php index 6a2af5a51..f9c4ec681 100644 --- a/packages/Webkul/Shop/src/Http/Controllers/ProductsCategoriesProxyController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/ProductsCategoriesProxyController.php @@ -9,27 +9,6 @@ use Webkul\Category\Repositories\CategoryRepository; class ProductsCategoriesProxyController extends Controller { - /** - * Category repository instance. - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - - /** - * Product repository instance. - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * Slider repository instance. - * - * @var \Webkul\Core\Repositories\SliderRepository - */ - protected $sliderRepository; - /** * Create a new controller instance. * @@ -38,16 +17,11 @@ class ProductsCategoriesProxyController extends Controller * @return void */ public function __construct( - CategoryRepository $categoryRepository, - ProductRepository $productRepository, - SliderRepository $sliderRepository - ) { - $this->categoryRepository = $categoryRepository; - - $this->productRepository = $productRepository; - - $this->sliderRepository = $sliderRepository; - + protected CategoryRepository $categoryRepository, + protected ProductRepository $productRepository, + protected SliderRepository $sliderRepository + ) + { parent::__construct(); } diff --git a/packages/Webkul/Shop/src/Http/Controllers/ReviewController.php b/packages/Webkul/Shop/src/Http/Controllers/ReviewController.php index aeb2d8549..e7299468e 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/ReviewController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/ReviewController.php @@ -8,27 +8,6 @@ use Webkul\Product\Repositories\ProductReviewImageRepository; class ReviewController extends Controller { - /** - * ProductRepository object - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * ProductReviewRepository object - * - * @var \Webkul\Product\Repositories\ProductReviewRepository - */ - protected $productReviewRepository; - - /** - * ProductReviewImageRepository object - * - * @var \Webkul\Product\Repositories\ProductReviewImageRepository - */ - protected $productReviewImageRepository; - /** * Create a new controller instance. * @@ -38,16 +17,11 @@ class ReviewController extends Controller * @return void */ public function __construct( - ProductRepository $productRepository, - ProductReviewRepository $productReviewRepository, - ProductReviewImageRepository $productReviewImageRepository - ) { - $this->productRepository = $productRepository; - - $this->productReviewRepository = $productReviewRepository; - - $this->productReviewImageRepository = $productReviewImageRepository; - + protected ProductRepository $productRepository, + protected ProductReviewRepository $productReviewRepository, + protected ProductReviewImageRepository $productReviewImageRepository + ) + { parent::__construct(); } diff --git a/packages/Webkul/Shop/src/Http/Controllers/SearchController.php b/packages/Webkul/Shop/src/Http/Controllers/SearchController.php index 3ce33f657..61db83c58 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/SearchController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/SearchController.php @@ -4,25 +4,16 @@ namespace Webkul\Shop\Http\Controllers; use Webkul\Product\Repositories\SearchRepository; - class SearchController extends Controller +class SearchController extends Controller { - /** - * SearchRepository object - * - * @var \Webkul\Product\Repositories\SearchRepository - */ - protected $searchRepository; - /** * Create a new controller instance. * * @param \Webkul\Product\Repositories\SearchRepository $searchRepository * @return void - */ - public function __construct(SearchRepository $searchRepository) + */ + public function __construct(protected SearchRepository $searchRepository) { - $this->searchRepository = $searchRepository; - parent::__construct(); } diff --git a/packages/Webkul/Shop/src/Http/Controllers/SubscriptionController.php b/packages/Webkul/Shop/src/Http/Controllers/SubscriptionController.php index e9da4e14f..d919445a0 100755 --- a/packages/Webkul/Shop/src/Http/Controllers/SubscriptionController.php +++ b/packages/Webkul/Shop/src/Http/Controllers/SubscriptionController.php @@ -8,23 +8,14 @@ use Webkul\Core\Repositories\SubscribersListRepository; class SubscriptionController extends Controller { - /** - * SubscribersListRepository - * - * @var \Webkul\Core\Repositories\SubscribersListRepository - */ - protected $subscriptionRepository; - /** * Create a new controller instance. * * @param \Webkul\Core\Repositories\SubscribersListRepository $subscriptionRepository * @return void */ - public function __construct(SubscribersListRepository $subscriptionRepository) + public function __construct(protected SubscribersListRepository $subscriptionRepository) { - $this->subscriptionRepository = $subscriptionRepository; - parent::__construct(); } diff --git a/packages/Webkul/Shop/src/Http/Middleware/Currency.php b/packages/Webkul/Shop/src/Http/Middleware/Currency.php index 77640898f..1b69f6e06 100755 --- a/packages/Webkul/Shop/src/Http/Middleware/Currency.php +++ b/packages/Webkul/Shop/src/Http/Middleware/Currency.php @@ -7,22 +7,14 @@ use Webkul\Core\Repositories\CurrencyRepository; class Currency { - /** - * Currency repository instance. - * - * @var \Webkul\Core\Repositories\CurrencyRepository - */ - protected $currencyRepository; - /** * Create a middleware instance. * * @param \Webkul\Core\Repositories\CurrencyRepository $currencyRepository * @return void */ - public function __construct(CurrencyRepository $currencyRepository) + public function __construct(protected CurrencyRepository $currencyRepository) { - $this->currencyRepository = $currencyRepository; } /** diff --git a/packages/Webkul/Shop/src/Http/Middleware/Locale.php b/packages/Webkul/Shop/src/Http/Middleware/Locale.php index 1b02fb835..2d8bdcfbf 100755 --- a/packages/Webkul/Shop/src/Http/Middleware/Locale.php +++ b/packages/Webkul/Shop/src/Http/Middleware/Locale.php @@ -7,22 +7,14 @@ use Webkul\Core\Repositories\LocaleRepository; class Locale { - /** - * Locale repository instance. - * - * @var \Webkul\Core\Repositories\LocaleRepository - */ - protected $localeRepository; - /** * Create a middleware instance. * * @param \Webkul\Core\Repositories\LocaleRepository $localeRepository * @return void */ - public function __construct(LocaleRepository $localeRepository) + public function __construct(protected LocaleRepository $localeRepository) { - $this->localeRepository = $localeRepository; } /** diff --git a/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php b/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php index 6f791d241..a94877ca2 100755 --- a/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php +++ b/packages/Webkul/Shop/src/Mail/SubscriptionEmail.php @@ -11,16 +11,13 @@ class SubscriptionEmail extends Mailable { use Queueable, SerializesModels; - public $subscriptionData; - /** * Create a mailable instance * * @param array $subscriptionData */ - public function __construct($subscriptionData) + public function __construct(public $subscriptionData) { - $this->subscriptionData = $subscriptionData; } /** diff --git a/packages/Webkul/Sitemap/src/Http/Controllers/Admin/SitemapController.php b/packages/Webkul/Sitemap/src/Http/Controllers/Admin/SitemapController.php index d2ef75009..b02ce4722 100644 --- a/packages/Webkul/Sitemap/src/Http/Controllers/Admin/SitemapController.php +++ b/packages/Webkul/Sitemap/src/Http/Controllers/Admin/SitemapController.php @@ -27,9 +27,7 @@ class SitemapController extends Controller * * @return void */ - public function __construct( - public SitemapRepository $sitemapRepository - ) + public function __construct(public SitemapRepository $sitemapRepository) { $this->_config = request('_config'); } diff --git a/packages/Webkul/SocialLogin/src/Http/Controllers/LoginController.php b/packages/Webkul/SocialLogin/src/Http/Controllers/LoginController.php index 0410445cc..cddff97de 100644 --- a/packages/Webkul/SocialLogin/src/Http/Controllers/LoginController.php +++ b/packages/Webkul/SocialLogin/src/Http/Controllers/LoginController.php @@ -19,24 +19,15 @@ class LoginController extends Controller * @var array */ protected $_config; - - /** - * CustomerSocialAccountRepository - * - * @var \Webkul\SocialLogin\Repositories\CustomerSocialAccountRepository - */ - protected $customerSocialAccountRepository; - + /** * Create a new controller instance. * * @param \Webkul\SocialLogin\Repositories\CustomerSocialAccountRepository $customerSocialAccountRepository * @return void */ - public function __construct(CustomerSocialAccountRepository $customerSocialAccountRepository) + public function __construct(protected CustomerSocialAccountRepository $customerSocialAccountRepository) { - $this->customerSocialAccountRepository = $customerSocialAccountRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/SocialLogin/src/Repositories/CustomerSocialAccountRepository.php b/packages/Webkul/SocialLogin/src/Repositories/CustomerSocialAccountRepository.php index d803a9270..ff7bb6e53 100644 --- a/packages/Webkul/SocialLogin/src/Repositories/CustomerSocialAccountRepository.php +++ b/packages/Webkul/SocialLogin/src/Repositories/CustomerSocialAccountRepository.php @@ -9,38 +9,20 @@ use Webkul\Customer\Repositories\CustomerGroupRepository; class CustomerSocialAccountRepository extends Repository { - /** - * CustomerRepository object - * - * @var \Webkul\Customer\Repositories\CustomerRepository - */ - protected $customerRepository; - - /** - * CustomerGroupRepository object - * - * @var \Webkul\Customer\Repositories\CustomerGroupRepository - */ - protected $customerGroupRepository; - /** * Create a new reposotory instance. * - * @param \Webkul\Customer\Repositories\CustomerRepository $customerRepository + * @param \Webkul\Customer\Repositories\CustomerRepository $customerRepository * @param \Webkul\Customer\Repositories\CustomerGroupRepository $customerGroupRepository * @param \Illuminate\Container\Container $app * @return void */ public function __construct( - CustomerRepository $customerRepository, - CustomerGroupRepository $customerGroupRepository, + protected CustomerRepository $customerRepository, + protected CustomerGroupRepository $customerGroupRepository, App $app ) { - $this->customerRepository = $customerRepository; - - $this->customerGroupRepository = $customerGroupRepository; - $this->_config = request('_config'); parent::__construct($app); diff --git a/packages/Webkul/Tax/src/Http/Controllers/TaxCategoryController.php b/packages/Webkul/Tax/src/Http/Controllers/TaxCategoryController.php index ba1f26a79..26c453d83 100755 --- a/packages/Webkul/Tax/src/Http/Controllers/TaxCategoryController.php +++ b/packages/Webkul/Tax/src/Http/Controllers/TaxCategoryController.php @@ -14,20 +14,6 @@ class TaxCategoryController extends Controller */ protected $_config; - /** - * Tax category repository instance. - * - * @var \Webkul\Tax\Repositories\TaxCategoryRepository - */ - protected $taxCategoryRepository; - - /** - * Tax rate repository instance. - * - * @var \Webkul\Tax\Repositories\TaxRateRepository - */ - protected $taxRateRepository; - /** * Create a new controller instance. * @@ -36,13 +22,10 @@ class TaxCategoryController extends Controller * @return void */ public function __construct( - TaxCategoryRepository $taxCategoryRepository, - TaxRateRepository $taxRateRepository - ) { - $this->taxCategoryRepository = $taxCategoryRepository; - - $this->taxRateRepository = $taxRateRepository; - + protected TaxCategoryRepository $taxCategoryRepository, + protected TaxRateRepository $taxRateRepository + ) + { $this->_config = request('_config'); } diff --git a/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php b/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php index 83f6d54a1..ff0811d13 100755 --- a/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php +++ b/packages/Webkul/Tax/src/Http/Controllers/TaxRateController.php @@ -16,24 +16,15 @@ class TaxRateController extends Controller * @var array */ protected $_config; - - /** - * Tax rate repository instance. - * - * @var \Webkul\Tax\Repositories\TaxRateRepository - */ - protected $taxRateRepository; - + /** * Create a new controller instance. * * @param \Webkul\Tax\Repositories\TaxRateRepository $taxRateRepository * @return void */ - public function __construct(TaxRateRepository $taxRateRepository) + public function __construct(protected TaxRateRepository $taxRateRepository) { - $this->taxRateRepository = $taxRateRepository; - $this->_config = request('_config'); } diff --git a/packages/Webkul/Theme/src/Theme.php b/packages/Webkul/Theme/src/Theme.php index 3fd9c990a..99828a0e0 100755 --- a/packages/Webkul/Theme/src/Theme.php +++ b/packages/Webkul/Theme/src/Theme.php @@ -7,34 +7,6 @@ use Webkul\Theme\Facades\Themes as Themes; class Theme { - /** - * Contains theme code - * - * @var string - */ - public $code; - - /** - * Contains theme name - * - * @var string - */ - public $name; - - /** - * Contains theme views path - * - * @var string - */ - public $viewsPath; - - /** - * Contains theme assets path - * - * @var string - */ - public $assetsPath; - /** * Contains theme parent * @@ -51,12 +23,13 @@ class Theme * @param string $viewsPath * @return void */ - public function __construct($code, $name = null, $assetsPath = null, $viewsPath = null) + public function __construct( + public $code, + public $name = null, + public $assetsPath = null, + public $viewsPath = null + ) { - $this->code = $code; - - $this->name = $name; - $this->assetsPath = $assetsPath === null ? $code : $assetsPath; $this->viewsPath = $viewsPath === null ? $code : $viewsPath; diff --git a/packages/Webkul/User/src/Http/Controllers/RoleController.php b/packages/Webkul/User/src/Http/Controllers/RoleController.php index ae75c1599..ac0ece3b5 100755 --- a/packages/Webkul/User/src/Http/Controllers/RoleController.php +++ b/packages/Webkul/User/src/Http/Controllers/RoleController.php @@ -15,20 +15,6 @@ class RoleController extends Controller */ protected $_config; - /** - * Role repository instance. - * - * @var \Webkul\User\Repositories\RoleRepository - */ - protected $roleRepository; - - /** - * Admin repository instance. - * - * @var \Webkul\User\Repositories\AdminRepository - */ - protected $adminRepository; - /** * Create a new controller instance. * @@ -37,13 +23,10 @@ class RoleController extends Controller * @return void */ public function __construct( - RoleRepository $roleRepository, - AdminRepository $adminRepository - ) { - $this->roleRepository = $roleRepository; - - $this->adminRepository = $adminRepository; - + protected RoleRepository $roleRepository, + protected AdminRepository $adminRepository + ) + { $this->_config = request('_config'); } diff --git a/packages/Webkul/User/src/Http/Controllers/UserController.php b/packages/Webkul/User/src/Http/Controllers/UserController.php index faa59b435..3c55914e1 100755 --- a/packages/Webkul/User/src/Http/Controllers/UserController.php +++ b/packages/Webkul/User/src/Http/Controllers/UserController.php @@ -19,20 +19,6 @@ class UserController extends Controller */ protected $_config; - /** - * Admin repository instance. - * - * @var \Webkul\User\Repositories\AdminRepository - */ - protected $adminRepository; - - /** - * Role repository instance. - * - * @var \Webkul\User\Repositories\RoleRepository - */ - protected $roleRepository; - /** * Create a new controller instance. * @@ -41,13 +27,10 @@ class UserController extends Controller * @return void */ public function __construct( - AdminRepository $adminRepository, - RoleRepository $roleRepository - ) { - $this->adminRepository = $adminRepository; - - $this->roleRepository = $roleRepository; - + protected AdminRepository $adminRepository, + protected RoleRepository $roleRepository + ) + { $this->_config = request('_config'); } diff --git a/packages/Webkul/User/src/Notifications/AdminUpdatePassword.php b/packages/Webkul/User/src/Notifications/AdminUpdatePassword.php index 221ed869c..7af99cb04 100644 --- a/packages/Webkul/User/src/Notifications/AdminUpdatePassword.php +++ b/packages/Webkul/User/src/Notifications/AdminUpdatePassword.php @@ -9,23 +9,15 @@ use Illuminate\Queue\SerializesModels; class AdminUpdatePassword extends Mailable { use Queueable, SerializesModels; - - /** - * The admin instance. - * - * @var \Webkul\User\Contracts\Admin $admin - */ - public $admin; - + /** * Create a new admin instance. * * @param \Webkul\User\Contracts\Admin $admin * @return void */ - public function __construct($admin) + public function __construct(public $admin) { - $this->admin = $admin; } /** diff --git a/packages/Webkul/Velocity/src/Helpers/AdminHelper.php b/packages/Webkul/Velocity/src/Helpers/AdminHelper.php index be62a91e0..87578c3e1 100644 --- a/packages/Webkul/Velocity/src/Helpers/AdminHelper.php +++ b/packages/Webkul/Velocity/src/Helpers/AdminHelper.php @@ -7,22 +7,14 @@ use Webkul\Category\Repositories\CategoryRepository; class AdminHelper { - /** - * Category repository instance. - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - /** * Create a new helper instance. * * @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository * @return void */ - public function __construct(CategoryRepository $categoryRepository) + public function __construct(protected CategoryRepository $categoryRepository) { - $this->categoryRepository = $categoryRepository; } /** diff --git a/packages/Webkul/Velocity/src/Helpers/Helper.php b/packages/Webkul/Velocity/src/Helpers/Helper.php index 871876506..9194a32e6 100644 --- a/packages/Webkul/Velocity/src/Helpers/Helper.php +++ b/packages/Webkul/Velocity/src/Helpers/Helper.php @@ -14,87 +14,26 @@ use Webkul\Velocity\Repositories\VelocityMetadataRepository; class Helper extends Review { - /** - * Product model instance. - * - * @var \Webkul\Product\Contracts\Product - */ - protected $productModel; - - /** - * Order brands instance. - * - * @var \Webkul\Velocity\Repositories\OrderBrandsRepository - */ - protected $orderBrandsRepository; - - /** - * Product repository instance. - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * Product flat repository instance. - * - * @var \Webkul\Product\Repositories\ProductFlatRepository - */ - protected $productFlatRepository; - - /** - * Attribute option instance. - * - * @var \Webkul\Attribute\Repositories\AttributeOptionRepository - */ - protected $attributeOptionRepository; - - /** - * Product review repository instance. - * - * @var \Webkul\Product\Repositories\ProductReviewRepository - */ - protected $productReviewRepository; - - /** - * Velocity metadata instance. - * - * @var \Webkul\Velocity\Repositories\VelocityMetadataRepository - */ - protected $velocityMetadataRepository; - /** * Create a helper instance. * - * @param \Webkul\Product\Contracts\Product $productModel - * @param \Webkul\Velocity\Repositories\OrderBrandsRepository $orderBrands - * @param \Webkul\Attribute\Repositories\AttributeOptionRepository $attributeOptionRepository - * @param \Webkul\Product\Repositories\ProductReviewRepository $productReviewRepository - * @param \Webkul\Velocity\Repositories\VelocityMetadataRepository $velocityMetadataRepository + * @param \Webkul\Product\Contracts\Product $productModel + * @param \Webkul\Velocity\Repositories\OrderBrandsRepository $orderBrands + * @param \Webkul\Attribute\Repositories\AttributeOptionRepository $attributeOptionRepository + * @param \Webkul\Product\Repositories\ProductReviewRepository $productReviewRepository + * @param \Webkul\Velocity\Repositories\VelocityMetadataRepository $velocityMetadataRepository * @return void */ public function __construct( - ProductModel $productModel, - ProductRepository $productRepository, - AttributeOptionRepository $attributeOptionRepository, - ProductFlatRepository $productFlatRepository, - OrderBrandsRepository $orderBrandsRepository, - ProductReviewRepository $productReviewRepository, - VelocityMetadataRepository $velocityMetadataRepository - ) { - $this->productModel = $productModel; - - $this->attributeOptionRepository = $attributeOptionRepository; - - $this->productRepository = $productRepository; - - $this->productFlatRepository = $productFlatRepository; - - $this->orderBrandsRepository = $orderBrandsRepository; - - $this->productReviewRepository = $productReviewRepository; - - $this->velocityMetadataRepository = $velocityMetadataRepository; + protected ProductModel $productModel, + protected ProductRepository $productRepository, + protected AttributeOptionRepository $attributeOptionRepository, + protected ProductFlatRepository $productFlatRepository, + protected OrderBrandsRepository $orderBrandsRepository, + protected ProductReviewRepository $productReviewRepository, + protected VelocityMetadataRepository $velocityMetadataRepository + ) + { } /** diff --git a/packages/Webkul/Velocity/src/Http/Controllers/Admin/CategoryController.php b/packages/Webkul/Velocity/src/Http/Controllers/Admin/CategoryController.php index d4bc5c044..53a7b181f 100644 --- a/packages/Webkul/Velocity/src/Http/Controllers/Admin/CategoryController.php +++ b/packages/Webkul/Velocity/src/Http/Controllers/Admin/CategoryController.php @@ -8,20 +8,6 @@ use Webkul\Velocity\Repositories\CategoryRepository as VelocityCategoryRepositor class CategoryController extends Controller { - /** - * Category Repository object - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - - /** - * VelocityCategory Repository object - * - * @var \Webkul\Velocity\Repositories\CategoryRepository - */ - protected $velocityCategoryRepository; - /** * Create a new controller instance. * @@ -30,13 +16,10 @@ class CategoryController extends Controller * @return void */ public function __construct( - CategoryRepository $categoryRepository, - VelocityCategoryRepository $velocityCategoryRepository - ) { - $this->categoryRepository = $categoryRepository; - - $this->velocityCategoryRepository = $velocityCategoryRepository; - + protected CategoryRepository $categoryRepository, + protected VelocityCategoryRepository $velocityCategoryRepository + ) + { $this->_config = request('_config'); } /** diff --git a/packages/Webkul/Velocity/src/Http/Controllers/Admin/ConfigurationController.php b/packages/Webkul/Velocity/src/Http/Controllers/Admin/ConfigurationController.php index 55f087f01..8c36ee5c2 100644 --- a/packages/Webkul/Velocity/src/Http/Controllers/Admin/ConfigurationController.php +++ b/packages/Webkul/Velocity/src/Http/Controllers/Admin/ConfigurationController.php @@ -13,36 +13,19 @@ class ConfigurationController extends Controller { use Sanitizer; - /** - * Velocity helper instance. - * - * @var \Webkul\Velocity\Helpers\Helper - */ - protected $velocityHelper; - - /** - * Velocity meta data repository intance. - * - * @var \Webkul\Velocity\Repositories\VelocityMetadataRepository - */ - protected $velocityMetaDataRepository; - /** * Create a new controller instance. * - * @param \Webkul\Velocity\Repositories\MetadataRepository $velocityMetaDataRepository + * @param \Webkul\Velocity\Helpers\Helper $velocityHelper + * @param \Webkul\Velocity\Repositories\MetadataRepository $velocityMetadataRepository * @return void */ public function __construct ( - Helper $velocityHelper, - VelocityMetadataRepository $velocityMetadataRepository + protected Helper $velocityHelper, + protected VelocityMetadataRepository $velocityMetadataRepository ) { $this->_config = request('_config'); - - $this->velocityHelper = $velocityHelper; - - $this->velocityMetaDataRepository = $velocityMetadataRepository; } /** @@ -92,7 +75,7 @@ class ConfigurationController extends Controller ]; } - $velocityMetaData = $this->velocityMetaDataRepository->findOneWhere([ + $velocityMetaData = $this->velocityMetadataRepository->findOneWhere([ 'id' => $id, ]); @@ -125,7 +108,7 @@ class ConfigurationController extends Controller $params['locale'] = $locale; /* update row */ - $this->velocityMetaDataRepository->update($params, $id); + $this->velocityMetadataRepository->update($params, $id); session()->flash('success', trans('admin::app.response.update-success', ['name' => trans('velocity::app.admin.meta-data.title')])); @@ -341,7 +324,7 @@ class ConfigurationController extends Controller */ private function createMetaData($locale, $channel) { - $this->velocityMetaDataRepository->create([ + $this->velocityMetadataRepository->create([ 'locale' => $locale, 'channel' => $channel, 'header_content_count' => '5', diff --git a/packages/Webkul/Velocity/src/Http/Controllers/Admin/ContentController.php b/packages/Webkul/Velocity/src/Http/Controllers/Admin/ContentController.php index b744f723f..e303c446f 100644 --- a/packages/Webkul/Velocity/src/Http/Controllers/Admin/ContentController.php +++ b/packages/Webkul/Velocity/src/Http/Controllers/Admin/ContentController.php @@ -8,20 +8,6 @@ use Webkul\Velocity\Repositories\ContentRepository; class ContentController extends Controller { - /** - * Product repository instance. - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * Content repository instance. - * - * @var \Webkul\Velocity\Repositories\ContentRepository - */ - protected $contentRepository; - /** * Create a new controller instance. * @@ -30,13 +16,10 @@ class ContentController extends Controller * @return void */ public function __construct( - ProductRepository $productRepository, - ContentRepository $contentRepository - ) { - $this->productRepository = $productRepository; - - $this->contentRepository = $contentRepository; - + protected ProductRepository $productRepository, + protected ContentRepository $contentRepository + ) + { $this->_config = request('_config'); } diff --git a/packages/Webkul/Velocity/src/Http/Controllers/Shop/CartController.php b/packages/Webkul/Velocity/src/Http/Controllers/Shop/CartController.php index ca3a0d0aa..b0d002e59 100644 --- a/packages/Webkul/Velocity/src/Http/Controllers/Shop/CartController.php +++ b/packages/Webkul/Velocity/src/Http/Controllers/Shop/CartController.php @@ -14,7 +14,7 @@ class CartController extends Controller * Retrives the mini cart details * * @return \Illuminate\Http\Response - */ + */ public function getMiniCartDetails() { $cart = cart()->getCart(); @@ -59,7 +59,7 @@ class CartController extends Controller * Function for guests user to add the product in the cart. * * @return array - */ + */ public function addProductToCart() { try { @@ -123,7 +123,7 @@ class CartController extends Controller * * @param int $itemId * @return \Illuminate\Http\Response - */ + */ public function removeProductFromCart($itemId) { $result = Cart::removeItem($itemId); diff --git a/packages/Webkul/Velocity/src/Http/Controllers/Shop/Controller.php b/packages/Webkul/Velocity/src/Http/Controllers/Shop/Controller.php index d90951a41..9c7cc1454 100755 --- a/packages/Webkul/Velocity/src/Http/Controllers/Shop/Controller.php +++ b/packages/Webkul/Velocity/src/Http/Controllers/Shop/Controller.php @@ -24,92 +24,29 @@ class Controller extends BaseController * @var array */ protected $_config; - - /** - * SearchRepository object - * - * @var \Webkul\Product\Repositories\SearchRepository - */ - protected $searchRepository; - - /** - * ProductRepository object - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - - /** - * ProductRepository object of velocity package - * - * @var \Webkul\Velocity\Repositories\Product\ProductRepository - */ - protected $velocityProductRepository; - - /** - * CategoryRepository object of velocity package - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - - /** - * WishlistRepository object - * - * @var \Webkul\Customer\Repositories\WishlistRepository - */ - protected $wishlistRepository; - - /** - * Helper object - * - * @var \Webkul\Velocity\Helpers\Helper - */ - protected $velocityHelper; - - /** - * VelocityCustomerCompareProductRepository object of repository - * - * @var \Webkul\Velocity\Repositories\VelocityCustomerCompareProductRepository - */ - protected $compareProductsRepository; - - + /** * Create a new controller instance. * - * @param \Webkul\Velocity\Helpers\Helper $velocityHelper - * @param \Webkul\Product\Repositories\SearchRepository $searchRepository - * @param \Webkul\Product\Repositories\ProductRepository $productRepository - * @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository - * @param \Webkul\Velocity\Repositories\Product\ProductRepository $velocityProductRepository + * @param \Webkul\Velocity\Helpers\Helper $velocityHelper + * @param \Webkul\Product\Repositories\SearchRepository $searchRepository + * @param \Webkul\Product\Repositories\ProductRepository $productRepository + * @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository + * @param \Webkul\Velocity\Repositories\Product\ProductRepository $velocityProductRepository * @param \Webkul\Velocity\Repositories\VelocityCustomerCompareProductRepository $compareProductsRepository * * @return void */ public function __construct( - Helper $velocityHelper, - SearchRepository $searchRepository, - ProductRepository $productRepository, - WishlistRepository $wishlistRepository, - CategoryRepository $categoryRepository, - VelocityProductRepository $velocityProductRepository, - CustomerCompareProductRepository $compareProductsRepository - ) { + protected Helper $velocityHelper, + protected SearchRepository $searchRepository, + protected ProductRepository $productRepository, + protected WishlistRepository $wishlistRepository, + protected CategoryRepository $categoryRepository, + protected VelocityProductRepository $velocityProductRepository, + protected CustomerCompareProductRepository $compareProductsRepository + ) + { $this->_config = request('_config'); - - $this->velocityHelper = $velocityHelper; - - $this->searchRepository = $searchRepository; - - $this->productRepository = $productRepository; - - $this->categoryRepository = $categoryRepository; - - $this->wishlistRepository = $wishlistRepository; - - $this->velocityProductRepository = $velocityProductRepository; - - $this->compareProductsRepository = $compareProductsRepository; } } diff --git a/packages/Webkul/Velocity/src/Repositories/CategoryRepository.php b/packages/Webkul/Velocity/src/Repositories/CategoryRepository.php index 95475b080..b76a58a7c 100644 --- a/packages/Webkul/Velocity/src/Repositories/CategoryRepository.php +++ b/packages/Webkul/Velocity/src/Repositories/CategoryRepository.php @@ -10,13 +10,6 @@ class CategoryRepository extends Repository { use CacheableRepository; - /** - * Category Repository object - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - /** * Create a new repository instance. * @@ -25,12 +18,10 @@ class CategoryRepository extends Repository * @return void */ public function __construct( - CategoryRepository $categoryRepository, + protected CategoryRepository $categoryRepository, App $app ) { - $this->categoryRepository = $categoryRepository; - parent::__construct($app); } diff --git a/packages/Webkul/Velocity/src/Repositories/ContentRepository.php b/packages/Webkul/Velocity/src/Repositories/ContentRepository.php index 3d807af71..d0aebe5d2 100644 --- a/packages/Webkul/Velocity/src/Repositories/ContentRepository.php +++ b/packages/Webkul/Velocity/src/Repositories/ContentRepository.php @@ -11,13 +11,6 @@ class ContentRepository extends Repository { use CacheableRepository; - /** - * Product Repository object - * - * @var \Webkul\Product\Repositories\ProductRepository - */ - protected $productRepository; - /** * Create a new controller instance. * @@ -26,12 +19,10 @@ class ContentRepository extends Repository * @return void */ public function __construct( - ProductRepository $productRepository, + protected ProductRepository $productRepository, App $app ) { - $this->productRepository = $productRepository; - parent::__construct($app); } diff --git a/packages/Webkul/Velocity/src/Repositories/Product/ProductRepository.php b/packages/Webkul/Velocity/src/Repositories/Product/ProductRepository.php index e9b766c48..5d9e29430 100644 --- a/packages/Webkul/Velocity/src/Repositories/Product/ProductRepository.php +++ b/packages/Webkul/Velocity/src/Repositories/Product/ProductRepository.php @@ -13,13 +13,6 @@ class ProductRepository extends Repository { use CacheableRepository; - /** - * AttributeRepository object - * - * @var \Webkul\Attribute\Repositories\AttributeRepository - */ - protected $attributeRepository; - /** * Create a new controller instance. * @@ -28,12 +21,10 @@ class ProductRepository extends Repository * @return void */ public function __construct( - AttributeRepository $attributeRepository, + protected AttributeRepository $attributeRepository, App $app ) { - $this->attributeRepository = $attributeRepository; - parent::__construct($app); } diff --git a/packages/Webkul/Velocity/src/Velocity.php b/packages/Webkul/Velocity/src/Velocity.php index 7b1f9412e..cba453289 100644 --- a/packages/Webkul/Velocity/src/Velocity.php +++ b/packages/Webkul/Velocity/src/Velocity.php @@ -32,22 +32,14 @@ class Velocity 'custom' => 'Custom Selection', ]; - /** - * CategoryRepository object - * - * @var \Webkul\Category\Repositories\CategoryRepository - */ - protected $categoryRepository; - /** * Create a new instance. * * @param \Webkul\Category\Repositories\CategoryRepository $categoryRepository * @return void */ - public function __construct(CategoryRepository $categoryRepository) + public function __construct(protected CategoryRepository $categoryRepository) { - $this->categoryRepository = $categoryRepository; } /**