Merge pull request #1 from olssonm/dev

Updates to dependencies and documentation.
This commit is contained in:
Marcus Olsson 2016-11-07 17:31:32 +01:00 committed by GitHub
commit 2416c9f9ca
5 changed files with 34 additions and 25 deletions

View File

@ -1,8 +1,11 @@
language: php
php:
- 5.5
- 5.6
- 7.0
- nightly
before_script: composer install
before_script:
- travis_retry composer self-update
- travis_retry composer install --prefer-dist --no-interaction
script: phpunit

View File

@ -1,6 +1,6 @@
# The MIT License (MIT)
Copyright (c) 2015 Marcus Olsson <hello@marcusolsson.me>
Copyright (c) 2016 Marcus Olsson <hello@marcusolsson.me>
> Permission is hereby granted, free of charge, to any person obtaining a copy
> of this software and associated documentation files (the "Software"), to deal

View File

@ -40,22 +40,23 @@ If you've added `Olssonm\Zxcvbn` as an alias, your can access Zxcvbn easily from
``` php
<?php
use Zxcvbn;
class MyClass
class MyClass extends MyOtherClass
{
public function myFunction()
{
$zxcvbn = Zxcvbn::passwordStrength('password');;
dd($zxcvbn->passwordStrength('password'));
$zxcvbn = Zxcvbn::passwordStrength('password');
dd($zxcvbn);
// array:6 [
// "crack_time" => 5.0E-5
// "calc_time" => 0.1857271194458
// "password" => "password"
// "entropy" => 0.0
// "match_sequence" => array:1 []
// "score" => 0
// array:6 [
// "crack_time" => 5.0E-5
// "calc_time" => 0.12961101531982
// "password" => "password"
// "entropy" => 0.0
// "match_sequence" => array:1 []
// "score" => 0
// ]
}
}
@ -72,8 +73,11 @@ The package gives you two different validation rules that you may use; `zxcvbn_m
`zxcvbn_min` allows you to set up a rule for minimum score that the value beeing tested should adhere to.
***Syntax***
`'input' => 'zxcvbn_min:min_value'`
**Syntax**
input' => 'zxcvbn_min:min_value'
**Example**
``` php
<?php
@ -91,8 +95,11 @@ In this example the password should at least have a "score" of three (3) to pass
This is a bit more interesting. `zxcvbn_dictionary` allows you to input both the users username and/or email, and their password. The validator checks that the password doesn't exist in the username, or that they are too similar.
***Syntax***
`'input' => 'xcvbn_dictionary:username,email'`
**Syntax**
'input' => 'xcvbn_dictionary:username,email'
**Example**
``` php
<?php
@ -143,7 +150,7 @@ $ phpunit
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
© 2015 [Marcus Olsson](https://marcusolsson.me).
© 2016 [Marcus Olsson](https://marcusolsson.me).
[ico-version]: https://img.shields.io/packagist/v/olssonm/l5-zxcvbn.svg?style=flat-square
[ico-license]: https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square

View File

@ -21,13 +21,12 @@
],
"require": {
"php" : ">=5.3.0",
"illuminate/support": "~5.1",
"bjeavons/zxcvbn-php": "0.1.4"
"illuminate/support": "~5.3",
"bjeavons/zxcvbn-php": "^0.2"
},
"require-dev": {
"phpunit/phpunit" : "4.*",
"orchestra/testbench": "~3.0",
"scrutinizer/ocular": "~1.1"
"orchestra/testbench": "~3.3"
},
"autoload": {
"psr-4": {
@ -44,7 +43,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.x-dev"
"dev-master": "2.x-dev"
}
},
"minimum-stability": "stable"

View File

@ -74,8 +74,8 @@ class ZxcvbnServiceProvider extends ServiceProvider
*/
public function register()
{
$this->app['zxcvbn'] = $this->app->share(function ($app) {
return new ZxcvbnPhp($this->app['config']);
$this->app->bind('zxcvbn', function ($app) {
return new ZxcvbnPhp();
});
}
}