Skip to content

Commit 4ed071b

Browse files
committed
Updated comments/signatures/formatting.
1 parent d07b1fc commit 4ed071b

File tree

3 files changed

+31
-27
lines changed

3 files changed

+31
-27
lines changed

composer.json

Lines changed: 23 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
{
2-
"name": "typedphp/optional",
3-
"description": "A library to reduce the code required for null-checking.",
4-
"homepage": "https://github.com/typedphp/php-optional",
5-
"license": "MIT",
6-
"authors": [
7-
{
8-
"name": "Christopher Pitt",
9-
"email": "[email protected]"
2+
"name": "typedphp/optional",
3+
"description": "A library to reduce the code required for null-checking.",
4+
"homepage": "https://github.com/typedphp/php-optional",
5+
"license": "MIT",
6+
"authors": [
7+
{
8+
"name": "Christopher Pitt",
9+
"email": "[email protected]"
10+
}
11+
],
12+
"autoload": {
13+
"psr-4": {
14+
"TypedPHP\\Optional\\": "source"
15+
}
16+
},
17+
"require-dev": {
18+
"phpunit/phpunit": "4.*",
19+
"mockery/mockery": "0.*"
20+
},
21+
"autoload-dev": {
22+
"psr-4": {
23+
"TypedPHP\\Optional\\Tests\\": "tests"
24+
}
1025
}
11-
],
12-
"autoload": {
13-
"psr-4": {
14-
"TypedPHP\\Optional\\": "source"
15-
}
16-
},
17-
"require-dev": {
18-
"phpunit/phpunit": "4.*",
19-
"mockery/mockery": "0.*"
20-
},
21-
"autoload-dev": {
22-
"psr-4": {
23-
"TypedPHP\\Optional\\Tests\\": "tests"
24-
}
25-
}
2626
}

source/None.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,21 @@ public function __call($method, $parameters)
1616
}
1717

1818
/**
19+
* @param mixed $then
20+
*
1921
* @return null
2022
*/
21-
public function value()
23+
public function value(callable $then = null)
2224
{
2325
return null;
2426
}
2527

2628
/**
27-
* @param callable $then
29+
* @param mixed $then
2830
*
2931
* @return None
3032
*/
31-
public function none(callable $then)
33+
public function none(callable $then = null)
3234
{
3335
$then();
3436
return $this;

source/Optional.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,11 @@ protected function isNotNone($result)
8181
}
8282

8383
/**
84+
* @param mixed $then
85+
*
8486
* @return $this
8587
*/
86-
public function none()
88+
public function none(callable $then = null)
8789
{
8890
return $this;
8991
}

0 commit comments

Comments
 (0)