Skip to content

Commit 574d1c9

Browse files
committed
repeat helper moved to Repeat namespace
1 parent 1feead6 commit 574d1c9

File tree

4 files changed

+19
-9
lines changed

4 files changed

+19
-9
lines changed

composer.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
"Acelot\\Helpers\\": "src"
2626
},
2727
"files": [
28+
"src/repeat_helper.php",
2829
"src/array_helpers.php",
2930
"src/path_helpers.php",
3031
"src/date_helpers.php",
3132
"src/retry_helpers.php",
32-
"src/string_helpers.php",
33-
"src/repeat_helper.php"
33+
"src/string_helpers.php"
3434
]
3535
},
3636
"autoload-dev": {

src/repeat_helper.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php declare(strict_types=1);
22

3-
namespace Acelot\Helpers;
3+
namespace Acelot\Helpers\Repeat;
44

55
const SECONDS = 1000000;
66
const MILLISECONDS = 1000;

src/retry_helpers.php

+10
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,16 @@
22

33
namespace Acelot\Helpers;
44

5+
use const Acelot\Helpers\Repeat\SECONDS as REPEAT_SECONDS;
6+
use const Acelot\Helpers\Repeat\MILLISECONDS as REPEAT_MILLISECONDS;
7+
use function Acelot\Helpers\Repeat\max_attempts;
8+
use function Acelot\Helpers\Repeat\pause;
9+
use function Acelot\Helpers\Repeat\repeat;
10+
use function Acelot\Helpers\Repeat\timeout;
11+
12+
const SECONDS = REPEAT_SECONDS;
13+
const MILLISECONDS = REPEAT_MILLISECONDS;
14+
515
/**
616
* Repeats the callback until the answer is returned or timeout occurs.
717
*

tests/RepeatHelperTest.php

+6-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22

33
namespace Acelot\Helpers\Tests;
44

5-
use function Acelot\Helpers\catch_only;
6-
use function Acelot\Helpers\max_attempts;
7-
use const Acelot\Helpers\MILLISECONDS;
8-
use function Acelot\Helpers\pause;
9-
use function Acelot\Helpers\repeat;
10-
use function Acelot\Helpers\timeout;
5+
use const Acelot\Helpers\Repeat\MILLISECONDS;
6+
use function Acelot\Helpers\Repeat\catch_only;
7+
use function Acelot\Helpers\Repeat\max_attempts;
8+
use function Acelot\Helpers\Repeat\pause;
9+
use function Acelot\Helpers\Repeat\repeat;
10+
use function Acelot\Helpers\Repeat\timeout;
1111
use PHPUnit\Framework\TestCase;
1212

1313
class RepeatHelperTest extends TestCase

0 commit comments

Comments
 (0)