Skip to content

Commit 62bd639

Browse files
ata-no-oneRenovate Botunglaublicherdude
authored
Update all major dependencies (major) (#53)
* Update all major dependencies * adjust composer.json and build script * add php 8.1 to tbe build matrix * add support for php 8.4 * try tests with original php image * try the bitnami php image * remove composer.lock file * remove the platfrom statement so it can install a lower phpunit version for php 8.1 * illuminate container can conditionally also install a lower version for php 8.1 * add php 8.1 again * remove composer.lock file * also allow a lower symfony finder version * some working tests of the client implementation, still have to verify via wordpres ui * remove composer.lock * fix scoper problems, remove credentials * remove composer.lock file * use vaas password secret * fix initialization problem --------- Co-authored-by: Renovate Bot <[email protected]> Co-authored-by: Matthias Simonis <[email protected]>
1 parent 2753091 commit 62bd639

28 files changed

+607
-5113
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
{
44
"name": "PHP",
55
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
6-
"image": "mcr.microsoft.com/devcontainers/php:1-8.2-bullseye",
6+
"image": "mcr.microsoft.com/devcontainers/php:1-8.3-bullseye",
77
"customizations": {
88
"vscode": {
99
"extensions": [

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,5 @@
2424
LICENSE
2525
README.md
2626
wordpress/**
27-
svn/**
27+
svn/**
28+
composer.lock

.github/workflows/github-release.yaml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,11 +45,16 @@ jobs:
4545
fi
4646
4747
test:
48+
strategy:
49+
matrix:
50+
php-version: ["8.1", "8.2", "8.3", "8.4"]
51+
env:
52+
VAAS_PASSWORD: ${{ secrets.VAAS_PASSWORD }}
4853
runs-on: ubuntu-latest
4954
container:
50-
image: mcr.microsoft.com/devcontainers/php:1-8.2-bullseye
55+
image: bitnami/php-fpm:${{ matrix.php-version }}
5156
steps:
52-
- uses: actions/checkout@v4
57+
- uses: actions/checkout@v4
5358
- name: composer install
5459
run: composer install
5560
- name: phpunit

.phpunit.result.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"version":1,"defects":{"Gdatacyberdefenseag\\GdataAntivirus\\tests\\unittests\\ScanClientTest::testScanFunction":7,"Gdatacyberdefenseag\\GdataAntivirus\\tests\\unittests\\GdataAntivirusTest::testDependencyInjection":8},"times":{"Gdatacyberdefenseag\\GdataAntivirus\\tests\\unittests\\GdataAntivirusTest::testDependencyInjection":0.01,"Gdatacyberdefenseag\\GdataAntivirus\\tests\\unittests\\ScanClientTest::testScanFunction":0.537,"Gdatacyberdefenseag\\GdataAntivirus\\tests\\unittests\\VaasOptionsTest::test_credentials_configured_when_ROPG_credentials_are_correct_configured_returns_true":0,"Gdatacyberdefenseag\\GdataAntivirus\\tests\\unittests\\VaasOptionsTest::test_credentials_configured_when_CCG_credentials_are_correct_configured_returns_true":0,"Gdatacyberdefenseag\\GdataAntivirus\\tests\\unittests\\VaasOptionsTest::test_credentials_configured_when_ROPG_credentials_are_incorrect_configured_returns_false":0,"Gdatacyberdefenseag\\GdataAntivirus\\tests\\unittests\\VaasOptionsTest::test_credentials_configured_when_CCG_credentials_are_incorrect_configured_returns_false":0,"Gdatacyberdefenseag\\GdataAntivirus\\tests\\unittests\\VaasOptionsTest::test_credentials_configured_when_CCG_credentials_one_option_missing_configured_returns_false":0,"Gdatacyberdefenseag\\GdataAntivirus\\tests\\unittests\\VaasOptionsTest::test_credentials_configured_when_ROPG_credentials_one_option_missing_configured_returns_false":0}}

GdataAntivirusPlugin.php

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,10 @@
1919
use Psr\Log\NullLogger;
2020

2121
if (! class_exists('GdataAntivirusPlugin')) {
22-
class GdataAntivirusPlugin extends Container {
23-
public function __construct( LoggerInterface $logger = new NullLogger() ) {
22+
class GdataAntivirusPlugin extends Container
23+
{
24+
public function __construct(LoggerInterface $logger = new NullLogger())
25+
{
2426
$logger->info('GdataAntivirusPlugin::__construct');
2527
$this->singleton(FindingsMenuPage::class, FindingsMenuPage::class);
2628
$this->singleton(FullScanMenuPage::class, FullScanMenuPage::class);
@@ -31,10 +33,13 @@ public function __construct( LoggerInterface $logger = new NullLogger() ) {
3133
$this->singleton(GdataAntivirusMenuPage::class, GdataAntivirusMenuPage::class);
3234
$this->singleton(ScanClient::class, ScanClient::class);
3335
$this->singleton(AdminNotices::class, AdminNotices::class);
34-
$this->singleton(LoggerInterface::class, function () use ( $logger ) {
36+
$this->singleton(LoggerInterface::class, function () use ($logger) {
3537
return $logger;
3638
});
39+
}
3740

41+
public function start()
42+
{
3843
$this->make(GdataAntivirusMenuPage::class);
3944
$findings_menu = $this->make(FindingsMenuPage::class);
4045
$this->make(FullScanMenuPage::class);

PluginPage/AdminNotices.php

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,29 @@
55
use Psr\Log\LoggerInterface;
66

77
if (! class_exists('AdminNotices')) {
8-
class AdminNotices {
8+
class AdminNotices implements AdminNoticesInterface
9+
{
910
private static $notices = array();
1011

11-
public function __construct( LoggerInterface $logger ) {
12+
public function __construct(LoggerInterface $logger)
13+
{
1214
$logger->info('AdminNotices::__construct');
13-
add_action('admin_notices', array( $this, 'output_notices' ));
14-
add_action('shutdown', array( $this, 'save_notices' ));
15+
add_action('admin_notices', array($this, 'output_notices'));
16+
add_action('shutdown', array($this, 'save_notices'));
1517
}
1618

17-
public static function add_notice( $text ) {
19+
public static function add_notice(string $text): void
20+
{
1821
self::$notices[] = $text;
1922
}
2023

21-
public function save_notices() {
24+
public function save_notices(): void
25+
{
2226
update_option('gdatacyberdefenseag_antivirus_notices', self::$notices);
2327
}
2428

25-
public function output_notices() {
29+
public function output_notices(): void
30+
{
2631
$notices = maybe_unserialize(get_option('gdatacyberdefenseag_antivirus_notices'));
2732

2833
if (! empty($notices)) {
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
namespace Gdatacyberdefenseag\GdataAntivirus\PluginPage;
4+
5+
interface AdminNoticesInterface
6+
{
7+
public static function add_notice(string $text): void;
8+
public function save_notices(): void;
9+
public function output_notices(): void;
10+
}

0 commit comments

Comments
 (0)