Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,8 @@ data/*.txt
.buildpath
.project
.settings/*
test/php-code-style/vendor
.php-cs-fixer.cache
.phpunit.result.cache
phpstan_results.xml

21 changes: 18 additions & 3 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,35 @@ pipeline {
}
}

stage('phpunit tests') {
stage('code style tests') {
steps {
script {
sh 'mkdir logs'
sh 'php vendor/bin/phpunit --log-junit logs/phpunit_results.xml --configuration test/phpunit.xml --teamcity '
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'bash test/php-code-style/validate.sh'
}
}
}
}

stage('phpstan tests') {
steps {
script {
catchError(buildResult: 'SUCCESS', stageResult: 'FAILURE') {
sh 'mkdir -p logs'
if ("${phpstan_level}" == ""){
def phpstan_level = "1";
}
sh 'vendor/bin/phpstan analyse -l ${phpstan_level} --error-format=junit > logs/phpstan_results.xml'
}
}
}
}

stage('phpunit tests') {
steps {
script {
sh 'mkdir -p logs'
sh 'php vendor/bin/phpunit --log-junit logs/phpunit_results.xml --configuration test/phpunit.xml --teamcity '
}
}
}
Expand Down
7 changes: 4 additions & 3 deletions core/collectionplan.class.inc.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

// Copyright (C) 2022 Combodo SARL
//
// This application is free software; you can redistribute it and/or modify
Expand All @@ -21,7 +22,7 @@
abstract class CollectionPlan
{
// Instance of the collection plan
static protected $oCollectionPlan;
protected static $oCollectionPlan;

public function __construct()
{
Expand Down Expand Up @@ -58,7 +59,7 @@ public function GetSortedLaunchSequence(): array
$aCollectorsLaunchSequence = Utils::GetConfigurationValue('collectors_launch_sequence', []);
$aExtensionsCollectorsLaunchSequence = Utils::GetConfigurationValue('extensions_collectors_launch_sequence', []);
$aCollectorsLaunchSequence = array_merge($aCollectorsLaunchSequence, $aExtensionsCollectorsLaunchSequence);
$aRank=[];
$aRank = [];
if (!empty($aCollectorsLaunchSequence)) {
// Sort sequence
$aSortedCollectorsLaunchSequence = [];
Expand Down Expand Up @@ -135,7 +136,7 @@ public function AddCollectorsToOrchestrator(): bool

/** @var Collector $oCollector */
// Instantiate collector
$oCollector = new $sCollectorName;
$oCollector = new $sCollectorName();
$oCollector->Init();
if ($oCollector->CheckToLaunch($aOrchestratedCollectors)) {
Utils::Log(LOG_INFO, $sCollectorName.' will be launched !');
Expand Down
Loading