{"action":"created","comment":{"url":"https://api.github.com/repos/phalcon/zephir/pulls/comments/37516900","id":37516900,"diff_hunk":"@@ -0,0 +1,54 @@\n+<?php\n+/*\n+ +--------------------------------------------------------------------------+\n+ | Zephir Language                                                          |\n+ +--------------------------------------------------------------------------+\n+ | Copyright (c) 2013-2015 Zephir Team and contributors                     |\n+ +--------------------------------------------------------------------------+\n+ | This source file is subject the MIT license, that is bundled with        |\n+ | this package in the file LICENSE, and is available through the           |\n+ | world-wide-web at the following url:                                     |\n+ | http://zephir-lang.com/license.html                                      |\n+ |                                                                          |\n+ | If you did not receive a copy of the MIT license and are unable          |\n+ | to obtain it through the world-wide-web, please send a note to           |\n+ | license@zephir-lang.com so we can mail you a copy immediately.           |\n+ +--------------------------------------------------------------------------+\n+*/\n+\n+namespace Extension\\Optimizers;\n+\n+use Test\\Optimizers\\IsScalar;\n+\n+class IsScalarTest extends \\PHPUnit_Framework_TestCase\n+{\n+    public function testVariable()\n+    {\n+        $t = new IsScalar();\n+\n+        $this->assertTrue($t->testIntVar());\n+        $this->assertTrue($t->testDoubleVar());\n+        $this->assertTrue($t->testBoolVar());\n+        $this->assertTrue($t->testStringVar());\n+        $this->assertTrue($t->testVar());\n+\n+        $this->assertFalse($t->testEmptyArrayVar());\n+    }\n+\n+    public function testVariableParameter()\n+    {\n+        $t = new IsScalar();\n+\n+        $this->assertTrue($t->testVarParameter(1));\n+        $this->assertTrue($t->testVarParameter(1.0));\n+        $this->assertTrue($t->testVarParameter(true));\n+        $this->assertTrue($t->testVarParameter(false));\n+        $this->assertTrue($t->testVarParameter(\"\"));\n+        $this->assertTrue($t->testVarParameter(\"test string\"));\n+\n+        $this->assertFalse($t->testVarParameter([]));\n+        $this->assertFalse($t->testVarParameter([1,2,3,4,5]));\n+        $this->assertFalse($t->testVarParameter($this));\n+        $this->assertFalse($t->testVarParameter(function() {}));","path":"unit-tests/Extension/Optimizers/IsScalarTest.php","position":52,"original_position":52,"commit_id":"08e7298fe265607653457a50d9186ccc591654e2","original_commit_id":"08e7298fe265607653457a50d9186ccc591654e2","user":{"login":"sergeyklay","id":1256298,"avatar_url":"https://avatars.githubusercontent.com/u/1256298?v=3","gravatar_id":"","url":"https://api.github.com/users/sergeyklay","html_url":"https://github.com/sergeyklay","followers_url":"https://api.github.com/users/sergeyklay/followers","following_url":"https://api.github.com/users/sergeyklay/following{/other_user}","gists_url":"https://api.github.com/users/sergeyklay/gists{/gist_id}","starred_url":"https://api.github.com/users/sergeyklay/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sergeyklay/subscriptions","organizations_url":"https://api.github.com/users/sergeyklay/orgs","repos_url":"https://api.github.com/users/sergeyklay/repos","events_url":"https://api.github.com/users/sergeyklay/events{/privacy}","received_events_url":"https://api.github.com/users/sergeyklay/received_events","type":"User","site_admin":false},"body":"What about null ? :)","created_at":"2015-08-20T10:54:04Z","updated_at":"2015-08-20T10:54:04Z","html_url":"https://github.com/phalcon/zephir/pull/1060#discussion_r37516900","pull_request_url":"https://api.github.com/repos/phalcon/zephir/pulls/1060","_links":{"self":{"href":"https://api.github.com/repos/phalcon/zephir/pulls/comments/37516900"},"html":{"href":"https://github.com/phalcon/zephir/pull/1060#discussion_r37516900"},"pull_request":{"href":"https://api.github.com/repos/phalcon/zephir/pulls/1060"}}},"pull_request":{"url":"https://api.github.com/repos/phalcon/zephir/pulls/1060","id":42915589,"html_url":"https://github.com/phalcon/zephir/pull/1060","diff_url":"https://github.com/phalcon/zephir/pull/1060.diff","patch_url":"https://github.com/phalcon/zephir/pull/1060.patch","issue_url":"https://api.github.com/repos/phalcon/zephir/issues/1060","number":1060,"state":"open","locked":false,"title":"Fix #1045, Implement optimizer for is_scalar","user":{"login":"ovr","id":572096,"avatar_url":"https://avatars.githubusercontent.com/u/572096?v=3","gravatar_id":"","url":"https://api.github.com/users/ovr","html_url":"https://github.com/ovr","followers_url":"https://api.github.com/users/ovr/followers","following_url":"https://api.github.com/users/ovr/following{/other_user}","gists_url":"https://api.github.com/users/ovr/gists{/gist_id}","starred_url":"https://api.github.com/users/ovr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ovr/subscriptions","organizations_url":"https://api.github.com/users/ovr/orgs","repos_url":"https://api.github.com/users/ovr/repos","events_url":"https://api.github.com/users/ovr/events{/privacy}","received_events_url":"https://api.github.com/users/ovr/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-08-20T10:47:15Z","updated_at":"2015-08-20T10:54:04Z","closed_at":null,"merged_at":null,"merge_commit_sha":"380696b93560ebc977e537cd878fca8fd12653d4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/phalcon/zephir/pulls/1060/commits","review_comments_url":"https://api.github.com/repos/phalcon/zephir/pulls/1060/comments","review_comment_url":"https://api.github.com/repos/phalcon/zephir/pulls/comments{/number}","comments_url":"https://api.github.com/repos/phalcon/zephir/issues/1060/comments","statuses_url":"https://api.github.com/repos/phalcon/zephir/statuses/08e7298fe265607653457a50d9186ccc591654e2","head":{"label":"ovr:1045_issue-is_scalar","ref":"1045_issue-is_scalar","sha":"08e7298fe265607653457a50d9186ccc591654e2","user":{"login":"ovr","id":572096,"avatar_url":"https://avatars.githubusercontent.com/u/572096?v=3","gravatar_id":"","url":"https://api.github.com/users/ovr","html_url":"https://github.com/ovr","followers_url":"https://api.github.com/users/ovr/followers","following_url":"https://api.github.com/users/ovr/following{/other_user}","gists_url":"https://api.github.com/users/ovr/gists{/gist_id}","starred_url":"https://api.github.com/users/ovr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ovr/subscriptions","organizations_url":"https://api.github.com/users/ovr/orgs","repos_url":"https://api.github.com/users/ovr/repos","events_url":"https://api.github.com/users/ovr/events{/privacy}","received_events_url":"https://api.github.com/users/ovr/received_events","type":"User","site_admin":false},"repo":{"id":13360404,"name":"zephir","full_name":"ovr/zephir","owner":{"login":"ovr","id":572096,"avatar_url":"https://avatars.githubusercontent.com/u/572096?v=3","gravatar_id":"","url":"https://api.github.com/users/ovr","html_url":"https://github.com/ovr","followers_url":"https://api.github.com/users/ovr/followers","following_url":"https://api.github.com/users/ovr/following{/other_user}","gists_url":"https://api.github.com/users/ovr/gists{/gist_id}","starred_url":"https://api.github.com/users/ovr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ovr/subscriptions","organizations_url":"https://api.github.com/users/ovr/orgs","repos_url":"https://api.github.com/users/ovr/repos","events_url":"https://api.github.com/users/ovr/events{/privacy}","received_events_url":"https://api.github.com/users/ovr/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/ovr/zephir","description":":gift: Zephir is a compiled high level language aimed to the creation of C-extensions for PHP","fork":true,"url":"https://api.github.com/repos/ovr/zephir","forks_url":"https://api.github.com/repos/ovr/zephir/forks","keys_url":"https://api.github.com/repos/ovr/zephir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ovr/zephir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ovr/zephir/teams","hooks_url":"https://api.github.com/repos/ovr/zephir/hooks","issue_events_url":"https://api.github.com/repos/ovr/zephir/issues/events{/number}","events_url":"https://api.github.com/repos/ovr/zephir/events","assignees_url":"https://api.github.com/repos/ovr/zephir/assignees{/user}","branches_url":"https://api.github.com/repos/ovr/zephir/branches{/branch}","tags_url":"https://api.github.com/repos/ovr/zephir/tags","blobs_url":"https://api.github.com/repos/ovr/zephir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ovr/zephir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ovr/zephir/git/refs{/sha}","trees_url":"https://api.github.com/repos/ovr/zephir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ovr/zephir/statuses/{sha}","languages_url":"https://api.github.com/repos/ovr/zephir/languages","stargazers_url":"https://api.github.com/repos/ovr/zephir/stargazers","contributors_url":"https://api.github.com/repos/ovr/zephir/contributors","subscribers_url":"https://api.github.com/repos/ovr/zephir/subscribers","subscription_url":"https://api.github.com/repos/ovr/zephir/subscription","commits_url":"https://api.github.com/repos/ovr/zephir/commits{/sha}","git_commits_url":"https://api.github.com/repos/ovr/zephir/git/commits{/sha}","comments_url":"https://api.github.com/repos/ovr/zephir/comments{/number}","issue_comment_url":"https://api.github.com/repos/ovr/zephir/issues/comments{/number}","contents_url":"https://api.github.com/repos/ovr/zephir/contents/{+path}","compare_url":"https://api.github.com/repos/ovr/zephir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ovr/zephir/merges","archive_url":"https://api.github.com/repos/ovr/zephir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ovr/zephir/downloads","issues_url":"https://api.github.com/repos/ovr/zephir/issues{/number}","pulls_url":"https://api.github.com/repos/ovr/zephir/pulls{/number}","milestones_url":"https://api.github.com/repos/ovr/zephir/milestones{/number}","notifications_url":"https://api.github.com/repos/ovr/zephir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ovr/zephir/labels{/name}","releases_url":"https://api.github.com/repos/ovr/zephir/releases{/id}","created_at":"2013-10-06T10:18:42Z","updated_at":"2015-04-05T05:50:08Z","pushed_at":"2015-08-20T10:50:15Z","git_url":"git://github.com/ovr/zephir.git","ssh_url":"git@github.com:ovr/zephir.git","clone_url":"https://github.com/ovr/zephir.git","svn_url":"https://github.com/ovr/zephir","homepage":"http://zephir-lang.com/","size":35908,"stargazers_count":2,"watchers_count":2,"language":"PHP","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"php7"}},"base":{"label":"phalcon:master","ref":"master","sha":"5d1daa8fe8be870fc28327d01995bd1dd0140c0c","user":{"login":"phalcon","id":1221505,"avatar_url":"https://avatars.githubusercontent.com/u/1221505?v=3","gravatar_id":"","url":"https://api.github.com/users/phalcon","html_url":"https://github.com/phalcon","followers_url":"https://api.github.com/users/phalcon/followers","following_url":"https://api.github.com/users/phalcon/following{/other_user}","gists_url":"https://api.github.com/users/phalcon/gists{/gist_id}","starred_url":"https://api.github.com/users/phalcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phalcon/subscriptions","organizations_url":"https://api.github.com/users/phalcon/orgs","repos_url":"https://api.github.com/users/phalcon/repos","events_url":"https://api.github.com/users/phalcon/events{/privacy}","received_events_url":"https://api.github.com/users/phalcon/received_events","type":"User","site_admin":false},"repo":{"id":11478636,"name":"zephir","full_name":"phalcon/zephir","owner":{"login":"phalcon","id":1221505,"avatar_url":"https://avatars.githubusercontent.com/u/1221505?v=3","gravatar_id":"","url":"https://api.github.com/users/phalcon","html_url":"https://github.com/phalcon","followers_url":"https://api.github.com/users/phalcon/followers","following_url":"https://api.github.com/users/phalcon/following{/other_user}","gists_url":"https://api.github.com/users/phalcon/gists{/gist_id}","starred_url":"https://api.github.com/users/phalcon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/phalcon/subscriptions","organizations_url":"https://api.github.com/users/phalcon/orgs","repos_url":"https://api.github.com/users/phalcon/repos","events_url":"https://api.github.com/users/phalcon/events{/privacy}","received_events_url":"https://api.github.com/users/phalcon/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/phalcon/zephir","description":"Zephir is a compiled high level language aimed to the creation of C-extensions for PHP","fork":false,"url":"https://api.github.com/repos/phalcon/zephir","forks_url":"https://api.github.com/repos/phalcon/zephir/forks","keys_url":"https://api.github.com/repos/phalcon/zephir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/phalcon/zephir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/phalcon/zephir/teams","hooks_url":"https://api.github.com/repos/phalcon/zephir/hooks","issue_events_url":"https://api.github.com/repos/phalcon/zephir/issues/events{/number}","events_url":"https://api.github.com/repos/phalcon/zephir/events","assignees_url":"https://api.github.com/repos/phalcon/zephir/assignees{/user}","branches_url":"https://api.github.com/repos/phalcon/zephir/branches{/branch}","tags_url":"https://api.github.com/repos/phalcon/zephir/tags","blobs_url":"https://api.github.com/repos/phalcon/zephir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/phalcon/zephir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/phalcon/zephir/git/refs{/sha}","trees_url":"https://api.github.com/repos/phalcon/zephir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/phalcon/zephir/statuses/{sha}","languages_url":"https://api.github.com/repos/phalcon/zephir/languages","stargazers_url":"https://api.github.com/repos/phalcon/zephir/stargazers","contributors_url":"https://api.github.com/repos/phalcon/zephir/contributors","subscribers_url":"https://api.github.com/repos/phalcon/zephir/subscribers","subscription_url":"https://api.github.com/repos/phalcon/zephir/subscription","commits_url":"https://api.github.com/repos/phalcon/zephir/commits{/sha}","git_commits_url":"https://api.github.com/repos/phalcon/zephir/git/commits{/sha}","comments_url":"https://api.github.com/repos/phalcon/zephir/comments{/number}","issue_comment_url":"https://api.github.com/repos/phalcon/zephir/issues/comments{/number}","contents_url":"https://api.github.com/repos/phalcon/zephir/contents/{+path}","compare_url":"https://api.github.com/repos/phalcon/zephir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/phalcon/zephir/merges","archive_url":"https://api.github.com/repos/phalcon/zephir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/phalcon/zephir/downloads","issues_url":"https://api.github.com/repos/phalcon/zephir/issues{/number}","pulls_url":"https://api.github.com/repos/phalcon/zephir/pulls{/number}","milestones_url":"https://api.github.com/repos/phalcon/zephir/milestones{/number}","notifications_url":"https://api.github.com/repos/phalcon/zephir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/phalcon/zephir/labels{/name}","releases_url":"https://api.github.com/repos/phalcon/zephir/releases{/id}","created_at":"2013-07-17T14:49:27Z","updated_at":"2015-08-20T06:42:48Z","pushed_at":"2015-08-20T10:50:16Z","git_url":"git://github.com/phalcon/zephir.git","ssh_url":"git@github.com:phalcon/zephir.git","clone_url":"https://github.com/phalcon/zephir.git","svn_url":"https://github.com/phalcon/zephir","homepage":"http://zephir-lang.com/","size":22805,"stargazers_count":1131,"watchers_count":1131,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":190,"mirror_url":null,"open_issues_count":158,"forks":190,"open_issues":158,"watchers":1131,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/phalcon/zephir/pulls/1060"},"html":{"href":"https://github.com/phalcon/zephir/pull/1060"},"issue":{"href":"https://api.github.com/repos/phalcon/zephir/issues/1060"},"comments":{"href":"https://api.github.com/repos/phalcon/zephir/issues/1060/comments"},"review_comments":{"href":"https://api.github.com/repos/phalcon/zephir/pulls/1060/comments"},"review_comment":{"href":"https://api.github.com/repos/phalcon/zephir/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/phalcon/zephir/pulls/1060/commits"},"statuses":{"href":"https://api.github.com/repos/phalcon/zephir/statuses/08e7298fe265607653457a50d9186ccc591654e2"}}}}