Skip to content

Commit 70ea81e

Browse files
committed
phpstan used
1 parent 8b21655 commit 70ea81e

File tree

13 files changed

+619
-62
lines changed

13 files changed

+619
-62
lines changed

Examples/liveage.php

Lines changed: 30 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,35 @@
1717

1818
$oPage = new \Ease\WebPage();
1919

20-
$oPage->addItem(new \Ease\Html\Widgets\Toggle('tog1', 'a'));
21-
$oPage->addItem(new \Ease\Html\Widgets\ToggleRounded('tog2', 'b'));
20+
\Ease\Part::jQueryze();
21+
date_default_timezone_set('Europe/Prague');
22+
23+
$now = new DateTime();
24+
$oPage->addItem(new \Ease\Html\H1Tag('LiveAge Widget'));
25+
$oPage->addItem($now->format('Y-m-d H:i:s').'<br>');
26+
$oPage->addItem(new \Ease\Html\Widgets\LiveAge($now,['title'=>'now']));
27+
28+
$oneminute = new DateTime();
29+
$oPage->addItem(new \Ease\Html\H2Tag('LiveAge Widget +1 minute'));
30+
$oneminute->modify('+1 minute');
31+
$oPage->addItem($oneminute->format('Y-m-d H:i:s').'<br>');
32+
$oPage->addItem(new \Ease\Html\Widgets\LiveAge($oneminute,['title'=>'+1 minute']));
33+
34+
$fiveminutes = new DateTime();
35+
$oPage->addItem(new \Ease\Html\H2Tag('LiveAge Widget +5 minutes'));
36+
$fiveminutes->modify('+5 minutes');
37+
$oPage->addItem( $fiveminutes->format('Y-m-d H:i:s').'<br>');
38+
$oPage->addItem(new \Ease\Html\Widgets\LiveAge($fiveminutes,['title'=>'+5 minutes']));
39+
40+
$fifteenminutes = new DateTime();
41+
$oPage->addItem(new \Ease\Html\H2Tag('LiveAge Widget -15 minutes'));
42+
$fifteenminutes->modify('-15 minutes');
43+
$oPage->addItem( $fifteenminutes->format('Y-m-d H:i:s').'<br>');
44+
$oPage->addItem(new \Ease\Html\Widgets\LiveAge($fifteenminutes,['title'=>'-15 minutes']));
45+
46+
$yesterday = new DateTime('yesterday 13:00');
47+
$oPage->addItem(new \Ease\Html\H2Tag('LiveAge Widget Yesterday 13:00'));
48+
$oPage->addItem($yesterday->format('Y-m-d H:i:s').'<br>');
49+
$oPage->addItem(new \Ease\Html\Widgets\LiveAge($yesterday,['title'=>'Yesterday 13:00']));
2250

2351
echo $oPage;

debian/changelog

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,15 @@
11
php-vitexsoftware-ease-html-widgets (1.1.0) UNRELEASED; urgency=medium
22

3+
* Semafor Light added
4+
5+
-- vitex <info@vitexsoftware.cz> Sat, 16 Nov 2024 12:59:37 +0100
6+
7+
php-vitexsoftware-ease-html-widgets (1.1.0) unstable; urgency=medium
8+
9+
[ vitezslav.dvorak@spojenet.cz ]
310
* Semantic versioning of depse
411

5-
-- <vitezslav.dvorak@spojenet.cz> Fri, 15 Nov 2024 19:40:43 +0100
12+
-- vitex <info@vitexsoftware.cz> Sat, 16 Nov 2024 12:59:03 +0100
613

714
php-vitexsoftware-ease-html-widgets (0.1.0) unstable; urgency=low
815

debian/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "deb/ease-html-widgets",
33
"description": "Addons for PHP Framework (debianized)",
4-
"version": "0.1.0",
4+
"version": "1.1.0",
55
"authors": [
66
{
77
"name": "Vítězslav Dvořák",

semafor.svg

Lines changed: 225 additions & 0 deletions
Loading

src/Ease/Html/Widgets/BrowsingHistory.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ class BrowsingHistory extends \Ease\Html\DivTag
2626
/**
2727
* Show history of visited pages in app.
2828
*
29-
* @param mixed $content
30-
* @param array $properties
29+
* @param array<string> $histrory Array of visited pages
30+
* @param array<string,string> $properties Additional properties
3131
*/
32-
public function __construct($content = null, $properties = null)
32+
public function __construct(array $histrory = [], array $properties = [])
3333
{
34-
$webPage = \Ease\Shared::webPage();
34+
$webPage = \Ease\WebPage::singleton();
3535

3636
if (null === $properties) {
3737
$properties = [];

src/Ease/Html/Widgets/LangLinks.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,11 @@
2222
*/
2323
class LangLinks extends \Ease\Html\UlTag
2424
{
25-
public function __construct($properties = [])
25+
/**
26+
* Language Selector.
27+
* @param array<string,string> $properties
28+
*/
29+
public function __construct(array $properties = [])
2630
{
2731
parent::__construct(null, $properties);
2832
$locale = \Ease\Locale::singleton();

src/Ease/Html/Widgets/LangSelect.php

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,13 @@
2222
*/
2323
class LangSelect extends \Ease\Html\SelectTag
2424
{
25-
public function __construct($name = 'lang', $properties = [])
25+
/**
26+
* Language Selector.
27+
*
28+
* @param string $name Input Name
29+
* @param array<string,string> $properties Additional properties
30+
*/
31+
public function __construct(string $name = 'lang', array $properties = [])
2632
{
2733
parent::__construct($name, $properties);
2834
$locale = \Ease\Locale::singleton();
@@ -31,12 +37,12 @@ public function __construct($name = 'lang', $properties = [])
3137
$name = substr($name, 0, strpos($name, ' ('));
3238

3339
if (\Ease\Locale::$localeUsed === $code) {
34-
$this->addItemSmart(new \Ease\Html\StrongTag(new \Ease\Html\ATag(
40+
$this->addItem(new \Ease\Html\StrongTag(new \Ease\Html\ATag(
3541
'?locale='.$code,
3642
$name,
3743
)));
3844
} else {
39-
$this->addItemSmart(new \Ease\Html\ATag('?locale='.$code, $name));
45+
$this->addItem(new \Ease\Html\ATag('?locale='.$code, $name));
4046
}
4147
}
4248
}

0 commit comments

Comments
 (0)