Skip to content

Commit 8ea8d67

Browse files
committed
ci: ship patch file instead of always downloading
fixes flakyness through rate limitation Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
1 parent 68b29b0 commit 8ea8d67

File tree

3 files changed

+83
-1
lines changed

3 files changed

+83
-1
lines changed

.patches/php-saml-600.patch

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
SPDX-FileCopyrightText: 2024 Nextcloud GmbH
2+
SPDX-License-Identifier: MIT
3+
From 3628572e9916f747a450484c35c51a5164b00c54 Mon Sep 17 00:00:00 2001
4+
From: Arthur Schiwon <blizzz@arthur-schiwon.de>
5+
Date: Fri, 8 Nov 2024 18:05:46 +0100
6+
Subject: [PATCH] Include PHP 8.4 test coverage
7+
8+
- also fixes deprecations on implicit null
9+
10+
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
11+
---
12+
.github/workflows/php-package.yml | 6 +++---
13+
src/Saml2/Auth.php | 2 +-
14+
src/Saml2/Settings.php | 2 +-
15+
src/Saml2/Utils.php | 2 +-
16+
4 files changed, 6 insertions(+), 6 deletions(-)
17+
18+
diff --git a/.github/workflows/php-package.yml b/.github/workflows/php-package.yml
19+
index 7840700a..6321b7ef 100644
20+
--- a/.github/workflows/php-package.yml
21+
+++ b/.github/workflows/php-package.yml
22+
@@ -16,7 +16,7 @@ jobs:
23+
fail-fast: false
24+
matrix:
25+
operating-system: ['ubuntu-latest']
26+
- php-versions: [7.3, 7.4, 8.0, 8.1, 8.2, 8.3]
27+
+ php-versions: [7.3, 7.4, 8.0, 8.1, 8.2, 8.3, 8.4]
28+
steps:
29+
- name: Setup PHP, with composer and extensions
30+
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
31+
@@ -46,9 +46,9 @@ jobs:
32+
php vendor/bin/phploc src/.
33+
mkdir -p tests/build/dependences
34+
php vendor/bin/pdepend --summary-xml=tests/build/logs/dependence-summary.xml --jdepend-chart=tests/build/dependences/jdepend.svg --overview-pyramid=tests/build/dependences/pyramid.svg src/.
35+
-
36+
+
37+
- name: PHP Code Sniffer
38+
run: php vendor/bin/phpcs --standard=tests/ZendModStandard src/Saml2 demo1 demo2 endpoints tests/src
39+
-
40+
+
41+
- name: Run unit tests
42+
run: vendor/bin/phpunit --verbose --debug
43+
diff --git a/src/Saml2/Auth.php b/src/Saml2/Auth.php
44+
index 35037031..a860b358 100644
45+
--- a/src/Saml2/Auth.php
46+
+++ b/src/Saml2/Auth.php
47+
@@ -171,7 +171,7 @@ class Auth
48+
* @throws Exception
49+
* @throws Error
50+
*/
51+
- public function __construct(array $settings = null, bool $spValidationOnly = false)
52+
+ public function __construct(?array $settings = null, bool $spValidationOnly = false)
53+
{
54+
$this->_settings = new Settings($settings, $spValidationOnly);
55+
}
56+
diff --git a/src/Saml2/Settings.php b/src/Saml2/Settings.php
57+
index 0ca095a9..c750608e 100644
58+
--- a/src/Saml2/Settings.php
59+
+++ b/src/Saml2/Settings.php
60+
@@ -120,7 +120,7 @@ class Settings
61+
* @throws Error If any settings parameter is invalid
62+
* @throws Exception If Settings is incorrectly supplied
63+
*/
64+
- public function __construct(array $settings = null,bool $spValidationOnly = false)
65+
+ public function __construct(?array $settings = null,bool $spValidationOnly = false)
66+
{
67+
$this->_spValidationOnly = $spValidationOnly;
68+
$this->_loadPaths();
69+
diff --git a/src/Saml2/Utils.php b/src/Saml2/Utils.php
70+
index eea057ff..5742a063 100644
71+
--- a/src/Saml2/Utils.php
72+
+++ b/src/Saml2/Utils.php
73+
@@ -954,7 +954,7 @@ public static function getExpireTime($cacheDuration = null, $validUntil = null)
74+
*
75+
* @return DOMNodeList The queried nodes
76+
*/
77+
- public static function query(DOMDocument $dom, $query, DOMElement $context = null)
78+
+ public static function query(DOMDocument $dom, $query, ?DOMElement $context = null)
79+
{
80+
$xpath = new DOMXPath($dom);
81+
$xpath->registerNamespace('samlp', Constants::NS_SAMLP);

Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ appstore: clean
3333
--exclude=.github \
3434
--exclude=.gitignore \
3535
--exclude=.git-blame-ignore-revs \
36+
--exclude=.patches \
3637
--exclude=.php-cs-fixer.dist.php \
3738
--exclude=.scrutinizer.yml \
3839
--exclude=.travis.yml \

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
"extra": {
1515
"patches": {
1616
"onelogin/php-saml": {
17-
"PHP 8.4 compatibility": "https://patch-diff.githubusercontent.com/raw/SAML-Toolkits/php-saml/pull/600.patch"
17+
"PHP 8.4 compatibility": ".patches/php-saml-600.patch"
1818
}
1919
},
2020
"bamarni-bin": {

0 commit comments

Comments
 (0)