Pop\Auth\Auth::factory PHP Method

factory() public static method

Static method to instantiate the auth object and return itself to facilitate chaining methods together.
public static factory ( Pop\Auth\Adapter\AdapterInterface $adapter, integer $encryption ) : Auth
$adapter Pop\Auth\Adapter\AdapterInterface
$encryption integer
return Auth
    public static function factory(Adapter\AdapterInterface $adapter, $encryption = 0)
    {
        return new self($adapter, $encryption);
    }

Usage Example

示例#1
0
 public function testConstructor()
 {
     $this->assertInstanceOf('Pop\\Auth\\Auth', new Auth(new File(__DIR__ . '/../tmp/access.txt')));
     $this->assertInstanceOf('Pop\\Auth\\Auth', Auth::factory(new File(__DIR__ . '/../tmp/access.txt')));
 }