From 04fd5f1f578c24f6f71653ebad3d0c7361bc5e86 Mon Sep 17 00:00:00 2001
From: arno <a.vdvegt@ultraware.nl>
Date: Tue, 9 Oct 2018 13:30:06 +0200
Subject: [PATCH] Use declared names of methods and classes

---
 lib/SimpleSAML/Memcache.php                            | 2 +-
 lib/SimpleSAML/XHTML/IdPDisco.php                      | 2 +-
 lib/SimpleSAML/XML/Shib13/AuthnResponse.php            | 2 +-
 lib/SimpleSAML/XML/Signer.php                          | 2 +-
 modules/adfs/lib/IdP/ADFS.php                          | 2 +-
 modules/authfacebook/extlibinc/base_facebook.php       | 4 ++--
 modules/authlinkedin/lib/Auth/Source/LinkedIn.php      | 2 +-
 modules/authwindowslive/lib/Auth/Source/LiveID.php     | 4 ++--
 modules/core/lib/Auth/Process/Cardinality.php          | 6 +++---
 modules/core/lib/Auth/Process/CardinalitySingle.php    | 4 ++--
 modules/core/www/show_metadata.php                     | 2 +-
 modules/discopower/templates/disco.tpl.php             | 8 ++++----
 modules/exampleattributeserver/www/attributeserver.php | 2 +-
 modules/metarefresh/lib/MetaLoader.php                 | 8 ++++----
 modules/negotiate/lib/Auth/Source/Negotiate.php        | 2 +-
 modules/saml/hooks/hook_metadata_hosted.php            | 2 +-
 modules/saml/lib/Auth/Source/SP.php                    | 2 +-
 modules/statistics/templates/statistics.tpl.php        | 4 ++--
 www/saml2/idp/ArtifactResolutionService.php            | 2 +-
 19 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/lib/SimpleSAML/Memcache.php b/lib/SimpleSAML/Memcache.php
index 0d82d5e32..c348a966b 100644
--- a/lib/SimpleSAML/Memcache.php
+++ b/lib/SimpleSAML/Memcache.php
@@ -60,7 +60,7 @@ class Memcache
             if ($serializedInfo === false) {
                 // either the server is down, or we don't have the value stored on that server
                 $mustUpdate = true;
-                $up = $server->getstats();
+                $up = $server->getStats();
                 if ($up !== false) {
                     $allDown = false;
                 }
diff --git a/lib/SimpleSAML/XHTML/IdPDisco.php b/lib/SimpleSAML/XHTML/IdPDisco.php
index 0cf77f0d6..7957219ad 100644
--- a/lib/SimpleSAML/XHTML/IdPDisco.php
+++ b/lib/SimpleSAML/XHTML/IdPDisco.php
@@ -512,7 +512,7 @@ class IdPDisco
      */
     protected function start()
     {
-        $idp = $this->getTargetIdp();
+        $idp = $this->getTargetIdP();
         if ($idp !== null) {
             $extDiscoveryStorage = $this->config->getString('idpdisco.extDiscoveryStorage', null);
             if ($extDiscoveryStorage !== null) {
diff --git a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php
index e6d1a20ad..20b1db4b7 100644
--- a/lib/SimpleSAML/XML/Shib13/AuthnResponse.php
+++ b/lib/SimpleSAML/XML/Shib13/AuthnResponse.php
@@ -204,7 +204,7 @@ class AuthnResponse
     public function getAttributes()
     {
         $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler();
-        $md = $metadata->getMetadata($this->getIssuer(), 'shib13-idp-remote');
+        $md = $metadata->getMetaData($this->getIssuer(), 'shib13-idp-remote');
         $base64 = isset($md['base64attributes']) ? $md['base64attributes'] : false;
 
         if (!($this->dom instanceof \DOMDocument)) {
diff --git a/lib/SimpleSAML/XML/Signer.php b/lib/SimpleSAML/XML/Signer.php
index ae79c8a1d..3e3c86c09 100644
--- a/lib/SimpleSAML/XML/Signer.php
+++ b/lib/SimpleSAML/XML/Signer.php
@@ -84,7 +84,7 @@ class Signer
         }
 
         if (array_key_exists('id', $options)) {
-            $this->setIdAttribute($options['id']);
+            $this->setIDAttribute($options['id']);
         }
     }
 
diff --git a/modules/adfs/lib/IdP/ADFS.php b/modules/adfs/lib/IdP/ADFS.php
index 6e79f3e36..6a09ff988 100644
--- a/modules/adfs/lib/IdP/ADFS.php
+++ b/modules/adfs/lib/IdP/ADFS.php
@@ -136,7 +136,7 @@ MSG;
     {
         $config = \SimpleSAML\Configuration::getInstance();
         $t = new \SimpleSAML\XHTML\Template($config, 'adfs:postResponse.twig');
-        $t->data['baseurlpath'] = \SimpleSAML\Module::getModuleUrl('adfs');
+        $t->data['baseurlpath'] = \SimpleSAML\Module::getModuleURL('adfs');
         $t->data['url'] = $url;
         $t->data['wresult'] = $wresult;
         $t->data['wctx'] = $wctx;
diff --git a/modules/authfacebook/extlibinc/base_facebook.php b/modules/authfacebook/extlibinc/base_facebook.php
index a536be64d..1df472e45 100644
--- a/modules/authfacebook/extlibinc/base_facebook.php
+++ b/modules/authfacebook/extlibinc/base_facebook.php
@@ -819,13 +819,13 @@ abstract class BaseFacebook
         }
 
         if (empty($access_token_response)) {
-            self::errorlog('No access token response');
+            self::errorLog('No access token response');
             return false;
         }
 
         $response_params = json_decode($access_token_response, true);
         if (!isset($response_params['access_token'])) {
-            self::errorlog('No access token in response. ' . $access_token_response);
+            self::errorLog('No access token in response. ' . $access_token_response);
             return false;
         }
 
diff --git a/modules/authlinkedin/lib/Auth/Source/LinkedIn.php b/modules/authlinkedin/lib/Auth/Source/LinkedIn.php
index 672ef7f15..215d7c342 100644
--- a/modules/authlinkedin/lib/Auth/Source/LinkedIn.php
+++ b/modules/authlinkedin/lib/Auth/Source/LinkedIn.php
@@ -85,7 +85,7 @@ class LinkedIn extends \SimpleSAML\Auth\Source
         $requestToken = $consumer->getRequestToken(
             'https://api.linkedin.com/uas/oauth/requestToken',
             array(
-                'oauth_callback' => \SimpleSAML\Module::getModuleUrl('authlinkedin').'/linkback.php?stateid='.$stateID
+                'oauth_callback' => \SimpleSAML\Module::getModuleURL('authlinkedin').'/linkback.php?stateid='.$stateID
             )
         );
 
diff --git a/modules/authwindowslive/lib/Auth/Source/LiveID.php b/modules/authwindowslive/lib/Auth/Source/LiveID.php
index 45488abe2..facac508e 100644
--- a/modules/authwindowslive/lib/Auth/Source/LiveID.php
+++ b/modules/authwindowslive/lib/Auth/Source/LiveID.php
@@ -76,7 +76,7 @@ class LiveID extends \SimpleSAML\Auth\Source
             '?client_id='.$this->key.
             '&response_type=code'.
             '&response_mode=query'.
-            '&redirect_uri='.urlencode(\SimpleSAML\Module::getModuleUrl('authwindowslive').'/linkback.php').
+            '&redirect_uri='.urlencode(\SimpleSAML\Module::getModuleURL('authwindowslive').'/linkback.php').
             '&state='.urlencode($stateID).
             '&scope='.urlencode('openid https://graph.microsoft.com/user.read')
         ;
@@ -102,7 +102,7 @@ class LiveID extends \SimpleSAML\Auth\Source
             '&client_secret='.urlencode($this->secret).
             '&scope='.urlencode('https://graph.microsoft.com/user.read').
             '&grant_type=authorization_code'.
-            '&redirect_uri='.urlencode(\SimpleSAML\Module::getModuleUrl('authwindowslive').'/linkback.php').
+            '&redirect_uri='.urlencode(\SimpleSAML\Module::getModuleURL('authwindowslive').'/linkback.php').
             '&code='.urlencode($state['authwindowslive:verification_code']);
 
         $context = array(
diff --git a/modules/core/lib/Auth/Process/Cardinality.php b/modules/core/lib/Auth/Process/Cardinality.php
index 204de7f6f..772c3a469 100644
--- a/modules/core/lib/Auth/Process/Cardinality.php
+++ b/modules/core/lib/Auth/Process/Cardinality.php
@@ -2,7 +2,7 @@
 
 namespace SimpleSAML\Module\core\Auth\Process;
 
-use SimpleSAML\Utils\HTTPAdapter;
+use SimpleSAML\Utils\HttpAdapter;
 
 /**
  * Filter to ensure correct cardinality of attributes
@@ -30,12 +30,12 @@ class Cardinality extends \SimpleSAML\Auth\ProcessingFilter
      * @param HTTPAdapter $http  HTTP utility service (handles redirects).
      * @throws \SimpleSAML\Error\Exception
      */
-    public function __construct($config, $reserved, HTTPAdapter $http = null)
+    public function __construct($config, $reserved, HttpAdapter $http = null)
     {
         parent::__construct($config, $reserved);
         assert(is_array($config));
 
-        $this->http = $http ? : new HTTPAdapter();
+        $this->http = $http ? : new HttpAdapter();
 
         foreach ($config as $attribute => $rules) {
             if ($attribute === '%ignoreEntities') {
diff --git a/modules/core/lib/Auth/Process/CardinalitySingle.php b/modules/core/lib/Auth/Process/CardinalitySingle.php
index ce4b12aac..da120934d 100644
--- a/modules/core/lib/Auth/Process/CardinalitySingle.php
+++ b/modules/core/lib/Auth/Process/CardinalitySingle.php
@@ -41,12 +41,12 @@ class CardinalitySingle extends \SimpleSAML\Auth\ProcessingFilter
      * @param mixed $reserved  For future use.
      * @param HTTPAdapter $http  HTTP utility service (handles redirects).
      */
-    public function __construct($config, $reserved, HTTPAdapter $http = null)
+    public function __construct($config, $reserved, HttpAdapter $http = null)
     {
         parent::__construct($config, $reserved);
         assert(is_array($config));
 
-        $this->http = $http ? : new HTTPAdapter();
+        $this->http = $http ? : new HttpAdapter();
 
         if (array_key_exists('singleValued', $config)) {
             $this->singleValued = $config['singleValued'];
diff --git a/modules/core/www/show_metadata.php b/modules/core/www/show_metadata.php
index 389d12a33..2beb26c59 100644
--- a/modules/core/www/show_metadata.php
+++ b/modules/core/www/show_metadata.php
@@ -22,7 +22,7 @@ if (!in_array(
 
 $metadata = \SimpleSAML\Metadata\MetaDataStorageHandler::getMetadataHandler();
 
-$m = $metadata->getMetadata($_REQUEST['entityid'], $_REQUEST['set']);
+$m = $metadata->getMetaData($_REQUEST['entityid'], $_REQUEST['set']);
 
 $t = new \SimpleSAML\XHTML\Template($config, 'core:show_metadata.tpl.php');
 $t->data['clipboard.js'] = true;
diff --git a/modules/discopower/templates/disco.tpl.php b/modules/discopower/templates/disco.tpl.php
index 72cad5298..02ae742eb 100644
--- a/modules/discopower/templates/disco.tpl.php
+++ b/modules/discopower/templates/disco.tpl.php
@@ -4,12 +4,12 @@ $this->data['header'] = $this->t('selectidp');
 $this->data['jquery'] = array('core' => true, 'ui' => true, 'css' => true);
 
 $this->data['head'] = '<link rel="stylesheet" media="screen" type="text/css" href="'.
-    SimpleSAML\Module::getModuleUrl('discopower/assets/css/style.css').'" />';
+    SimpleSAML\Module::getModuleURL('discopower/assets/css/style.css').'" />';
 
 $this->data['post'] = '<script type="text/javascript" src="'.
-    SimpleSAML\Module::getModuleUrl('discopower/assets/js/jquery.livesearch.js').'"></script>';
+    SimpleSAML\Module::getModuleURL('discopower/assets/js/jquery.livesearch.js').'"></script>';
 $this->data['post'] .= '<script type="text/javascript" src="'.
-    SimpleSAML\Module::getModuleUrl('discopower/assets/js/quicksilver.js').'"></script>';
+    SimpleSAML\Module::getModuleURL('discopower/assets/js/quicksilver.js').'"></script>';
 
 if (!empty($this->data['faventry'])) {
     $this->data['autofocus'] = 'favouritesubmit';
@@ -144,5 +144,5 @@ foreach ($this->data['idplist'] as $tab => $slist) {
 
 <?php
 $this->data['post'] .= '<script type="text/javascript" src="'.
-    SimpleSAML\Module::getModuleUrl('discopower/js/javascript.js').'"></script>';
+    SimpleSAML\Module::getModuleURL('discopower/js/javascript.js').'"></script>';
 $this->includeAtTemplateBase('includes/footer.php');
diff --git a/modules/exampleattributeserver/www/attributeserver.php b/modules/exampleattributeserver/www/attributeserver.php
index 1de9e54b0..135cc6a74 100644
--- a/modules/exampleattributeserver/www/attributeserver.php
+++ b/modules/exampleattributeserver/www/attributeserver.php
@@ -16,7 +16,7 @@ if ($spEntityId === null) {
     throw new \SimpleSAML\Error\BadRequest('Missing <saml:Issuer> in <samlp:AttributeQuery>.');
 }
 
-$idpMetadata = $metadata->getMetadataConfig($idpEntityId, 'saml20-idp-hosted');
+$idpMetadata = $metadata->getMetaDataConfig($idpEntityId, 'saml20-idp-hosted');
 $spMetadata = $metadata->getMetaDataConfig($spEntityId, 'saml20-sp-remote');
 
 // The endpoint we should deliver the message to
diff --git a/modules/metarefresh/lib/MetaLoader.php b/modules/metarefresh/lib/MetaLoader.php
index d9c92a027..1398a623b 100644
--- a/modules/metarefresh/lib/MetaLoader.php
+++ b/modules/metarefresh/lib/MetaLoader.php
@@ -130,15 +130,15 @@ class MetaLoader
 
         foreach ($entities as $entity) {
             if (isset($source['blacklist'])) {
-                if (!empty($source['blacklist']) && in_array($entity->getEntityID(), $source['blacklist'], true)) {
-                    Logger::info('Skipping "'.$entity->getEntityID().'" - blacklisted.'."\n");
+                if (!empty($source['blacklist']) && in_array($entity->getEntityId(), $source['blacklist'], true)) {
+                    Logger::info('Skipping "'.$entity->getEntityId().'" - blacklisted.'."\n");
                     continue;
                 }
             }
 
             if (isset($source['whitelist'])) {
-                if (!empty($source['whitelist']) && !in_array($entity->getEntityID(), $source['whitelist'], true)) {
-                    Logger::info('Skipping "'.$entity->getEntityID().'" - not in the whitelist.'."\n");
+                if (!empty($source['whitelist']) && !in_array($entity->getEntityId(), $source['whitelist'], true)) {
+                    Logger::info('Skipping "'.$entity->getEntityId().'" - not in the whitelist.'."\n");
                     continue;
                 }
             }
diff --git a/modules/negotiate/lib/Auth/Source/Negotiate.php b/modules/negotiate/lib/Auth/Source/Negotiate.php
index eaf32c44f..b8a23ff1f 100644
--- a/modules/negotiate/lib/Auth/Source/Negotiate.php
+++ b/modules/negotiate/lib/Auth/Source/Negotiate.php
@@ -248,7 +248,7 @@ class Negotiate extends \SimpleSAML\Auth\Source
         header('WWW-Authenticate: Negotiate', false);
 
         $t = new \SimpleSAML\XHTML\Template($config, 'negotiate:redirect.twig');
-        $t->data['baseurlpath'] = \SimpleSAML\Module::getModuleUrl('negotiate');
+        $t->data['baseurlpath'] = \SimpleSAML\Module::getModuleURL('negotiate');
         $t->data['url'] = $url;
         $t->data['json_url'] = $json_url;
         $t->show();
diff --git a/modules/saml/hooks/hook_metadata_hosted.php b/modules/saml/hooks/hook_metadata_hosted.php
index 9090edd9c..f04ee40cd 100644
--- a/modules/saml/hooks/hook_metadata_hosted.php
+++ b/modules/saml/hooks/hook_metadata_hosted.php
@@ -20,7 +20,7 @@ function saml_hook_metadata_hosted(&$metadataHosted)
             $name = $metadata->getValue('OrganizationDisplayName', null);
         }
         if ($name === null) {
-            $name = $source->getAuthID();
+            $name = $source->getAuthId();
         }
 
         $md = array(
diff --git a/modules/saml/lib/Auth/Source/SP.php b/modules/saml/lib/Auth/Source/SP.php
index e1017175b..58e43744f 100644
--- a/modules/saml/lib/Auth/Source/SP.php
+++ b/modules/saml/lib/Auth/Source/SP.php
@@ -710,7 +710,7 @@ class SP extends Source
         assert(array_key_exists('LogoutState', $state));
         assert(array_key_exists('saml:logout:Type', $state['LogoutState']));
 
-        $idpMetadata = $this->getIdpMetadata($idp);
+        $idpMetadata = $this->getIdPMetadata($idp);
 
         $spMetadataArray = $this->metadata->toArray();
         $idpMetadataArray = $idpMetadata->toArray();
diff --git a/modules/statistics/templates/statistics.tpl.php b/modules/statistics/templates/statistics.tpl.php
index 11e72e99a..243a101e5 100644
--- a/modules/statistics/templates/statistics.tpl.php
+++ b/modules/statistics/templates/statistics.tpl.php
@@ -15,7 +15,7 @@ echo '<p>'.$this->data['available.rules'][$this->data['selected.rule']]['descr']
 
 // Report settings
 echo '<table class="selecttime">';
-echo '<tr><td class="selecttime_icon"><img src="'.SimpleSAML\Utils\HTTP::getBaseUrl().
+echo '<tr><td class="selecttime_icon"><img src="'.SimpleSAML\Utils\HTTP::getBaseURL().
     'resources/icons/crystal_project/kchart.32x32.png" alt="Report settings" /></td>';
 
 // Select report
@@ -75,7 +75,7 @@ echo '</table>';
 
 // Select time and date
 echo '<table class="selecttime">';
-echo '<tr><td class="selecttime_icon"><img src="'.SimpleSAML\Utils\HTTP::getBaseUrl().
+echo '<tr><td class="selecttime_icon"><img src="'.SimpleSAML\Utils\HTTP::getBaseURL().
     'resources/icons/crystal_project/date.32x32.png" alt="Select date and time" /></td>';
 
 if (isset($this->data['available.times.prev'])) {
diff --git a/www/saml2/idp/ArtifactResolutionService.php b/www/saml2/idp/ArtifactResolutionService.php
index 975e8d826..16a99dc62 100644
--- a/www/saml2/idp/ArtifactResolutionService.php
+++ b/www/saml2/idp/ArtifactResolutionService.php
@@ -47,7 +47,7 @@ if (!($request instanceof \SAML2\ArtifactResolve)) {
 }
 
 $issuer = $request->getIssuer();
-$spMetadata = $metadata->getMetadataConfig($issuer, 'saml20-sp-remote');
+$spMetadata = $metadata->getMetaDataConfig($issuer, 'saml20-sp-remote');
 
 $artifact = $request->getArtifact();
 
-- 
GitLab