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

Commit

Permalink
Merge pull request #23 from webimpress/improvement/import-internals
Browse files Browse the repository at this point in the history
Import internal PHP functions + optimize imports
  • Loading branch information
Geert Eltink committed Mar 15, 2018
2 parents 11010dc + faea7e5 commit 8535d3b
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/AuthenticationInterface.php
Expand Up @@ -9,8 +9,8 @@

namespace Zend\Expressive\Authentication;

use Psr\Http\Message\ServerRequestInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;

interface AuthenticationInterface
{
Expand Down
10 changes: 10 additions & 0 deletions src/UserRepository/Htpasswd.php
Expand Up @@ -13,6 +13,16 @@
use Zend\Expressive\Authentication\UserInterface;
use Zend\Expressive\Authentication\UserRepositoryInterface;

use function explode;
use function fclose;
use function fgets;
use function file_exists;
use function fopen;
use function password_verify;
use function sprintf;
use function strpos;
use function trim;

/**
* Adapter for Apache htpasswd file
* It supports only bcrypt hash password for security reason
Expand Down
2 changes: 2 additions & 0 deletions src/UserRepository/HtpasswdFactory.php
Expand Up @@ -12,6 +12,8 @@
use Psr\Container\ContainerInterface;
use Zend\Expressive\Authentication\Exception;

use function sprintf;

class HtpasswdFactory
{
/**
Expand Down
4 changes: 4 additions & 0 deletions src/UserRepository/PdoDatabase.php
Expand Up @@ -15,6 +15,10 @@
use Zend\Expressive\Authentication\UserInterface;
use Zend\Expressive\Authentication\UserRepositoryInterface;

use function password_verify;
use function sprintf;
use function strpos;

/**
* Adapter for PDO database
* It supports only bcrypt hash password for security reason
Expand Down
7 changes: 6 additions & 1 deletion test/ExceptionTest.php
Expand Up @@ -11,9 +11,14 @@

use Generator;
use PHPUnit\Framework\TestCase;
use Psr\Container\ContainerExceptionInterface;
use Zend\Expressive\Authentication\Exception\ExceptionInterface;

use function basename;
use function glob;
use function is_a;
use function strrpos;
use function substr;

class ExceptionTest extends TestCase
{
public function exception() : Generator
Expand Down
2 changes: 1 addition & 1 deletion test/UserRepository/HtpasswdTest.php
Expand Up @@ -11,8 +11,8 @@

use PHPUnit\Framework\TestCase;
use Zend\Expressive\Authentication\UserInterface;
use Zend\Expressive\Authentication\UserRepositoryInterface;
use Zend\Expressive\Authentication\UserRepository\Htpasswd;
use Zend\Expressive\Authentication\UserRepositoryInterface;

class HtpasswdTest extends TestCase
{
Expand Down
2 changes: 1 addition & 1 deletion test/UserRepository/PdoDatabaseTest.php
Expand Up @@ -14,8 +14,8 @@
use Zend\Expressive\Authentication\Exception\InvalidConfigException;
use Zend\Expressive\Authentication\Exception\RuntimeException;
use Zend\Expressive\Authentication\UserInterface;
use Zend\Expressive\Authentication\UserRepositoryInterface;
use Zend\Expressive\Authentication\UserRepository\PdoDatabase;
use Zend\Expressive\Authentication\UserRepositoryInterface;

class PdoDatabaseTest extends TestCase
{
Expand Down

0 comments on commit 8535d3b

Please sign in to comment.