Skip to content

Commit 1b9efa6

Browse files
committed
Minor changes.
1 parent ed88f0e commit 1b9efa6

File tree

5 files changed

+9
-17
lines changed

5 files changed

+9
-17
lines changed

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
11
vendor
2-
report

.scrutinizer.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
inherit: true
2-
32
tools:
4-
external_code_coverage: true
5-
3+
external_code_coverage: true
64
checks:
75
php:
86
code_rating: true
97
duplication: true
10-
118
filter:
12-
paths: [source/*, tests/*]
9+
paths: [source/*, tests/*]

source/None.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ class None
88
* @param string $method
99
* @param array $parameters
1010
*
11-
* @return None
11+
* @return $this
1212
*/
1313
public function __call($method, $parameters)
1414
{
@@ -28,7 +28,7 @@ public function value(callable $then = null)
2828
/**
2929
* @param mixed $then
3030
*
31-
* @return None
31+
* @return $this
3232
*/
3333
public function none(callable $then = null)
3434
{

source/Optional.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,13 @@
44

55
class Optional
66
{
7-
87
/**
98
* @var mixed
109
*/
1110
protected $value;
1211

1312
/**
14-
* @param $value
15-
*
16-
* @return Optional
13+
* @param mixed $value
1714
*/
1815
public function __construct($value)
1916
{
@@ -62,8 +59,8 @@ public function __call($method, $parameters)
6259
}
6360

6461
/**
65-
* @param array $callable
66-
* @param array $parameters
62+
* @param callable $callable
63+
* @param array $parameters
6764
*
6865
* @return mixed
6966
*/
@@ -91,7 +88,6 @@ public function none(callable $then = null)
9188
{
9289
if (!$this->isNotNone($this->value)) {
9390
$then();
94-
return;
9591
}
9692

9793
return $this;

tests/OptionalTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ public function itHandlesOptionalsCreatedWithNulls()
123123
{
124124
$optional = new Optional(null);
125125

126-
$optional->value(function() {
126+
$optional->value(function () {
127127
$this->fail("Value should not be called here.");
128128
});
129129

130130
$flag = false;
131131

132-
$optional->none(function() use (&$flag) {
132+
$optional->none(function () use (&$flag) {
133133
$flag = true;
134134
});
135135

0 commit comments

Comments
 (0)