Skip to content
Browse files

Merge branch 'cs/#6490-zend-authentication-cs-fixes'

Close #6490
  • Loading branch information...
2 parents 1539c6a + 8ffbdcf commit 3484e50a5edd943a3adbf8dce983208770ed3b6a @Ocramius Ocramius committed Aug 6, 2014
View
6 library/Zend/Authentication/Adapter/DbTable/AbstractAdapter.php
@@ -334,8 +334,10 @@ protected function authenticateQuerySelect(Sql\Select $dbSelect)
} catch (\Exception $e) {
throw new Exception\RuntimeException(
'The supplied parameters to DbTable failed to '
- . 'produce a valid sql statement, please check table and column names '
- . 'for validity.', 0, $e
+ . 'produce a valid sql statement, please check table and column names '
+ . 'for validity.',
+ 0,
+ $e
);
}
return $resultIdentities;
View
3 library/Zend/Authentication/Adapter/DbTable/Exception/ExceptionInterface.php
@@ -12,4 +12,5 @@
use Zend\Authentication\Adapter\Exception\ExceptionInterface as Exception;
interface ExceptionInterface extends Exception
-{}
+{
+}
View
4 library/Zend/Authentication/Adapter/DbTable/Exception/InvalidArgumentException.php
@@ -11,8 +11,6 @@
use Zend\Authentication\Adapter\Exception;
-class InvalidArgumentException
- extends Exception\InvalidArgumentException
- implements ExceptionInterface
+class InvalidArgumentException extends Exception\InvalidArgumentException implements ExceptionInterface
{
}
View
3 library/Zend/Authentication/Adapter/Exception/ExceptionInterface.php
@@ -12,4 +12,5 @@
use Zend\Authentication\Exception\ExceptionInterface as Exception;
interface ExceptionInterface extends Exception
-{}
+{
+}
View
4 library/Zend/Authentication/Adapter/Exception/InvalidArgumentException.php
@@ -11,8 +11,6 @@
use Zend\Authentication\Exception;
-class InvalidArgumentException
- extends Exception\InvalidArgumentException
- implements ExceptionInterface
+class InvalidArgumentException extends Exception\InvalidArgumentException implements ExceptionInterface
{
}
View
10 library/Zend/Authentication/Adapter/Http.php
@@ -324,8 +324,9 @@ public function getResponse()
public function authenticate()
{
if (empty($this->request) || empty($this->response)) {
- throw new Exception\RuntimeException('Request and Response objects must be set before calling '
- . 'authenticate()');
+ throw new Exception\RuntimeException(
+ 'Request and Response objects must be set before calling authenticate()'
+ );
}
if ($this->imaProxy) {
@@ -476,8 +477,8 @@ protected function _basicAuth($header)
}
if (empty($this->basicResolver)) {
throw new Exception\RuntimeException(
- 'A basicResolver object must be set before doing Basic '
- . 'authentication');
+ 'A basicResolver object must be set before doing Basic authentication'
+ );
}
// Decode the Authorization header
@@ -592,7 +593,6 @@ protected function _digestAuth($header)
// easier
$ha2 = hash('md5', $a2);
-
// Calculate the server's version of the request-digest. This must
// match $data['response']. See RFC 2617, section 3.2.2.1
$message = $data['nonce'] . ':' . $data['nc'] . ':' . $data['cnonce'] . ':' . $data['qop'] . ':' . $ha2;
View
3 library/Zend/Authentication/Adapter/Http/Exception/ExceptionInterface.php
@@ -15,4 +15,5 @@
* HTTP Auth Resolver Exception
*/
interface ExceptionInterface extends Exception
-{}
+{
+}
View
10 library/Zend/Authentication/Adapter/Http/FileResolver.php
@@ -88,14 +88,16 @@ public function resolve($username, $realm, $password = null)
if (empty($username)) {
throw new Exception\InvalidArgumentException('Username is required');
} elseif (!ctype_print($username) || strpos($username, ':') !== false) {
- throw new Exception\InvalidArgumentException('Username must consist only of printable characters, '
- . 'excluding the colon');
+ throw new Exception\InvalidArgumentException(
+ 'Username must consist only of printable characters, excluding the colon'
+ );
}
if (empty($realm)) {
throw new Exception\InvalidArgumentException('Realm is required');
} elseif (!ctype_print($realm) || strpos($realm, ':') !== false) {
- throw new Exception\InvalidArgumentException('Realm must consist only of printable characters, '
- . 'excluding the colon.');
+ throw new Exception\InvalidArgumentException(
+ 'Realm must consist only of printable characters, excluding the colon.'
+ );
}
// Open file, read through looking for matching credentials
View
21 library/Zend/Authentication/Adapter/Ldap.php
@@ -168,8 +168,10 @@ protected function getAuthorityName()
{
$options = $this->getLdap()->getOptions();
$name = $options['accountDomainName'];
- if (!$name)
+ if (!$name) {
$name = $options['accountDomainNameShort'];
+ }
+
return $name ? $name : '';
}
@@ -220,8 +222,10 @@ public function authenticate()
$dname = '';
try {
- if ($messages[1])
+ if ($messages[1]) {
$messages[] = $messages[1];
+ }
+
$messages[1] = '';
$messages[] = $this->optionsToString($options);
@@ -341,9 +345,16 @@ protected function prepareOptions(ZendLdap\Ldap $ldap, array $options)
switch ($key) {
case 'groupScope':
$value = (int) $value;
- if (in_array($value, array(ZendLdap\Ldap::SEARCH_SCOPE_BASE,
- ZendLdap\Ldap::SEARCH_SCOPE_ONE, ZendLdap\Ldap::SEARCH_SCOPE_SUB), true)) {
- $adapterOptions[$key] = $value;
+ if (in_array(
+ $value,
+ array(
+ ZendLdap\Ldap::SEARCH_SCOPE_BASE,
+ ZendLdap\Ldap::SEARCH_SCOPE_ONE,
+ ZendLdap\Ldap::SEARCH_SCOPE_SUB,
+ ),
+ true
+ )) {
+ $adapterOptions[$key] = $value;
}
break;
case 'memberIsDn':
View
3 library/Zend/Authentication/Exception/ExceptionInterface.php
@@ -10,4 +10,5 @@
namespace Zend\Authentication\Exception;
interface ExceptionInterface
-{}
+{
+}

0 comments on commit 3484e50

Please sign in to comment.
Something went wrong with that request. Please try again.