{"action":"created","comment":{"url":"https://api.github.com/repos/Nentix/xentriq.core/pulls/comments/237741675","pull_request_review_id":180115977,"id":237741675,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIzNzc0MTY3NQ==","diff_hunk":"@@ -385,58 +175,67 @@ static function getFirstCallingClazzNotBeing($notBeing)\n             }\n         }\n         \n-        return false;\n+        return null;\n     }\n     \n-    public static function merge(&$object1, &$object2)\n+    /**\n+     *\n+     * @param string $name\n+     */\n+    public static function getEnvironmentVariableName(string $name): string\n     {\n-        if (empty($object1)) {\n-            return $object2;\n-        } else if (empty($object2)) {\n-            return $object1;\n+        if (!is_string($name) || empty($name)) {\n+            return $name;\n         }\n         \n-        foreach ($object2 as $key => $value2) {\n-            if ($value2 instanceof \\stdClass && isset($object1->$key)) {\n-                self::merge($object1->$key, $value2);\n-                continue;\n-            }\n-            \n-            $object1->$key = $value2;\n-        }\n+        $envName = str_replace('.', '_', $name);\n+        $envName = 'XENTRIQ_CONFIG_' . StringUtils::toSnakeCase($envName); // TODO define prefix somewhere\n+        \n+        return strtoupper($envName);\n     }\n     \n     /**\n-     * Can be used to replace occurrences of parameters denoted as '{parameterName}' in a string with the contents of\n-     * the in the parameters array contained value for the key 'parameterName'.\n-     * If a parameter is not contained in the parameters array the value is not replaced and the '{parameterName}'\n-     * string will remain in the resulting output.\n+     * Check if environment variable with specified name exists.\n+     *\n+     * @param string $name\n+     *            The name of the environment variable to check for.\n+     * @param boolean $ignoreCase\n      *\n-     * @param string $string\n-     *            The string in which to replace the parameters.\n-     * @param array $parameters\n-     *            An array containing 'parameterName'->'parameterValue' mappings\n-     * @return string Returns the string with the parameters contained in parameters replaced.\n+     * @return boolean\n      */\n-    public static function replaceStringParameters($string, $parameters)\n+    public static function hasEnvironmentVariable(string $name, bool $ignoreCase = false): bool\n     {\n-        if (!empty($string) && !empty($parameters) && preg_match_all(\"/{(.*?)}/\", $string, $matches) > 0) {\n-            // Use index 1 for the results of the group capture:\n-            foreach ($matches[1] as $match) {\n-                if (array_key_exists($match, $parameters)) {\n-                    $string = str_replace(\"{{$match}}\", $parameters[$match], $string);\n-                }\n-            }\n-        }\n-        return $string;\n+        return (getenv($name) || ArrayUtils::doesArrayHaveValueForKey($_ENV, $name, $ignoreCase));","path":"src/core/Utils.php","position":477,"original_position":477,"commit_id":"5bfa02fbbb5e89d02babd060b3244fbf7ec34ec1","original_commit_id":"5bfa02fbbb5e89d02babd060b3244fbf7ec34ec1","user":{"login":"codacy-bot","id":19940114,"node_id":"MDQ6VXNlcjE5OTQwMTE0","avatar_url":"https://avatars1.githubusercontent.com/u/19940114?v=4","gravatar_id":"","url":"https://api.github.com/users/codacy-bot","html_url":"https://github.com/codacy-bot","followers_url":"https://api.github.com/users/codacy-bot/followers","following_url":"https://api.github.com/users/codacy-bot/following{/other_user}","gists_url":"https://api.github.com/users/codacy-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/codacy-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/codacy-bot/subscriptions","organizations_url":"https://api.github.com/users/codacy-bot/orgs","repos_url":"https://api.github.com/users/codacy-bot/repos","events_url":"https://api.github.com/users/codacy-bot/events{/privacy}","received_events_url":"https://api.github.com/users/codacy-bot/received_events","type":"User","site_admin":false},"body":"![Codacy](https://app.codacy.com/assets/images/favicon.png) Issue found: [Avoid using static access to class '\\Xentriq\\Core\\Utils\\ArrayUtils' in method 'hasEnvironmentVariable'.](https://app.codacy.com/app/ttveldhuis/xentriq.core/pullRequest?prid=2654191)","created_at":"2018-11-30T04:08:12Z","updated_at":"2018-11-30T04:08:13Z","html_url":"https://github.com/Nentix/xentriq.core/pull/76#discussion_r237741675","pull_request_url":"https://api.github.com/repos/Nentix/xentriq.core/pulls/76","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/Nentix/xentriq.core/pulls/comments/237741675"},"html":{"href":"https://github.com/Nentix/xentriq.core/pull/76#discussion_r237741675"},"pull_request":{"href":"https://api.github.com/repos/Nentix/xentriq.core/pulls/76"}}},"pull_request":{"url":"https://api.github.com/repos/Nentix/xentriq.core/pulls/76","id":197160272,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk3MTYwMjcy","html_url":"https://github.com/Nentix/xentriq.core/pull/76","diff_url":"https://github.com/Nentix/xentriq.core/pull/76.diff","patch_url":"https://github.com/Nentix/xentriq.core/pull/76.patch","issue_url":"https://api.github.com/repos/Nentix/xentriq.core/issues/76","number":76,"state":"open","locked":false,"title":"Version 1 0","user":{"login":"ttveldhuis","id":1822698,"node_id":"MDQ6VXNlcjE4MjI2OTg=","avatar_url":"https://avatars3.githubusercontent.com/u/1822698?v=4","gravatar_id":"","url":"https://api.github.com/users/ttveldhuis","html_url":"https://github.com/ttveldhuis","followers_url":"https://api.github.com/users/ttveldhuis/followers","following_url":"https://api.github.com/users/ttveldhuis/following{/other_user}","gists_url":"https://api.github.com/users/ttveldhuis/gists{/gist_id}","starred_url":"https://api.github.com/users/ttveldhuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ttveldhuis/subscriptions","organizations_url":"https://api.github.com/users/ttveldhuis/orgs","repos_url":"https://api.github.com/users/ttveldhuis/repos","events_url":"https://api.github.com/users/ttveldhuis/events{/privacy}","received_events_url":"https://api.github.com/users/ttveldhuis/received_events","type":"User","site_admin":false},"body":"Pull Request to track changes. Not final yet.","created_at":"2018-06-25T15:57:12Z","updated_at":"2018-11-30T04:08:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5dbdfdbb0c5861baacb03a0dd298dbd0b59cc9b6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Nentix/xentriq.core/pulls/76/commits","review_comments_url":"https://api.github.com/repos/Nentix/xentriq.core/pulls/76/comments","review_comment_url":"https://api.github.com/repos/Nentix/xentriq.core/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Nentix/xentriq.core/issues/76/comments","statuses_url":"https://api.github.com/repos/Nentix/xentriq.core/statuses/5bfa02fbbb5e89d02babd060b3244fbf7ec34ec1","head":{"label":"Nentix:version_1_0","ref":"version_1_0","sha":"5bfa02fbbb5e89d02babd060b3244fbf7ec34ec1","user":{"login":"Nentix","id":26377826,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2Mzc3ODI2","avatar_url":"https://avatars3.githubusercontent.com/u/26377826?v=4","gravatar_id":"","url":"https://api.github.com/users/Nentix","html_url":"https://github.com/Nentix","followers_url":"https://api.github.com/users/Nentix/followers","following_url":"https://api.github.com/users/Nentix/following{/other_user}","gists_url":"https://api.github.com/users/Nentix/gists{/gist_id}","starred_url":"https://api.github.com/users/Nentix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nentix/subscriptions","organizations_url":"https://api.github.com/users/Nentix/orgs","repos_url":"https://api.github.com/users/Nentix/repos","events_url":"https://api.github.com/users/Nentix/events{/privacy}","received_events_url":"https://api.github.com/users/Nentix/received_events","type":"Organization","site_admin":false},"repo":{"id":84806795,"node_id":"MDEwOlJlcG9zaXRvcnk4NDgwNjc5NQ==","name":"xentriq.core","full_name":"Nentix/xentriq.core","private":false,"owner":{"login":"Nentix","id":26377826,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2Mzc3ODI2","avatar_url":"https://avatars3.githubusercontent.com/u/26377826?v=4","gravatar_id":"","url":"https://api.github.com/users/Nentix","html_url":"https://github.com/Nentix","followers_url":"https://api.github.com/users/Nentix/followers","following_url":"https://api.github.com/users/Nentix/following{/other_user}","gists_url":"https://api.github.com/users/Nentix/gists{/gist_id}","starred_url":"https://api.github.com/users/Nentix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nentix/subscriptions","organizations_url":"https://api.github.com/users/Nentix/orgs","repos_url":"https://api.github.com/users/Nentix/repos","events_url":"https://api.github.com/users/Nentix/events{/privacy}","received_events_url":"https://api.github.com/users/Nentix/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Nentix/xentriq.core","description":"Xentriq is a Template Rendering System. It allows for developers to create structured projects and provides in better separation for rendering and functional implementation using PHP.","fork":false,"url":"https://api.github.com/repos/Nentix/xentriq.core","forks_url":"https://api.github.com/repos/Nentix/xentriq.core/forks","keys_url":"https://api.github.com/repos/Nentix/xentriq.core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nentix/xentriq.core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nentix/xentriq.core/teams","hooks_url":"https://api.github.com/repos/Nentix/xentriq.core/hooks","issue_events_url":"https://api.github.com/repos/Nentix/xentriq.core/issues/events{/number}","events_url":"https://api.github.com/repos/Nentix/xentriq.core/events","assignees_url":"https://api.github.com/repos/Nentix/xentriq.core/assignees{/user}","branches_url":"https://api.github.com/repos/Nentix/xentriq.core/branches{/branch}","tags_url":"https://api.github.com/repos/Nentix/xentriq.core/tags","blobs_url":"https://api.github.com/repos/Nentix/xentriq.core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nentix/xentriq.core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nentix/xentriq.core/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nentix/xentriq.core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nentix/xentriq.core/statuses/{sha}","languages_url":"https://api.github.com/repos/Nentix/xentriq.core/languages","stargazers_url":"https://api.github.com/repos/Nentix/xentriq.core/stargazers","contributors_url":"https://api.github.com/repos/Nentix/xentriq.core/contributors","subscribers_url":"https://api.github.com/repos/Nentix/xentriq.core/subscribers","subscription_url":"https://api.github.com/repos/Nentix/xentriq.core/subscription","commits_url":"https://api.github.com/repos/Nentix/xentriq.core/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nentix/xentriq.core/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nentix/xentriq.core/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nentix/xentriq.core/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nentix/xentriq.core/contents/{+path}","compare_url":"https://api.github.com/repos/Nentix/xentriq.core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nentix/xentriq.core/merges","archive_url":"https://api.github.com/repos/Nentix/xentriq.core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nentix/xentriq.core/downloads","issues_url":"https://api.github.com/repos/Nentix/xentriq.core/issues{/number}","pulls_url":"https://api.github.com/repos/Nentix/xentriq.core/pulls{/number}","milestones_url":"https://api.github.com/repos/Nentix/xentriq.core/milestones{/number}","notifications_url":"https://api.github.com/repos/Nentix/xentriq.core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nentix/xentriq.core/labels{/name}","releases_url":"https://api.github.com/repos/Nentix/xentriq.core/releases{/id}","deployments_url":"https://api.github.com/repos/Nentix/xentriq.core/deployments","created_at":"2017-03-13T09:17:46Z","updated_at":"2018-10-20T15:30:13Z","pushed_at":"2018-11-29T20:48:13Z","git_url":"git://github.com/Nentix/xentriq.core.git","ssh_url":"git@github.com:Nentix/xentriq.core.git","clone_url":"https://github.com/Nentix/xentriq.core.git","svn_url":"https://github.com/Nentix/xentriq.core","homepage":"","size":2283,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":9,"watchers":1,"default_branch":"master"}},"base":{"label":"Nentix:master","ref":"master","sha":"6d75512fed7b4fcf3357d13f9b0b7acd6be83ace","user":{"login":"Nentix","id":26377826,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2Mzc3ODI2","avatar_url":"https://avatars3.githubusercontent.com/u/26377826?v=4","gravatar_id":"","url":"https://api.github.com/users/Nentix","html_url":"https://github.com/Nentix","followers_url":"https://api.github.com/users/Nentix/followers","following_url":"https://api.github.com/users/Nentix/following{/other_user}","gists_url":"https://api.github.com/users/Nentix/gists{/gist_id}","starred_url":"https://api.github.com/users/Nentix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nentix/subscriptions","organizations_url":"https://api.github.com/users/Nentix/orgs","repos_url":"https://api.github.com/users/Nentix/repos","events_url":"https://api.github.com/users/Nentix/events{/privacy}","received_events_url":"https://api.github.com/users/Nentix/received_events","type":"Organization","site_admin":false},"repo":{"id":84806795,"node_id":"MDEwOlJlcG9zaXRvcnk4NDgwNjc5NQ==","name":"xentriq.core","full_name":"Nentix/xentriq.core","private":false,"owner":{"login":"Nentix","id":26377826,"node_id":"MDEyOk9yZ2FuaXphdGlvbjI2Mzc3ODI2","avatar_url":"https://avatars3.githubusercontent.com/u/26377826?v=4","gravatar_id":"","url":"https://api.github.com/users/Nentix","html_url":"https://github.com/Nentix","followers_url":"https://api.github.com/users/Nentix/followers","following_url":"https://api.github.com/users/Nentix/following{/other_user}","gists_url":"https://api.github.com/users/Nentix/gists{/gist_id}","starred_url":"https://api.github.com/users/Nentix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Nentix/subscriptions","organizations_url":"https://api.github.com/users/Nentix/orgs","repos_url":"https://api.github.com/users/Nentix/repos","events_url":"https://api.github.com/users/Nentix/events{/privacy}","received_events_url":"https://api.github.com/users/Nentix/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Nentix/xentriq.core","description":"Xentriq is a Template Rendering System. It allows for developers to create structured projects and provides in better separation for rendering and functional implementation using PHP.","fork":false,"url":"https://api.github.com/repos/Nentix/xentriq.core","forks_url":"https://api.github.com/repos/Nentix/xentriq.core/forks","keys_url":"https://api.github.com/repos/Nentix/xentriq.core/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Nentix/xentriq.core/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Nentix/xentriq.core/teams","hooks_url":"https://api.github.com/repos/Nentix/xentriq.core/hooks","issue_events_url":"https://api.github.com/repos/Nentix/xentriq.core/issues/events{/number}","events_url":"https://api.github.com/repos/Nentix/xentriq.core/events","assignees_url":"https://api.github.com/repos/Nentix/xentriq.core/assignees{/user}","branches_url":"https://api.github.com/repos/Nentix/xentriq.core/branches{/branch}","tags_url":"https://api.github.com/repos/Nentix/xentriq.core/tags","blobs_url":"https://api.github.com/repos/Nentix/xentriq.core/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Nentix/xentriq.core/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Nentix/xentriq.core/git/refs{/sha}","trees_url":"https://api.github.com/repos/Nentix/xentriq.core/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Nentix/xentriq.core/statuses/{sha}","languages_url":"https://api.github.com/repos/Nentix/xentriq.core/languages","stargazers_url":"https://api.github.com/repos/Nentix/xentriq.core/stargazers","contributors_url":"https://api.github.com/repos/Nentix/xentriq.core/contributors","subscribers_url":"https://api.github.com/repos/Nentix/xentriq.core/subscribers","subscription_url":"https://api.github.com/repos/Nentix/xentriq.core/subscription","commits_url":"https://api.github.com/repos/Nentix/xentriq.core/commits{/sha}","git_commits_url":"https://api.github.com/repos/Nentix/xentriq.core/git/commits{/sha}","comments_url":"https://api.github.com/repos/Nentix/xentriq.core/comments{/number}","issue_comment_url":"https://api.github.com/repos/Nentix/xentriq.core/issues/comments{/number}","contents_url":"https://api.github.com/repos/Nentix/xentriq.core/contents/{+path}","compare_url":"https://api.github.com/repos/Nentix/xentriq.core/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Nentix/xentriq.core/merges","archive_url":"https://api.github.com/repos/Nentix/xentriq.core/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Nentix/xentriq.core/downloads","issues_url":"https://api.github.com/repos/Nentix/xentriq.core/issues{/number}","pulls_url":"https://api.github.com/repos/Nentix/xentriq.core/pulls{/number}","milestones_url":"https://api.github.com/repos/Nentix/xentriq.core/milestones{/number}","notifications_url":"https://api.github.com/repos/Nentix/xentriq.core/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Nentix/xentriq.core/labels{/name}","releases_url":"https://api.github.com/repos/Nentix/xentriq.core/releases{/id}","deployments_url":"https://api.github.com/repos/Nentix/xentriq.core/deployments","created_at":"2017-03-13T09:17:46Z","updated_at":"2018-10-20T15:30:13Z","pushed_at":"2018-11-29T20:48:13Z","git_url":"git://github.com/Nentix/xentriq.core.git","ssh_url":"git@github.com:Nentix/xentriq.core.git","clone_url":"https://github.com/Nentix/xentriq.core.git","svn_url":"https://github.com/Nentix/xentriq.core","homepage":"","size":2283,"stargazers_count":1,"watchers_count":1,"language":"PHP","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":9,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":9,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Nentix/xentriq.core/pulls/76"},"html":{"href":"https://github.com/Nentix/xentriq.core/pull/76"},"issue":{"href":"https://api.github.com/repos/Nentix/xentriq.core/issues/76"},"comments":{"href":"https://api.github.com/repos/Nentix/xentriq.core/issues/76/comments"},"review_comments":{"href":"https://api.github.com/repos/Nentix/xentriq.core/pulls/76/comments"},"review_comment":{"href":"https://api.github.com/repos/Nentix/xentriq.core/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Nentix/xentriq.core/pulls/76/commits"},"statuses":{"href":"https://api.github.com/repos/Nentix/xentriq.core/statuses/5bfa02fbbb5e89d02babd060b3244fbf7ec34ec1"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"codacy-bot"}}