{"action":"created","comment":{"url":"https://api.github.com/repos/ideatosrl/Idephix/pulls/comments/73122751","id":73122751,"diff_hunk":"@@ -0,0 +1,84 @@\n+<?php\n+namespace Idephix\\Task;\n+\n+use Idephix\\Task\\Parameter\\Collection;\n+use Idephix\\Task\\Parameter\\Idephix;\n+use Idephix\\Task\\Parameter\\UserDefined;\n+use Idephix\\Task\\Parameter\\UserDefinedCollection;\n+use Idephix\\Util\\DocBlockParser;\n+\n+class CallableTask implements Task\n+{\n+    private $name;\n+    private $description;\n+    private $parameters;\n+    private $code;\n+\n+    public function __construct($name, $description, $code, Collection $parameters)\n+    {\n+        $this->name = $name;\n+        $this->description = $description;\n+        $this->parameters = $parameters;\n+        $this->code = $code;\n+    }\n+\n+    /**\n+     * @return static\n+     */\n+    public static function buildFromClosure($name, \\Closure $code)\n+    {\n+        $parameters = Collection::dry();\n+\n+        $reflector = new \\ReflectionFunction($code);\n+        $parser = new DocBlockParser($reflector->getDocComment());\n+\n+        foreach ($reflector->getParameters() as $parameter) {\n+            if ($parameter->getClass() && $parameter->getClass()->implementsInterface('\\Idephix\\IdephixInterface')) {\n+                $parameters[] = Idephix::create();\n+                continue;\n+            }\n+\n+            $description = $parser->getParamDescription($parameter->getName());\n+            $default = $parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : null;\n+            $parameters[] = UserDefined::create($parameter->getName(), $description, $default);\n+        }\n+\n+        return new CallableTask(str_replace('_', '', $name), $parser->getDescription(), $code, $parameters);\n+    }\n+\n+    public function name()\n+    {\n+        return $this->name;\n+    }\n+\n+    public function description()\n+    {\n+        return $this->description;\n+    }\n+\n+    /**\n+     * @return Collection\n+     */\n+    public function parameters()\n+    {\n+        return $this->parameters;\n+    }\n+\n+    public function userDefinedParameters()\n+    {\n+        return new UserDefinedCollection($this->parameters);\n+    }\n+\n+    public function code()\n+    {\n+        return $this->code;\n+    }\n+\n+    public static function dummy()","path":"src/Idephix/Task/CallableTask.php","position":77,"original_position":77,"commit_id":"2e3e016dcf282e27e1de6b4a2561d2bc3f5cb46a","original_commit_id":"fcd10dc5b06a48462b0f5a9effc5a1178e9bde46","user":{"login":"ftassi","id":176622,"avatar_url":"https://avatars.githubusercontent.com/u/176622?v=3","gravatar_id":"","url":"https://api.github.com/users/ftassi","html_url":"https://github.com/ftassi","followers_url":"https://api.github.com/users/ftassi/followers","following_url":"https://api.github.com/users/ftassi/following{/other_user}","gists_url":"https://api.github.com/users/ftassi/gists{/gist_id}","starred_url":"https://api.github.com/users/ftassi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ftassi/subscriptions","organizations_url":"https://api.github.com/users/ftassi/orgs","repos_url":"https://api.github.com/users/ftassi/repos","events_url":"https://api.github.com/users/ftassi/events{/privacy}","received_events_url":"https://api.github.com/users/ftassi/received_events","type":"User","site_admin":false},"body":"Serviva sicuramente per i test, ma non vedo utilizzi la momento, probabilmente non serve più. Rimuovo","created_at":"2016-08-02T09:27:13Z","updated_at":"2016-08-02T09:27:13Z","html_url":"https://github.com/ideatosrl/Idephix/pull/71#discussion_r73122751","pull_request_url":"https://api.github.com/repos/ideatosrl/Idephix/pulls/71","_links":{"self":{"href":"https://api.github.com/repos/ideatosrl/Idephix/pulls/comments/73122751"},"html":{"href":"https://github.com/ideatosrl/Idephix/pull/71#discussion_r73122751"},"pull_request":{"href":"https://api.github.com/repos/ideatosrl/Idephix/pulls/71"}}},"pull_request":{"url":"https://api.github.com/repos/ideatosrl/Idephix/pulls/71","id":77732751,"html_url":"https://github.com/ideatosrl/Idephix/pull/71","diff_url":"https://github.com/ideatosrl/Idephix/pull/71.diff","patch_url":"https://github.com/ideatosrl/Idephix/pull/71.patch","issue_url":"https://api.github.com/repos/ideatosrl/Idephix/issues/71","number":71,"state":"open","locked":false,"title":"Extension refactoring","user":{"login":"ftassi","id":176622,"avatar_url":"https://avatars.githubusercontent.com/u/176622?v=3","gravatar_id":"","url":"https://api.github.com/users/ftassi","html_url":"https://github.com/ftassi","followers_url":"https://api.github.com/users/ftassi/followers","following_url":"https://api.github.com/users/ftassi/following{/other_user}","gists_url":"https://api.github.com/users/ftassi/gists{/gist_id}","starred_url":"https://api.github.com/users/ftassi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ftassi/subscriptions","organizations_url":"https://api.github.com/users/ftassi/orgs","repos_url":"https://api.github.com/users/ftassi/repos","events_url":"https://api.github.com/users/ftassi/events{/privacy}","received_events_url":"https://api.github.com/users/ftassi/received_events","type":"User","site_admin":false},"body":"Ho riscritto un po' come vengono gestite le estensioni. Questa forma mi pare flessibile abbastanza da poterla tenere pubblica per un po'. \r\n\r\nRiscrivendo l'estensione per il deploy ho sentito la necessità di avere un modo per sovrascrivere alcune parti (la creazione dell'artefatto imho è troppo specifica del progetto per metterla in un' estensione, mentre le fasi precedenti e successive al deploy sono sempre le stesse). Così ho provato ad ipotizzare un'implementazione che permetta in qualche modo di fare override. Non mi convince molto perché non sono sicuro che sia chiarissimo il funzionamento[1], ma vorrei provarlo per riscrivere il deploy prima di bocciarlo, a meno che non abbiate suggerimenti forti al riguardo. \r\n\r\n[1] Il problema è che definendo un task che si chiama come un metodo di un'estensione faccio in modo che venga eseguito il mio codice al posto di quello dell'estensione stessa, solo che sto sostituendo un metodo, che quindi ha accesso all'istanza dell'estensione, con una funziona che ha uno scope completamente diverso. Potrebbe non essere un problema, dato che se sto facendo un override voglio fare delle cose (e so cosa devo fare), ma il tutto mi sembra un po' farraginoso.\r\n\r\nThis is connected to #75\r\n<!---\r\n@huboard:{\"order\":71.0,\"milestone_order\":71,\"custom_state\":\"\"}\r\n-->","created_at":"2016-07-17T11:06:25Z","updated_at":"2016-08-02T09:27:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"77d54dd0c8305ce804b326c004f7634e3aba438c","assignee":{"login":"ftassi","id":176622,"avatar_url":"https://avatars.githubusercontent.com/u/176622?v=3","gravatar_id":"","url":"https://api.github.com/users/ftassi","html_url":"https://github.com/ftassi","followers_url":"https://api.github.com/users/ftassi/followers","following_url":"https://api.github.com/users/ftassi/following{/other_user}","gists_url":"https://api.github.com/users/ftassi/gists{/gist_id}","starred_url":"https://api.github.com/users/ftassi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ftassi/subscriptions","organizations_url":"https://api.github.com/users/ftassi/orgs","repos_url":"https://api.github.com/users/ftassi/repos","events_url":"https://api.github.com/users/ftassi/events{/privacy}","received_events_url":"https://api.github.com/users/ftassi/received_events","type":"User","site_admin":false},"assignees":[{"login":"ftassi","id":176622,"avatar_url":"https://avatars.githubusercontent.com/u/176622?v=3","gravatar_id":"","url":"https://api.github.com/users/ftassi","html_url":"https://github.com/ftassi","followers_url":"https://api.github.com/users/ftassi/followers","following_url":"https://api.github.com/users/ftassi/following{/other_user}","gists_url":"https://api.github.com/users/ftassi/gists{/gist_id}","starred_url":"https://api.github.com/users/ftassi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ftassi/subscriptions","organizations_url":"https://api.github.com/users/ftassi/orgs","repos_url":"https://api.github.com/users/ftassi/repos","events_url":"https://api.github.com/users/ftassi/events{/privacy}","received_events_url":"https://api.github.com/users/ftassi/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/ideatosrl/Idephix/milestones/1","html_url":"https://github.com/ideatosrl/Idephix/milestones/1.0","labels_url":"https://api.github.com/repos/ideatosrl/Idephix/milestones/1/labels","id":1136732,"number":1,"title":"1.0","description":"","creator":{"login":"micheleorselli","id":173605,"avatar_url":"https://avatars.githubusercontent.com/u/173605?v=3","gravatar_id":"","url":"https://api.github.com/users/micheleorselli","html_url":"https://github.com/micheleorselli","followers_url":"https://api.github.com/users/micheleorselli/followers","following_url":"https://api.github.com/users/micheleorselli/following{/other_user}","gists_url":"https://api.github.com/users/micheleorselli/gists{/gist_id}","starred_url":"https://api.github.com/users/micheleorselli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/micheleorselli/subscriptions","organizations_url":"https://api.github.com/users/micheleorselli/orgs","repos_url":"https://api.github.com/users/micheleorselli/repos","events_url":"https://api.github.com/users/micheleorselli/events{/privacy}","received_events_url":"https://api.github.com/users/micheleorselli/received_events","type":"User","site_admin":false},"open_issues":8,"closed_issues":4,"state":"open","created_at":"2015-05-27T19:45:56Z","updated_at":"2016-07-23T11:11:49Z","due_on":"2016-09-29T22:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/ideatosrl/Idephix/pulls/71/commits","review_comments_url":"https://api.github.com/repos/ideatosrl/Idephix/pulls/71/comments","review_comment_url":"https://api.github.com/repos/ideatosrl/Idephix/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ideatosrl/Idephix/issues/71/comments","statuses_url":"https://api.github.com/repos/ideatosrl/Idephix/statuses/2e3e016dcf282e27e1de6b4a2561d2bc3f5cb46a","head":{"label":"ideatosrl:extension-refactoring","ref":"extension-refactoring","sha":"2e3e016dcf282e27e1de6b4a2561d2bc3f5cb46a","user":{"login":"ideatosrl","id":394453,"avatar_url":"https://avatars.githubusercontent.com/u/394453?v=3","gravatar_id":"","url":"https://api.github.com/users/ideatosrl","html_url":"https://github.com/ideatosrl","followers_url":"https://api.github.com/users/ideatosrl/followers","following_url":"https://api.github.com/users/ideatosrl/following{/other_user}","gists_url":"https://api.github.com/users/ideatosrl/gists{/gist_id}","starred_url":"https://api.github.com/users/ideatosrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideatosrl/subscriptions","organizations_url":"https://api.github.com/users/ideatosrl/orgs","repos_url":"https://api.github.com/users/ideatosrl/repos","events_url":"https://api.github.com/users/ideatosrl/events{/privacy}","received_events_url":"https://api.github.com/users/ideatosrl/received_events","type":"Organization","site_admin":false},"repo":{"id":3523798,"name":"Idephix","full_name":"ideatosrl/Idephix","owner":{"login":"ideatosrl","id":394453,"avatar_url":"https://avatars.githubusercontent.com/u/394453?v=3","gravatar_id":"","url":"https://api.github.com/users/ideatosrl","html_url":"https://github.com/ideatosrl","followers_url":"https://api.github.com/users/ideatosrl/followers","following_url":"https://api.github.com/users/ideatosrl/following{/other_user}","gists_url":"https://api.github.com/users/ideatosrl/gists{/gist_id}","starred_url":"https://api.github.com/users/ideatosrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideatosrl/subscriptions","organizations_url":"https://api.github.com/users/ideatosrl/orgs","repos_url":"https://api.github.com/users/ideatosrl/repos","events_url":"https://api.github.com/users/ideatosrl/events{/privacy}","received_events_url":"https://api.github.com/users/ideatosrl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ideatosrl/Idephix","description":"Ideato automation and deploy tool - ALPHA release - things can catch fire in any moment!","fork":false,"url":"https://api.github.com/repos/ideatosrl/Idephix","forks_url":"https://api.github.com/repos/ideatosrl/Idephix/forks","keys_url":"https://api.github.com/repos/ideatosrl/Idephix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ideatosrl/Idephix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ideatosrl/Idephix/teams","hooks_url":"https://api.github.com/repos/ideatosrl/Idephix/hooks","issue_events_url":"https://api.github.com/repos/ideatosrl/Idephix/issues/events{/number}","events_url":"https://api.github.com/repos/ideatosrl/Idephix/events","assignees_url":"https://api.github.com/repos/ideatosrl/Idephix/assignees{/user}","branches_url":"https://api.github.com/repos/ideatosrl/Idephix/branches{/branch}","tags_url":"https://api.github.com/repos/ideatosrl/Idephix/tags","blobs_url":"https://api.github.com/repos/ideatosrl/Idephix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ideatosrl/Idephix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ideatosrl/Idephix/git/refs{/sha}","trees_url":"https://api.github.com/repos/ideatosrl/Idephix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ideatosrl/Idephix/statuses/{sha}","languages_url":"https://api.github.com/repos/ideatosrl/Idephix/languages","stargazers_url":"https://api.github.com/repos/ideatosrl/Idephix/stargazers","contributors_url":"https://api.github.com/repos/ideatosrl/Idephix/contributors","subscribers_url":"https://api.github.com/repos/ideatosrl/Idephix/subscribers","subscription_url":"https://api.github.com/repos/ideatosrl/Idephix/subscription","commits_url":"https://api.github.com/repos/ideatosrl/Idephix/commits{/sha}","git_commits_url":"https://api.github.com/repos/ideatosrl/Idephix/git/commits{/sha}","comments_url":"https://api.github.com/repos/ideatosrl/Idephix/comments{/number}","issue_comment_url":"https://api.github.com/repos/ideatosrl/Idephix/issues/comments{/number}","contents_url":"https://api.github.com/repos/ideatosrl/Idephix/contents/{+path}","compare_url":"https://api.github.com/repos/ideatosrl/Idephix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ideatosrl/Idephix/merges","archive_url":"https://api.github.com/repos/ideatosrl/Idephix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ideatosrl/Idephix/downloads","issues_url":"https://api.github.com/repos/ideatosrl/Idephix/issues{/number}","pulls_url":"https://api.github.com/repos/ideatosrl/Idephix/pulls{/number}","milestones_url":"https://api.github.com/repos/ideatosrl/Idephix/milestones{/number}","notifications_url":"https://api.github.com/repos/ideatosrl/Idephix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ideatosrl/Idephix/labels{/name}","releases_url":"https://api.github.com/repos/ideatosrl/Idephix/releases{/id}","deployments_url":"https://api.github.com/repos/ideatosrl/Idephix/deployments","created_at":"2012-02-23T09:08:30Z","updated_at":"2016-07-23T21:12:34Z","pushed_at":"2016-08-02T09:26:07Z","git_url":"git://github.com/ideatosrl/Idephix.git","ssh_url":"git@github.com:ideatosrl/Idephix.git","clone_url":"https://github.com/ideatosrl/Idephix.git","svn_url":"https://github.com/ideatosrl/Idephix","homepage":"http://getidephix.com/","size":5369,"stargazers_count":63,"watchers_count":63,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":11,"forks":18,"open_issues":11,"watchers":63,"default_branch":"master"}},"base":{"label":"ideatosrl:master","ref":"master","sha":"da220c83863d146d812509d17622563f7e9b018a","user":{"login":"ideatosrl","id":394453,"avatar_url":"https://avatars.githubusercontent.com/u/394453?v=3","gravatar_id":"","url":"https://api.github.com/users/ideatosrl","html_url":"https://github.com/ideatosrl","followers_url":"https://api.github.com/users/ideatosrl/followers","following_url":"https://api.github.com/users/ideatosrl/following{/other_user}","gists_url":"https://api.github.com/users/ideatosrl/gists{/gist_id}","starred_url":"https://api.github.com/users/ideatosrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideatosrl/subscriptions","organizations_url":"https://api.github.com/users/ideatosrl/orgs","repos_url":"https://api.github.com/users/ideatosrl/repos","events_url":"https://api.github.com/users/ideatosrl/events{/privacy}","received_events_url":"https://api.github.com/users/ideatosrl/received_events","type":"Organization","site_admin":false},"repo":{"id":3523798,"name":"Idephix","full_name":"ideatosrl/Idephix","owner":{"login":"ideatosrl","id":394453,"avatar_url":"https://avatars.githubusercontent.com/u/394453?v=3","gravatar_id":"","url":"https://api.github.com/users/ideatosrl","html_url":"https://github.com/ideatosrl","followers_url":"https://api.github.com/users/ideatosrl/followers","following_url":"https://api.github.com/users/ideatosrl/following{/other_user}","gists_url":"https://api.github.com/users/ideatosrl/gists{/gist_id}","starred_url":"https://api.github.com/users/ideatosrl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ideatosrl/subscriptions","organizations_url":"https://api.github.com/users/ideatosrl/orgs","repos_url":"https://api.github.com/users/ideatosrl/repos","events_url":"https://api.github.com/users/ideatosrl/events{/privacy}","received_events_url":"https://api.github.com/users/ideatosrl/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ideatosrl/Idephix","description":"Ideato automation and deploy tool - ALPHA release - things can catch fire in any moment!","fork":false,"url":"https://api.github.com/repos/ideatosrl/Idephix","forks_url":"https://api.github.com/repos/ideatosrl/Idephix/forks","keys_url":"https://api.github.com/repos/ideatosrl/Idephix/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ideatosrl/Idephix/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ideatosrl/Idephix/teams","hooks_url":"https://api.github.com/repos/ideatosrl/Idephix/hooks","issue_events_url":"https://api.github.com/repos/ideatosrl/Idephix/issues/events{/number}","events_url":"https://api.github.com/repos/ideatosrl/Idephix/events","assignees_url":"https://api.github.com/repos/ideatosrl/Idephix/assignees{/user}","branches_url":"https://api.github.com/repos/ideatosrl/Idephix/branches{/branch}","tags_url":"https://api.github.com/repos/ideatosrl/Idephix/tags","blobs_url":"https://api.github.com/repos/ideatosrl/Idephix/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ideatosrl/Idephix/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ideatosrl/Idephix/git/refs{/sha}","trees_url":"https://api.github.com/repos/ideatosrl/Idephix/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ideatosrl/Idephix/statuses/{sha}","languages_url":"https://api.github.com/repos/ideatosrl/Idephix/languages","stargazers_url":"https://api.github.com/repos/ideatosrl/Idephix/stargazers","contributors_url":"https://api.github.com/repos/ideatosrl/Idephix/contributors","subscribers_url":"https://api.github.com/repos/ideatosrl/Idephix/subscribers","subscription_url":"https://api.github.com/repos/ideatosrl/Idephix/subscription","commits_url":"https://api.github.com/repos/ideatosrl/Idephix/commits{/sha}","git_commits_url":"https://api.github.com/repos/ideatosrl/Idephix/git/commits{/sha}","comments_url":"https://api.github.com/repos/ideatosrl/Idephix/comments{/number}","issue_comment_url":"https://api.github.com/repos/ideatosrl/Idephix/issues/comments{/number}","contents_url":"https://api.github.com/repos/ideatosrl/Idephix/contents/{+path}","compare_url":"https://api.github.com/repos/ideatosrl/Idephix/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ideatosrl/Idephix/merges","archive_url":"https://api.github.com/repos/ideatosrl/Idephix/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ideatosrl/Idephix/downloads","issues_url":"https://api.github.com/repos/ideatosrl/Idephix/issues{/number}","pulls_url":"https://api.github.com/repos/ideatosrl/Idephix/pulls{/number}","milestones_url":"https://api.github.com/repos/ideatosrl/Idephix/milestones{/number}","notifications_url":"https://api.github.com/repos/ideatosrl/Idephix/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ideatosrl/Idephix/labels{/name}","releases_url":"https://api.github.com/repos/ideatosrl/Idephix/releases{/id}","deployments_url":"https://api.github.com/repos/ideatosrl/Idephix/deployments","created_at":"2012-02-23T09:08:30Z","updated_at":"2016-07-23T21:12:34Z","pushed_at":"2016-08-02T09:26:07Z","git_url":"git://github.com/ideatosrl/Idephix.git","ssh_url":"git@github.com:ideatosrl/Idephix.git","clone_url":"https://github.com/ideatosrl/Idephix.git","svn_url":"https://github.com/ideatosrl/Idephix","homepage":"http://getidephix.com/","size":5369,"stargazers_count":63,"watchers_count":63,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"open_issues_count":11,"forks":18,"open_issues":11,"watchers":63,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ideatosrl/Idephix/pulls/71"},"html":{"href":"https://github.com/ideatosrl/Idephix/pull/71"},"issue":{"href":"https://api.github.com/repos/ideatosrl/Idephix/issues/71"},"comments":{"href":"https://api.github.com/repos/ideatosrl/Idephix/issues/71/comments"},"review_comments":{"href":"https://api.github.com/repos/ideatosrl/Idephix/pulls/71/comments"},"review_comment":{"href":"https://api.github.com/repos/ideatosrl/Idephix/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ideatosrl/Idephix/pulls/71/commits"},"statuses":{"href":"https://api.github.com/repos/ideatosrl/Idephix/statuses/2e3e016dcf282e27e1de6b4a2561d2bc3f5cb46a"}}}}
{"actor":{"display_login":"ftassi"}}