From 63d4371783943bedae7b1a3f47752d120a242119 Mon Sep 17 00:00:00 2001 From: m1 Date: Tue, 19 Jan 2016 19:40:22 +0000 Subject: [PATCH] Clean up --- src/Loader/DirectoryLoader.php | 4 ++-- src/Resource/FileResource.php | 4 ++-- src/Resource/ResourceProvider.php | 2 -- src/Traits/TransformerTrait.php | 8 ++++---- src/Variables/VariableProvider.php | 7 +++---- src/Vars.php | 4 ++-- 6 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/Loader/DirectoryLoader.php b/src/Loader/DirectoryLoader.php index 1915654..f3fd6bd 100644 --- a/src/Loader/DirectoryLoader.php +++ b/src/Loader/DirectoryLoader.php @@ -58,7 +58,7 @@ public function load() /** * Returns the supported files in the directory recursively * - * @return array The supported files in the directories + * @return \RegexIterator The supported files in the directories */ private function getSupportedFilesRecursively() { @@ -76,7 +76,7 @@ private function getSupportedFilesRecursively() /** * Returns the supported files in the directory * - * @return array The supported files in the directory + * @return \RegexIterator The supported files in the directory */ private function getSupportedFiles() { diff --git a/src/Resource/FileResource.php b/src/Resource/FileResource.php index e2bcc5d..1552a18 100644 --- a/src/Resource/FileResource.php +++ b/src/Resource/FileResource.php @@ -254,7 +254,7 @@ private function import2Resource($import, array $imported_resources) * * @param array|string $import The import to create a resource from * - * @return array|\M1\Vars\Resource\ResourceProvider The resource of the import + * @return \M1\Vars\Resource\ResourceProvider The resource of the import */ private function createResource($import) { @@ -377,7 +377,7 @@ private function getBooleanValue($value) /** * Returns the filename of the resource * - * @return mixed The filename + * @return string The filename */ public function getFilename() { diff --git a/src/Resource/ResourceProvider.php b/src/Resource/ResourceProvider.php index 2df558d..7c450b1 100644 --- a/src/Resource/ResourceProvider.php +++ b/src/Resource/ResourceProvider.php @@ -226,8 +226,6 @@ private function getSupportedFilesInDir($entity) /** * Merges various configuration contents into one array * - * @param mixed $contents,... Optional number of arrays to merge - * * @return array The merged contents */ private function mergeContents() diff --git a/src/Traits/TransformerTrait.php b/src/Traits/TransformerTrait.php index 92ce59c..90b9d17 100644 --- a/src/Traits/TransformerTrait.php +++ b/src/Traits/TransformerTrait.php @@ -18,8 +18,6 @@ namespace M1\Vars\Traits; -use M1\Vars\Resource\InternalVariableResource; - /** * Vars transformer class for to*() functions * @@ -35,8 +33,10 @@ public function toEnv() { $dots = $this->toDots(); - foreach ($dots as $dot_k => $dot_v) { - putenv(sprintf('%s=%s', $dot_k, $dot_v)); + if (is_array($dots)) { + foreach ($dots as $dot_k => $dot_v) { + putenv(sprintf('%s=%s', $dot_k, $dot_v)); + } } } diff --git a/src/Variables/VariableProvider.php b/src/Variables/VariableProvider.php index df0f687..2969c85 100644 --- a/src/Variables/VariableProvider.php +++ b/src/Variables/VariableProvider.php @@ -48,9 +48,9 @@ class VariableProvider /** - * The replacement store + * The types of variables * - * @var \M1\Vars\Variables\ReplacementStore $rstore + * @var array $variable_types */ private static $variable_types = array('replacement', 'variable', 'env'); @@ -64,7 +64,7 @@ class VariableProvider /** * The variable store * - * @var \M1\Vars\Variables\ReplacementStore $vstore + * @var \M1\Vars\Variables\VariableStore $vstore */ public $vstore; @@ -75,7 +75,6 @@ class VariableProvider */ public function __construct($vars) { - $this->vars = $vars; $this->vstore = new VariableStore(); $this->rstore = new ReplacementStore($vars); } diff --git a/src/Vars.php b/src/Vars.php index 8b2f740..05bdcdf 100644 --- a/src/Vars.php +++ b/src/Vars.php @@ -315,9 +315,9 @@ public function getResources() } /** - * Returns the CacheProvider if set, if not return false + * Returns the CacheProvider if set * - * @return \M1\Vars\Cache\CacheProvider|false The CacheProvider or false + * @return \M1\Vars\Cache\CacheProvider The CacheProvider */ public function getCache() {