From b2300f4cfb63f5fa72c78e47501245f08f2c1e6d Mon Sep 17 00:00:00 2001 From: "Timothy J. Warren" Date: Thu, 30 Mar 2017 16:57:58 -0400 Subject: [PATCH] Remove duplicated function --- index.php | 3 +-- src/AnimeClient.php | 12 ------------ src/Controller.php | 2 +- src/ControllerTrait.php | 2 +- src/Dispatcher.php | 2 +- tests/AnimeClientTest.php | 29 ----------------------------- tests/AnimeClientTestCase.php | 2 +- 7 files changed, 5 insertions(+), 47 deletions(-) delete mode 100644 tests/AnimeClientTest.php diff --git a/index.php b/index.php index ad5bb110..b89d9fc0 100644 --- a/index.php +++ b/index.php @@ -17,8 +17,7 @@ namespace Aviat\AnimeClient; use function Aviat\AnimeClient\loadToml; - -use Aviat\AnimeClient\AnimeClient; +use function Aviat\Ion\_dir; // Work around the silly timezone error $timezone = ini_get('date.timezone'); diff --git a/src/AnimeClient.php b/src/AnimeClient.php index 849a0615..f1d07a15 100644 --- a/src/AnimeClient.php +++ b/src/AnimeClient.php @@ -28,18 +28,6 @@ const NOT_FOUND_METHOD = 'notFound'; const ERROR_MESSAGE_METHOD = 'errorPage'; const SRC_DIR = SRC_DIR; -/** - * Joins paths together. Variadic to take an - * arbitrary number of arguments - * - * @param string[] ...$args - * @return string - */ -function _dir(...$args) -{ - return implode(DIRECTORY_SEPARATOR, $args); -} - /** * Load configuration options from .toml files * diff --git a/src/Controller.php b/src/Controller.php index 2886feb7..398011cb 100644 --- a/src/Controller.php +++ b/src/Controller.php @@ -18,7 +18,7 @@ namespace Aviat\AnimeClient; use const Aviat\AnimeClient\SESSION_SEGMENT; -use function Aviat\AnimeClient\_dir; +use function Aviat\Ion\_dir; use Aviat\AnimeClient\API\JsonAPI; use Aviat\Ion\Di\{ContainerAware, ContainerInterface}; diff --git a/src/ControllerTrait.php b/src/ControllerTrait.php index fa44caaa..7f2f4310 100644 --- a/src/ControllerTrait.php +++ b/src/ControllerTrait.php @@ -18,7 +18,7 @@ namespace Aviat\AnimeClient; use const Aviat\AnimeClient\SESSION_SEGMENT; -use function Aviat\AnimeClient\_dir; +use function Aviat\Ion\_dir; use Aviat\AnimeClient\API\JsonAPI; use Aviat\Ion\Di\{ContainerAware, ContainerInterface}; diff --git a/src/Dispatcher.php b/src/Dispatcher.php index 3f3dffd2..2e092c7d 100644 --- a/src/Dispatcher.php +++ b/src/Dispatcher.php @@ -24,7 +24,7 @@ use const Aviat\AnimeClient\{ SRC_DIR }; -use function Aviat\AnimeClient\_dir; +use function Aviat\Ion\_dir; use Aviat\Ion\Di\ContainerInterface; use Aviat\Ion\Friend; diff --git a/tests/AnimeClientTest.php b/tests/AnimeClientTest.php deleted file mode 100644 index 6725c830..00000000 --- a/tests/AnimeClientTest.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @copyright 2015 - 2017 Timothy J. Warren - * @license http://www.opensource.org/licenses/mit-license.html MIT License - * @version 4.0 - * @link https://git.timshomepage.net/timw4mail/HummingBirdAnimeClient - */ - -namespace Aviat\AnimeClient\Tests; - -use function Aviat\AnimeClient\_dir; - -class AnimeClientTest extends AnimeClientTestCase { - /** - * Basic sanity test for _dir function - */ - public function testDir() - { - $this->assertEquals('foo' . \DIRECTORY_SEPARATOR . 'bar', _dir('foo', 'bar')); - } -} diff --git a/tests/AnimeClientTestCase.php b/tests/AnimeClientTestCase.php index d6040b1d..f531273f 100644 --- a/tests/AnimeClientTestCase.php +++ b/tests/AnimeClientTestCase.php @@ -18,7 +18,7 @@ namespace Aviat\AnimeClient\Tests; use const Aviat\AnimeClient\SRC_DIR; -use function Aviat\AnimeClient\_dir; +use function Aviat\Ion\_dir; use Aura\Web\WebFactory; use Aviat\Ion\Json;