{"action":"created","comment":{"url":"https://api.github.com/repos/Nentix/xentriq.core/pulls/comments/243099123","pull_request_review_id":186778935,"id":243099123,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI0MzA5OTEyMw==","diff_hunk":"@@ -43,6 +53,59 @@ public function parseOpenTag()\n     \n     public function getEndingTag()\n     {\n-        return CHAR_OB . CHAR_SLASH . \"foreach\" . CHAR_CB;\n+        return ForeachNode::FOREACH_TAG_END;\n+    }\n+    \n+    public function parse(AnatomizerContext &$context)\n+    {\n+        parent::parse($context);\n+        \n+        $this->tag = $context->tag;\n+        $this->parseOpenTag();\n+        \n+        $tagContent = $context->scanner->scanUpToClose(ForeachNode::FOREACH_TAG_END, ForeachNode::FOREACH_TAG_START);\n+        $this->closeTag = $context->scanner->scanUpToAfterClose(CHAR_CB, CHAR_OB);\n+        \n+        $treeHelper = new Anatomizer($tagContent, $this->searchPaths, $context->currentFormId);\n+        $this->children = $treeHelper->parse();\n+    }\n+    \n+    public function outputPhp(RenderContext& $context): bool\n+    {\n+        // get variable's scope\n+        $variableFromScope = $context->renderer->getRenderableVariable($this->name, false, true);\n+        \n+        // initialize scope\n+        $scopeId = $this->alias ? $this->alias : RenderUtils::getNewVariableName();\n+        \n+        $scopeSizeVar = '$' . $scopeId . 'Size';\n+        $scopeIndexVar = '$' . $scopeId . 'Index';\n+        \n+        $context->output .= 'if(is_array('. $variableFromScope .') || '. $variableFromScope .' instanceof Countable) {';\n+        $context->output .= $scopeSizeVar . '= sizeof(' . $variableFromScope . ');' . CHAR_CRLF;\n+        $context->output .= $scopeIndexVar . '= 0;' . CHAR_CRLF;\n+        \n+        $context->renderer->pushNewScope($context->output);\n+        $context->output .= 'foreach(' . $variableFromScope . ' as $' . $scopeId . '){';\n+        $context->output .= $context->renderer->getAssignVariableStatement($scopeId, '$' . $scopeId);\n+        \n+        if (isset($this->meta)) {\n+            // TODO ensure meta is a 'safe' variable-name","path":"src/core/engine/node/ForeachNode.php","position":92,"original_position":92,"commit_id":"6751efb14a168c873a574a269573468479b495ef","original_commit_id":"6751efb14a168c873a574a269573468479b495ef","user":{"login":"sonarcloud[bot]","id":39514782,"node_id":"MDM6Qm90Mzk1MTQ3ODI=","avatar_url":"https://avatars2.githubusercontent.com/in/12526?v=4","gravatar_id":"","url":"https://api.github.com/users/sonarcloud%5Bbot%5D","html_url":"https://github.com/apps/sonarcloud","followers_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/followers","following_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/following{/other_user}","gists_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/gists{/gist_id}","starred_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/subscriptions","organizations_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/orgs","repos_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/repos","events_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/events{/privacy}","received_events_url":"https://api.github.com/users/sonarcloud%5Bbot%5D/received_events","type":"Bot","site_admin":false},"body":"![Code Smell](https://sonarsource.github.io/sonar-github/code_smell.png 'Code Smell') Code Smell: Complete the task associated to this \"TODO\" comment. ([php:S1135](https://sonarcloud.io/organizations/nentix/rules#rule_key=php%3AS1135))\n\n[See it in SonarCloud](https://sonarcloud.io/project/issues?id=Nentix_xentriq.core&pullRequest=76&issues=AWecyhUth8YERCevJUOJ&open=AWecyhUth8YERCevJUOJ)\n\n[ISSUE_KEY]: AWecyhUth8YERCevJUOJ","created_at":"2018-12-19T22:31:51Z","updated_at":"2018-12-19T22:31:52Z","html_url":"https://github.com/Nentix/xentriq.core/pull/76#discussion_r243099123","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/243099123"},"html":{"href":"https://github.com/Nentix/xentriq.core/pull/76#discussion_r243099123"},"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-12-19T22:31:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4c3039f5d845289641d438918eb27b2d5bda489f","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/6751efb14a168c873a574a269573468479b495ef","head":{"label":"Nentix:version_1_0","ref":"version_1_0","sha":"6751efb14a168c873a574a269573468479b495ef","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-12-12T15:13:36Z","pushed_at":"2018-12-19T22:29:04Z","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":2344,"stargazers_count":2,"watchers_count":2,"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":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":11,"watchers":2,"default_branch":"master"}},"base":{"label":"Nentix:development","ref":"development","sha":"eaebfc8811353b6b9aaaf9fcad248d103d141311","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-12-12T15:13:36Z","pushed_at":"2018-12-19T22:29:04Z","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":2344,"stargazers_count":2,"watchers_count":2,"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":11,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":0,"open_issues":11,"watchers":2,"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/6751efb14a168c873a574a269573468479b495ef"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"sonarcloud"}}