Skip to content

Commit

Permalink
Revert "Fix deprecated assert(...) usage"
Browse files Browse the repository at this point in the history
This reverts commit a55f292.
  • Loading branch information
thijskh committed Dec 6, 2017
1 parent 6ebd4ba commit 5a00d98
Show file tree
Hide file tree
Showing 52 changed files with 229 additions and 229 deletions.
2 changes: 1 addition & 1 deletion src/SAML2/ArtifactResolve.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function getArtifact()
*/
public function setArtifact($artifact)
{
assert(is_string($artifact));
assert('is_string($artifact)');
$this->artifact = $artifact;
}

Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/ArtifactResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(\DOMElement $xml = null)

if (!is_null($xml)) {
$status = Utils::xpQuery($xml, './saml_protocol:Status');
assert(!empty($status)); /* Will have failed during StatusResponse parsing. */
assert('!empty($status)'); /* Will have failed during StatusResponse parsing. */

$status = $status[0];

Expand Down
24 changes: 12 additions & 12 deletions src/SAML2/Assertion.php
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ private function parseSignature(\DOMElement $xml)
*/
public function validate(XMLSecurityKey $key)
{
assert($key->type === \RobRichards\XMLSecLibs\XMLSecurityKey::RSA_SHA1);
assert('$key->type === \RobRichards\XMLSecLibs\XMLSecurityKey::RSA_SHA1');

if ($this->signatureData === null) {
return false;
Expand Down Expand Up @@ -669,7 +669,7 @@ public function getId()
*/
public function setId($id)
{
assert(is_string($id));
assert('is_string($id)');

$this->id = $id;
}
Expand All @@ -691,7 +691,7 @@ public function getIssueInstant()
*/
public function setIssueInstant($issueInstant)
{
assert(is_int($issueInstant));
assert('is_int($issueInstant)');

$this->issueInstant = $issueInstant;
}
Expand All @@ -713,7 +713,7 @@ public function getIssuer()
*/
public function setIssuer($issuer)
{
assert(is_string($issuer) || $issuer instanceof \SAML2\XML\saml\Issuer);
assert('is_string($issuer) || $issuer instanceof \SAML2\XML\saml\Issuer');

$this->issuer = $issuer;
}
Expand Down Expand Up @@ -744,7 +744,7 @@ public function getNameId()
*/
public function setNameId($nameId)
{
assert(is_array($nameId) || is_null($nameId) || is_a($nameId, "\SAML2\XML\saml\NameID"));
assert('is_array($nameId) || is_null($nameId) || is_a($nameId, "\SAML2\XML\saml\NameID")');

if (is_array($nameId)) {
$nameId = XML\saml\NameID::fromArray($nameId);
Expand Down Expand Up @@ -896,7 +896,7 @@ public function getNotBefore()
*/
public function setNotBefore($notBefore)
{
assert(is_int($notBefore) || is_null($notBefore));
assert('is_int($notBefore) || is_null($notBefore)');

$this->notBefore = $notBefore;
}
Expand All @@ -923,7 +923,7 @@ public function getNotOnOrAfter()
*/
public function setNotOnOrAfter($notOnOrAfter)
{
assert(is_int($notOnOrAfter) || is_null($notOnOrAfter));
assert('is_int($notOnOrAfter) || is_null($notOnOrAfter)');

$this->notOnOrAfter = $notOnOrAfter;
}
Expand Down Expand Up @@ -980,7 +980,7 @@ public function getAuthnInstant()
*/
public function setAuthnInstant($authnInstant)
{
assert(is_int($authnInstant) || is_null($authnInstant));
assert('is_int($authnInstant) || is_null($authnInstant)');

$this->authnInstant = $authnInstant;
}
Expand All @@ -1007,7 +1007,7 @@ public function getSessionNotOnOrAfter()
*/
public function setSessionNotOnOrAfter($sessionNotOnOrAfter)
{
assert(is_int($sessionNotOnOrAfter) || is_null($sessionNotOnOrAfter));
assert('is_int($sessionNotOnOrAfter) || is_null($sessionNotOnOrAfter)');

$this->sessionNotOnOrAfter = $sessionNotOnOrAfter;
}
Expand All @@ -1032,7 +1032,7 @@ public function getSessionIndex()
*/
public function setSessionIndex($sessionIndex)
{
assert(is_string($sessionIndex) || is_null($sessionIndex));
assert('is_string($sessionIndex) || is_null($sessionIndex)');

$this->sessionIndex = $sessionIndex;
}
Expand Down Expand Up @@ -1099,7 +1099,7 @@ public function getAuthnContextClassRef()
*/
public function setAuthnContextClassRef($authnContextClassRef)
{
assert(is_string($authnContextClassRef) || is_null($authnContextClassRef));
assert('is_string($authnContextClassRef) || is_null($authnContextClassRef)');

$this->authnContextClassRef = $authnContextClassRef;
}
Expand Down Expand Up @@ -1246,7 +1246,7 @@ public function getAttributeNameFormat()
*/
public function setAttributeNameFormat($nameFormat)
{
assert(is_string($nameFormat));
assert('is_string($nameFormat)');

$this->nameFormat = $nameFormat;
}
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/AttributeQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ public function getAttributeNameFormat()
*/
public function setAttributeNameFormat($nameFormat)
{
assert(is_string($nameFormat));
assert('is_string($nameFormat)');

$this->nameFormat = $nameFormat;
}
Expand Down
22 changes: 11 additions & 11 deletions src/SAML2/AuthnRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public function getForceAuthn()
*/
public function setForceAuthn($forceAuthn)
{
assert(is_bool($forceAuthn));
assert('is_bool($forceAuthn)');

$this->forceAuthn = $forceAuthn;
}
Expand All @@ -375,7 +375,7 @@ public function getProviderName()
*/
public function setProviderName($ProviderName)
{
assert(is_string($ProviderName));
assert('is_string($ProviderName)');

$this->ProviderName = $ProviderName;
}
Expand All @@ -399,7 +399,7 @@ public function getIsPassive()
*/
public function setIsPassive($isPassive)
{
assert(is_bool($isPassive));
assert('is_bool($isPassive)');

$this->isPassive = $isPassive;
}
Expand All @@ -420,7 +420,7 @@ public function setIsPassive($isPassive)
*/
public function setIDPList($IDPList)
{
assert(is_array($IDPList));
assert('is_array($IDPList)');
$this->IDPList = $IDPList;
}

Expand All @@ -440,7 +440,7 @@ public function getIDPList()
*/
public function setProxyCount($ProxyCount)
{
assert(is_int($ProxyCount));
assert('is_int($ProxyCount)');
$this->ProxyCount = $ProxyCount;
}

Expand Down Expand Up @@ -485,7 +485,7 @@ public function getAssertionConsumerServiceURL()
*/
public function setAssertionConsumerServiceURL($assertionConsumerServiceURL)
{
assert(is_string($assertionConsumerServiceURL) || is_null($assertionConsumerServiceURL));
assert('is_string($assertionConsumerServiceURL) || is_null($assertionConsumerServiceURL)');

$this->assertionConsumerServiceURL = $assertionConsumerServiceURL;
}
Expand All @@ -507,7 +507,7 @@ public function getProtocolBinding()
*/
public function setProtocolBinding($protocolBinding)
{
assert(is_string($protocolBinding) || is_null($protocolBinding));
assert('is_string($protocolBinding) || is_null($protocolBinding)');

$this->protocolBinding = $protocolBinding;
}
Expand All @@ -529,7 +529,7 @@ public function getAttributeConsumingServiceIndex()
*/
public function setAttributeConsumingServiceIndex($attributeConsumingServiceIndex)
{
assert(is_int($attributeConsumingServiceIndex) || is_null($attributeConsumingServiceIndex));
assert('is_int($attributeConsumingServiceIndex) || is_null($attributeConsumingServiceIndex)');

$this->attributeConsumingServiceIndex = $attributeConsumingServiceIndex;
}
Expand All @@ -551,7 +551,7 @@ public function getAssertionConsumerServiceIndex()
*/
public function setAssertionConsumerServiceIndex($assertionConsumerServiceIndex)
{
assert(is_int($assertionConsumerServiceIndex) || is_null($assertionConsumerServiceIndex));
assert('is_int($assertionConsumerServiceIndex) || is_null($assertionConsumerServiceIndex)');

$this->assertionConsumerServiceIndex = $assertionConsumerServiceIndex;
}
Expand All @@ -573,7 +573,7 @@ public function getRequestedAuthnContext()
*/
public function setRequestedAuthnContext($requestedAuthnContext)
{
assert(is_array($requestedAuthnContext) || is_null($requestedAuthnContext));
assert('is_array($requestedAuthnContext) || is_null($requestedAuthnContext)');

$this->requestedAuthnContext = $requestedAuthnContext;
}
Expand All @@ -600,7 +600,7 @@ public function getNameId()
*/
public function setNameId($nameId)
{
assert(is_array($nameId) || is_null($nameId) || is_a($nameId, "\SAML2\XML\saml\NameID"));
assert('is_array($nameId) || is_null($nameId) || is_a($nameId, "\SAML2\XML\saml\NameID")');

if (is_array($nameId)) {
$nameId = XML\saml\NameID::fromArray($nameId);
Expand Down
4 changes: 2 additions & 2 deletions src/SAML2/Binding.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ abstract class Binding
*/
public static function getBinding($urn)
{
assert(is_string($urn));
assert('is_string($urn)');

switch ($urn) {
case Constants::BINDING_HTTP_POST:
Expand Down Expand Up @@ -123,7 +123,7 @@ public function getDestination()
*/
public function setDestination($destination)
{
assert(is_string($destination) || is_null($destination));
assert('is_string($destination) || is_null($destination)');

$this->destination = $destination;
}
Expand Down
6 changes: 3 additions & 3 deletions src/SAML2/HTTPRedirect.php
Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,9 @@ private static function parseQuery()
*/
public static function validateSignature(array $data, XMLSecurityKey $key)
{
assert(array_key_exists("Query", $data));
assert(array_key_exists("SigAlg", $data));
assert(array_key_exists("Signature", $data));
assert('array_key_exists("Query", $data)');
assert('array_key_exists("SigAlg", $data)');
assert('array_key_exists("Signature", $data)');

$query = $data['Query'];
$sigAlg = $data['SigAlg'];
Expand Down
6 changes: 3 additions & 3 deletions src/SAML2/LogoutRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public function getNotOnOrAfter()
*/
public function setNotOnOrAfter($notOnOrAfter)
{
assert(is_int($notOnOrAfter) || is_null($notOnOrAfter));
assert('is_int($notOnOrAfter) || is_null($notOnOrAfter)');

$this->notOnOrAfter = $notOnOrAfter;
}
Expand Down Expand Up @@ -190,7 +190,7 @@ public function getNameId()
*/
public function setNameId($nameId)
{
assert(is_array($nameId) || is_a($nameId, "\SAML2\XML\saml\NameID"));
assert('is_array($nameId) || is_a($nameId, "\SAML2\XML\saml\NameID")');

if (is_array($nameId)) {
$nameId = XML\saml\NameID::fromArray($nameId);
Expand Down Expand Up @@ -239,7 +239,7 @@ public function getSessionIndex()
*/
public function setSessionIndex($sessionIndex)
{
assert(is_string($sessionIndex) || is_null($sessionIndex));
assert('is_string($sessionIndex) || is_null($sessionIndex)');

if (is_null($sessionIndex)) {
$this->sessionIndexes = array();
Expand Down
18 changes: 9 additions & 9 deletions src/SAML2/Message.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ abstract class Message implements SignedElement
*/
protected function __construct($tagName, \DOMElement $xml = null)
{
assert(is_string($tagName));
assert('is_string($tagName)');
$this->tagName = $tagName;

$this->id = Utils::getContainer()->generateId();
Expand Down Expand Up @@ -224,7 +224,7 @@ private function validateSignature(\DOMElement $xml)
*/
public function addValidator($function, $data)
{
assert(is_callable($function));
assert('is_callable($function)');

$this->validators[] = array(
'Function' => $function,
Expand Down Expand Up @@ -288,7 +288,7 @@ public function getId()
*/
public function setId($id)
{
assert(is_string($id));
assert('is_string($id)');

$this->id = $id;
}
Expand All @@ -310,7 +310,7 @@ public function getIssueInstant()
*/
public function setIssueInstant($issueInstant)
{
assert(is_int($issueInstant));
assert('is_int($issueInstant)');

$this->issueInstant = $issueInstant;
}
Expand All @@ -332,7 +332,7 @@ public function getDestination()
*/
public function setDestination($destination)
{
assert(is_string($destination) || is_null($destination));
assert('is_string($destination) || is_null($destination)');

$this->destination = $destination;
}
Expand All @@ -348,7 +348,7 @@ public function setDestination($destination)
*/
public function setConsent($consent)
{
assert(is_string($consent));
assert('is_string($consent)');

$this->consent = $consent;
}
Expand Down Expand Up @@ -388,7 +388,7 @@ public function getIssuer()
*/
public function setIssuer($issuer)
{
assert(is_string($issuer) || $issuer instanceof \SAML2\XML\saml\Issuer || is_null($issuer));
assert('is_string($issuer) || $issuer instanceof \SAML2\XML\saml\Issuer || is_null($issuer)');

$this->issuer = $issuer;
}
Expand Down Expand Up @@ -420,7 +420,7 @@ public function getRelayState()
*/
public function setRelayState($relayState)
{
assert(is_string($relayState) || is_null($relayState));
assert('is_string($relayState) || is_null($relayState)');

$this->relayState = $relayState;
}
Expand Down Expand Up @@ -602,7 +602,7 @@ public function getExtensions()
*/
public function setExtensions($extensions)
{
assert(is_array($extensions) || is_null($extensions));
assert('is_array($extensions) || is_null($extensions)');

$this->extensions = $extensions;
}
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/SOAPClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ private static function addSSLValidator(Message $msg, $context)
*/
public static function validateSSL($data, XMLSecurityKey $key)
{
assert(is_string($data));
assert('is_string($data)');

$keyInfo = openssl_pkey_get_details($key->key);
if ($keyInfo === false) {
Expand Down
2 changes: 1 addition & 1 deletion src/SAML2/SignedElementHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ protected function __construct(\DOMElement $xml = null)
*/
public function addValidator($function, $data)
{
assert(is_callable($function));
assert('is_callable($function)');

$this->validators[] = array(
'Function' => $function,
Expand Down
Loading

0 comments on commit 5a00d98

Please sign in to comment.