Skip to content

Commit

Permalink
Merge branch 'release/1.1.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
jmalloc committed Sep 18, 2014
2 parents 15017bb + 90552b7 commit 3ac848e
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
language: php

php: ["5.3", "5.4", "5.5"]
php: ["5.3", "5.4", "5.5", "5.6", "hhvm"]

matrix:
allow_failures: [{"php": "5.6"}, {"php": "hhvm"}]
fast_finish: true

env:
global:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Abraxas Changelog

### 1.1.0 (2014-09-18)

* Mutators on `PasswordGenerator` now return `$this` to allow method chaining (thanks @felipemyung)

### 1.0.0 (2014-09-09)

* No API changes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ $password = $generator->generate();
<!-- references -->
[Build Status]: http://img.shields.io/travis/IcecaveStudios/abraxas/develop.svg
[Test Coverage]: http://img.shields.io/coveralls/IcecaveStudios/abraxas/develop.svg
[SemVer]: http://img.shields.io/:semver-1.0.0-green.svg
[SemVer]: http://img.shields.io/:semver-1.1.0-green.svg
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
},
"extra": {
"branch-alias": {
"dev-develop": "1.0.x-dev"
"dev-develop": "1.1.x-dev"
}
}
}
2 changes: 1 addition & 1 deletion src/PackageInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@
class PackageInfo
{
const NAME = 'Abraxas';
const VERSION = '1.0.0';
const VERSION = '1.1.0';
}
24 changes: 24 additions & 0 deletions src/PasswordGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,14 @@ public function minimumLength()
* Set the minimum length of generated passwords.
*
* @param integer $length The minimum length of generated passwords.
*
* @return PasswordGenerator This object.
*/
public function setMinimumLength($length)
{
$this->minimumLength = $length;

return $this;
}

/**
Expand All @@ -51,10 +55,14 @@ public function maximumLength()
* Set the maximum length of generated passwords.
*
* @param integer $length The maximum length of generated passwords.
*
* @return PasswordGenerator This object.
*/
public function setMaximumLength($length)
{
$this->maximumLength = $length;

return $this;
}

/**
Expand All @@ -72,11 +80,15 @@ public function allowUppercase()
* Set whether or not generated passwords may contain symbols.
*
* @param boolean $allow True if uppercase characters are allowed.
*
* @return PasswordGenerator This object.
*/
public function setAllowUppercase($allow)
{
$this->allowUppercase = $allow;
$this->characterSet = null;

return $this;
}

/**
Expand All @@ -93,11 +105,15 @@ public function allowDigits()
* Set whether or not generated passwords may contain symbols.
*
* @param boolean $allow True if digits are allowed.
*
* @return PasswordGenerator This object.
*/
public function setAllowDigits($allow)
{
$this->allowDigits = $allow;
$this->characterSet = null;

return $this;
}

/**
Expand All @@ -117,11 +133,15 @@ public function allowSymbols()
* Set whether or not generated passwords may contain symbols.
*
* @param boolean $allow True if symbols are allowed.
*
* @return PasswordGenerator This object.
*/
public function setAllowSymbols($allow)
{
$this->allowSymbols = $allow;
$this->characterSet = null;

return $this;
}

/**
Expand All @@ -141,11 +161,15 @@ public function allowAmbiguousCharacters()
* Set whether or not generated passwords may ambiguous characters.
*
* @param boolean $allow True if ambiguous characters are allowed.
*
* @return PasswordGenerator This object.
*/
public function setAllowAmbiguousCharacters($allow)
{
$this->allowAmbiguousCharacters = $allow;
$this->characterSet = null;

return $this;
}

/**
Expand Down
4 changes: 4 additions & 0 deletions src/PasswordGeneratorInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public function minimumLength();
* Set the minimum length of generated passwords.
*
* @param integer $length The minimum length of generated passwords.
*
* @return PasswordGeneratorInterface This object.
*/
public function setMinimumLength($length);

Expand All @@ -38,6 +40,8 @@ public function maximumLength();
* Set the maximum length of generated passwords.
*
* @param integer $length The maximum length of generated passwords.
*
* @return PasswordGeneratorInterface This object.
*/
public function setMaximumLength($length);
}
33 changes: 33 additions & 0 deletions test/suite/PasswordGeneratorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,39 @@ public function setUp()
$this->generator = new PasswordGenerator($this->random);
}

public function testMutatorsReturnThis()
{
$this->assertSame(
$this->generator,
$this->generator->setMinimumLength(10)
);

$this->assertSame(
$this->generator,
$this->generator->setMaximumLength(20)
);

$this->assertSame(
$this->generator,
$this->generator->setAllowUppercase(true)
);

$this->assertSame(
$this->generator,
$this->generator->setAllowDigits(true)
);

$this->assertSame(
$this->generator,
$this->generator->setAllowSymbols(true)
);

$this->assertSame(
$this->generator,
$this->generator->setAllowAmbiguousCharacters(true)
);
}

public function testDefaultCharacterSet()
{
$this->assertSame(
Expand Down

0 comments on commit 3ac848e

Please sign in to comment.