Skip to content

Commit

Permalink
Changed "::class" declarations to hard strings to allow PHP 5.4 compa…
Browse files Browse the repository at this point in the history
…tibility.
  • Loading branch information
ikari7789 committed May 3, 2016
1 parent 9ffa719 commit f1280e0
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 21 deletions.
20 changes: 10 additions & 10 deletions source/CAS.php
Original file line number Diff line number Diff line change
Expand Up @@ -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';

/** @} */

Expand All @@ -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';

/** @} */

Expand Down
10 changes: 5 additions & 5 deletions source/CAS/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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().
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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++) {
Expand Down
2 changes: 1 addition & 1 deletion test/CAS/Tests/AuthenticationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*********************************************************
Expand Down
2 changes: 1 addition & 1 deletion test/CAS/Tests/Cas20AttributesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down
2 changes: 1 addition & 1 deletion test/CAS/Tests/ProxyTicketValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*********************************************************
Expand Down
2 changes: 1 addition & 1 deletion test/CAS/Tests/ServiceMailTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/CAS/Tests/ServiceTicketValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*********************************************************
Expand Down
2 changes: 1 addition & 1 deletion test/CAS/Tests/ServiceWebTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit f1280e0

Please sign in to comment.