Skip to content

Commit

Permalink
Accept only string|null as template value strictly (#1989)
Browse files Browse the repository at this point in the history
  • Loading branch information
mvorisek authored Jan 31, 2023
1 parent b113eb5 commit f288153
Show file tree
Hide file tree
Showing 25 changed files with 449 additions and 468 deletions.
1 change: 0 additions & 1 deletion demos/basic/columns.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
/** @var View $boxClass */
$boxClass = AnonymousClassNameCache::get_class(fn () => new class() extends View {
public $ui = 'segment';
public $content = false;

protected function init(): void
{
Expand Down
2 changes: 1 addition & 1 deletion demos/basic/label.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@

$seg = View::addTo($app, ['ui' => 'segment']);
Header::addTo($seg, ['Label Group']);
$labels = View::addTo($seg, [false, 'class.tag' => true, 'ui' => 'labels']);
$labels = View::addTo($seg, ['class.tag' => true, 'ui' => 'labels']);
Label::addTo($seg, ['$9.99']);
Label::addTo($seg, ['$19.99']);
Label::addTo($seg, ['$24.99']);
Expand Down
4 changes: 2 additions & 2 deletions demos/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

Header::addTo($app)->set('Welcome to Agile Toolkit Demo!');

$t = Text::addTo(View::addTo($app, [false, 'class.green' => true, 'ui' => 'segment']));
$t = Text::addTo(View::addTo($app, ['class.green' => true, 'ui' => 'segment']));
$t->addParagraph('Take a quick stroll through some of the amazing features of Agile Toolkit.');

Button::addTo($app, ['Begin the demo..', 'class.huge primary fluid' => true, 'iconRight' => 'right arrow'])
->link('tutorial/intro.php');

Header::addTo($app)->set('What is new in Agile Toolkit');

$t = Text::addTo(View::addTo($app, [false, 'class.green' => true, 'ui' => 'segment']));
$t = Text::addTo(View::addTo($app, ['class.green' => true, 'ui' => 'segment']));
$t->addParagraph('In this version of Agile Toolkit we introduce "User Actions"!');

Button::addTo($app, ['Learn about User Actions', 'class.huge basic primary fluid' => true, 'iconRight' => 'right arrow'])
Expand Down
2 changes: 1 addition & 1 deletion demos/interactive/popup.php
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ public function linkCart(View $cart, $jsAction = null): void

// Label now can be added referencing Cart's items. Init() was colled when I added it into app, so the
// item property is populated.
$cartOutterLabel = Label::addTo($cartItem, [count($cart->items), 'class.floating red' => true]);
$cartOutterLabel = Label::addTo($cartItem, [(string) count($cart->items), 'class.floating red' => true]);
if (!$cart->items) {
$cartOutterLabel->setStyle('display', 'none');
}
Expand Down
2 changes: 1 addition & 1 deletion docs/icon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ Here is the code with comments::

if (is_null($this->social)) {
$this->social = $this->content;
$this->content = 'Add on '.ucwords($this->content);
$this->content = 'Add on ' . ucwords($this->content);
}

if (!$this->social) {
Expand Down
2 changes: 1 addition & 1 deletion docs/label.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Groups
Label can be part of the group, but you would need to either use custom HTML template or
composition::

$group = View::addTo($app, [false, 'class.blue tag' => true, 'ui' => 'labels']);
$group = View::addTo($app, ['class.blue tag' => true, 'ui' => 'labels']);
Label::addTo($group, ['$9.99']);
Label::addTo($group, ['$19.99', 'class.red tag' => true]);
Label::addTo($group, ['$24.99']);
Expand Down
2 changes: 1 addition & 1 deletion docs/popup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Popup can also operate with dynamic content::

$button = Button::addTo($app, ['Click me']);
Popup::addTo($app, [$button])
->set('hello world with rand='.rand(1, 100));
->set('hello world with rand=' . rand(1, 100));

Pop-up should be added into a viewport which will define boundaries of a pop-up, but it will
be positioned relative to the $button. Popup remains invisible until it's triggered by event of $button.
Expand Down
2 changes: 1 addition & 1 deletion docs/sticky.rst
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Sticky GET is a better approach. It works like this::

Loader::addTo($app)->set(function (Loader $p) {
Console::addTo($p)->set(function (Console $console) {
$console->output('client_id = !'. $_GET['client_id']);
$console->output('client_id = !' . $_GET['client_id']);
});
});

Expand Down
281 changes: 140 additions & 141 deletions js/package-lock.json

Large diffs are not rendered by default.

118 changes: 62 additions & 56 deletions public/external/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f288153

Please sign in to comment.