summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaime Perez Crespo <jaime.perez@uninett.no>2016-03-03 16:22:06 +0100
committerJaime Perez Crespo <jaime.perez@uninett.no>2016-03-03 16:22:06 +0100
commite374df4be73e5d58361515ba068929d7c33115b0 (patch)
tree0266f2e57b9e7ac7582374c7569389200ad7df22
parent9c3d26ab5932ba05248ea095268ed5eefd979cb8 (diff)
downloadsimplesamlphp-e374df4be73e5d58361515ba068929d7c33115b0.zip
simplesamlphp-e374df4be73e5d58361515ba068929d7c33115b0.tar.gz
simplesamlphp-e374df4be73e5d58361515ba068929d7c33115b0.tar.bz2
Minor formatting issues.
-rw-r--r--lib/SimpleSAML/Utils/Auth.php4
-rw-r--r--lib/SimpleSAML/Utils/System.php34
-rw-r--r--lib/SimpleSAML/Utils/XML.php4
3 files changed, 27 insertions, 15 deletions
diff --git a/lib/SimpleSAML/Utils/Auth.php b/lib/SimpleSAML/Utils/Auth.php
index 8450820..68a7212 100644
--- a/lib/SimpleSAML/Utils/Auth.php
+++ b/lib/SimpleSAML/Utils/Auth.php
@@ -68,7 +68,9 @@ class Auth
$as = new \SimpleSAML_Auth_Simple('admin');
$as->login();
} else {
- throw new \SimpleSAML_Error_Exception('Cannot find "admin" auth source, and admin privileges are required.');
+ throw new \SimpleSAML_Error_Exception(
+ 'Cannot find "admin" auth source, and admin privileges are required.'
+ );
}
}
} \ No newline at end of file
diff --git a/lib/SimpleSAML/Utils/System.php b/lib/SimpleSAML/Utils/System.php
index 6a9ec0e..61e6bfe 100644
--- a/lib/SimpleSAML/Utils/System.php
+++ b/lib/SimpleSAML/Utils/System.php
@@ -71,21 +71,28 @@ class System
{
$globalConfig = \SimpleSAML_Configuration::getInstance();
- $tempDir = rtrim($globalConfig->getString('tempdir', sys_get_temp_dir().DIRECTORY_SEPARATOR.'simplesaml'),
- DIRECTORY_SEPARATOR);
+ $tempDir = rtrim(
+ $globalConfig->getString(
+ 'tempdir',
+ sys_get_temp_dir().DIRECTORY_SEPARATOR.'simplesaml'
+ ),
+ DIRECTORY_SEPARATOR
+ );
if (!is_dir($tempDir)) {
if (!mkdir($tempDir, 0700, true)) {
$error = error_get_last();
- throw new \SimpleSAML_Error_Exception('Error creating temporary directory "'.$tempDir.
- '": '.$error['message']);
+ throw new \SimpleSAML_Error_Exception(
+ 'Error creating temporary directory "'.$tempDir.'": '.$error['message']
+ );
}
} elseif (function_exists('posix_getuid')) {
// check that the owner of the temp directory is the current user
$stat = lstat($tempDir);
if ($stat['uid'] !== posix_getuid()) {
- throw new \SimpleSAML_Error_Exception('Temporary directory "'.$tempDir.
- '" does not belong to the current user.');
+ throw new \SimpleSAML_Error_Exception(
+ 'Temporary directory "'.$tempDir.'" does not belong to the current user.'
+ );
}
}
@@ -174,24 +181,27 @@ class System
$res = @file_put_contents($tmpFile, $data);
if ($res === false) {
$error = error_get_last();
- throw new \SimpleSAML_Error_Exception('Error saving file "'.$tmpFile.
- '": '.$error['message']);
+ throw new \SimpleSAML_Error_Exception(
+ 'Error saving file "'.$tmpFile.'": '.$error['message']
+ );
}
if (self::getOS() !== self::WINDOWS) {
if (!chmod($tmpFile, $mode)) {
unlink($tmpFile);
$error = error_get_last();
- throw new \SimpleSAML_Error_Exception('Error changing file mode of "'.$tmpFile.
- '": '.$error['message']);
+ throw new \SimpleSAML_Error_Exception(
+ 'Error changing file mode of "'.$tmpFile.'": '.$error['message']
+ );
}
}
if (!rename($tmpFile, $filename)) {
unlink($tmpFile);
$error = error_get_last();
- throw new \SimpleSAML_Error_Exception('Error moving "'.$tmpFile.'" to "'.
- $filename.'": '.$error['message']);
+ throw new \SimpleSAML_Error_Exception(
+ 'Error moving "'.$tmpFile.'" to "'.$filename.'": '.$error['message']
+ );
}
}
}
diff --git a/lib/SimpleSAML/Utils/XML.php b/lib/SimpleSAML/Utils/XML.php
index 13b5123..092de6c 100644
--- a/lib/SimpleSAML/Utils/XML.php
+++ b/lib/SimpleSAML/Utils/XML.php
@@ -230,7 +230,7 @@ class XML
try {
$doc = \SAML2_DOMDocumentFactory::fromString($xml);
- } catch(\Exception $e) {
+ } catch (\Exception $e) {
throw new \DOMException('Error parsing XML string.');
}
@@ -405,7 +405,7 @@ class XML
try {
$dom = \SAML2_DOMDocumentFactory::fromString($xml);
$res = true;
- } catch(Exception $e) {
+ } catch (Exception $e) {
$res = false;
}
}