@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace DeGraciaMathieu\Riddler; |
4 | 4 | |
5 | -use DeGraciaMathieu\Riddler\Password; |
|
5 | +use DeGraciaMathieu\Riddler\Password; |
|
6 | 6 | use Illuminate\Support\ServiceProvider; |
7 | 7 | |
8 | 8 | class RiddlerServiceProvider extends ServiceProvider{ |
@@ -7,22 +7,22 @@ |
||
7 | 7 | |
8 | 8 | class RiddlerServiceProvider extends ServiceProvider{ |
9 | 9 | |
10 | - /** |
|
11 | - * Indicates if loading of the provider is deferred. |
|
12 | - * |
|
13 | - * @var bool |
|
14 | - */ |
|
15 | - protected $defer = false; |
|
10 | + /** |
|
11 | + * Indicates if loading of the provider is deferred. |
|
12 | + * |
|
13 | + * @var bool |
|
14 | + */ |
|
15 | + protected $defer = false; |
|
16 | 16 | |
17 | - public function boot() |
|
18 | - { |
|
19 | - // |
|
20 | - } |
|
17 | + public function boot() |
|
18 | + { |
|
19 | + // |
|
20 | + } |
|
21 | 21 | |
22 | - public function register() |
|
23 | - { |
|
24 | - $this->app->bind(Password::class, function($app) { |
|
25 | - return new Password(); |
|
26 | - }); |
|
27 | - } |
|
22 | + public function register() |
|
23 | + { |
|
24 | + $this->app->bind(Password::class, function($app) { |
|
25 | + return new Password(); |
|
26 | + }); |
|
27 | + } |
|
28 | 28 | } |
@@ -5,7 +5,7 @@ |
||
5 | 5 | use DeGraciaMathieu\Riddler\Password; |
6 | 6 | use Illuminate\Support\ServiceProvider; |
7 | 7 | |
8 | -class RiddlerServiceProvider extends ServiceProvider{ |
|
8 | +class RiddlerServiceProvider extends ServiceProvider { |
|
9 | 9 | |
10 | 10 | /** |
11 | 11 | * Indicates if loading of the provider is deferred. |
@@ -4,14 +4,14 @@ |
||
4 | 4 | |
5 | 5 | class CriteriaBuilder { |
6 | 6 | |
7 | - public function __construct($criteria, $occurence) |
|
8 | - { |
|
9 | - $this->criteria = $criteria; |
|
10 | - $this->occurence = $occurence; |
|
11 | - } |
|
7 | + public function __construct($criteria, $occurence) |
|
8 | + { |
|
9 | + $this->criteria = $criteria; |
|
10 | + $this->occurence = $occurence; |
|
11 | + } |
|
12 | 12 | |
13 | - public function build() |
|
14 | - { |
|
15 | - return $this->occurence->parse($this->criteria->handle()); |
|
16 | - } |
|
13 | + public function build() |
|
14 | + { |
|
15 | + return $this->occurence->parse($this->criteria->handle()); |
|
16 | + } |
|
17 | 17 | } |
@@ -4,10 +4,10 @@ |
||
4 | 4 | |
5 | 5 | class Between extends Occurence |
6 | 6 | { |
7 | - protected $size; |
|
7 | + protected $size; |
|
8 | 8 | |
9 | - public function __construct($smaller, $bigger) |
|
10 | - { |
|
11 | - $this->size = rand($smaller, $bigger); |
|
12 | - } |
|
9 | + public function __construct($smaller, $bigger) |
|
10 | + { |
|
11 | + $this->size = rand($smaller, $bigger); |
|
12 | + } |
|
13 | 13 | } |
@@ -4,10 +4,10 @@ |
||
4 | 4 | |
5 | 5 | class Strict extends Occurence |
6 | 6 | { |
7 | - protected $size; |
|
7 | + protected $size; |
|
8 | 8 | |
9 | - public function __construct($size) |
|
10 | - { |
|
11 | - $this->size = $size; |
|
12 | - } |
|
9 | + public function __construct($size) |
|
10 | + { |
|
11 | + $this->size = $size; |
|
12 | + } |
|
13 | 13 | } |
@@ -4,17 +4,17 @@ |
||
4 | 4 | |
5 | 5 | abstract class Occurence |
6 | 6 | { |
7 | - public function parse(array $dictionary) |
|
8 | - { |
|
9 | - $tmp = []; |
|
7 | + public function parse(array $dictionary) |
|
8 | + { |
|
9 | + $tmp = []; |
|
10 | 10 | |
11 | - for ($i=0; $i < $this->size; $i++) { |
|
11 | + for ($i=0; $i < $this->size; $i++) { |
|
12 | 12 | |
13 | - shuffle($dictionary); |
|
13 | + shuffle($dictionary); |
|
14 | 14 | |
15 | - $tmp[] = $dictionary[0]; |
|
16 | - } |
|
15 | + $tmp[] = $dictionary[0]; |
|
16 | + } |
|
17 | 17 | |
18 | - return $tmp; |
|
19 | - } |
|
18 | + return $tmp; |
|
19 | + } |
|
20 | 20 | } |
@@ -8,7 +8,7 @@ |
||
8 | 8 | { |
9 | 9 | $tmp = []; |
10 | 10 | |
11 | - for ($i=0; $i < $this->size; $i++) { |
|
11 | + for ($i = 0; $i < $this->size; $i++) { |
|
12 | 12 | |
13 | 13 | shuffle($dictionary); |
14 | 14 |
@@ -4,21 +4,21 @@ |
||
4 | 4 | |
5 | 5 | class Password { |
6 | 6 | |
7 | - public function __construct() |
|
8 | - { |
|
9 | - $this->criteriasAggregator = []; |
|
10 | - $this->manager = new Manager; |
|
11 | - } |
|
7 | + public function __construct() |
|
8 | + { |
|
9 | + $this->criteriasAggregator = []; |
|
10 | + $this->manager = new Manager; |
|
11 | + } |
|
12 | 12 | |
13 | - public function addCriteria($criteria, $occurence = null) |
|
14 | - { |
|
15 | - $buildCriteria = $this->manager->buildCriteria($criteria, $occurence); |
|
13 | + public function addCriteria($criteria, $occurence = null) |
|
14 | + { |
|
15 | + $buildCriteria = $this->manager->buildCriteria($criteria, $occurence); |
|
16 | 16 | |
17 | - $this->criteriasAggregator[] = $buildCriteria; |
|
18 | - } |
|
17 | + $this->criteriasAggregator[] = $buildCriteria; |
|
18 | + } |
|
19 | 19 | |
20 | - public function generate() |
|
21 | - { |
|
22 | - return $this->manager->generate($this->criteriasAggregator); |
|
23 | - } |
|
20 | + public function generate() |
|
21 | + { |
|
22 | + return $this->manager->generate($this->criteriasAggregator); |
|
23 | + } |
|
24 | 24 | } |
25 | 25 | \ No newline at end of file |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | class Letter |
6 | 6 | { |
7 | - public function handle() |
|
8 | - { |
|
9 | - return ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; |
|
10 | - } |
|
7 | + public function handle() |
|
8 | + { |
|
9 | + return ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; |
|
10 | + } |
|
11 | 11 | } |
@@ -6,6 +6,6 @@ |
||
6 | 6 | { |
7 | 7 | public function handle() |
8 | 8 | { |
9 | - return ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']; |
|
9 | + return ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']; |
|
10 | 10 | } |
11 | 11 | } |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | class Digit |
6 | 6 | { |
7 | - public function handle() |
|
8 | - { |
|
9 | - return [0,1,2,3,4,5,6,7,8,9]; |
|
10 | - } |
|
7 | + public function handle() |
|
8 | + { |
|
9 | + return [0,1,2,3,4,5,6,7,8,9]; |
|
10 | + } |
|
11 | 11 | } |
@@ -6,6 +6,6 @@ |
||
6 | 6 | { |
7 | 7 | public function handle() |
8 | 8 | { |
9 | - return [0,1,2,3,4,5,6,7,8,9]; |
|
9 | + return [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]; |
|
10 | 10 | } |
11 | 11 | } |
@@ -4,8 +4,8 @@ |
||
4 | 4 | |
5 | 5 | class AccentedLetter |
6 | 6 | { |
7 | - public function handle() |
|
8 | - { |
|
9 | - return ['à','á','â','ã','ä','ø','ò','ó','ô','õ','ö','è','é','ê','ë','î','ï','ù','ú','û','ü','ñ']; |
|
10 | - } |
|
7 | + public function handle() |
|
8 | + { |
|
9 | + return ['à','á','â','ã','ä','ø','ò','ó','ô','õ','ö','è','é','ê','ë','î','ï','ù','ú','û','ü','ñ']; |
|
10 | + } |
|
11 | 11 | } |
@@ -6,6 +6,6 @@ |
||
6 | 6 | { |
7 | 7 | public function handle() |
8 | 8 | { |
9 | - return ['à','á','â','ã','ä','ø','ò','ó','ô','õ','ö','è','é','ê','ë','î','ï','ù','ú','û','ü','ñ']; |
|
9 | + return ['à', 'á', 'â', 'ã', 'ä', 'ø', 'ò', 'ó', 'ô', 'õ', 'ö', 'è', 'é', 'ê', 'ë', 'î', 'ï', 'ù', 'ú', 'û', 'ü', 'ñ']; |
|
10 | 10 | } |
11 | 11 | } |