From 1761dd2c5e7086ab27750bd3400e5119620f6a7d Mon Sep 17 00:00:00 2001 From: Andrew Miller Date: Wed, 4 May 2016 00:17:55 +0900 Subject: [PATCH] Changed "::class" declarations to hard strings to allow PHP 5.4 compatibility. --- source/CAS.php | 20 +++++++++---------- source/CAS/Client.php | 10 +++++----- test/CAS/Tests/AuthenticationTest.php | 2 +- test/CAS/Tests/Cas20AttributesTest.php | 2 +- test/CAS/Tests/ProxyTicketValidationTest.php | 2 +- test/CAS/Tests/ServiceMailTest.php | 2 +- .../CAS/Tests/ServiceTicketValidationTest.php | 2 +- test/CAS/Tests/ServiceWebTest.php | 2 +- 8 files changed, 21 insertions(+), 21 deletions(-) diff --git a/source/CAS.php b/source/CAS.php index 56c7efeb..92fc74ca 100644 --- a/source/CAS.php +++ b/source/CAS.php @@ -228,17 +228,17 @@ class CAS /** * static::getProxiedService() type for HTTP GET. */ - const PHPCAS_PROXIED_SERVICE_HTTP_GET = Get::class; + const PHPCAS_PROXIED_SERVICE_HTTP_GET = '\phpCAS\CAS\ProxiedService\Http\Get'; /** * static::getProxiedService() type for HTTP POST. */ - const PHPCAS_PROXIED_SERVICE_HTTP_POST = Post::class; + const PHPCAS_PROXIED_SERVICE_HTTP_POST = '\phpCAS\CAS\ProxiedService\Http\Post'; /** * static::getProxiedService() type for IMAP. */ - const PHPCAS_PROXIED_SERVICE_IMAP = Imap::class; + const PHPCAS_PROXIED_SERVICE_IMAP = '\phpCAS\CAS\ProxiedService\Imap'; /** @} */ @@ -251,13 +251,13 @@ class CAS * @{ */ - const PHPCAS_LANG_ENGLISH = English::class; - const PHPCAS_LANG_FRENCH = French::class; - const PHPCAS_LANG_GREEK = Greek::class; - const PHPCAS_LANG_GERMAN = German::class; - const PHPCAS_LANG_JAPANESE = Japanese::class; - const PHPCAS_LANG_SPANISH = Spanish::class; - const PHPCAS_LANG_CATALAN = Catalan::class; + const PHPCAS_LANG_ENGLISH = '\phpCAS\CAS\Languages\English'; + const PHPCAS_LANG_FRENCH = '\phpCAS\CAS\Languages\French'; + const PHPCAS_LANG_GREEK = '\phpCAS\CAS\Languages\Greek'; + const PHPCAS_LANG_GERMAN = '\phpCAS\CAS\Languages\German'; + const PHPCAS_LANG_JAPANESE = '\phpCAS\CAS\Languages\Japanese'; + const PHPCAS_LANG_SPANISH = '\phpCAS\CAS\Languages\Spanish'; + const PHPCAS_LANG_CATALAN = '\phpCAS\CAS\Languages\Catalan'; /** @} */ diff --git a/source/CAS/Client.php b/source/CAS/Client.php index 3a9b2d8a..df28500a 100644 --- a/source/CAS/Client.php +++ b/source/CAS/Client.php @@ -231,7 +231,7 @@ public function setLang($lang) $obj = new $lang(); if (! ($obj instanceof LanguageInterface)) { throw new InvalidArgumentException( - '$className must implement the '.LanguageInterface::class + '$className must implement the \phpCAS\CAS\Languages\LanguageInterface' ); } $this->_lang = $lang; @@ -631,7 +631,7 @@ public function setExtraCurlOption($key, $value) * By default CurlRequest is used, but this may be overridden to * supply alternate request mechanisms for testing. */ - private $_requestImplementation = CurlRequest::class; + private $_requestImplementation = '\phpCAS\CAS\Request\CurlRequest'; /** * Override the default implementation used to make web requests in readUrl(). @@ -1975,7 +1975,7 @@ public function setCasServerCACert($cert, $validate_cn) if (gettype($validate_cn) != 'boolean') { throw new TypeMismatchException($validate_cn, '$validate_cn', 'boolean'); } - if (! file_exists($cert) && $this->_requestImplementation !== DummyRequest::class) { + if (! file_exists($cert) && $this->_requestImplementation !== '\phpCAS\CAS\TestHarness\DummyRequest') { throw new InvalidArgumentException('Certificate file does not exist '.$this->_requestImplementation); } $this->_cas_server_ca_cert = $cert; @@ -2581,7 +2581,7 @@ public function setPGTStorage(AbstractStorage $storage) // check to make sure a valid storage object was specified if (! ($storage instanceof AbstractStorage)) { - throw new TypeMismatchException($storage, '$storage', AbstractStorage::class.' object'); + throw new TypeMismatchException($storage, '$storage', '\phpCAS\CAS\PGTStorage\AbstractStorage object'); } // store the PGTStorage object @@ -4005,7 +4005,7 @@ private function _rebroadcast($type) if (! empty($ip)) { $dns = gethostbyaddr($ip); } - $multiClassName = CurlMultiRequest::class; + $multiClassName = '\phpCAS\CAS\Request\CurlMultiRequest'; $multiRequest = new $multiClassName(); for ($i = 0; $i < sizeof($this->_rebroadcast_nodes); $i++) { diff --git a/test/CAS/Tests/AuthenticationTest.php b/test/CAS/Tests/AuthenticationTest.php index a45265d2..96fe0a80 100644 --- a/test/CAS/Tests/AuthenticationTest.php +++ b/test/CAS/Tests/AuthenticationTest.php @@ -83,7 +83,7 @@ protected function setUp() false // Start Session ); - $this->object->setRequestImplementation(DummyRequest::class); + $this->object->setRequestImplementation('\phpCAS\CAS\TestHarness\DummyRequest'); $this->object->setCasServerCACert('/path/to/ca_cert.crt', true); /********************************************************* diff --git a/test/CAS/Tests/Cas20AttributesTest.php b/test/CAS/Tests/Cas20AttributesTest.php index 03c63f50..2c7fda48 100755 --- a/test/CAS/Tests/Cas20AttributesTest.php +++ b/test/CAS/Tests/Cas20AttributesTest.php @@ -76,7 +76,7 @@ protected function setUp() false // Start Session ); - $this->object->setRequestImplementation(DummyRequest::class); + $this->object->setRequestImplementation('\phpCAS\CAS\TestHarness\DummyRequest'); $this->object->setCasServerCACert('/path/to/ca_cert.crt', true); $this->object->setNoClearTicketsFromUrl(); // CAS::setDebug(dirname(__FILE__).'/../test.log'); diff --git a/test/CAS/Tests/ProxyTicketValidationTest.php b/test/CAS/Tests/ProxyTicketValidationTest.php index 28c40022..f3bedb14 100755 --- a/test/CAS/Tests/ProxyTicketValidationTest.php +++ b/test/CAS/Tests/ProxyTicketValidationTest.php @@ -82,7 +82,7 @@ protected function setUp() false // Start Session ); - $this->object->setRequestImplementation(DummyRequest::class); + $this->object->setRequestImplementation('\phpCAS\CAS\TestHarness\DummyRequest'); $this->object->setCasServerCACert('/path/to/ca_cert.crt', true); /********************************************************* diff --git a/test/CAS/Tests/ServiceMailTest.php b/test/CAS/Tests/ServiceMailTest.php index 8a85b52c..78aca0e6 100755 --- a/test/CAS/Tests/ServiceMailTest.php +++ b/test/CAS/Tests/ServiceMailTest.php @@ -79,7 +79,7 @@ protected function setUp() false // Start Session ); - $this->object->setRequestImplementation(DummyRequest::class); + $this->object->setRequestImplementation('\phpCAS\CAS\TestHarness\DummyRequest'); $this->object->setCasServerCACert('/path/to/ca_cert.crt', true); // Bypass PGT storage since Client->callback() will exit. Just build diff --git a/test/CAS/Tests/ServiceTicketValidationTest.php b/test/CAS/Tests/ServiceTicketValidationTest.php index 07871a32..c32c70d1 100755 --- a/test/CAS/Tests/ServiceTicketValidationTest.php +++ b/test/CAS/Tests/ServiceTicketValidationTest.php @@ -78,7 +78,7 @@ protected function setUp() false // Start Session ); - $this->object->setRequestImplementation(DummyRequest::class); + $this->object->setRequestImplementation('\phpCAS\CAS\TestHarness\DummyRequest'); $this->object->setCasServerCACert('/path/to/ca_cert.crt', true); /********************************************************* diff --git a/test/CAS/Tests/ServiceWebTest.php b/test/CAS/Tests/ServiceWebTest.php index 9e5acd65..a44ef347 100755 --- a/test/CAS/Tests/ServiceWebTest.php +++ b/test/CAS/Tests/ServiceWebTest.php @@ -79,7 +79,7 @@ protected function setUp() false // Start Session ); - $this->object->setRequestImplementation(DummyRequest::class); + $this->object->setRequestImplementation('\phpCAS\CAS\TestHarness\DummyRequest'); $this->object->setCasServerCACert('/path/to/ca_cert.crt', true); // Bypass PGT storage since Client->callback() will exit. Just build