Skip to content

Commit

Permalink
repeat helper moved to Repeat namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
acelot committed Apr 5, 2019
1 parent 1feead6 commit 574d1c9
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 9 deletions.
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,12 @@
"Acelot\\Helpers\\": "src"
},
"files": [
"src/repeat_helper.php",
"src/array_helpers.php",
"src/path_helpers.php",
"src/date_helpers.php",
"src/retry_helpers.php",
"src/string_helpers.php",
"src/repeat_helper.php"
"src/string_helpers.php"
]
},
"autoload-dev": {
Expand Down
2 changes: 1 addition & 1 deletion src/repeat_helper.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php declare(strict_types=1);

namespace Acelot\Helpers;
namespace Acelot\Helpers\Repeat;

const SECONDS = 1000000;
const MILLISECONDS = 1000;
Expand Down
10 changes: 10 additions & 0 deletions src/retry_helpers.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,16 @@

namespace Acelot\Helpers;

use const Acelot\Helpers\Repeat\SECONDS as REPEAT_SECONDS;
use const Acelot\Helpers\Repeat\MILLISECONDS as REPEAT_MILLISECONDS;
use function Acelot\Helpers\Repeat\max_attempts;
use function Acelot\Helpers\Repeat\pause;
use function Acelot\Helpers\Repeat\repeat;
use function Acelot\Helpers\Repeat\timeout;

const SECONDS = REPEAT_SECONDS;
const MILLISECONDS = REPEAT_MILLISECONDS;

/**
* Repeats the callback until the answer is returned or timeout occurs.
*
Expand Down
12 changes: 6 additions & 6 deletions tests/RepeatHelperTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

namespace Acelot\Helpers\Tests;

use function Acelot\Helpers\catch_only;
use function Acelot\Helpers\max_attempts;
use const Acelot\Helpers\MILLISECONDS;
use function Acelot\Helpers\pause;
use function Acelot\Helpers\repeat;
use function Acelot\Helpers\timeout;
use const Acelot\Helpers\Repeat\MILLISECONDS;
use function Acelot\Helpers\Repeat\catch_only;
use function Acelot\Helpers\Repeat\max_attempts;
use function Acelot\Helpers\Repeat\pause;
use function Acelot\Helpers\Repeat\repeat;
use function Acelot\Helpers\Repeat\timeout;
use PHPUnit\Framework\TestCase;

class RepeatHelperTest extends TestCase
Expand Down

0 comments on commit 574d1c9

Please sign in to comment.