diff --git a/demos/_unit-test/sse.php b/demos/_unit-test/sse.php index 304acf3495..a3ba1e63a4 100644 --- a/demos/_unit-test/sse.php +++ b/demos/_unit-test/sse.php @@ -15,7 +15,7 @@ $v = View::addTo($app)->set('This will trigger a network request for testing SSE...'); $sse = JsSse::addTo($app); -// URL trigger must match php_unit test in sse provider. +// URL trigger must match phpunit test in SSE provider $sse->setUrlTrigger('see_test'); $v->js(true, $sse->set(static function () use ($sse) { diff --git a/demos/basic/button.php b/demos/basic/button.php index 8fd711822d..cc0b0f7e4d 100644 --- a/demos/basic/button.php +++ b/demos/basic/button.php @@ -15,14 +15,12 @@ /** @var \Atk4\Ui\App $app */ require_once __DIR__ . '/../init-app.php'; -// Demonstrates how to use buttons. - Header::addTo($app, ['Basic Button', 'size' => 2]); -// With Seed +// with seed Button::addTo($app, ['Click me'])->link(['index']); -// Without Seeding +// without seeding $b1 = new Button('Click me (no seed)'); $app->add($b1); // must be added first diff --git a/demos/collection/card-deck.php b/demos/collection/card-deck.php index d8096c275e..21b237682c 100644 --- a/demos/collection/card-deck.php +++ b/demos/collection/card-deck.php @@ -27,7 +27,7 @@ }, ]); -// Create custom button for this action in card. +// create custom button for this action in card $app->getExecutorFactory()->registerTrigger(ExecutorFactory::CARD_BUTTON, [Button::class, 'class.blue' => true, 'icon' => 'plane'], $action); $action->args = [ diff --git a/demos/collection/crud.php b/demos/collection/crud.php index 19fd4de177..8fa8463422 100644 --- a/demos/collection/crud.php +++ b/demos/collection/crud.php @@ -22,12 +22,12 @@ $crud = Crud::addTo($app, ['ipp' => 10]); -// callback for model action add form. +// callback for model action add form $crud->onFormAdd(static function (Form $form, ModalExecutor $ex) use ($model) { $form->js(true, $form->getControl($model->fieldName()->name)->jsInput()->val('Entering value via javascript')); }); -// callback for model action edit form. +// callback for model action edit form $crud->onFormEdit(static function (Form $form) use ($model) { $form->js(true, $form->getControl($model->fieldName()->name)->jsInput()->attr('readonly', true)); }); @@ -51,7 +51,7 @@ 'menu' => ['class' => ['green inverted']], 'table' => ['class' => ['red inverted']], ]); -// Condition on the model can be applied on a model +// condition on the model can be applied on a model $model = new Country($app->db); $model->addCondition($model->fieldName()->numcode, '<', 200); $model->onHook(Model::HOOK_VALIDATE, static function (Country $model, ?string $intent) { @@ -64,7 +64,7 @@ }); $crud->setModel($model); -// Because Crud inherits Grid, you can also define custom actions +// because Crud inherits Grid, you can also define custom actions $crud->addModalAction(['icon' => 'cogs'], 'Details', static function (View $p, $id) use ($crud) { $model = Country::assertInstanceOf($crud->model); Message::addTo($p, ['Details for: ' . $model->load($id)->name . ' (id: ' . $id . ')']); @@ -102,6 +102,6 @@ public function addFormTo(View $view): Form $crud->menu->addItem(['Rescan', 'icon' => 'recycle']); -// Condition on the model can be applied after setting the model +// condition on the model can be applied after setting the model $crud->setModel($file); $file->addCondition($file->fieldName()->parent_folder_id, null); diff --git a/demos/collection/crud3.php b/demos/collection/crud3.php index ac7f46953c..8a26d31e98 100644 --- a/demos/collection/crud3.php +++ b/demos/collection/crud3.php @@ -27,7 +27,7 @@ protected function init(): void } }); -// Prepare Persistence and data Model +// prepare Persistence and data Model $data = ['test' => [ 1 => ['id' => 1, 'name' => 'ABC9', 'code' => 11, 'country' => 'Ireland'], 2 => ['id' => 2, 'name' => 'ABC8', 'code' => 12, 'country' => 'Ireland'], diff --git a/demos/collection/grid.php b/demos/collection/grid.php index 874d96df3a..d9d78be4a3 100644 --- a/demos/collection/grid.php +++ b/demos/collection/grid.php @@ -36,7 +36,7 @@ 'nameField' => $model->fieldName()->name, ]); -// Adding Quicksearch on Name field using auto query. +// adding Quicksearch on Name field using auto query $grid->addQuickSearch([$model->fieldName()->name], true); if ($grid->stickyGet('no-ajax')) { @@ -49,7 +49,7 @@ $grid->addColumn(null, [Table\Column\Template::class, 'helloworld']); -// Creating a button for executing model test user action. +// creating a button for executing model test user action $grid->addExecutorButton($grid->getExecutorFactory()->createExecutor($model->getUserAction('test'), $grid)); $grid->addActionButton('Say HI', static function (Jquery $j, $id) use ($grid) { @@ -62,7 +62,7 @@ Message::addTo($p, ['Clicked on ID=' . $id]); }); -// Creating an executor for delete action. +// creating an executor for delete action $deleteExecutor = $grid->getExecutorFactory()->createExecutor($model->getUserAction('delete'), $grid); $deleteExecutor->onHook(BasicExecutor::HOOK_AFTER_EXECUTE, static function () { return [ @@ -79,7 +79,7 @@ return new JsToast('Selected: ' . implode(', ', $ids) . '#'); }); -// Executing a modal on a bulk selection +// executing a modal on a bulk selection $grid->addModalBulkAction(['Delete selected', 'icon' => 'trash'], '', static function (View $modal, array $ids) use ($grid) { Message::addTo($modal, [ 'The selected records will be permanently deleted: ' . implode(', ', $ids) . '#', @@ -103,5 +103,5 @@ }); }); -// Setting ipp with an array will add an ItemPerPageSelector to paginator. +// setting ipp with an array will add an ItemPerPageSelector to paginator $grid->setIpp([10, 100, 1000]); diff --git a/demos/collection/multitable.php b/demos/collection/multitable.php index d5f1c5b259..87a6cab5f7 100644 --- a/demos/collection/multitable.php +++ b/demos/collection/multitable.php @@ -17,7 +17,7 @@ /** @var \Atk4\Ui\App $app */ require_once __DIR__ . '/../init-app.php'; -// Re-usable component implementing counter +// re-usable component implementing counter $finderClass = AnonymousClassNameCache::get_class(fn () => new class() extends Columns { public array $route = []; diff --git a/demos/collection/tablecolumnmenu.php b/demos/collection/tablecolumnmenu.php index 88f42e2080..3191c0aee0 100644 --- a/demos/collection/tablecolumnmenu.php +++ b/demos/collection/tablecolumnmenu.php @@ -16,15 +16,15 @@ Header::addTo($app, ['Table column may contains popup or dropdown menu.']); -// Better Popup positioning when Popup are inside a container. +// better Popup positioning when Popup are inside a container $container = View::addTo($app, ['ui' => 'vertical segment']); $table = Table::addTo($container, ['class.celled' => true]); $table->setModel(new SomeData(), []); -// will add popup to this column. +// will add popup to this column $colName = $table->addColumn('name'); -// will add dropdown menu to this column. +// will add dropdown menu to this column $colSurname = $table->addColumn('surname'); $colTitle = $table->addColumn('title'); @@ -36,7 +36,7 @@ Text::addTo($colName->addPopup())->set('Name popup'); // dynamic popup setup -// This popup will add content using the callback function. +// this popup will add content using the callback function $colSurname->addPopup()->set(static function (View $pop) { Text::addTo($pop)->set('This popup is loaded dynamically'); }); @@ -50,16 +50,16 @@ Header::addTo($app, ['Grid column may contains popup or dropdown menu.']); -// Table in Grid are already inside a container. +// Table in Grid are already inside a container $grid = Grid::addTo($app); $grid->setModel(new Country($app->db)); $grid->ipp = 5; -// Adding a dropdown menu to the column 'name'. +// adding a dropdown menu to the column 'name' $grid->addDropdown(Country::hinting()->fieldName()->name, ['Rename', 'Delete'], static function (string $item) { return $item; }); -// Adding a popup view to the column 'iso' +// adding a popup view to the column 'iso' $pop = $grid->addPopup(Country::hinting()->fieldName()->iso); Text::addTo($pop)->set('Grid column popup'); diff --git a/demos/collection/tablefilter.php b/demos/collection/tablefilter.php index 2c999daafd..1b9935db8d 100644 --- a/demos/collection/tablefilter.php +++ b/demos/collection/tablefilter.php @@ -10,10 +10,9 @@ /** @var \Atk4\Ui\App $app */ require_once __DIR__ . '/../init-app.php'; -// For popup positioning to work correctly, table needs to be inside a view segment. +// for popup positioning to work correctly, table needs to be inside a view segment $view = View::addTo($app, ['ui' => 'basic segment']); -// Important: menu class added for Behat testing. -$grid = Grid::addTo($view, ['menu' => ['class' => ['atk-grid-menu']]]); +$grid = Grid::addTo($view, ['menu' => ['class' => ['atk-grid-menu']]]); // menu class added for Behat testing $model = new Country($app->db); $model->addExpression('is_uk', [ diff --git a/demos/data-action/actions.php b/demos/data-action/actions.php index fdb85c37aa..f406c9f485 100644 --- a/demos/data-action/actions.php +++ b/demos/data-action/actions.php @@ -22,7 +22,7 @@ // Which fields may be edited for the action. Default to all fields. // ModalExecutor for example, will only display fields set in this array. 'fields' => [$files->fieldName()->name], - // callback function to call in model when action execute. + // Callback function to call in model when action execute. // Can use a closure function or model method. 'callback' => 'importFromFilesystem', // Some Ui action executor will use this property for displaying text in button. diff --git a/demos/data-action/factory-view.php b/demos/data-action/factory-view.php index 288643fe79..862a881cc1 100644 --- a/demos/data-action/factory-view.php +++ b/demos/data-action/factory-view.php @@ -34,7 +34,7 @@ public function __construct() { - // registering card button default with our own method handler. + // registering card button default with our own method handler $this->triggerSeed = array_merge( $this->triggerSeed, [self::CARD_BUTTON => ['default' => [$this, 'getCardButton']]] diff --git a/demos/data-action/factory.php b/demos/data-action/factory.php index ac080adf15..fceee95685 100644 --- a/demos/data-action/factory.php +++ b/demos/data-action/factory.php @@ -48,7 +48,7 @@ ]; }); -// Set new executor factory globally. +// set new executor factory globally $app->setExecutorFactory(new $myFactory()); $country = new Country($app->db); diff --git a/demos/data-action/jsactions.php b/demos/data-action/jsactions.php index d5986660c0..9e8fdcf4ee 100644 --- a/demos/data-action/jsactions.php +++ b/demos/data-action/jsactions.php @@ -19,7 +19,7 @@ 'subHeader' => 'Model action can be trigger in various ways.', ]); -// Model action setup. +// Model action setup $country = new Country($app->db); $sendEmailAction = $country->addUserAction('Email', [ @@ -39,7 +39,7 @@ 'subHeader' => 'Action can be triggered via a button attached to an input. The data action argument value is set to the input value.', ]); -// Note here that we explicitly required a JsCallbackExecutor for the greet action. +// note here that we explicitly required a JsCallbackExecutor for the greet action $country->addUserAction('greet', [ 'appliesTo' => UserAction::APPLIES_TO_NO_RECORDS, 'args' => [ @@ -53,7 +53,7 @@ }, ]); -// Set the action property for the Line Form Control. +// set the action property for the Line Form Control Form\Control\Line::addTo($app, ['action' => $country->getUserAction('greet')]); // ----------------------------------------------------------------------------- @@ -66,7 +66,7 @@ 'subHeader' => 'Easily trigger a data action using a Card component.', ]); -// Card component. +// Card component $card = Card::addTo($app); $content = new View(['class' => ['content']]); $img = Image::addTo($content, ['../images/kristy.png']); @@ -79,5 +79,5 @@ $s = $card->addSection('Country'); $s->addFields($entity = $country->loadAny(), [$country->fieldName()->name, $country->fieldName()->iso]); -// Pass the model action to the Card::addClickAction() method. +// pass the model action to the Card::addClickAction() method $card->addClickAction($sendEmailAction, null, ['id' => $entity->getId()]); diff --git a/demos/data-action/jsactions2.php b/demos/data-action/jsactions2.php index 452502b557..2a0ed83e19 100644 --- a/demos/data-action/jsactions2.php +++ b/demos/data-action/jsactions2.php @@ -20,7 +20,7 @@ $entity = $country->loadAny(); $countryId = $entity->getId(); -// Model actions for this file are setup in DemoActionUtil. +// Model actions for this file are setup in DemoActionUtil DemoActionsUtil::setupDemoActions($country); Header::addTo($app, ['Assign Model action to button event', 'subHeader' => 'Execute model action on this country record by clicking on the appropriate button on the right.']); @@ -38,9 +38,9 @@ $buttons = View::addTo($gl, ['ui' => 'vertical basic buttons'], ['r1c2']); -// Create a button for every action in Country model. +// create a button for every action in Country model foreach ($country->getUserActions() as $action) { $b = Button::addTo($buttons, [$action->getCaption()]); - // Assign action to button using current model id as URL arguments. + // assign action to button using current model id as URL arguments $b->on('click', $action, ['args' => ['id' => $countryId]]); } diff --git a/demos/data-action/jsactionscrud.php b/demos/data-action/jsactionscrud.php index c55ca536e3..4d9f8080a4 100644 --- a/demos/data-action/jsactionscrud.php +++ b/demos/data-action/jsactionscrud.php @@ -17,7 +17,7 @@ $files = new File($app->db); -// This action must appear on top of the Crud +// this action must appear on top of the Crud $files->addUserAction('import_from_filesystem', [ 'caption' => 'Import', 'callback' => 'importFromFilesystem', diff --git a/demos/data-action/jsactionsgrid.php b/demos/data-action/jsactionsgrid.php index 64086b6032..6e2c586120 100644 --- a/demos/data-action/jsactionsgrid.php +++ b/demos/data-action/jsactionsgrid.php @@ -18,14 +18,15 @@ require_once __DIR__ . '/../init-app.php'; $country = new Country($app->db); -// Model actions for this file are setup in DemoActionUtil. + +// model actions for this file are setup in DemoActionUtil DemoActionsUtil::setupDemoActions($country); -// creating special menu item for multi_step action. +// creating special menu item for multi_step action $multiAction = $country->getUserAction('multi_step'); $specialItem = Factory::factory([View::class], ['name' => false, 'class' => ['item'], 'content' => 'Multi Step']); Icon::addTo($specialItem, ['content' => 'window maximize outline']); -// register this menu item in factory. +// register this menu item in factory $app->getExecutorFactory()->registerTrigger(ExecutorFactory::TABLE_MENU_ITEM, $specialItem, $multiAction); Header::addTo($app, ['Execute model action from Grid menu items', 'subHeader' => 'Setting grid menu items in order to execute model actions or javascript.']); @@ -42,7 +43,7 @@ Icon::addTo($jsHeader, ['content' => 'file code']); $grid->addActionMenuItem($jsHeader); -// Beside model user action, grid menu items can also execute javascript. +// beside model user action, grid menu items can also execute javascript $grid->addActionMenuItem('JS Callback', static function () { return (new View())->set('JS Callback done!'); }, 'Are you sure?'); @@ -51,7 +52,7 @@ $grid->addActionMenuItem($modelHeader); -// Adding Model actions. +// adding Model actions foreach ($country->getUserActions(UserAction::APPLIES_TO_SINGLE_RECORD) as $action) { if (in_array($action->shortName, ['add', 'edit', 'delete'], true)) { continue; diff --git a/demos/form-control/input2.php b/demos/form-control/input2.php index 0920862f0a..c76b5b823d 100644 --- a/demos/form-control/input2.php +++ b/demos/form-control/input2.php @@ -19,7 +19,7 @@ $form = Form::addTo($app); -// Test all kinds of input fields +// test all kinds of input fields $group = $form->addGroup('Line'); $group->addControl('line_norm')->set('editable'); $group->addControl('line_read', ['readOnly' => true])->set('read only'); diff --git a/demos/form-control/multiline.php b/demos/form-control/multiline.php index 2ced57efa6..d723dcf56d 100644 --- a/demos/form-control/multiline.php +++ b/demos/form-control/multiline.php @@ -27,12 +27,12 @@ $form = Form::addTo($app); -// Add multiline field and set model. +// add multiline field and set model /** @var Form\Control\Multiline */ $multiline = $form->addControl('items', [Form\Control\Multiline::class, 'tableProps' => ['color' => 'blue'], 'itemLimit' => 10, 'addOnTab' => true]); $multiline->setModel($inventory); -// Add total field. +// add total field $total = 0; foreach ($inventory as $item) { $total += $item->qty * $item->box; @@ -42,7 +42,7 @@ $column = $sublayout->addColumn(4); $controlTotal = $column->addControl('total', ['readOnly' => true])->set($total); -// Update total when qty and box value in any row has changed. +// update total when qty and box value in any row has changed $multiline->onLineChange(static function (array $rows, Form $form) use ($controlTotal) { $total = 0; foreach ($rows as $row => $cols) { diff --git a/demos/form-control/upload.php b/demos/form-control/upload.php index 10db421a04..4549ae5107 100644 --- a/demos/form-control/upload.php +++ b/demos/form-control/upload.php @@ -38,16 +38,15 @@ $img->setThumbnailSrc($img->getApp()->cdn['atk'] . '/logo.png'); $img->set('123456', $postFile['name'] . ' (token: 123456)'); // @phpstan-ignore-line - // Do file processing here... + // do file processing here... - // This will get caught by JsCallback and show via modal. + // this will get caught by JsCallback and show via modal // new Blabla(); - // JS Action can be return. - // if using form, can return an error to form control directly. + // JS Action can be return if using form, can return an error to form control directly // return $form->jsError('file', 'Unable to upload file.'); - // can also return a notifier. + // can also return a notifier return new JsToast([ 'title' => 'Upload success', 'message' => 'Image is uploaded!', diff --git a/demos/form/form2.php b/demos/form/form2.php index bfed6290d0..2f3cd32444 100644 --- a/demos/form/form2.php +++ b/demos/form/form2.php @@ -63,7 +63,7 @@ } } - // In-form validation + // in-form validation $errors = []; if (mb_strlen($form->model->get('first_name')) < 3) { $errors[] = $form->jsError('first_name', 'too short, ' . $form->model->get('first_name')); diff --git a/demos/form/form5.php b/demos/form/form5.php index 6877ae9402..6ac0a89118 100644 --- a/demos/form/form5.php +++ b/demos/form/form5.php @@ -29,16 +29,16 @@ // adding field without model creates a regular line $form->addControl('one'); -// Array second is a default seed for default line field +// array second is a default seed for default line field $form->addControl('three', ['caption' => 'Caption2']); -// Use zeroth argument of the seed to specify standard class +// use zeroth argument of the seed to specify standard class $form->addControl('four', [Form\Control\Checkbox::class, 'caption' => 'Caption2']); -// Use explicit object for user-defined or 3rd party field +// use explicit object for user-defined or 3rd party field $form->addControl('five', new Form\Control\Checkbox(), ['type' => 'boolean'])->set(true); -// Objects still accept seed +// objects still accept seed $form->addControl('six', new Form\Control\Checkbox(['caption' => 'Caption3'])); $form->onSubmit($formSubmit); @@ -57,7 +57,7 @@ // type is converted into CheckBox form control with caption as a seed $model->addField('four', ['type' => 'boolean', 'ui' => ['form' => ['caption' => 'Caption2']]]); -// Can specify class for a checkbox explicitly +// can specify class for a checkbox explicitly // type here in "six" should not be needed if we add Checkbox form control support for string type $model->addField('five', ['type' => 'boolean', 'ui' => ['form' => [Form\Control\Checkbox::class, 'caption' => 'Caption3']]]); @@ -70,20 +70,20 @@ $form->setModel($model); $form->onSubmit($formSubmit); -// Next form won't initialize default fields, but we'll add them individually +// next form won't initialize default fields, but we'll add them individually $form = Form::addTo($cc->addColumn()); $form->setModel($model, []); // adding that same field but with custom form control seed $form->addControl('one', ['caption' => 'Caption0']); -// We can override type, but seed from model will still be respected +// we can override type, but seed from model will still be respected $form->addControl('three', [Form\Control\Checkbox::class]); -// We override type and caption here +// we override type and caption here $form->addControl('four', [Form\Control\Line::class, 'caption' => 'CaptionX']); -// We can specify form control object. It's still seeded with caption from model. +// we can specify form control object, it's still seeded with caption from model $form->addControl('five', new Form\Control\Checkbox()); // can add field that does not exist in a model diff --git a/demos/form/jscondform.php b/demos/form/jscondform.php index 7ad998daa0..4fe30714ae 100644 --- a/demos/form/jscondform.php +++ b/demos/form/jscondform.php @@ -23,7 +23,7 @@ $formPhone->addControl('phone3'); $formPhone->addControl('phone4'); -// Show phoneX when previous phone is visible and has a number with at least 5 char. +// show phoneX when previous phone is visible and has a number with at least 5 char $formPhone->setControlsDisplayRules([ 'phone2' => ['phone1' => ['number', 'minLength[5]']], 'phone3' => ['phone2' => ['number', 'minLength[5]'], 'phone1' => ['number', 'minLength[5]']], @@ -44,9 +44,9 @@ $formSubscribe->addControl('m_gift', [Form\Control\Dropdown::class, 'caption' => 'Gift for Men', 'values' => ['Beer Glass', 'Swiss Knife']]); $formSubscribe->addControl('f_gift', [Form\Control\Dropdown::class, 'caption' => 'Gift for Women', 'values' => ['Wine Glass', 'Lipstick']]); -// Show email and gender when subscribe is checked. -// Show m_gift when gender = 'male' and subscribe is checked. -// Show f_gift when gender = 'female' and subscribe is checked. +// show email and gender when subscribe is checked +// show m_gift when gender = 'male' and subscribe is checked +// show f_gift when gender = 'female' and subscribe is checked $formSubscribe->setControlsDisplayRules([ 'email' => ['subscribe' => 'checked'], 'gender' => ['subscribe' => 'checked'], @@ -64,9 +64,9 @@ $formDog->addControl('age'); $formDog->addControl('hair_cut', [Form\Control\Dropdown::class, 'values' => ['Short', 'Long']]); -// Show 'hair_cut' when race contains the word 'poodle' AND age is between 1 and 5 +// show 'hair_cut' when race contains the word 'poodle' AND age is between 1 and 5 // OR -// Show 'hair_cut' when race contains exactly the word 'bichon' +// show 'hair_cut' when race contains exactly the word 'bichon' $formDog->setControlsDisplayRules([ 'hair_cut' => [['race' => 'contains[poodle]', 'age' => 'integer[1..5]'], ['race' => 'isExactly[bichon]']], ]); @@ -95,9 +95,9 @@ $groupOther->addControl('language', ['width' => 'eight']); $groupOther->addControl('favorite_pet', ['width' => 'four']); -// To hide-show group simply select a field in that group. -// Show group where 'php' belong when dev is checked. -// Show group where 'language' belong when dev is checked. +// to hide-show group simply select a field in that group +// show group where 'php' belong when dev is checked +// show group where 'language' belong when dev is checked $formGroup->setGroupDisplayRules(['php' => ['dev' => 'checked'], 'language' => ['dev' => 'checked']]); // ----------------------------------------------------------------------------- @@ -131,9 +131,9 @@ $accordionLayout->activate($invoiceAddressSection); -// To hide-show group or section simply select a field in that group. -// Show group where 'php' belong when dev is checked. -// Show group where 'language' belong when dev is checked. +// to hide-show group or section simply select a field in that group +// show group where 'php' belong when dev is checked +// show group where 'language' belong when dev is checked $formAccordion->setGroupDisplayRules( ['delivery_addr' => ['has_custom_delivery_address' => 'checked']], diff --git a/demos/interactive/accordion.php b/demos/interactive/accordion.php index 0f4d9d6fbd..5f4a7ed11a 100644 --- a/demos/interactive/accordion.php +++ b/demos/interactive/accordion.php @@ -53,7 +53,7 @@ }); }); -// Activate on page load. +// activate on page load $accordion->activate($i2); $b1->on('click', $accordion->jsToggle($i1)); diff --git a/demos/interactive/loader.php b/demos/interactive/loader.php index 38efcdb918..bfd03fd8af 100644 --- a/demos/interactive/loader.php +++ b/demos/interactive/loader.php @@ -24,33 +24,34 @@ // Example 1 - Basic usage of a Loader. Loader::addTo($app)->set(static function (Loader $p) { - // set your time expensive function here. + // set your time expensive function here sleep(1); Header::addTo($p, ['Loader #1']); LoremIpsum::addTo($p, ['size' => 1]); - // Any dynamic views can perform callbacks just fine + // any dynamic views can perform callbacks just fine ViewTester::addTo($p); - // Loader may be inside another loader, works fine. + // Loader may be inside another loader $loader = Loader::addTo($p); // use loadEvent to prevent manual loading or even specify custom trigger event $loader->loadEvent = false; $loader->set(static function (Loader $p) { - // You may pass arguments to the loader, in this case it's "color" + // you may pass arguments to the loader, in this case it's "color" sleep(1); - Header::addTo($p, ['Loader #1b - ' . $_GET['color']]); - LoremIpsum::addTo(View::addTo($p, ['ui' => $_GET['color'] . ' segment']), ['size' => 1]); + $color = $_GET['color']; + Header::addTo($p, ['Loader #1b - ' . $color]); + LoremIpsum::addTo(View::addTo($p, ['ui' => $color . ' segment']), ['size' => 1]); // don't forget to make your own argument sticky so that Components can communicate with themselves: $p->stickyGet('color'); ViewTester::addTo($p); - // This loader takes 2s to load because it needs to go through 2 sleep statements. + // this loader takes 2s to load because it needs to go through 2 sleep statements }); - // button may contain load event. + // button may contain load event Button::addTo($p, ['Load Segment Manually (2s)', 'class.red' => true]) ->on('click', $loader->jsLoad(['color' => 'red'])); Button::addTo($p, ['Load Segment Manually (2s)', 'class.blue' => true]) diff --git a/demos/interactive/loader2.php b/demos/interactive/loader2.php index fb776bc443..d979c65a9e 100644 --- a/demos/interactive/loader2.php +++ b/demos/interactive/loader2.php @@ -29,5 +29,7 @@ $grid->table->onRowClick($countryLoader->jsLoad(['id' => $grid->jsRow()->data('id')])); $countryLoader->set(static function (Loader $p) { - Form::addTo($p)->setModel((new Country($p->getApp()->db))->load($_GET['id'])); + Form::addTo($p)->setModel( + (new Country($p->getApp()->db))->load($_GET['id']) + ); }); diff --git a/demos/interactive/modal.php b/demos/interactive/modal.php index 7e2f217224..3ab6602d57 100644 --- a/demos/interactive/modal.php +++ b/demos/interactive/modal.php @@ -23,6 +23,7 @@ Header::addTo($app, ['Modal View']); $session = new Session($app); + // Re-usable component implementing counter Header::addTo($app, ['Static Modal Dialog']); @@ -54,7 +55,7 @@ Button::addTo($bar, ['Scrolling Content']) ->on('click', $modalScrolling->jsShow()); -// Modal demos. +// Modal demos // REGULAR @@ -70,10 +71,10 @@ Header::addTo($app, ['Three levels of Modal loading dynamic content via callback']); -// vp1Modal will be render into page but hide until $vp1Modal->jsShow() is activate. +// vp1Modal will be render into page but hide until $vp1Modal->jsShow() is activate $vp1Modal = Modal::addTo($app, ['title' => 'Lorem Ipsum load dynamically']); -// vp2Modal will be render into page but hide until $vp1Modal->jsShow() is activate. +// vp2Modal will be render into page but hide until $vp1Modal->jsShow() is activate $vp2Modal = Modal::addTo($app, ['title' => 'Text message load dynamically'])->addClass('small'); $vp3Modal = Modal::addTo($app, ['title' => 'Third level modal'])->addClass('small'); @@ -82,10 +83,10 @@ LoremIpsum::addTo($p, ['size' => 2]); }); -// When $vp1Modal->jsShow() is activate, it will dynamically add this content to it. +// when $vp1Modal->jsShow() is activate, it will dynamically add this content to it $vp1Modal->set(static function (View $p) use ($vp2Modal) { ViewTester::addTo($p); - View::addTo($p, ['Showing lorem ipsum']); // need in behat test. + View::addTo($p, ['Showing lorem ipsum']); // need in behat test LoremIpsum::addTo($p, ['size' => 2]); $form = Form::addTo($p); $form->addControl('color', [], ['enum' => ['red', 'green', 'blue'], 'default' => 'green']); @@ -94,7 +95,7 @@ }); }); -// When $vp2Modal->jsShow() is activate, it will dynamically add this content to it. +// when $vp2Modal->jsShow() is activate, it will dynamically add this content to it $vp2Modal->set(static function (View $p) use ($vp3Modal) { ViewTester::addTo($p); Message::addTo($p, [$_GET['color'] ?? 'No color'])->text->addParagraph('This text is loaded using a second modal.'); @@ -161,10 +162,10 @@ Header::addTo($app, ['Multiple page modal']); -// Add modal to layout. +// add modal to layout $stepModal = Modal::addTo($app, ['title' => 'Multi step actions']); -// Add buttons to modal for next and previous actions. +// add buttons to modal for next and previous actions $action = new View(['ui' => 'buttons']); $previousAction = new Button(['Previous', 'icon' => 'left arrow']); $nextAction = new Button(['Next', 'iconRight' => 'right arrow']); @@ -179,10 +180,10 @@ $page = $session->recall('page', 1); $success = $session->recall('success', false); if (isset($_GET['move'])) { - if ($_GET['move'] === 'next' && $success) { + $move = $_GET['move']; + if ($move === 'next' && $success) { ++$page; - } - if ($_GET['move'] === 'previous' && $page > 1) { + } elseif ($move === 'previous' && $page > 1) { --$page; } $session->memorize('success', false); @@ -238,7 +239,7 @@ ['url' => $stepModal->cb->getJsUrl(), 'urlOptions' => ['move' => 'next']] )); -// Bind display modal to page display button. +// bind display modal to page display button $menuBar = View::addTo($app, ['ui' => 'buttons']); $button = Button::addTo($menuBar)->set('Multi Step Modal'); $button->on('click', $stepModal->jsShow()); diff --git a/demos/interactive/paginator.php b/demos/interactive/paginator.php index 056493f005..18150b5542 100644 --- a/demos/interactive/paginator.php +++ b/demos/interactive/paginator.php @@ -16,7 +16,7 @@ Header::addTo($app, ['Paginator tracks its own position']); Paginator::addTo($app, ['total' => 40, 'urlTrigger' => 'page']); -// Dynamically reloading paginator +// dynamically reloading paginator Header::addTo($app, ['Dynamic reloading']); $seg = View::addTo($app, ['ui' => 'blue segment']); $label = Label::addTo($seg); @@ -24,7 +24,7 @@ $label->addClass('blue ribbon'); $label->set('Current page: ' . $bb->page); -// Multiple dependent Paginators +// multiple dependent Paginators Header::addTo($app, ['Local Sticky Usage']); $seg = View::addTo($app, ['ui' => 'blue segment']); diff --git a/demos/interactive/popup.php b/demos/interactive/popup.php index 08a91cd757..584768153a 100644 --- a/demos/interactive/popup.php +++ b/demos/interactive/popup.php @@ -202,7 +202,7 @@ public function linkCart(View $cart, JsExpressionable $jsAction = null): void $cartPopup->set(static function (View $popup) use ($cart) { $cartInnerLabel = Label::addTo($popup, ['Number of items:']); - // cart is already initialized, so init() is not called again. However, cart will be rendered + // Cart is already initialized, so init() is not called again. However, cart will be rendered // as a child of a pop-up now. $popup->add($cart); diff --git a/demos/interactive/scroll-grid-container.php b/demos/interactive/scroll-grid-container.php index b5349583d5..5386f85126 100644 --- a/demos/interactive/scroll-grid-container.php +++ b/demos/interactive/scroll-grid-container.php @@ -37,7 +37,7 @@ $g1->addActionButton('red', static function (Jquery $js) { return $js->closest('tr')->css('color', 'red'); }); -// THIS SHOULD GO AFTER YOU CALL Grid::addActionButton() !!! +// THIS SHOULD GO AFTER YOU CALL Grid::addActionButton() $g1->addJsPaginatorInContainer(30, 350); $c2 = $c->addColumn(); diff --git a/demos/interactive/virtual.php b/demos/interactive/virtual.php index 79ef7faa1c..2b8abf3be3 100644 --- a/demos/interactive/virtual.php +++ b/demos/interactive/virtual.php @@ -18,12 +18,12 @@ /** @var \Atk4\Ui\App $app */ require_once __DIR__ . '/../init-app.php'; -// Demonstrate the use of Virtual Page. +// Demonstrate the use of VirtualPage -// define virtual page. +// define virtual page $virtualPage = VirtualPage::addTo($app->layout, ['urlTrigger' => 'in']); -// Add content to virtual page. +// add content to virtual page if (isset($_GET['p_id'])) { Header::addTo($virtualPage, [$_GET['p_id']])->addClass('__atk-behat-test-car'); } @@ -44,14 +44,13 @@ $msg->text->addParagraph('Virtual page content are not rendered on page load. They will ouptput their content when trigger.'); $msg->text->addParagraph('Click button below to trigger it.'); -// button that trigger virtual page. +// button that trigger virtual page $button = Button::addTo($app, ['More info on Car']); $button->link($virtualPage->cb->getUrl() . '&p_id=Car'); $button = Button::addTo($app, ['More info on Bike']); $button->link($virtualPage->cb->getUrl() . '&p_id=Bike'); -// Test 1 - Basic reloading Header::addTo($app, ['Virtual Page Logic']); $virtualPage = VirtualPage::addTo($app); // this page will not be visible unless you trigger it specifically diff --git a/demos/interactive/wizard.php b/demos/interactive/wizard.php index 7725b7be9f..319971e91b 100644 --- a/demos/interactive/wizard.php +++ b/demos/interactive/wizard.php @@ -32,7 +32,7 @@ // to store wizard-specific variables $wizard->addStep(['Set DSN', 'icon' => 'configure', 'description' => 'Database Connection String'], static function (Wizard $wizard) { $form = Form::addTo($wizard); - // IMPORTANT - needed for php_unit Wizard test. + // IMPORTANT - needed for phpunit Wizard test $form->cb->setUrlTrigger('w_form_submit'); $form->addControl('dsn', ['caption' => 'Connect DSN'], ['required' => true])->placeholder = 'mysql://user:pass@db-host.example.com/mydb'; @@ -91,7 +91,7 @@ }); }); -// calling addFinish adds a step, which will not appear in the list of steps, but +// Calling addFinish adds a step, which will not appear in the list of steps, but // will be displayed when you click the "Finish". Finish will not add any buttons // because you shouldn't be able to navigate wizard back without restarting it. // Only one finish can be added. diff --git a/demos/javascript/js.php b/demos/javascript/js.php index 45cb09ffe6..b1ac81267d 100644 --- a/demos/javascript/js.php +++ b/demos/javascript/js.php @@ -15,14 +15,15 @@ /** @var \Atk4\Ui\App $app */ require_once __DIR__ . '/../init-app.php'; -// Demonstrates how to use interactive buttons. +// Demonstrates how to use interactive buttons + Header::addTo($app, ['Basic Button']); -// This button hides on page load +// this button hides on page load $b = Button::addTo($app, ['Hidden Button']); $b->js(true)->hide(); -// This button hides when clicked +// this button hides when clicked $b = Button::addTo($app, ['name' => 'b2'])->set('Hide on click Button'); $b->js('click')->hide(); @@ -53,7 +54,7 @@ Header::addTo($app, ['Callbacks']); -// On button click reload it and change it's title +// on button click reload it and change it's title $b = Button::addTo($app, ['Callback Test']); $b->on('click', null, static function (Jquery $j) { return $j->text(random_int(1, 20)); diff --git a/demos/javascript/reloading.php b/demos/javascript/reloading.php index bdeb8919a7..1434555805 100644 --- a/demos/javascript/reloading.php +++ b/demos/javascript/reloading.php @@ -42,12 +42,12 @@ Counter::addTo($seg, ['40']); Counter::addTo($seg, ['-20']); -// Add button to reload all counters +// add button to reload all counters $bar = View::addTo($app, ['ui' => 'buttons']); $b = Button::addTo($bar, ['Reload counter']) ->on('click', new JsReload($seg)); -// Relading with argument +// reloading with argument Header::addTo($app, ['We can pass argument to reloader']); $v = View::addTo($app, ['ui' => 'segment'])->set($_GET['val'] ?? 'No value'); diff --git a/demos/javascript/vue-component.php b/demos/javascript/vue-component.php index 5b16ae914e..299b9e8f3f 100644 --- a/demos/javascript/vue-component.php +++ b/demos/javascript/vue-component.php @@ -19,7 +19,7 @@ Header::addTo($app, ['Component', 'size' => 2, 'icon' => 'vuejs', 'subHeader' => 'UI view handle by Vue.js']); View::addTo($app, ['ui' => 'divider']); -// Inline Edit +// InlineEdit $entity = (new Country($app->db)) ->setOrder(Country::hinting()->fieldName()->id) @@ -109,7 +109,7 @@ }; EOF)); -// Injecting template but normally you would create a template file. +// injecting template but normally you would create a template file $clockTemplate = new HtmlTemplate(<<<'EOF'
{{ JSON.stringify(query, null, 2) }}\n \n
{{ JSON.stringify(query, null, 2) }}\n \n
{{ JSON.stringify(query, null, 2) }}\n \n
{{ JSON.stringify(query, null, 2) }}\n \n
Error: Unable to load Vue component
Error: Unable to load Vue component
{"use strict";var n,o=r(51207),i=r(98363),s=r(88697),a=r(63357),c=r(44296),u=r(9121),l=r(60904),f=r(52786),p=r(20821).enforce,d=r(79044),h=r(32512),g=Object,v=Array.isArray,m=g.isExtensible,y=g.isFrozen,_=g.isSealed,b=g.freeze,S=g.seal,x={},w={},E=!i.ActiveXObject&&"ActiveXObject"in i,k=function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}},A=u("WeakMap",k,l),C=A.prototype,O=s(C.set);if(h)if(E){n=l.getConstructor(k,"WeakMap",!0),c.enable();var T=s(C.delete),I=s(C.has),P=s(C.get);a(C,{delete:function(e){if(f(e)&&!m(e)){var t=p(this);return t.frozen||(t.frozen=new n),T(this,e)||t.frozen.delete(e)}return T(this,e)},has:function(e){if(f(e)&&!m(e)){var t=p(this);return t.frozen||(t.frozen=new n),I(this,e)||t.frozen.has(e)}return I(this,e)},get:function(e){if(f(e)&&!m(e)){var t=p(this);return t.frozen||(t.frozen=new n),I(this,e)?P(this,e):t.frozen.get(e)}return P(this,e)},set:function(e,t){if(f(e)&&!m(e)){var r=p(this);r.frozen||(r.frozen=new n),I(this,e)?O(this,e,t):r.frozen.set(e,t)}else O(this,e,t);return this}})}else o&&d((function(){var e=b([]);return O(new A,e,1),!y(e)}))&&a(C,{set:function(e,t){var r;return v(e)&&(y(e)?r=x:_(e)&&(r=w)),O(this,e,t),r==x&&b(e),r==w&&S(e),this}})},44978:(e,t,r)=>{r(44619)},56669:(e,t,r)=>{"use strict";r(9121)("WeakSet",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),r(60904))},58276:(e,t,r)=>{r(56669)},21739:(e,t,r)=>{"use strict";var n=r(19882),o=r(91977),i=r(6677);n({target:"Array",proto:!0},{group:function(e){return o(this,e,arguments.length>1?arguments[1]:void 0)}}),i("group")},67242:(e,t,r)=>{"use strict";var n=r(19882),o=r(79611),i=r(97676),s=r(83875),a=r(52786),c=r(82716),u=r(37366),l=r(26145),f=r(16437),p=u((function(e){var t=this,r=t.iterator,n=t.predicate;return new e((function(i,c){var u=function(e){t.done=!0,c(e)},p=function(e){f(r,u,e,u)},d=function(){try{e.resolve(s(o(t.next,r))).then((function(r){try{if(s(r).done)t.done=!0,i(l(void 0,!0));else{var o=r.value;try{var c=n(o,t.counter++),f=function(e){e?i(l(o,!1)):d()};a(c)?e.resolve(c).then(f,p):f(c)}catch(e){p(e)}}}catch(e){u(e)}}),u)}catch(e){u(e)}};d()}))}));n({target:"AsyncIterator",proto:!0,real:!0},{filter:function(e){return s(this),i(e),new p(c(this),{predicate:e})}})},59668:(e,t,r)=>{"use strict";var n=r(19882),o=r(57416).find;n({target:"AsyncIterator",proto:!0,real:!0},{find:function(e){return o(this,e)}})},74659:(e,t,r)=>{r(19882)({target:"AsyncIterator",proto:!0,real:!0},{map:r(36196)})},90170:(e,t,r)=>{"use strict";var n=r(19882),o=r(98363),i=r(9519),s=r(75277),a=r(45899),c=r(79044),u=r(24792),l=r(52280),f=r(97022).IteratorPrototype,p=r(21178),d=l("toStringTag"),h=o.Iterator,g=p||!s(h)||h.prototype!==f||!c((function(){h({})})),v=function(){i(this,f)};u(f,d)||a(f,d,"Iterator"),!g&&u(f,"constructor")&&f.constructor!==Object||a(f,"constructor",v),v.prototype=f,n({global:!0,constructor:!0,forced:g},{Iterator:v})},42359:(e,t,r)=>{"use strict";var n=r(19882),o=r(79611),i=r(97676),s=r(83875),a=r(82716),c=r(8821),u=r(9637),l=c((function(){for(var e,t,r=this.iterator,n=this.predicate,i=this.next;;){if(e=s(o(i,r)),this.done=!!e.done)return;if(t=e.value,u(r,n,[t,this.counter++],!0))return t}}));n({target:"Iterator",proto:!0,real:!0},{filter:function(e){return s(this),i(e),new l(a(this),{predicate:e})}})},62052:(e,t,r)=>{"use strict";var n=r(19882),o=r(5166),i=r(97676),s=r(83875),a=r(82716);n({target:"Iterator",proto:!0,real:!0},{find:function(e){s(this),i(e);var t=a(this),r=0;return o(t,(function(t,n){if(e(t,r++))return n(t)}),{IS_RECORD:!0,INTERRUPTED:!0}).result}})},26576:(e,t,r)=>{r(19882)({target:"Iterator",proto:!0,real:!0},{map:r(74801)})},96454:(e,t,r)=>{"use strict";var n=r(19882),o=r(7493),i=r(98363),s=r(22773),a=r(88697),c=r(79611),u=r(75277),l=r(52786),f=r(71982),p=r(24792),d=r(28967),h=r(47046),g=r(35039),v=r(79044),m=r(38091),y=r(746),_=i.JSON,b=i.Number,S=i.SyntaxError,x=_&&_.parse,w=s("Object","keys"),E=Object.getOwnPropertyDescriptor,k=a("".charAt),A=a("".slice),C=a(/./.exec),O=a([].push),T=/^\d$/,I=/^[1-9]$/,P=/^(-|\d)$/,R=/^[\t\n\r ]$/,M=function(e,t,r,n){var o,i,s,a,u,d=e[t],g=n&&d===n.value,v=g&&"string"==typeof n.source?{source:n.source}:{};if(l(d)){var m=f(d),y=g?n.nodes:m?[]:{};if(m)for(o=y.length,s=h(d),a=0;a f?K(e,o,i,!0,!1,p):A(t,r,n,o,i,a,c,u,p)},V=(e,t,r,n,o,i,a,c,u)=>{let l=0;const f=t.length;let p=e.length-1,d=f-1;for(;l<=p&&l<=d;){const n=e[l],s=t[l]=u?ts(t[l]):es(t[l]);if(!$i(n,s))break;y(n,s,r,null,o,i,a,c,u),l++}for(;l<=p&&l<=d;){const n=e[p],s=t[d]=u?ts(t[d]):es(t[d]);if(!$i(n,s))break;y(n,s,r,null,o,i,a,c,u),p--,d--}if(l>p){if(l<=d){const e=d+1,s=e Error: Unable to load Vue component Error: Unable to load Vue component{"use strict";var n=r(19882),o=r(42573),i=r(49916).add;n({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var e=o(this),t=0,r=arguments.length;t{"use strict";var n=r(19882),o=r(79611),i=r(96790),s=r(96647);n({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(e){return o(s,this,i(e))}})},6053:(e,t,r)=>{var n=r(19882),o=r(96647);n({target:"Set",proto:!0,real:!0,forced:!r(69998)("difference")},{difference:o})},46345:(e,t,r)=>{"use strict";var n=r(19882),o=r(98166),i=r(42573),s=r(78872);n({target:"Set",proto:!0,real:!0,forced:!0},{every:function(e){var t=i(this),r=o(e,arguments.length>1?arguments[1]:void 0);return!1!==s(t,(function(e){if(!r(e,e,t))return!1}),!0)}})},14098:(e,t,r)=>{"use strict";var n=r(19882),o=r(98166),i=r(42573),s=r(49916),a=r(78872),c=s.Set,u=s.add;n({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(e){var t=i(this),r=o(e,arguments.length>1?arguments[1]:void 0),n=new c;return a(t,(function(e){r(e,e,t)&&u(n,e)})),n}})},29747:(e,t,r)=>{"use strict";var n=r(19882),o=r(98166),i=r(42573),s=r(78872);n({target:"Set",proto:!0,real:!0,forced:!0},{find:function(e){var t=i(this),r=o(e,arguments.length>1?arguments[1]:void 0),n=s(t,(function(e){if(r(e,e,t))return{value:e}}),!0);return n&&n.value}})},77572:(e,t,r)=>{"use strict";var n=r(19882),o=r(79611),i=r(96790),s=r(29711);n({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(e){return o(s,this,i(e))}})},89342:(e,t,r)=>{var n=r(19882),o=r(79044),i=r(29711);n({target:"Set",proto:!0,real:!0,forced:!r(69998)("intersection")||o((function(){return"3,2"!=Array.from(new Set([1,2,3]).intersection(new Set([3,2])))}))},{intersection:i})},35817:(e,t,r)=>{"use strict";var n=r(19882),o=r(79611),i=r(96790),s=r(3579);n({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(e){return o(s,this,i(e))}})},29140:(e,t,r)=>{var n=r(19882),o=r(3579);n({target:"Set",proto:!0,real:!0,forced:!r(69998)("isDisjointFrom")},{isDisjointFrom:o})},67124:(e,t,r)=>{"use strict";var n=r(19882),o=r(79611),i=r(96790),s=r(42964);n({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(e){return o(s,this,i(e))}})},57166:(e,t,r)=>{var n=r(19882),o=r(42964);n({target:"Set",proto:!0,real:!0,forced:!r(69998)("isSubsetOf")},{isSubsetOf:o})},14947:(e,t,r)=>{"use strict";var n=r(19882),o=r(79611),i=r(96790),s=r(70818);n({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(e){return o(s,this,i(e))}})},90045:(e,t,r)=>{var n=r(19882),o=r(70818);n({target:"Set",proto:!0,real:!0,forced:!r(69998)("isSupersetOf")},{isSupersetOf:o})},45712:(e,t,r)=>{"use strict";var n=r(19882),o=r(88697),i=r(42573),s=r(78872),a=r(28967),c=o([].join),u=o([].push);n({target:"Set",proto:!0,real:!0,forced:!0},{join:function(e){var t=i(this),r=void 0===e?",":a(e),n=[];return s(t,(function(e){u(n,e)})),c(n,r)}})},5127:(e,t,r)=>{"use strict";var n=r(19882),o=r(98166),i=r(42573),s=r(49916),a=r(78872),c=s.Set,u=s.add;n({target:"Set",proto:!0,real:!0,forced:!0},{map:function(e){var t=i(this),r=o(e,arguments.length>1?arguments[1]:void 0),n=new c;return a(t,(function(e){u(n,r(e,e,t))})),n}})},73988:(e,t,r)=>{"use strict";var n=r(19882),o=r(97676),i=r(42573),s=r(78872),a=TypeError;n({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(e){var t=i(this),r=arguments.length<2,n=r?void 0:arguments[1];if(o(e),s(t,(function(o){r?(r=!1,n=o):n=e(n,o,o,t)})),r)throw a("Reduce of empty set with no initial value");return n}})},79192:(e,t,r)=>{"use strict";var n=r(19882),o=r(98166),i=r(42573),s=r(78872);n({target:"Set",proto:!0,real:!0,forced:!0},{some:function(e){var t=i(this),r=o(e,arguments.length>1?arguments[1]:void 0);return!0===s(t,(function(e){if(r(e,e,t))return!0}),!0)}})},74238:(e,t,r)=>{"use strict";var n=r(19882),o=r(79611),i=r(96790),s=r(20447);n({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(e){return o(s,this,i(e))}})},30217:(e,t,r)=>{var n=r(19882),o=r(20447);n({target:"Set",proto:!0,real:!0,forced:!r(69998)("symmetricDifference")},{symmetricDifference:o})},96180:(e,t,r)=>{"use strict";var n=r(19882),o=r(79611),i=r(96790),s=r(77403);n({target:"Set",proto:!0,real:!0,forced:!0},{union:function(e){return o(s,this,i(e))}})},93955:(e,t,r)=>{var n=r(19882),o=r(77403);n({target:"Set",proto:!0,real:!0,forced:!r(69998)("union")},{union:o})},84217:(e,t,r)=>{"use strict";var n=r(19882),o=r(91140).charAt,i=r(96411),s=r(14229),a=r(28967);n({target:"String",proto:!0,forced:!0},{at:function(e){var t=a(i(this)),r=t.length,n=s(e),c=n>=0?n:r+n;return c<0||c>=r?void 0:o(t,c)}})},2443:(e,t,r)=>{var n=r(19882),o=r(98363),i=r(22773),s=r(88697),a=r(79611),c=r(79044),u=r(28967),l=r(24792),f=r(27687),p=r(21185).ctoi,d=/[^\d+/a-z]/i,h=/[\t\n\f\r ]+/g,g=/[=]{1,2}$/,v=i("atob"),m=String.fromCharCode,y=s("".charAt),_=s("".replace),b=s(d.exec),S=c((function(){return""!==v(" ")})),x=!c((function(){v("a")})),w=!S&&!x&&!c((function(){v()})),E=!S&&!x&&1!==v.length;n({global:!0,bind:!0,enumerable:!0,forced:S||x||w||E},{atob:function(e){if(f(arguments.length,1),w||E)return a(v,o,e);var t,r,n=_(u(e),h,""),s="",c=0,S=0;if(n.length%4==0&&(n=_(n,g,"")),n.length%4==1||b(d,n))throw new(i("DOMException"))("The string is not correctly encoded","InvalidCharacterError");for(;t=y(n,c++);)l(p,t)&&(r=S%4?64*r+p[t]:p[t],S++%4&&(s+=m(255&r>>(-2*S&6))));return s}})},50039:(e,t,r)=>{var n=r(19882),o=r(98363),i=r(22773),s=r(88697),a=r(79611),c=r(79044),u=r(28967),l=r(27687),f=r(21185).itoc,p=i("btoa"),d=s("".charAt),h=s("".charCodeAt),g=!!p&&!c((function(){p()})),v=!!p&&c((function(){return"bnVsbA=="!==p(null)})),m=!!p&&1!==p.length;n({global:!0,bind:!0,enumerable:!0,forced:g||v||m},{btoa:function(e){if(l(arguments.length,1),g||v||m)return a(p,o,u(e));for(var t,r,n=u(e),s="",c=0,y=f;d(n,c)||(y="=",c%1);){if((r=h(n,c+=3/4))>255)throw new(i("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");s+=d(y,63&(t=t<<8|r)>>8-c%1*8)}return s}})},10449:(e,t,r)=>{var n=r(19882),o=r(98363),i=r(84643).clear;n({global:!0,bind:!0,enumerable:!0,forced:o.clearImmediate!==i},{clearImmediate:i})},6208:(e,t,r)=>{var n=r(98363),o=r(12848),i=r(79189),s=r(20379),a=r(45899),c=function(e){if(e&&e.forEach!==s)try{a(e,"forEach",s)}catch(t){e.forEach=s}};for(var u in o)o[u]&&c(n[u]&&n[u].prototype);c(i)},68995:(e,t,r)=>{var n=r(98363),o=r(12848),i=r(79189),s=r(54883),a=r(45899),c=r(52280),u=c("iterator"),l=c("toStringTag"),f=s.values,p=function(e,t){if(e){if(e[u]!==f)try{a(e,u,f)}catch(t){e[u]=f}if(e[l]||a(e,l,t),o[t])for(var r in s)if(e[r]!==s[r])try{a(e,r,s[r])}catch(t){e[r]=s[r]}}};for(var d in o)p(n[d]&&n[d].prototype,d);p(i,"DOMTokenList")},21950:(e,t,r)=>{"use strict";var n=r(19882),o=r(91573),i=r(22773),s=r(79044),a=r(51569),c=r(69199),u=r(86385).f,l=r(50403),f=r(13600),p=r(24792),d=r(9519),h=r(83875),g=r(97240),v=r(654),m=r(45932),y=r(78624),_=r(20821),b=r(7493),S=r(21178),x="DOMException",w="DATA_CLONE_ERR",E=i("Error"),k=i(x)||function(){try{(new(i("MessageChannel")||o("worker_threads").MessageChannel)).port1.postMessage(new WeakMap)}catch(e){if(e.name==w&&25==e.code)return e.constructor}}(),A=k&&k.prototype,C=E.prototype,O=_.set,T=_.getterFor(x),I="stack"in E(x),P=function(e){return p(m,e)&&m[e].m?m[e].c:0},R=function(){d(this,M);var e=arguments.length,t=v(e<1?void 0:arguments[0]),r=v(e<2?void 0:arguments[1],"Error"),n=P(r);if(O(this,{type:x,name:r,message:t,code:n}),b||(this.name=r,this.message=t,this.code=n),I){var o=E(t);o.name=x,u(this,"stack",c(1,y(o.stack,1)))}},M=R.prototype=a(C),L=function(e){return{enumerable:!0,configurable:!0,get:e}},D=function(e){return L((function(){return T(this)[e]}))};b&&(f(M,"code",D("code")),f(M,"message",D("message")),f(M,"name",D("name"))),u(M,"constructor",c(1,R));var N=s((function(){return!(new k instanceof E)})),j=N||s((function(){return C.toString!==g||"2: 1"!==String(new k(1,2))})),F=N||s((function(){return 25!==new k(1,"DataCloneError").code})),U=N||25!==k[w]||25!==A[w],B=S?j||F||U:N;n({global:!0,constructor:!0,forced:B},{DOMException:B?R:k});var $=i(x),V=$.prototype;for(var q in j&&(S||k===$)&&l(V,"toString",g),F&&b&&k===$&&f(V,"code",L((function(){return P(h(this).name)}))),m)if(p(m,q)){var W=m[q],H=W.s,z=c(6,W.c);p($,H)||u($,H,z),p(V,H)||u(V,H,z)}},31508:(e,t,r)=>{"use strict";var n=r(19882),o=r(98363),i=r(22773),s=r(69199),a=r(86385).f,c=r(24792),u=r(9519),l=r(59250),f=r(654),p=r(45932),d=r(78624),h=r(7493),g=r(21178),v="DOMException",m=i("Error"),y=i(v),_=function(){u(this,b);var e=arguments.length,t=f(e<1?void 0:arguments[0]),r=f(e<2?void 0:arguments[1],"Error"),n=new y(t,r),o=m(t);return o.name=v,a(n,"stack",s(1,d(o.stack,1))),l(n,this,_),n},b=_.prototype=y.prototype,S="stack"in m(v),x="stack"in new y(1,2),w=y&&h&&Object.getOwnPropertyDescriptor(o,v),E=!(!w||w.writable&&w.configurable),k=S&&!E&&!x;n({global:!0,constructor:!0,forced:g||k},{DOMException:k?_:y});var A=i(v),C=A.prototype;if(C.constructor!==A)for(var O in g||a(C,"constructor",s(1,A)),p)if(c(p,O)){var T=p[O],I=T.s;c(A,I)||a(A,I,s(6,T.c))}},38520:(e,t,r)=>{var n=r(22773),o="DOMException";r(60878)(n(o),o)},77194:(e,t,r)=>{r(10449),r(48388)},95739:(e,t,r)=>{var n=r(19882),o=r(98363),i=r(71800),s=r(97676),a=r(27687),c=r(93921),u=o.process;n({global:!0,enumerable:!0,dontCallGetSet:!0},{queueMicrotask:function(e){a(arguments.length,1),s(e);var t=c&&u.domain;i(t?t.bind(e):e)}})},53261:(e,t,r)=>{"use strict";var n=r(19882),o=r(98363),i=r(13600),s=r(7493),a=TypeError,c=Object.defineProperty,u=o.self!==o;try{if(s){var l=Object.getOwnPropertyDescriptor(o,"self");!u&&l&&l.get&&l.enumerable||i(o,"self",{get:function(){return o},set:function(e){if(this!==o)throw a("Illegal invocation");c(o,"self",{value:e,writable:!0,configurable:!0,enumerable:!0})},configurable:!0,enumerable:!0})}else n({global:!0,simple:!0,forced:u},{self:o})}catch(e){}},48388:(e,t,r)=>{var n=r(19882),o=r(98363),i=r(84643).set,s=r(59402),a=o.setImmediate?s(i,!1):i;n({global:!0,bind:!0,enumerable:!0,forced:o.setImmediate!==a},{setImmediate:a})},37343:(e,t,r)=>{var n=r(19882),o=r(98363),i=r(59402)(o.setInterval,!0);n({global:!0,bind:!0,forced:o.setInterval!==i},{setInterval:i})},22091:(e,t,r)=>{var n=r(19882),o=r(98363),i=r(59402)(o.setTimeout,!0);n({global:!0,bind:!0,forced:o.setTimeout!==i},{setTimeout:i})},98364:(e,t,r)=>{var n,o=r(21178),i=r(19882),s=r(98363),a=r(22773),c=r(88697),u=r(79044),l=r(34524),f=r(75277),p=r(31536),d=r(49903),h=r(52786),g=r(66681),v=r(5166),m=r(83875),y=r(36994),_=r(24792),b=r(35039),S=r(45899),x=r(47046),w=r(27687),E=r(22511),k=r(81710),A=r(49916),C=r(67679),O=r(38981),T=s.Object,I=s.Array,P=s.Date,R=s.Error,M=s.EvalError,L=s.RangeError,D=s.ReferenceError,N=s.SyntaxError,j=s.TypeError,F=s.URIError,U=s.PerformanceMark,B=s.WebAssembly,$=B&&B.CompileError||R,V=B&&B.LinkError||R,q=B&&B.RuntimeError||R,W=a("DOMException"),H=k.Map,z=k.has,G=k.get,Z=k.set,K=A.Set,J=A.add,Y=a("Object","keys"),X=c([].push),Q=c((!0).valueOf),ee=c(1..valueOf),te=c("".valueOf),re=c(P.prototype.getTime),ne=l("structuredClone"),oe="DataCloneError",ie="Transferring",se=function(e){return!u((function(){var t=new s.Set([7]),r=e(t),n=e(T(7));return r==t||!r.has(7)||"object"!=typeof n||7!=n}))&&e},ae=function(e,t){return!u((function(){var r=new t,n=e({a:r,b:r});return!(n&&n.a===n.b&&n.a instanceof t&&n.a.stack===r.stack)}))},ce=s.structuredClone,ue=o||!ae(ce,R)||!ae(ce,W)||(n=ce,!!u((function(){var e=n(new s.AggregateError([1],ne,{cause:3}));return"AggregateError"!=e.name||1!=e.errors[0]||e.message!=ne||3!=e.cause}))),le=!ce&&se((function(e){return new U(ne,{detail:e}).detail})),fe=se(ce)||le,pe=function(e){throw new W("Uncloneable type: "+e,oe)},de=function(e,t){throw new W((t||"Cloning")+" of "+e+" cannot be properly polyfilled in this engine",oe)},he=function(e,t){return fe||de(t),fe(e)},ge=function(e,t){if(g(e)&&pe("Symbol"),!h(e))return e;if(t){if(z(t,e))return G(t,e)}else t=new H;var r,n,o,i,c,u,l,p,d,v,m,w=y(e),k=!1;switch(w){case"Array":o=I(x(e)),k=!0;break;case"Object":o={},k=!0;break;case"Map":o=new H,k=!0;break;case"Set":o=new K,k=!0;break;case"RegExp":o=new RegExp(e.source,E(e));break;case"Error":switch(n=e.name){case"AggregateError":o=a("AggregateError")([]);break;case"EvalError":o=M();break;case"RangeError":o=L();break;case"ReferenceError":o=D();break;case"SyntaxError":o=N();break;case"TypeError":o=j();break;case"URIError":o=F();break;case"CompileError":o=$();break;case"LinkError":o=V();break;case"RuntimeError":o=q();break;default:o=R()}k=!0;break;case"DOMException":o=new W(e.message,e.name),k=!0;break;case"DataView":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"BigInt64Array":case"BigUint64Array":r=s[w],h(r)||de(w),o=new r(ge(e.buffer,t),e.byteOffset,"DataView"===w?e.byteLength:e.length);break;case"DOMQuad":try{o=new DOMQuad(ge(e.p1,t),ge(e.p2,t),ge(e.p3,t),ge(e.p4,t))}catch(t){o=he(e,w)}break;case"File":if(fe)try{o=fe(e),y(o)!==w&&(o=void 0)}catch(e){}if(!o)try{o=new File([e],e.name,e)}catch(e){}o||de(w);break;case"FileList":if(i=function(){var e;try{e=new s.DataTransfer}catch(t){try{e=new s.ClipboardEvent("").clipboardData}catch(e){}}return e&&e.items&&e.files?e:null}()){for(c=0,u=x(e);c1&&!d(arguments[1])?m(arguments[1]):void 0,n=r?r.transfer:void 0;return void 0!==n&&function(e,t){if(!h(e))throw j("Transfer option cannot be converted to a sequence");var r=[];v(e,(function(e){X(r,m(e))}));var n,o,i,a,c,u,l=0,d=x(r);if(O)for(a=ce(r,{transfer:r});l{const t=n.fn(...e);return t&&(t.key=n.key),t}:n.fn)}return e}function io(e,t,r={},n,o){if(Nr.isCE||Nr.parent&&kn(Nr.parent)&&Nr.parent.isCE)return"default"!==t&&(r.name=t),Gi("slot",r,n&&n());let i=e[t];i&&i._c&&(i._d=!1),Ri();const s=i&&so(i(r)),a=Ui(Ai,{key:r.key||s&&s.key||`_${t}`},s||(n?n():[]),s&&1===e._?64:-2);return!o&&a.scopeId&&(a.slotScopeIds=[a.scopeId+"-s"]),i&&i._c&&(i._d=!0),a}function so(e){return e.some((e=>!Bi(e)||e.type!==Oi&&!(e.type===Ai&&!so(e.children))))?e:null}function ao(e,t){const r={};for(const n in e)r[t&&/[A-Z]/.test(n)?`on:${n}`:F(n)]=e[n];return r}const co=e=>e?gs(e)?ks(e)||e.proxy:co(e.parent):null,uo=p(Object.create(null),{$:e=>e,$el:e=>e.vnode.el,$data:e=>e.data,$props:e=>e.props,$attrs:e=>e.attrs,$slots:e=>e.slots,$refs:e=>e.refs,$parent:e=>co(e.parent),$root:e=>co(e.root),$emit:e=>e.emit,$options:e=>Lo(e),$forceUpdate:e=>e.f||(e.f=()=>Sr(e.update)),$nextTick:e=>e.n||(e.n=br.bind(e.proxy)),$watch:e=>un.bind(e)}),lo=(e,t)=>e!==i&&!e.__isScriptSetup&&g(e,t),fo={get({_:e},t){const{ctx:r,setupState:n,data:o,props:s,accessCache:a,type:c,appContext:u}=e;let l;if("$"!==t[0]){const c=a[t];if(void 0!==c)switch(c){case 1:return n[t];case 2:return o[t];case 4:return r[t];case 3:return s[t]}else{if(lo(n,t))return a[t]=1,n[t];if(o!==i&&g(o,t))return a[t]=2,o[t];if((l=e.propsOptions[0])&&g(l,t))return a[t]=3,s[t];if(r!==i&&g(r,t))return a[t]=4,r[t];Io&&(a[t]=0)}}const f=uo[t];let p,d;return f?("$attrs"===t&&De(e,0,t),f(e)):(p=c.__cssModules)&&(p=p[t])?p:r!==i&&g(r,t)?(a[t]=4,r[t]):(d=u.config.globalProperties,g(d,t)?d[t]:void 0)},set({_:e},t,r){const{data:n,setupState:o,ctx:s}=e;return lo(o,t)?(o[t]=r,!0):n!==i&&g(n,t)?(n[t]=r,!0):!g(e.props,t)&&(("$"!==t[0]||!(t.slice(1)in e))&&(s[t]=r,!0))},has({_:{data:e,setupState:t,accessCache:r,ctx:n,appContext:o,propsOptions:s}},a){let c;return!!r[a]||e!==i&&g(e,a)||lo(t,a)||(c=s[0])&&g(c,a)||g(n,a)||g(uo,a)||g(o.config.globalProperties,a)},defineProperty(e,t,r){return null!=r.get?e._.accessCache[t]=0:g(r,"value")&&this.set(e,t,r.value,null),Reflect.defineProperty(e,t,r)}};const po=p({},fo,{get(e,t){if(t!==Symbol.unscopables)return fo.get(e,t,e)},has:(e,t)=>"_"!==t[0]&&!G(t)});function ho(){return null}function go(){return null}function vo(e){0}function mo(e){0}function yo(){return null}function _o(){0}function bo(e,t){return null}function So(){return Eo().slots}function xo(){return Eo().attrs}function wo(e,t,r){const n=us();if(r&&r.local){const r=qt(e[t]);return an((()=>e[t]),(e=>r.value=e)),an(r,(r=>{r!==e[t]&&n.emit(`update:${t}`,r)})),r}return{__v_isRef:!0,get value(){return e[t]},set value(e){n.emit(`update:${t}`,e)}}}function Eo(){const e=us();return e.setupContext||(e.setupContext=Es(e))}function ko(e){return v(e)?e.reduce(((e,t)=>(e[t]=null,e)),{}):e}function Ao(e,t){const r=ko(e);for(const e in t){if(e.startsWith("__skip"))continue;let n=r[e];n?v(n)||b(n)?n=r[e]={type:n,default:t[e]}:n.default=t[e]:null===n&&(n=r[e]={default:t[e]}),n&&t[`__skip_${e}`]&&(n.skipFactory=!0)}return r}function Co(e,t){return e&&t?v(e)&&v(t)?e.concat(t):p({},ko(e),ko(t)):e||t}function Oo(e,t){const r={};for(const n in e)t.includes(n)||Object.defineProperty(r,n,{enumerable:!0,get:()=>e[n]});return r}function To(e){const t=us();let r=e();return hs(),E(r)&&(r=r.catch((e=>{throw ds(t),e}))),[r,()=>ds(t)]}let Io=!0;function Po(e){const t=Lo(e),r=e.proxy,n=e.ctx;Io=!1,t.beforeCreate&&Ro(t.beforeCreate,e,"bc");const{data:o,computed:i,methods:s,watch:c,provide:u,inject:l,created:f,beforeMount:p,mounted:d,beforeUpdate:h,updated:g,activated:m,deactivated:y,beforeDestroy:_,beforeUnmount:S,destroyed:x,unmounted:E,render:k,renderTracked:A,renderTriggered:C,errorCaptured:O,serverPrefetch:T,expose:I,inheritAttrs:P,components:R,directives:M,filters:L}=t;if(l&&function(e,t,r=a){v(e)&&(e=Fo(e));for(const r in e){const n=e[r];let o;o=w(n)?"default"in n?Go(n.from||r,n.default,!0):Go(n.from||r):Go(n),Vt(o)?Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>o.value,set:e=>o.value=e}):t[r]=o}}(l,n,null),s)for(const e in s){const t=s[e];b(t)&&(n[e]=t.bind(r))}if(o){0;const t=o.call(r,r);0,w(t)&&(e.data=Ct(t))}if(Io=!0,i)for(const e in i){const t=i[e],o=b(t)?t.bind(r,r):b(t.get)?t.get.bind(r,r):a;0;const s=!b(t)&&b(t.set)?t.set.bind(r):a,c=Os({get:o,set:s});Object.defineProperty(n,e,{enumerable:!0,configurable:!0,get:()=>c.value,set:e=>c.value=e})}if(c)for(const e in c)Mo(c[e],n,r,e);if(u){const e=b(u)?u.call(r):u;Reflect.ownKeys(e).forEach((t=>{zo(t,e[t])}))}function D(e,t){v(t)?t.forEach((t=>e(t.bind(r)))):t&&e(t.bind(r))}if(f&&Ro(f,e,"c"),D(Un,p),D(Bn,d),D($n,h),D(Vn,g),D(Pn,m),D(Rn,y),D(Zn,O),D(Gn,A),D(zn,C),D(qn,S),D(Wn,E),D(Hn,T),v(I))if(I.length){const t=e.exposed||(e.exposed={});I.forEach((e=>{Object.defineProperty(t,e,{get:()=>r[e],set:t=>r[e]=t})}))}else e.exposed||(e.exposed={});k&&e.render===a&&(e.render=k),null!=P&&(e.inheritAttrs=P),R&&(e.components=R),M&&(e.directives=M)}function Ro(e,t,r){ur(v(e)?e.map((e=>e.bind(t.proxy))):e.bind(t.proxy),t,r)}function Mo(e,t,r,n){const o=n.includes(".")?ln(r,n):()=>r[n];if(S(e)){const r=t[e];b(r)&&an(o,r)}else if(b(e))an(o,e.bind(r));else if(w(e))if(v(e))e.forEach((e=>Mo(e,t,r,n)));else{const n=b(e.handler)?e.handler.bind(r):t[e.handler];b(n)&&an(o,n,e)}else 0}function Lo(e){const t=e.type,{mixins:r,extends:n}=t,{mixins:o,optionsCache:i,config:{optionMergeStrategies:s}}=e.appContext,a=i.get(t);let c;return a?c=a:o.length||r||n?(c={},o.length&&o.forEach((e=>Do(c,e,s,!0))),Do(c,t,s)):c=t,w(t)&&i.set(t,c),c}function Do(e,t,r,n=!1){const{mixins:o,extends:i}=t;i&&Do(e,i,r,!0),o&&o.forEach((t=>Do(e,t,r,!0)));for(const o in t)if(n&&"expose"===o);else{const n=No[o]||r&&r[o];e[o]=n?n(e[o],t[o]):t[o]}return e}const No={data:jo,props:$o,emits:$o,methods:Bo,computed:Bo,beforeCreate:Uo,created:Uo,beforeMount:Uo,mounted:Uo,beforeUpdate:Uo,updated:Uo,beforeDestroy:Uo,beforeUnmount:Uo,destroyed:Uo,unmounted:Uo,activated:Uo,deactivated:Uo,errorCaptured:Uo,serverPrefetch:Uo,components:Bo,directives:Bo,watch:function(e,t){if(!e)return t;if(!t)return e;const r=p(Object.create(null),e);for(const n in t)r[n]=Uo(e[n],t[n]);return r},provide:jo,inject:function(e,t){return Bo(Fo(e),Fo(t))}};function jo(e,t){return t?e?function(){return p(b(e)?e.call(this,this):e,b(t)?t.call(this,this):t)}:t:e}function Fo(e){if(v(e)){const t={};for(let r=0;r..
header.
+ * $h = new Header(['size' => 1]); // creates ..
header
*
* Alternatively set content headers. Those will emphasize the text in the context of the section.
*
diff --git a/src/HtmlTemplate.php b/src/HtmlTemplate.php
index 06ccde55da..b44c7757b9 100644
--- a/src/HtmlTemplate.php
+++ b/src/HtmlTemplate.php
@@ -199,14 +199,6 @@ protected function _setOrAppend($tag, string $value = null, bool $encodeHtml = t
* If tag is found inside template several times, all occurrences are
* replaced.
*
- * ALTERNATIVE USE(2) of this function is to pass associative array as
- * a single argument. This will assign multiple tags with one call.
- * Sample use is:
- *
- * set($_GET);
- *
- * would read and set multiple region values from $_GET array.
- *
* @param string|array{$email} password={$password} ', $t->getDataRowHtml());
+ self::assertSame('{$email} password={$password} ', $table->getDataRowHtml());
self::assertSame(
' ',
- $this->extractTableRow($t)
+ $this->extractTableRow($table)
);
}
public function test2(): void
{
- $t = new Table();
- $t->setApp($this->createApp());
- $t->invokeInit();
- $t->setModel($this->m, []);
+ $table = new Table();
+ $table->setApp($this->createApp());
+ $table->invokeInit();
+ $table->setModel($this->m, []);
- $t->addColumn('email');
- $t->addColumn('password', [Table\Column\Password::class]);
+ $table->addColumn('email');
+ $table->addColumn('password', [Table\Column\Password::class]);
- self::assertSame('test@test.com password=abc123 {$email} *** ', $t->getDataRowHtml());
+ self::assertSame('{$email} *** ', $table->getDataRowHtml());
self::assertSame(
' ',
- $this->extractTableRow($t)
+ $this->extractTableRow($table)
);
}
}
diff --git a/tests/ListerTest.php b/tests/ListerTest.php
index ef38e04c75..554bcbb916 100644
--- a/tests/ListerTest.php
+++ b/tests/ListerTest.php
@@ -19,11 +19,11 @@ class ListerTest extends TestCase
*/
public function testListerRender(): void
{
- $v = new View();
- $v->setApp($this->createApp());
- $v->invokeInit();
- $l = Lister::addTo($v, ['defaultTemplate' => 'lister.html']);
- $l->setSource(['foo', 'bar']);
+ $view = new View();
+ $view->setApp($this->createApp());
+ $view->invokeInit();
+ $lister = Lister::addTo($view, ['defaultTemplate' => 'lister.html']);
+ $lister->setSource(['foo', 'bar']);
}
/**
@@ -31,21 +31,21 @@ public function testListerRender(): void
*/
public function testListerRender2(): void
{
- $v = new View(['template' => new HtmlTemplate('hello{list}, world{/list}')]);
- $v->setApp($this->createApp());
- $v->invokeInit();
- $l = Lister::addTo($v, [], ['list']);
- $l->setSource(['foo', 'bar']);
- self::assertSame('hello, world, world', $v->render());
+ $view = new View(['template' => new HtmlTemplate('hello{list}, world{/list}')]);
+ $view->setApp($this->createApp());
+ $view->invokeInit();
+ $lister = Lister::addTo($view, [], ['list']);
+ $lister->setSource(['foo', 'bar']);
+ self::assertSame('hello, world, world', $view->render());
}
public function testAddAfterRender(): void
{
- $v = new View();
- $v->setApp($this->createApp());
- $v->invokeInit();
+ $view = new View();
+ $view->setApp($this->createApp());
+ $view->invokeInit();
$this->expectException(Exception::class);
- Lister::addTo($v);
+ Lister::addTo($view);
}
}
diff --git a/tests/PaginatorTest.php b/tests/PaginatorTest.php
index 1fef6d1e67..c2d84ce0ab 100644
--- a/tests/PaginatorTest.php
+++ b/tests/PaginatorTest.php
@@ -36,7 +36,7 @@ public function providePaginatorCases(): iterable
*/
public function testPaginator(int $page, int $range, int $total, array $expected): void
{
- $p = new Paginator(['page' => $page, 'range' => $range, 'total' => $total]);
- self::assertSame($expected, $p->getPaginatorItems());
+ $paginator = new Paginator(['page' => $page, 'range' => $range, 'total' => $total]);
+ self::assertSame($expected, $paginator->getPaginatorItems());
}
}
diff --git a/tests/TableTest.php b/tests/TableTest.php
index 01ae576f59..b10c0eb0db 100644
--- a/tests/TableTest.php
+++ b/tests/TableTest.php
@@ -17,35 +17,35 @@ class TableTest extends TestCase
*/
public function testAddColumnWithoutModel(): void
{
- $t = new Table();
- $t->setApp($this->createApp());
- $t->invokeInit();
- $t->setSource([
+ $table = new Table();
+ $table->setApp($this->createApp());
+ $table->invokeInit();
+ $table->setSource([
['one' => 1, 'two' => 2, 'three' => 3, 'four' => 4],
['one' => 11, 'two' => 12, 'three' => 13, 'four' => 14],
]);
// 4 ways to add column
- $t->addColumn(null, new Table\Column\Link('test.php?id=1'));
+ $table->addColumn(null, new Table\Column\Link('test.php?id=1'));
// multiple ways to add column which doesn't exist in model
- $t->addColumn('five', new Table\Column\Link('test.php?id=1'));
- $t->addColumn('seven', [Table\Column\Link::class]);
- $t->addColumn('eight', [Table\Column\Link::class, ['id' => 3]]);
- $t->addColumn('nine');
+ $table->addColumn('five', new Table\Column\Link('test.php?id=1'));
+ $table->addColumn('seven', [Table\Column\Link::class]);
+ $table->addColumn('eight', [Table\Column\Link::class, ['id' => 3]]);
+ $table->addColumn('nine');
- $t->render();
+ $table->render();
}
public function testAddColumnAlreadyExistsException(): void
{
- $t = new Table();
- $t->setApp($this->createApp());
- $t->invokeInit();
- $t->addColumn('foo');
+ $table = new Table();
+ $table->setApp($this->createApp());
+ $table->invokeInit();
+ $table->addColumn('foo');
$this->expectException(Exception::class);
$this->expectExceptionMessage('Table column already exists');
- $t->addColumn('foo');
+ $table->addColumn('foo');
}
}
test@test.com ***