Skip to content

Commit

Permalink
pradosoft#872 Added missing class properties and floor($time) for los…
Browse files Browse the repository at this point in the history
…s of precision

From being pushed to upgrade from PHP 8.0 to PHP 8.1+ today, I moved to 8.2.  There were a few minor errors and this patches those errors.
  • Loading branch information
belisoful committed Apr 17, 2023
1 parent 3b20dfa commit 68ef85a
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 3 deletions.
4 changes: 4 additions & 0 deletions debug
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
./vendor/bin/php-cs-fixer fix
./vendor/bin/phpstan analyse framework --memory-limit=512M
composer unittest

2 changes: 1 addition & 1 deletion framework/Util/Cron/TShellCronAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function actionRun($args)
return true;
}
$time = $module->getLastCronTime();
$this->_outWriter->writeLine("\n Last cron run time was " . ($time == 0 ? 'never' : date('Y-m-d H:i:s TP', $time)) . '');
$this->_outWriter->writeLine("\n Last cron run time was " . ($time == 0 ? 'never' : date('Y-m-d H:i:s TP', floor($time))) . '');
$module->processPendingTasks();
return true;
}
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/Util/Cron/TShellCronActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@

class TShellCronActionTest extends PHPUnit\Framework\TestCase
{
protected $obj, $writer;
protected $obj;
protected $writer;

protected function getTestClass()
{
Expand Down
2 changes: 1 addition & 1 deletion tests/unit/Util/Cron/TShellCronLogBehaviorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class TShellCronLogBehaviorTest extends PHPUnit\Framework\TestCase
{
protected $obj;

protected $writer;

protected function setUp(): void
{
Expand Down
1 change: 1 addition & 0 deletions tests/unit/Util/Cron/TShellDbCronActionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
class TShellDbCronActionTest extends PHPUnit\Framework\TestCase
{
protected $obj;
protected $writer;

protected function getTestClass()
{
Expand Down
2 changes: 2 additions & 0 deletions tests/unit/Web/TUriTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ class TUriTest extends PHPUnit\Framework\TestCase
{
const URISTR = 'http://login:p@ssw0rd:[email protected]:80/demos/quickstart/index.php?page=test&param1=test2#anchor';

protected $uri;

protected function setUp(): void
{
$this->uri = new TUri(self::URISTR);
Expand Down

0 comments on commit 68ef85a

Please sign in to comment.