Skip to content

Commit

Permalink
Format dmitrakovich code
Browse files Browse the repository at this point in the history
  • Loading branch information
dmitrakovich authored and github-actions[bot] committed Aug 11, 2024
1 parent 521e80e commit 5dc71bb
Show file tree
Hide file tree
Showing 119 changed files with 205 additions and 205 deletions.
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Order/BelpostImportCODAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class BelpostImportCODAction extends Action
public function handle(
Request $request
) {
$belpostCODService = new BelpostCODService;
$belpostCODService = new BelpostCODService();
$result = $belpostCODService->importExcelCOD($request->file);
$resultText = <<<TEXT
Импортировано платежей: {$result['count']}
Expand Down
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Order/BuyoutFormAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(?int $orderId = null)
*/
public function handle(Request $request)
{
$buyoutService = new BuyoutOrderService;
$buyoutService = new BuyoutOrderService();
$order = Order::where('id', $request->orderId)->with([
'itemsExtended' => fn ($query) => $query
->whereIn('status_key', Order::$itemDepartureStatuses)
Expand Down
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Order/CancelPayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CancelPayment extends RowAction
public function handle(
OnlinePayment $payment
) {
$paymentService = new PaymentService;
$paymentService = new PaymentService();
$result = $paymentService->cancelOnlinePayment($payment);
if ($result->last_status_enum_id === OnlinePaymentStatusEnum::CANCELED) {
return $this->response()->success('Платеж отменен!')->refresh();
Expand Down
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Order/CapturePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function handle(
OnlinePayment $payment,
Request $request
) {
$paymentService = new PaymentService;
$paymentService = new PaymentService();
$amount = (float)$request->input('amount');
$result = $paymentService->captureOnlinePayment($payment, $amount);
if ($result->last_status_enum_id === OnlinePaymentStatusEnum::SUCCEEDED) {
Expand Down
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Order/CreateOnlinePayment.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(?int $orderId = null)
public function handle(
Request $request
) {
$paymentService = new PaymentService;
$paymentService = new PaymentService();
$data = $request->all();
$data['amount'] = str_replace(',', '.', $data['amount']);
$paymentService->createOnlinePayment($data);
Expand Down
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Order/EnvelopeAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(?int $orderId = null)
*/
public function handle(Request $request)
{
$envelopeService = new EnvelopeService;
$envelopeService = new EnvelopeService();
$order = Order::where('id', $request->orderId)->with([
'user' => fn ($query) => $query->with('lastAddress'),
])->first();
Expand Down
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Order/InstallmentForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function handle(Request $request)
if (!isset($order->user->passport)) {
throw new \Exception('Заполните паспортные данные клиента');
}
$installmentService = new InstallmentOrderService;
$installmentService = new InstallmentOrderService();
$file = $installmentService->createInstallmentForm($order);

return $this->response()->success('Бланк рассрочки успешно создан')->download($file);
Expand Down
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Order/InstallmentFormRowAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function handle(Model $model)
if (!isset($order->user->passport)) {
throw new \Exception('Заполните паспортные данные клиента');
}
$installmentService = new InstallmentOrderService;
$installmentService = new InstallmentOrderService();
$file = $installmentService->createInstallmentForm($order);

return $this->response()->success('Бланк рассрочки успешно создан')->download($file);
Expand Down
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Order/LabelAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class LabelAction extends RowAction

public function handle(Model $model)
{
$labelService = new LabelService;
$labelService = new LabelService();
$file = $labelService->createLabel($model->id);

return $this->response()->success('Этикетка успешно создана')->download($file);
Expand Down
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Order/SendBatchAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class SendBatchAction extends RowAction

public function handle(Model $model)
{
$batchService = new BatchService;
$batchService = new BatchService();
$file = $batchService->createBatchCsv($model);
$model->dispatch_date = now();
$model->save();
Expand Down
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Product/AddToProductGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(?int $productId = null)
public function handle(
Request $request
) {
$service = new ProductGroupService;
$service = new ProductGroupService();
$data = $request->all();
$service->addToProductGroup($data['cur_product_id'], $data['product_id']);

Expand Down
2 changes: 1 addition & 1 deletion src/app/Admin/Actions/Product/RemoveFromProductGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function __construct(?int $productId = null, ?int $productGroupId = null)
public function handle(
Request $request,
) {
$service = new ProductGroupService;
$service = new ProductGroupService();
$data = $request->all();
$service->removeFromProductGroup($data['product_id'], $data['product_group_id']);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function grid()
$this->applyDefaultFilter($grid);
}

$grid->exporter((new AnalyticsExporter)->setFileName($this->title));
$grid->exporter((new AnalyticsExporter())->setFileName($this->title));
$grid->disablePagination();
$grid->disableActions();
$grid->disableCreateButton();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function getInstanceNameColumn(): string
*/
protected function getPreparedGrid(): Grid
{
$grid = new Grid(new Order);
$grid = new Grid(new Order());

$grid->model()->selectRaw($this->getSelectSql())
->withExpression('UserOrderStatusCount', $this->getUserOrderStatusCountQuery())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function getInstanceNameColumn(): string
*/
protected function getPreparedGrid(): Grid
{
$grid = new Grid(new Order);
$grid = new Grid(new Order());

$grid->model()->selectRaw($this->getSelectSql())
->leftJoin('delivery_methods', 'orders.delivery_id', '=', 'delivery_methods.id')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function getInstanceNameColumn(): string
*/
protected function getPreparedGrid(): Grid
{
$grid = new Grid(new Order);
$grid = new Grid(new Order());

$grid->model()->selectRaw($this->getSelectSql())
->withExpression('UserOrderStatusCount', $this->getUserOrderStatusCountQuery())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function getInstanceNameColumn(): string
*/
protected function getPreparedGrid(): Grid
{
$grid = new Grid(new Order);
$grid = new Grid(new Order());

$grid->model()->selectRaw($this->getSelectSql())
->leftJoin('admin_users', 'orders.admin_id', '=', 'admin_users.id')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function getInstanceNameColumn(): string
*/
protected function getPreparedGrid(): Grid
{
$grid = new Grid(new Order);
$grid = new Grid(new Order());

$grid->model()->selectRaw($this->getSelectSql())
->withExpression('UserOrderStatusCount', $this->getUserOrderStatusCountQuery())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function getInstanceNameColumn(): string
*/
protected function getPreparedGrid(): Grid
{
$grid = new Grid(new Order);
$grid = new Grid(new Order());

$grid->model()->selectRaw($this->getSelectSql())
->withExpression('UserOrderStatusCount', $this->getUserOrderStatusCountQuery())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ protected function getInstanceNameColumn(): string
*/
protected function getPreparedGrid(): Grid
{
$grid = new Grid(new Order);
$grid = new Grid(new Order());

$grid->model()->selectRaw($this->getSelectSql())
->leftJoin('payment_methods', 'orders.payment_id', '=', 'payment_methods.id')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class InventoryController extends AbstractAdminController
*/
protected function grid()
{
$grid = new Grid(new AvailableSizes);
$grid = new Grid(new AvailableSizes());

$select = [
'GROUP_CONCAT(available_sizes.id SEPARATOR \',\') as stock_ids',
Expand Down
8 changes: 4 additions & 4 deletions src/app/Admin/Controllers/Automation/StockController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class StockController extends AbstractAdminController
*/
protected function grid()
{
$grid = new Grid(new AvailableSizesFull);
$grid = new Grid(new AvailableSizesFull());

$stockNames = Stock::query()->pluck('internal_name', 'id')->toArray();
$defaultStockList = Stock::query()->where('type', 'shop')->pluck('id')->toArray();
Expand Down Expand Up @@ -109,8 +109,8 @@ protected function grid()

$grid->rows($this->highlightRows());
$grid->filter(fn (Filter $filter) => $this->addFiltersForAvailableSizes($filter, $stockNames, $defaultStockList, $maxSizesCountFilter));
$grid->tools(fn ($tools) => $tools->append(new UpdateAvailability));
$grid->exporter(new StockExporter);
$grid->tools(fn ($tools) => $tools->append(new UpdateAvailability()));
$grid->exporter(new StockExporter());
$grid->paginate(100);
$grid->perPages([50, 100, 250, 500, 1000]);
$grid->disableActions();
Expand Down Expand Up @@ -291,7 +291,7 @@ public function highlightRows(): \Closure
*/
public function updateAvailability(): RedirectResponse
{
dispatch_sync(new UpdateAvailableSizesFullTableJob);
dispatch_sync(new UpdateAvailableSizesFullTableJob());

Cache::forever('available_sizes_full_last_update', now()->format('d.m H:i:s'));

Expand Down
4 changes: 2 additions & 2 deletions src/app/Admin/Controllers/BannerController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class BannerController extends AdminController
*/
protected function grid()
{
$grid = new Grid(new Banner);
$grid = new Grid(new Banner());

$grid->column('position', 'Позиция')->using($this->position);
$grid->column('resource', 'Media')->image();
Expand Down Expand Up @@ -91,7 +91,7 @@ protected function detail($id)
*/
protected function form()
{
$form = new Form(new Banner);
$form = new Form(new Banner());

$form->select('position', 'Позиция')->options($this->position)->when('in', ['catalog_top', 'catalog_mob', 'index_main'], function (Form $form) {
$form->radio('spoiler.show', 'Спойлер')
Expand Down
8 changes: 4 additions & 4 deletions src/app/Admin/Controllers/Bookkeeping/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ class PaymentController extends AbstractAdminController

protected function grid()
{
$grid = new Grid(new OnlinePayment);
$grid = new Grid(new OnlinePayment());
$grid->model()->orderBy('id', 'desc');
$adminUsers = (new AdministratorService)->getAdministratorList();
$adminUsers = (new AdministratorService())->getAdministratorList();

$grid->filter(function ($filter) use ($adminUsers) {
$filter->like('payment_num', 'Номер счета');
Expand Down Expand Up @@ -68,7 +68,7 @@ protected function grid()
$grid->column('comment', 'Комментарий');

$grid->tools(function (Grid\Tools $tools) {
$tools->append(new BelpostImportCODAction);
$tools->append(new BelpostImportCODAction());
});
$grid->actions(function ($actions) {
$actions->disableDelete();
Expand All @@ -84,7 +84,7 @@ protected function grid()

protected function form()
{
$form = new Form(new OnlinePayment);
$form = new Form(new OnlinePayment());
$form->select('method_enum_id', 'Тип платежа')->options(OnlinePaymentMethodEnum::list())->placeholder('Введите сумму платежа')->rules(['required'], ['required' => 'Поле обязательно для заполнения.']);
$form->date('lastSucceededStatus.created_at', 'Дата оплаты');
$form->hidden('lastSucceededStatus.admin_user_id')->value(Admin::user()->id ?? null);
Expand Down
4 changes: 2 additions & 2 deletions src/app/Admin/Controllers/CityController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CityController extends AdminController

protected function grid()
{
$grid = new Grid(new City);
$grid = new Grid(new City());
$grid->model()->orderBy('id', 'desc');
$countries = Country::pluck('name', 'id');

Expand Down Expand Up @@ -44,7 +44,7 @@ protected function grid()

protected function form()
{
$form = new Form(new City);
$form = new Form(new City());
$countries = Country::pluck('name', 'id');

$form->select('country_id', 'Страна')->options($countries);
Expand Down
4 changes: 2 additions & 2 deletions src/app/Admin/Controllers/Config/CurrencyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class CurrencyController extends AdminController
*/
protected function grid()
{
$grid = new Grid(new Currency);
$grid = new Grid(new Currency());

$grid->column('code', 'Код валюты');
$grid->column('country', 'Код страны');
Expand Down Expand Up @@ -57,7 +57,7 @@ protected function detail($id)
*/
protected function form()
{
$form = new Form(new Currency);
$form = new Form(new Currency());

$form->text('code', 'Код валюты')->required();
$form->text('country', 'Код страны')->required();
Expand Down
4 changes: 2 additions & 2 deletions src/app/Admin/Controllers/Config/DeliveryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class DeliveryController extends AbstractAdminController
*/
protected function grid()
{
$grid = new Grid(new DeliveryMethod);
$grid = new Grid(new DeliveryMethod());

// $grid->column('id', __('Id'));
$grid->column('name', 'Название способа доставки');
Expand All @@ -46,7 +46,7 @@ protected function grid()
*/
protected function form()
{
$form = new Form(new DeliveryMethod);
$form = new Form(new DeliveryMethod());

$form->text('name', __('Name'));
// $form->text('instance', 'Instance');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class OrderItemStatusController extends AdminController
*/
protected function grid()
{
$grid = new Grid(new OrderItemStatus);
$grid = new Grid(new OrderItemStatus());

$grid->sortable();

Expand Down Expand Up @@ -53,7 +53,7 @@ protected function detail($id)
*/
protected function form()
{
$form = new Form(new OrderItemStatus);
$form = new Form(new OrderItemStatus());

if ($form->isCreating()) {
$form->text('key', 'Slug');
Expand Down
4 changes: 2 additions & 2 deletions src/app/Admin/Controllers/Config/OrderStatusController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class OrderStatusController extends AdminController
*/
protected function grid()
{
$grid = new Grid(new OrderStatus);
$grid = new Grid(new OrderStatus());

$grid->sortable();

Expand Down Expand Up @@ -53,7 +53,7 @@ protected function detail($id)
*/
protected function form()
{
$form = new Form(new OrderStatus);
$form = new Form(new OrderStatus());

if ($form->isCreating()) {
$form->text('key', 'Slug');
Expand Down
4 changes: 2 additions & 2 deletions src/app/Admin/Controllers/Config/PaymentController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class PaymentController extends AdminController
*/
protected function grid()
{
$grid = new Grid(new PaymentMethod);
$grid = new Grid(new PaymentMethod());

// $grid->column('id', __('Id'));
$grid->column('name', __('Name'));
Expand Down Expand Up @@ -65,7 +65,7 @@ protected function detail($id)
*/
protected function form()
{
$form = new Form(new PaymentMethod);
$form = new Form(new PaymentMethod());

$form->text('name', __('Name'));
$form->text('class', __('Class'));
Expand Down
Loading

0 comments on commit 5dc71bb

Please sign in to comment.