Skip to content

Commit

Permalink
Added min/max length methods to interface.
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Apr 9, 2014
1 parent e71e859 commit a0841bf
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/PasswordGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@

use Rych\Random\Random;

/**
* A basic password generator that generates passwords using alphanumeric
* characters and punctuation.
*/
class PasswordGenerator implements PasswordGeneratorInterface
{
public function __construct(Random $rng = null)
Expand Down
31 changes: 31 additions & 0 deletions src/PasswordGeneratorInterface.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php
namespace Icecave\Abraxas;

/**
* Interface for password generators.
*/
interface PasswordGeneratorInterface
{
/**
Expand All @@ -9,4 +12,32 @@ interface PasswordGeneratorInterface
* @return string The generated password.
*/
public function generate();

/**
* Fetch the minimum length of generated passwords.
*
* @return integer The minimum length of generated passwords.
*/
public function minimumLength();

/**
* Set the minimum length of generated passwords.
*
* @param integer $length The minimum length of generated passwords.
*/
public function setMinimumLength($length);

/**
* Fetch the maximum length of generated passwords.
*
* @return integer The maximum length of generated passwords.
*/
public function maximumLength();

/**
* Set the maximum length of generated passwords.
*
* @param integer $length The maximum length of generated passwords.
*/
public function setMaximumLength($length);
}

0 comments on commit a0841bf

Please sign in to comment.