From cab116af6850cca67659d0632a57a26a9de0b074 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Vo=C5=99=C3=AD=C5=A1ek?= Date: Fri, 2 Feb 2024 22:56:39 +0100 Subject: [PATCH] fix cs --- demos/form-control/multiline-crud.php | 4 +++- mastercrud-develop/src/MasterCRUD.php | 8 ++++---- mastercrud-develop/src/MethodExecutor.php | 2 +- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/demos/form-control/multiline-crud.php b/demos/form-control/multiline-crud.php index 6c6fd56a24..8ea1bc0302 100644 --- a/demos/form-control/multiline-crud.php +++ b/demos/form-control/multiline-crud.php @@ -4,7 +4,9 @@ namespace Atk4\Ui\Demos; -/** @var \Atk4\Ui\App $app */ +use Atk4\Ui\App; + +/** @var App $app */ require_once __DIR__ . '/../init-app.php'; // TODO diff --git a/mastercrud-develop/src/MasterCRUD.php b/mastercrud-develop/src/MasterCRUD.php index ff94026803..34e80a542e 100644 --- a/mastercrud-develop/src/MasterCRUD.php +++ b/mastercrud-develop/src/MasterCRUD.php @@ -184,7 +184,7 @@ public function initTabs(array $defs, View $view = null) // $sub_crud->addDecorator($m->title_field, [Table\Column\Link::class, [$t => false, 'path' => $this->getPath($ref)], [$m->table . '_id' => 'id']]); // Creating url template in order to produce proper url. - $sub_crud->addDecorator($m->title_field, [Table\Column\Link::class, 'url' => $this->getApp()->url(['path' => $this->getPath($ref)]) . '&' . $m->table . '_id=' . '{$id}']); + $sub_crud->addDecorator($m->title_field, [Table\Column\Link::class, 'url' => $this->getApp()->url(['path' => $this->getPath($ref)]) . '&' . $m->table . '_id={$id}']); } $this->addActions($sub_crud, $subdef); @@ -266,7 +266,7 @@ public function addActions(View $crud, array $defs) if (is_string($action)) { $crud->menu->addItem($key)->on( 'click', - new JsModal('Executing ' . $key, $this->add([VirtualPage::class])->set(function ($p) use ($key, $crud) { + new JsModal('Executing ' . $key, $this->add([VirtualPage::class])->set(static function ($p) use ($key, $crud) { // TODO: this does ont work within a tab :( $p->add(new MethodExecutor($crud->model, $key)); })) @@ -304,11 +304,11 @@ public function addActions(View $crud, array $defs) } if (isset($action[0]) && $action[0] instanceof \Closure) { - $crud->addModalAction($label ?: $key, $key, function ($p, $id) use ($action, $crud) { + $crud->addModalAction($label ?: $key, $key, static function ($p, $id) use ($action, $crud) { call_user_func($action[0], $p, $crud->model->load($id)); }); } else { - $crud->addModalAction($label ?: $key, $key, function ($p, $id) use ($action, $key, $crud) { + $crud->addModalAction($label ?: $key, $key, static function ($p, $id) use ($action, $key, $crud) { $p->add(new MethodExecutor($crud->model->load($id), $key, $action)); }); } diff --git a/mastercrud-develop/src/MethodExecutor.php b/mastercrud-develop/src/MethodExecutor.php index 924f9496ab..7168b34b15 100644 --- a/mastercrud-develop/src/MethodExecutor.php +++ b/mastercrud-develop/src/MethodExecutor.php @@ -55,7 +55,7 @@ protected function init(): void { parent::init(); - $this->console = $this->add([Console::class, 'event' => false]); //->addStyle('display', 'none'); + $this->console = $this->add([Console::class, 'event' => false]); // ->addStyle('display', 'none'); $this->console->addStyle('max-height', '50em')->addStyle('overflow', 'scroll'); $this->form = $this->add([Form::class]);