@@ -116,13 +116,13 @@ class Settings
116116 * - Sets the paths of the different folders
117117 * - Loads settings info from settings file or array/object provided
118118 *
119- * @param array|object| null $settings SAML Toolkit Settings
120- * @param bool $spValidationOnly Validate or not the IdP data
119+ * @param array|null $settings SAML Toolkit Settings
120+ * @param bool $spValidationOnly Validate or not the IdP data
121121 *
122122 * @throws Error If any settings parameter is invalid
123123 * @throws Exception If Settings is incorrectly supplied
124124 */
125- public function __construct ($ settings = null , $ spValidationOnly = false )
125+ public function __construct (array $ settings = null , $ spValidationOnly = false )
126126 {
127127 $ this ->_spValidationOnly = $ spValidationOnly ;
128128 $ this ->_loadPaths ();
@@ -136,26 +136,14 @@ public function __construct($settings = null, $spValidationOnly = false)
136136 );
137137 }
138138 $ this ->_addDefaultValues ();
139- } else if ( is_array ( $ settings )) {
139+ } else {
140140 if (!$ this ->_loadSettingsFromArray ($ settings )) {
141141 throw new Error (
142142 'Invalid array settings: %s ' ,
143143 Error::SETTINGS_INVALID ,
144144 array (implode (', ' , $ this ->_errors ))
145145 );
146146 }
147- } else if ($ settings instanceof \Settings) {
148- throw new Error (
149- 'Only OneLogin\Saml\Settings objects are supported. ' ,
150- Error::UNSUPPORTED_SETTINGS_OBJECT ,
151- array (implode (', ' , $ this ->_errors ))
152- );
153- } else {
154- throw new Error (
155- 'Invalid array settings: %s ' ,
156- Error::SETTINGS_INVALID ,
157- array (implode (', ' , $ this ->_errors ))
158- );
159147 }
160148
161149 $ this ->formatIdPCert ();
0 commit comments