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

Commit 2506dd0

Browse files
committed
Merge branch 'feature/strict-types' into release-1.0.0
Close #6 Close #7
2 parents 52a658e + 3c27b3c commit 2506dd0

21 files changed

+82
-28
lines changed

src/AuthenticationInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-expressive-authentication for the canonical source repository
4-
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
55
* @license https://github.com/zendframework/zend-expressive-authentication/blob/master/LICENSE.md New BSD License
66
*/
77

8+
declare(strict_types=1);
9+
810
namespace Zend\Expressive\Authentication;
911

1012
use Psr\Http\Message\ServerRequestInterface;

src/AuthenticationMiddleware.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-expressive-authentication for the canonical source repository
4-
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
55
* @license https://github.com/zendframework/zend-expressive-authentication/blob/master/LICENSE.md New BSD License
66
*/
77

8+
declare(strict_types=1);
9+
810
namespace Zend\Expressive\Authentication;
911

1012
use Interop\Http\Server\MiddlewareInterface;

src/AuthenticationMiddlewareFactory.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-expressive-authentication for the canonical source repository
4-
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
55
* @license https://github.com/zendframework/zend-expressive-authentication/blob/master/LICENSE.md New BSD License
66
*/
77

8+
declare(strict_types=1);
9+
810
namespace Zend\Expressive\Authentication;
911

1012
use Psr\Container\ContainerInterface;

src/ConfigProvider.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-expressive-authentication for the canonical source repository
4-
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
55
* @license https://github.com/zendframework/zend-expressive-authentication/blob/master/LICENSE.md New BSD License
66
*/
77

8+
declare(strict_types=1);
9+
810
namespace Zend\Expressive\Authentication;
911

1012
class ConfigProvider

src/Exception/ExceptionInterface.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-expressive-authentication for the canonical source repository
4-
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
55
* @license https://github.com/zendframework/zend-expressive-authentication/blob/master/LICENSE.md New BSD License
66
*/
77

8+
declare(strict_types=1);
9+
810
namespace Zend\Expressive\Authentication\Exception;
911

1012
/**

src/Exception/InvalidConfigException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-expressive-authentication for the canonical source repository
4-
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
55
* @license https://github.com/zendframework/zend-expressive-authentication/blob/master/LICENSE.md New BSD License
66
*/
77

8+
declare(strict_types=1);
9+
810
namespace Zend\Expressive\Authentication\Exception;
911

1012
class InvalidConfigException extends RuntimeException implements ExceptionInterface

src/Exception/RuntimeException.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-expressive-authentication for the canonical source repository
4-
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
55
* @license https://github.com/zendframework/zend-expressive-authentication/blob/master/LICENSE.md New BSD License
66
*/
77

8+
declare(strict_types=1);
9+
810
namespace Zend\Expressive\Authentication\Exception;
911

1012
class RuntimeException extends \RuntimeException implements

src/ResponsePrototypeTrait.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-expressive-authentication for the canonical source repository
4-
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
55
* @license https://github.com/zendframework/zend-expressive-authentication/blob/master/LICENSE.md New BSD License
66
*/
7+
8+
declare(strict_types=1);
9+
710
namespace Zend\Expressive\Authentication;
811

912
use Psr\Container\ContainerInterface;

src/UserInterface.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-expressive-authentication for the canonical source repository
4-
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
55
* @license https://github.com/zendframework/zend-expressive-authentication/blob/master/LICENSE.md New BSD License
66
*/
7+
8+
declare(strict_types=1);
9+
710
namespace Zend\Expressive\Authentication;
811

912
interface UserInterface

src/UserRepository/Htpasswd.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
<?php
22
/**
33
* @see https://github.com/zendframework/zend-expressive-authentication for the canonical source repository
4-
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (http://www.zend.com)
4+
* @copyright Copyright (c) 2017 Zend Technologies USA Inc. (https://www.zend.com)
55
* @license https://github.com/zendframework/zend-expressive-authentication/blob/master/LICENSE.md New BSD License
66
*/
7+
8+
declare(strict_types=1);
9+
710
namespace Zend\Expressive\Authentication\UserRepository;
811

912
use Zend\Expressive\Authentication\Exception;
@@ -58,9 +61,10 @@ public function authenticate(string $credential, string $password = null) : ?Use
5861
}
5962
fclose($handle);
6063

61-
return $found && password_verify($password, $hash) ?
62-
$this->generateUser($credential) :
63-
null;
64+
return $found
65+
&& password_verify($password === null ? '' : $password, $hash)
66+
? $this->generateUser($credential)
67+
: null;
6468
}
6569

6670
/**

0 commit comments

Comments
 (0)