From 6264c88f25dc8f314f1ac461041ca078c66266ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Wed, 4 Sep 2024 09:14:59 +0200 Subject: [PATCH 1/5] Add PHP 8.3 and 8.4 to test matrix --- .github/workflows/test.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ee763841..6f07983d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,6 +24,10 @@ jobs: phpunit: '9' - php: '8.2' phpunit: '9' + - php: '8.3' + phpunit: '9' + - php: '8.4' + phpunit: '9' steps: - uses: actions/checkout@v2 - uses: php-actions/composer@v6 From 77309b6a7f304a5f9e351bc52d8adc831989734f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Anne?= Date: Wed, 4 Sep 2024 09:15:38 +0200 Subject: [PATCH 2/5] Fix `Implicitly marking parameter $param as nullable is deprecated` --- source/CAS.php | 8 ++++---- source/CAS/Client.php | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/source/CAS.php b/source/CAS.php index df6bc825..bf75c551 100644 --- a/source/CAS.php +++ b/source/CAS.php @@ -338,7 +338,7 @@ class phpCAS * @param bool $changeSessionID Allow phpCAS to change the session_id * (Single Sign Out/handleLogoutRequests * is based on that change) - * @param \SessionHandlerInterface $sessionHandler the session handler + * @param \SessionHandlerInterface|null $sessionHandler the session handler * * @return void a newly created CAS_Client object * @note Only one of the phpCAS::client() and phpCAS::proxy functions should be @@ -347,7 +347,7 @@ class phpCAS */ public static function client($server_version, $server_hostname, $server_port, $server_uri, $service_base_url, - $changeSessionID = true, \SessionHandlerInterface $sessionHandler = null + $changeSessionID = true, ?\SessionHandlerInterface $sessionHandler = null ) { phpCAS :: traceBegin(); if (is_object(self::$_PHPCAS_CLIENT)) { @@ -393,7 +393,7 @@ public static function client($server_version, $server_hostname, * @param bool $changeSessionID Allow phpCAS to change the session_id * (Single Sign Out/handleLogoutRequests * is based on that change) - * @param \SessionHandlerInterface $sessionHandler the session handler + * @param \SessionHandlerInterface|null $sessionHandler the session handler * * @return void a newly created CAS_Client object * @note Only one of the phpCAS::client() and phpCAS::proxy functions should be @@ -402,7 +402,7 @@ public static function client($server_version, $server_hostname, */ public static function proxy($server_version, $server_hostname, $server_port, $server_uri, $service_base_url, - $changeSessionID = true, \SessionHandlerInterface $sessionHandler = null + $changeSessionID = true, ?\SessionHandlerInterface $sessionHandler = null ) { phpCAS :: traceBegin(); if (is_object(self::$_PHPCAS_CLIENT)) { diff --git a/source/CAS/Client.php b/source/CAS/Client.php index 8ca9711f..294eda44 100644 --- a/source/CAS/Client.php +++ b/source/CAS/Client.php @@ -926,7 +926,7 @@ public function getAuthenticationCallerMethod () * CAS_ServiceBaseUrl_Interface for custom * behavior. Added in 1.6.0. Similar to * serverName config in other CAS clients. - * @param \SessionHandlerInterface $sessionHandler the session handler + * @param \SessionHandlerInterface|null $sessionHandler the session handler * * @return self a newly created CAS_Client object */ @@ -938,7 +938,7 @@ public function __construct( $server_uri, $service_base_url, $changeSessionID = true, - \SessionHandlerInterface $sessionHandler = null + ?\SessionHandlerInterface $sessionHandler = null ) { // Argument validation if (gettype($server_version) != 'string') From 73ab961d79ecf91ffd256c134b95ac8541b4ecc3 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 1 Dec 2025 23:44:52 +0100 Subject: [PATCH 3/5] Fix `E_DEPRECATED messages when running against PHP 8.5` Fixes https://github.com/apereo/phpCAS/issues/448 --- source/CAS/Request/CurlMultiRequest.php | 7 ++++++- source/CAS/Request/CurlRequest.php | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/source/CAS/Request/CurlMultiRequest.php b/source/CAS/Request/CurlMultiRequest.php index 850f6f0e..18a810ef 100644 --- a/source/CAS/Request/CurlMultiRequest.php +++ b/source/CAS/Request/CurlMultiRequest.php @@ -139,7 +139,12 @@ public function send () $buf = curl_multi_getcontent($handles[$i]); $request->_storeResponseBody($buf); curl_multi_remove_handle($multiHandle, $handles[$i]); - curl_close($handles[$i]); + if (PHP_VERSION_ID < 80000) { + curl_close($handles[$i]); + } else { + // unreference it => it will be closed + unset($handles[$i]); + } } curl_multi_close($multiHandle); diff --git a/source/CAS/Request/CurlRequest.php b/source/CAS/Request/CurlRequest.php index e30dd0d1..ac7f0ec9 100644 --- a/source/CAS/Request/CurlRequest.php +++ b/source/CAS/Request/CurlRequest.php @@ -86,7 +86,9 @@ protected function sendRequest () } // close the CURL session - curl_close($ch); + if (PHP_VERSION_ID < 80000) { + curl_close($ch); + } phpCAS::traceEnd($res); return $res; From f5adfdd307f522ff121423679f17cc3c1f6ea443 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 2 Dec 2025 12:30:34 +0100 Subject: [PATCH 4/5] Fix `E_DEPRECATED messages when running against PHP 8.5` Fixes https://github.com/apereo/phpCAS/issues/448 --- source/CAS/Client.php | 4 ++-- test/CAS/Tests/CallbackTest.php | 6 ++++-- test/CAS/Tests/CookieJarTest.php | 30 +++++++++++++++--------------- test/CAS/Tests/ProxyChainsTest.php | 25 +++++++++++++------------ 4 files changed, 34 insertions(+), 31 deletions(-) diff --git a/source/CAS/Client.php b/source/CAS/Client.php index 294eda44..7f7c7d11 100644 --- a/source/CAS/Client.php +++ b/source/CAS/Client.php @@ -788,7 +788,7 @@ public function markAuthenticationCall ($auth) 'file' => $dbg[1]['file'], 'line' => $dbg[1]['line'], 'method' => $dbg[1]['class'] . '::' . $dbg[1]['function'], - 'result' => (boolean)$auth + 'result' => (bool)$auth ); } private $_authentication_caller; @@ -3166,7 +3166,7 @@ public function getProxiedService ($type) $proxiedService->setCasClient($this); } return $proxiedService; - case PHPCAS_PROXIED_SERVICE_IMAP; + case PHPCAS_PROXIED_SERVICE_IMAP: $proxiedService = new CAS_ProxiedService_Imap($this->_getUser()); if ($proxiedService instanceof CAS_ProxiedService_Testable) { $proxiedService->setCasClient($this); diff --git a/test/CAS/Tests/CallbackTest.php b/test/CAS/Tests/CallbackTest.php index 465135d9..4626bd9a 100644 --- a/test/CAS/Tests/CallbackTest.php +++ b/test/CAS/Tests/CallbackTest.php @@ -73,7 +73,9 @@ public static function setUpBeforeClass(): void $class = new \ReflectionClass('\CAS_Client'); $method = $class->getMethod('isXmlResponse'); - $method->setAccessible(true); + if (PHP_VERSION_ID < 80100) { + $method->setAccessible(true); + } self::$isXmlResponse = $method; } @@ -94,7 +96,7 @@ public function testAcceptXML($accept, $expected) $this->assertEquals($expected, self::$isXmlResponse->invokeArgs(self::$client, array()), $accept); } - public function acceptXMLDataProvider() + public static function acceptXMLDataProvider() { return array( array(false, false), diff --git a/test/CAS/Tests/CookieJarTest.php b/test/CAS/Tests/CookieJarTest.php index 6c9996b2..8b2cd07b 100644 --- a/test/CAS/Tests/CookieJarTest.php +++ b/test/CAS/Tests/CookieJarTest.php @@ -81,19 +81,8 @@ class CookieJarTest extends TestCase */ protected $object; - /** - * Sets up the fixture, for example, opens a network connection. - * This method is called before a test is executed. - * - * @return void - */ - protected function setUp(): void - { - $this->cookieArray = array(); - $this->object = new CookieJarExposed($this->cookieArray); - - $this->serviceUrl_1 = 'http://service.example.com/lookup/?action=search&query=username'; - $this->responseHeaders_1 = array('HTTP/1.1 302 Found', + protected $serviceUrl_1 = 'http://service.example.com/lookup/?action=search&query=username'; + protected $responseHeaders_1 = array('HTTP/1.1 302 Found', 'Date: Tue, 07 Sep 2010 17:51:54 GMT', 'Server: Apache/2.2.3 (Red Hat)', 'X-Powered-By: PHP/5.1.6', 'Set-Cookie: SID=k1jut1r1bqrumpei837kk4jks0; path=/', @@ -104,8 +93,19 @@ protected function setUp(): void 'Content-Length: 525', 'Connection: close', 'Content-Type: text/html; charset=UTF-8', ); - $this->serviceUrl_1b = 'http://service.example.com/lookup/?action=search&query=another_username'; - $this->serviceUrl_1c = 'http://service.example.com/make_changes.php'; + protected $serviceUrl_1b = 'http://service.example.com/lookup/?action=search&query=another_username'; + protected $serviceUrl_1c = 'http://service.example.com/make_changes.php'; + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + * + * @return void + */ + protected function setUp(): void + { + $cookieArray = array(); + $this->object = new CookieJarExposed($cookieArray); // Verify that there are no cookies to start. $this->assertEquals( diff --git a/test/CAS/Tests/ProxyChainsTest.php b/test/CAS/Tests/ProxyChainsTest.php index 76808474..64cba65b 100644 --- a/test/CAS/Tests/ProxyChainsTest.php +++ b/test/CAS/Tests/ProxyChainsTest.php @@ -48,27 +48,28 @@ class ProxyChainsTest extends TestCase */ protected $object; - /** - * Sets up the fixture, for example, opens a network connection. - * This method is called before a test is executed. - */ - protected function setUp(): void - { - $this->object = new \CAS_ProxyChain_AllowedList; - $this->list_size_0 = array(); - $this->list_size_1 = array('https://service1.example.com/rest',); - $this->list_size_2 = array('https://service1.example.com/rest', + protected $list_size_0 = array(); + protected $list_size_1 = array('https://service1.example.com/rest',); + protected $list_size_2 = array('https://service1.example.com/rest', 'http://service2.example.com/my/path', ); - $this->list_size_3 = array('https://service1.example.com/rest', + protected $list_size_3 = array('https://service1.example.com/rest', 'http://service2.example.com/my/path', 'http://service3.example.com/other/', ); - $this->list_size_4 = array('https://service1.example.com/rest', + protected $list_size_4 = array('https://service1.example.com/rest', 'http://service2.example.com/my/path', 'http://service3.example.com/other/', 'https://service4.example.com/', ); + + /** + * Sets up the fixture, for example, opens a network connection. + * This method is called before a test is executed. + */ + protected function setUp(): void + { + $this->object = new \CAS_ProxyChain_AllowedList; } /** From 57a7744146a963d8fa80192e0ab351051b711ff6 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 2 Dec 2025 12:38:13 +0100 Subject: [PATCH 5/5] docs: projet *is* maintained --- README.md | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/README.md b/README.md index bf733931..05f3c7d1 100644 --- a/README.md +++ b/README.md @@ -13,14 +13,7 @@ Api documentation can be found here: https://apereo.github.io/phpCAS/api/ -[![Test](https://github.com/apereo/phpCAS/actions/workflows/test.yml/badge.svg)](https://github.com/apereo/phpCAS/actions/workflows/test.yml) - -Project is unmaintained ------------------------ - -As of June 2024 this library is not actively maintained and looking for active developers & maintainers. The project is in an okay shape and in working order but needs a bit of steady maintenance or maybe even someone who wants to modernize it. We have also documented & automated a lot so I think it's nothing to worry about. - -Please contact the CAS project management team if you are interested: https://apereo.github.io/cas/developer/Project-Commitee.html or through the public mailing lists: https://apereo.github.io/cas/Mailing-Lists.html +[![Test](https://github.com/EsupPortail/phpCAS/actions/workflows/test.yml/badge.svg)](https://github.com/EsupPortail/phpCAS/actions/workflows/test.yml) LICENSE -------