From 7037f415e42421eccf17b75882aaa130cb19cb4e Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Mon, 24 Jul 2017 15:11:20 +0900 Subject: [PATCH 1/2] move getResourceListGenerator to abstract class --- src/AbstractAppMeta.php | 12 +++++++++--- src/AppMeta.php | 12 ------------ 2 files changed, 9 insertions(+), 15 deletions(-) diff --git a/src/AbstractAppMeta.php b/src/AbstractAppMeta.php index ae8fa5c..f41c39f 100644 --- a/src/AbstractAppMeta.php +++ b/src/AbstractAppMeta.php @@ -6,6 +6,8 @@ */ namespace BEAR\AppMeta; +use Koriym\Psr4List\Psr4List; + abstract class AbstractAppMeta { /** @@ -31,9 +33,13 @@ abstract class AbstractAppMeta public $logDir; /** - * Return resource list generator - * * @return \Generator */ - abstract public function getResourceListGenerator(); + public function getResourceListGenerator() + { + $list = new Psr4List(); + $resourceListGenerator = $list($this->name . '\Resource', $this->appDir . '/src/Resource'); + + return $resourceListGenerator; + } } diff --git a/src/AppMeta.php b/src/AppMeta.php index 9b38599..891d157 100644 --- a/src/AppMeta.php +++ b/src/AppMeta.php @@ -8,7 +8,6 @@ use BEAR\AppMeta\Exception\AppNameException; use BEAR\AppMeta\Exception\NotWritableException; -use Koriym\Psr4List\Psr4List; class AppMeta extends AbstractAppMeta { @@ -39,17 +38,6 @@ public function __construct($name, $context = 'app', $appDir = null) } } - /** - * @return \Generator - */ - public function getResourceListGenerator() - { - $list = new Psr4List; - $resourceListGenerator = $list($this->name . '\Resource', $this->appDir . '/src/Resource'); - - return $resourceListGenerator; - } - /** * @param string $dir */ From e985d7a00335eea67aaf0eb1de2f870e9e93b9e2 Mon Sep 17 00:00:00 2001 From: Akihito Koriyama Date: Mon, 24 Jul 2017 15:28:25 +0900 Subject: [PATCH 2/2] update phpdoc --- src/AppMeta.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AppMeta.php b/src/AppMeta.php index 891d157..e24cab2 100644 --- a/src/AppMeta.php +++ b/src/AppMeta.php @@ -44,7 +44,7 @@ public function __construct($name, $context = 'app', $appDir = null) private function clearTmpDirectory($dir) { /** - * A flag for clear once because called many times during the unit testing + * A flag for not deleting tmp directories many times with single request */ static $cleanUpFlg = [];