Skip to content

Commit b43bf04

Browse files
authored
Merge pull request #1 from StyleCI
Apply fixes from StyleCI
2 parents 1c1a2ce + 703b5ae commit b43bf04

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

config/otp.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
<?php
22

33
return [
4-
/**
4+
/*
55
* This is the default number of digits for all your calls.
66
*/
77
'digits' => 6,
88

9-
/**
9+
/*
1010
* This is the default expiry time for all your calls.
1111
*/
1212
'expiry' => 10,

src/OtpManager.php

+15-15
Original file line numberDiff line numberDiff line change
@@ -7,41 +7,41 @@ class OtpManager
77
/**
88
* Otp expiry limit - Default: 10 min.
99
*
10-
* @var integer
10+
* @var int
1111
*/
1212
protected $expiry = 600;
1313

1414
/**
15-
* Otp digits - Default: 4
15+
* Otp digits - Default: 4.
1616
*
17-
* @var integer
17+
* @var int
1818
*/
1919
protected $digits = 4;
2020

2121
/**
22-
* @var integer
22+
* @var int
2323
*/
2424
protected $time;
2525

2626
/**
27-
* Alias methods for generate
27+
* Alias methods for generate.
2828
*
2929
* @var array
3030
*/
3131
protected $aliasgenerate = ['make', 'create'];
3232

3333
/**
34-
* Alias methods for check
34+
* Alias methods for check.
3535
*
3636
* @var array
3737
*/
3838
protected $aliasCheck = ['verify', 'match'];
3939

4040
/**
41-
* OtpFactory Constructor
41+
* OtpFactory Constructor.
4242
*
43-
* @param integer $digits
44-
* @param integer $expiry
43+
* @param int $digits
44+
* @param int $expiry
4545
*/
4646
public function __construct($digits = null, $expiry = null)
4747
{
@@ -56,7 +56,7 @@ public function __construct($digits = null, $expiry = null)
5656
}
5757

5858
/**
59-
* @param integer $expiry
59+
* @param int $expiry
6060
* @return self
6161
*/
6262
public function expiry($expiry)
@@ -71,7 +71,7 @@ public function expiry($expiry)
7171
}
7272

7373
/**
74-
* @param integer $digits
74+
* @param int $digits
7575
* @return self
7676
*/
7777
public function digits($digits)
@@ -97,7 +97,7 @@ public function generate($secret)
9797
/**
9898
* @param string $code
9999
* @param string $secret
100-
* @return boolean
100+
* @return bool
101101
*/
102102
public function check($code, $secret)
103103
{
@@ -107,12 +107,12 @@ public function check($code, $secret)
107107

108108
$factor = ($this->time - floor($this->expiry / 2)) / $this->expiry;
109109

110-
return ($code == $this->calculate($secret, $factor));
110+
return $code == $this->calculate($secret, $factor);
111111
}
112112

113113
/**
114114
* @param string $secret
115-
* @param double $factor
115+
* @param float $factor
116116
* @return string
117117
*/
118118
protected function calculate($secret, $factor = null)
@@ -134,7 +134,7 @@ protected function calculate($secret, $factor = null)
134134
}
135135

136136
/**
137-
* @param double|null $divisionFactor
137+
* @param float|null $divisionFactor
138138
* @return string
139139
*/
140140
protected function timeFactor($divisionFactor)

tests/TestCase.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ protected function getPackageProviders($app)
1414
protected function getPackageAliases($app)
1515
{
1616
return [
17-
'Otp' => 'Tzsk\Otp\Facade\Otp'
17+
'Otp' => 'Tzsk\Otp\Facade\Otp',
1818
];
1919
}
2020
}

0 commit comments

Comments
 (0)