Skip to content

Commit 3f6706e

Browse files
committed
Improve code structure and update dependencies
Reorganizes method calls in CommonExecutor to ensure proper initialization order. Enhances code readability in Job and RunTemplate classes with formatting adjustments. Updates composer dependencies to their latest versions, ensuring compatibility and security. Adds license headers to test files for proper attribution. Refines test cases with improved autoloading checks and additional assertions to validate interface contracts.
1 parent cbdecaa commit 3f6706e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+707
-185
lines changed

.php-cs-fixer.dist.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@
9191
'php_unit_test_case_static_method_calls' => false,
9292
]));
9393

94-
$config = Factory::fromRuleSet($ruleSet);
94+
$config = Factory::fromRuleSet($ruleSet)->setUnsupportedPhpVersionAllowed(true);
9595

9696
$config->getFinder()
9797
->append([

composer.lock

Lines changed: 124 additions & 124 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/MultiFlexi/CommonExecutor.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,9 @@ abstract class CommonExecutor extends \Ease\Sand
3333

3434
public function __construct(Job &$job)
3535
{
36-
$this->setObjectName();
36+
// Initialize environment property first before any other operations
3737
$this->environment = new ConfigFields('Executor'.\Ease\Functions::baseClassName($this));
38+
$this->setObjectName();
3839
$this->setJob($job);
3940
}
4041

src/MultiFlexi/Job.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -866,10 +866,11 @@ public function isScheduled(): int
866866
public function scheduledJobInfo(): array
867867
{
868868
$scheduler = new Scheduler();
869+
869870
return $scheduler->listingQuery()
870871
->where('job', $this->getMyKey())
871872
->leftJoin('job ON job.id = schedule.job')->select(['job.schedule_type'])
872-
->leftJoin('runtemplate ON runtemplate.id = job.runtemplate_id')->select(['runtemplate.name AS runtemplate_name','runtemplate.id AS runtemplate_id', 'runtemplate.last_schedule'])
873+
->leftJoin('runtemplate ON runtemplate.id = job.runtemplate_id')->select(['runtemplate.name AS runtemplate_name', 'runtemplate.id AS runtemplate_id', 'runtemplate.last_schedule'])
873874
->orderBy('scheduled')
874875
->fetchAll();
875876
}

src/MultiFlexi/RunTemplate.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -596,8 +596,9 @@ public function getCredentialsAssigned(): array
596596

597597
return $credentor->listingQuery()->select(['credentials.name AS credential_name', 'credential_type.name AS credential_type_name', 'credential_type.class AS credential_type_class', 'credential_type.uuid AS credential_type_uuid', 'credential_type.logo AS credential_type_logo'])->where('runtemplate_id', $this->getMyKey())->leftJoin('credentials ON credentials.id = runtplcreds.credentials_id')->leftJoin('credential_type ON credential_type.id = credentials.credential_type_id')->fetchAll('credential_type_class');
598598
}
599-
600-
public function isScheduled(\DateTime $startTime): bool {
599+
600+
public function isScheduled(\DateTime $startTime): bool
601+
{
601602
$scheduler = new Scheduler();
602603
$scheduledJobs = $scheduler->listingQuery()
603604
->where('job', $this->getMyKey())
@@ -610,11 +611,11 @@ public function isScheduled(\DateTime $startTime): bool {
610611
public function getScheduledJobs(): array
611612
{
612613
$scheduler = new Scheduler();
614+
613615
return $scheduler->listingQuery()
614616
->where('job', $this->getMyKey())
615617
->leftJoin('runtemplate ON runtemplate.id = job.runtemplate_id')
616618
->select(['runtemplate.name AS runtemplate_name', 'runtemplate.id AS runtemplate_id', 'runtemplate.last_schedule'])
617619
->fetchAll();
618620
}
619-
620621
}

tests/src/MultiFlexi/ActionCustomCommandTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
declare(strict_types=1);
44

5+
/**
6+
* This file is part of the MultiFlexi package
7+
*
8+
* https://multiflexi.eu/
9+
*
10+
* (c) Vítězslav Dvořák <http://vitexsoftware.com>
11+
*
12+
* For the full copyright and license information, please view the LICENSE
13+
* file that was distributed with this source code.
14+
*/
15+
516
namespace Test\MultiFlexi;
617

718
use MultiFlexi\Action\CustomCommand;

tests/src/MultiFlexi/ActionGithubTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
declare(strict_types=1);
44

5+
/**
6+
* This file is part of the MultiFlexi package
7+
*
8+
* https://multiflexi.eu/
9+
*
10+
* (c) Vítězslav Dvořák <http://vitexsoftware.com>
11+
*
12+
* For the full copyright and license information, please view the LICENSE
13+
* file that was distributed with this source code.
14+
*/
15+
516
namespace Test\MultiFlexi;
617

718
use MultiFlexi\Action\Github;

tests/src/MultiFlexi/ActionLaunchJobTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
declare(strict_types=1);
44

5+
/**
6+
* This file is part of the MultiFlexi package
7+
*
8+
* https://multiflexi.eu/
9+
*
10+
* (c) Vítězslav Dvořák <http://vitexsoftware.com>
11+
*
12+
* For the full copyright and license information, please view the LICENSE
13+
* file that was distributed with this source code.
14+
*/
15+
516
namespace Test\MultiFlexi;
617

718
use MultiFlexi\Action\LaunchJob;

tests/src/MultiFlexi/ActionRedmineIssueTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
declare(strict_types=1);
44

5+
/**
6+
* This file is part of the MultiFlexi package
7+
*
8+
* https://multiflexi.eu/
9+
*
10+
* (c) Vítězslav Dvořák <http://vitexsoftware.com>
11+
*
12+
* For the full copyright and license information, please view the LICENSE
13+
* file that was distributed with this source code.
14+
*/
15+
516
namespace Test\MultiFlexi;
617

718
use MultiFlexi\Action\RedmineIssue;

tests/src/MultiFlexi/ActionRescheduleTest.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,17 @@
22

33
declare(strict_types=1);
44

5+
/**
6+
* This file is part of the MultiFlexi package
7+
*
8+
* https://multiflexi.eu/
9+
*
10+
* (c) Vítězslav Dvořák <http://vitexsoftware.com>
11+
*
12+
* For the full copyright and license information, please view the LICENSE
13+
* file that was distributed with this source code.
14+
*/
15+
516
namespace Test\MultiFlexi;
617

718
use MultiFlexi\Action\Reschedule;

0 commit comments

Comments
 (0)