Skip to content
This repository has been archived by the owner on Sep 20, 2021. It is now read-only.

Commit

Permalink
feat(type) Use strict types.
Browse files Browse the repository at this point in the history
  • Loading branch information
Hywan committed Aug 29, 2017
1 parent 68069ed commit 962dea0
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 59 deletions.
3 changes: 2 additions & 1 deletion Source/Option.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* Hoa
*
Expand Down Expand Up @@ -48,7 +50,6 @@
* there is `None` which is the equivalent of `null`. This is a convenient and
* safe way to manipulate an optional value.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
final class Option
Expand Down
2 changes: 2 additions & 0 deletions Source/Prelude.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* Hoa
*
Expand Down
31 changes: 16 additions & 15 deletions Test/Integration/Documentation.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<?php

declare(strict_types=1);

/**
* Hoa
*
Expand Down Expand Up @@ -47,12 +49,11 @@
*
* Test suite of the documentation.
*
* @copyright Copyright © 2007-2017 Hoa community
* @license New BSD License
*/
class Documentation extends Test\Integration\Suite implements Test\Decorrelated
{
public function case_readme_0()
public function case_readme_0(): void
{
$this
->given(
Expand All @@ -70,32 +71,32 @@ public function case_readme_0()
->isTrue();
}

public function case_readme_1()
public function case_readme_1(): void
{
$this
->when($result = Some(42)->unwrap())
->then
->integer($result)
->isEqualTo(42)

->exception(function () {
->exception(function (): void {
None()->unwrap();
})
->isInstanceOf(RuntimeException::class);
}

public function case_readme_2()
public function case_readme_2(): void
{
$this
->given($x = None())
->exception(function () use ($x) {
->exception(function () use ($x): void {
$x->expect('Damn…');
})
->isInstanceOf(RuntimeException::class)
->hasMessage('Damn…');
}

public function case_readme_3()
public function case_readme_3(): void
{
$this
->given(
Expand All @@ -113,7 +114,7 @@ public function case_readme_3()
->isEqualTo(153);
}

public function case_readme_4()
public function case_readme_4(): void
{
$this
->given(
Expand All @@ -134,7 +135,7 @@ public function case_readme_4()
->isEqualTo(153);
}

public function case_readme_5()
public function case_readme_5(): void
{
$this
->given(
Expand All @@ -152,7 +153,7 @@ public function case_readme_5()
->isEqualTo(None());
}

public function case_readme_6()
public function case_readme_6(): void
{
$this
->given($x = None())
Expand All @@ -162,7 +163,7 @@ public function case_readme_6()
->isEqualTo(Some(0));
}

public function case_readme_7()
public function case_readme_7(): void
{
$this
->given(
Expand All @@ -177,7 +178,7 @@ public function case_readme_7()
->isEqualTo(Some(0));
}

public function case_readme_8()
public function case_readme_8(): void
{
$this
->when($result = Some(42)->and(Some(153)))
Expand All @@ -196,7 +197,7 @@ public function case_readme_8()
->isEqualTo(None());
}

public function case_readme_9()
public function case_readme_9(): void
{
$this
->given(
Expand All @@ -218,7 +219,7 @@ public function case_readme_9()
->isEqualTo(None());
}

public function case_readme_10()
public function case_readme_10(): void
{
$this
->when($result = Some(42)->or(Some(153)))
Expand All @@ -232,7 +233,7 @@ public function case_readme_10()
->isEqualTo(Some(153));
}

public function case_readme_11()
public function case_readme_11(): void
{
$this
->given(
Expand Down
Loading

0 comments on commit 962dea0

Please sign in to comment.