Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

11 files changed

+21
-31
lines changed

src/Adapter/AbstractAdapter.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
abstract class AbstractAdapter implements ValidatableAdapterInterface
1313
{
14-
1514
/**
1615
* @var mixed
1716
*/

src/Adapter/DbTable/AbstractAdapter.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,25 +195,21 @@ public function getResultRowObject($returnColumns = null, $omitColumns = null)
195195
$returnObject = new stdClass();
196196

197197
if (null !== $returnColumns) {
198-
199198
$availableColumns = array_keys($this->resultRow);
200199
foreach ((array) $returnColumns as $returnColumn) {
201200
if (in_array($returnColumn, $availableColumns)) {
202201
$returnObject->{$returnColumn} = $this->resultRow[$returnColumn];
203202
}
204203
}
205204
return $returnObject;
206-
207205
} elseif (null !== $omitColumns) {
208-
209206
$omitColumns = (array) $omitColumns;
210207
foreach ($this->resultRow as $resultColumn => $resultValue) {
211208
if (!in_array($resultColumn, $omitColumns)) {
212209
$returnObject->{$resultColumn} = $resultValue;
213210
}
214211
}
215212
return $returnObject;
216-
217213
}
218214

219215
foreach ($this->resultRow as $resultColumn => $resultValue) {
@@ -352,7 +348,6 @@ protected function authenticateQuerySelect(Sql\Select $dbSelect)
352348
*/
353349
protected function authenticateValidateResultSet(array $resultIdentities)
354350
{
355-
356351
if (count($resultIdentities) < 1) {
357352
$this->authenticateResultInfo['code'] = AuthenticationResult::FAILURE_IDENTITY_NOT_FOUND;
358353
$this->authenticateResultInfo['messages'][] = 'A record with the supplied identity could not be found.';

src/Adapter/Digest.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -180,17 +180,14 @@ public function authenticate()
180180
}
181181
if (substr($line, 0, $idLength) === $id) {
182182
if (CryptUtils::compareStrings(substr($line, -32), md5("$this->identity:$this->realm:$this->credential"))) {
183-
$result['code'] = AuthenticationResult::SUCCESS;
184-
} else {
185-
$result['code'] = AuthenticationResult::FAILURE_CREDENTIAL_INVALID;
186-
$result['messages'][] = 'Password incorrect';
183+
return new AuthenticationResult(AuthenticationResult::SUCCESS, $result['identity'], $result['messages']);
187184
}
188-
return new AuthenticationResult($result['code'], $result['identity'], $result['messages']);
185+
$result['messages'][] = 'Password incorrect';
186+
return new AuthenticationResult(AuthenticationResult::FAILURE_CREDENTIAL_INVALID, $result['identity'], $result['messages']);
189187
}
190188
}
191189

192-
$result['code'] = AuthenticationResult::FAILURE_IDENTITY_NOT_FOUND;
193190
$result['messages'][] = "Username '$this->identity' and realm '$this->realm' combination not found";
194-
return new AuthenticationResult($result['code'], $result['identity'], $result['messages']);
191+
return new AuthenticationResult(AuthenticationResult::FAILURE_IDENTITY_NOT_FOUND, $result['identity'], $result['messages']);
195192
}
196193
}

src/Adapter/Http.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -762,7 +762,6 @@ protected function _parseDigestAuth($header)
762762
if ($this->useOpaque) {
763763
$ret = preg_match('/opaque="([^"]+)"/', $header, $temp);
764764
if (!$ret || empty($temp[1])) {
765-
766765
// Big surprise: IE isn't RFC 2617-compliant.
767766
$headers = $this->request->getHeaders();
768767
if (!$headers->has('User-Agent')) {

src/Adapter/Ldap.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616

1717
class Ldap extends AbstractAdapter
1818
{
19-
2019
/**
2120
* The Zend\Ldap\Ldap context.
2221
*
@@ -214,7 +213,6 @@ public function authenticate()
214213
* credentials against it.
215214
*/
216215
foreach ($this->options as $options) {
217-
218216
if (!is_array($options)) {
219217
throw new Exception\InvalidArgumentException('Adapter options array not an array');
220218
}
@@ -277,7 +275,6 @@ public function authenticate()
277275
$failedAuthorities[$dname] = $groupResult;
278276
}
279277
} catch (LdapException $zle) {
280-
281278
/* LDAP based authentication is notoriously difficult to diagnose. Therefore
282279
* we bend over backwards to capture and record every possible bit of
283280
* information when something goes wrong.

test/Adapter/DbTable/CallbackCheckAdapterTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -377,5 +377,4 @@ protected function _setupAuthAdapter()
377377
{
378378
$this->_adapter = new Adapter\DbTable\CallbackCheckAdapter($this->_db, 'users', 'username', 'password');
379379
}
380-
381380
}

test/Adapter/DbTable/CredentialTreatmentAdapterDb2Test.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
*/
2020
class CredentialTreatmentAdapterDb2Test extends \PHPUnit_Framework_TestCase
2121
{
22-
2322
/**
2423
* IbmDb2 database connection
2524
*

test/Adapter/DbTable/CredentialTreatmentAdapterTest.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,5 +364,4 @@ protected function _setupAuthAdapter()
364364
{
365365
$this->_adapter = new Adapter\DbTable\CredentialTreatmentAdapter($this->_db, 'users', 'username', 'password');
366366
}
367-
368367
}

test/Adapter/DbTableTest.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,8 @@
1717
*/
1818
class DbTableTest extends DbTable\CredentialTreatmentAdapterTest
1919
{
20-
2120
protected function _setupAuthAdapter()
2221
{
2322
$this->_adapter = new Adapter\DbTable($this->_db, 'users', 'username', 'password');
2423
}
25-
2624
}

test/Adapter/Http/ObjectTest.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ public function testValidConfigs()
9898
$this->_digestConfig,
9999
$this->_bothConfig,
100100
);
101-
foreach ($configs as $config)
102-
new Adapter\Http($config);
101+
foreach ($configs as $config) {
102+
new Adapter\Http($config);
103+
}
103104
}
104105

105106
public function testInvalidConfigs()

test/Adapter/Ldap/OnlineTest.php

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -41,20 +41,27 @@ public function setUp()
4141
'password' => TESTS_ZEND_LDAP_PASSWORD,
4242
'baseDn' => TESTS_ZEND_LDAP_BASE_DN,
4343
);
44-
if (defined('TESTS_ZEND_LDAP_PORT'))
44+
if (defined('TESTS_ZEND_LDAP_PORT')) {
4545
$this->options['port'] = TESTS_ZEND_LDAP_PORT;
46-
if (defined('TESTS_ZEND_LDAP_USE_START_TLS'))
46+
}
47+
if (defined('TESTS_ZEND_LDAP_USE_START_TLS')) {
4748
$this->options['useStartTls'] = TESTS_ZEND_LDAP_USE_START_TLS;
48-
if (defined('TESTS_ZEND_LDAP_USE_SSL'))
49+
}
50+
if (defined('TESTS_ZEND_LDAP_USE_SSL')) {
4951
$this->options['useSsl'] = TESTS_ZEND_LDAP_USE_SSL;
50-
if (defined('TESTS_ZEND_LDAP_BIND_REQUIRES_DN'))
52+
}
53+
if (defined('TESTS_ZEND_LDAP_BIND_REQUIRES_DN')) {
5154
$this->options['bindRequiresDn'] = TESTS_ZEND_LDAP_BIND_REQUIRES_DN;
52-
if (defined('TESTS_ZEND_LDAP_ACCOUNT_FILTER_FORMAT'))
55+
}
56+
if (defined('TESTS_ZEND_LDAP_ACCOUNT_FILTER_FORMAT')) {
5357
$this->options['accountFilterFormat'] = TESTS_ZEND_LDAP_ACCOUNT_FILTER_FORMAT;
54-
if (defined('TESTS_ZEND_LDAP_ACCOUNT_DOMAIN_NAME'))
58+
}
59+
if (defined('TESTS_ZEND_LDAP_ACCOUNT_DOMAIN_NAME')) {
5560
$this->options['accountDomainName'] = TESTS_ZEND_LDAP_ACCOUNT_DOMAIN_NAME;
56-
if (defined('TESTS_ZEND_LDAP_ACCOUNT_DOMAIN_NAME_SHORT'))
61+
}
62+
if (defined('TESTS_ZEND_LDAP_ACCOUNT_DOMAIN_NAME_SHORT')) {
5763
$this->options['accountDomainNameShort'] = TESTS_ZEND_LDAP_ACCOUNT_DOMAIN_NAME_SHORT;
64+
}
5865

5966
if (defined('TESTS_ZEND_LDAP_ALT_USERNAME')) {
6067
$this->names[Ldap\Ldap::ACCTNAME_FORM_USERNAME] = TESTS_ZEND_LDAP_ALT_USERNAME;

0 commit comments

Comments
 (0)