{"action":"created","comment":{"url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/comments/93935625","pull_request_review_id":14466893,"id":93935625,"diff_hunk":"@@ -0,0 +1,74 @@\n+<?php\n+\n+declare(strict_types=1);\n+\n+namespace CacheBundle\\Annotation;\n+\n+use CacheBundle\\Exception\\CacheException;\n+use Symfony\\Component\\Cache\\Adapter\\FilesystemAdapter;\n+use Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage;\n+\n+/**\n+ * @Annotation\n+ * @Target({\"METHOD\"})\n+ */\n+class CacheExpression extends Cache\n+{\n+    /**\n+     * @var ExpressionLanguage\n+     */\n+    protected $expressionLanguage;\n+\n+    /**\n+     * @var object\n+     */\n+    private $context;\n+\n+    /**\n+     * @var bool\n+     */\n+    private $hasEvaluation = false;\n+\n+    /**\n+     * @inheritDoc\n+     */\n+    public function getCache() : string\n+    {\n+        if (!$this->hasEvaluation) {\n+            $this->cache = $this->getExpressionLanguage()->evaluate($this->cache, ['this' => $this->context]);\n+            $this->hasEvaluation = true;\n+        }\n+\n+        return $this->cache;\n+    }\n+\n+    /**\n+     * @param   object  $context\n+     *\n+     * @return  CacheExpression\n+     */\n+    public function setContext($context) : self\n+    {\n+        $this->context = $context;\n+\n+        return $this;\n+    }\n+\n+    /**\n+     * @return  ExpressionLanguage\n+     *\n+     * @throws  CacheException\n+     */\n+    private function getExpressionLanguage() : ExpressionLanguage\n+    {\n+        if (null === $this->expressionLanguage) {\n+            if (!class_exists('Symfony\\Component\\ExpressionLanguage\\ExpressionLanguage')) {\n+                throw new CacheException('Unable to use expressions as the Symfony ExpressionLanguage component is not installed.');\n+            }\n+\n+            $this->expressionLanguage = new ExpressionLanguage(new FilesystemAdapter('expr_cache'));\n+        }","path":"src/CacheBundle/Annotation/CacheExpression.php","position":70,"original_position":70,"commit_id":"0c8645c597cc434f4e2572e7d2031cd1567039e3","original_commit_id":"0c8645c597cc434f4e2572e7d2031cd1567039e3","user":{"login":"devrck","id":16414298,"avatar_url":"https://avatars.githubusercontent.com/u/16414298?v=3","gravatar_id":"","url":"https://api.github.com/users/devrck","html_url":"https://github.com/devrck","followers_url":"https://api.github.com/users/devrck/followers","following_url":"https://api.github.com/users/devrck/following{/other_user}","gists_url":"https://api.github.com/users/devrck/gists{/gist_id}","starred_url":"https://api.github.com/users/devrck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devrck/subscriptions","organizations_url":"https://api.github.com/users/devrck/orgs","repos_url":"https://api.github.com/users/devrck/repos","events_url":"https://api.github.com/users/devrck/events{/privacy}","received_events_url":"https://api.github.com/users/devrck/received_events","type":"User","site_admin":false},"body":"Your talkin' about the `new FilesystemAdapter`?","created_at":"2016-12-27T14:24:57Z","updated_at":"2016-12-27T14:24:57Z","html_url":"https://github.com/eMAGTechLabs/cachebundle/pull/16#discussion_r93935625","pull_request_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/16","_links":{"self":{"href":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/comments/93935625"},"html":{"href":"https://github.com/eMAGTechLabs/cachebundle/pull/16#discussion_r93935625"},"pull_request":{"href":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/16"}}},"pull_request":{"url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/16","id":99442399,"html_url":"https://github.com/eMAGTechLabs/cachebundle/pull/16","diff_url":"https://github.com/eMAGTechLabs/cachebundle/pull/16.diff","patch_url":"https://github.com/eMAGTechLabs/cachebundle/pull/16.patch","issue_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/issues/16","number":16,"state":"open","locked":false,"title":"Cache expression","user":{"login":"devrck","id":16414298,"avatar_url":"https://avatars.githubusercontent.com/u/16414298?v=3","gravatar_id":"","url":"https://api.github.com/users/devrck","html_url":"https://github.com/devrck","followers_url":"https://api.github.com/users/devrck/followers","following_url":"https://api.github.com/users/devrck/following{/other_user}","gists_url":"https://api.github.com/users/devrck/gists{/gist_id}","starred_url":"https://api.github.com/users/devrck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devrck/subscriptions","organizations_url":"https://api.github.com/users/devrck/orgs","repos_url":"https://api.github.com/users/devrck/repos","events_url":"https://api.github.com/users/devrck/events{/privacy}","received_events_url":"https://api.github.com/users/devrck/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-12-27T13:02:25Z","updated_at":"2016-12-27T14:24:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b704dd0bb95f660ead95b88fe0e2d539e6ef82a1","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/16/commits","review_comments_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/16/comments","review_comment_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/comments{/number}","comments_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/issues/16/comments","statuses_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/statuses/0c8645c597cc434f4e2572e7d2031cd1567039e3","head":{"label":"devrck:cache-expression","ref":"cache-expression","sha":"0c8645c597cc434f4e2572e7d2031cd1567039e3","user":{"login":"devrck","id":16414298,"avatar_url":"https://avatars.githubusercontent.com/u/16414298?v=3","gravatar_id":"","url":"https://api.github.com/users/devrck","html_url":"https://github.com/devrck","followers_url":"https://api.github.com/users/devrck/followers","following_url":"https://api.github.com/users/devrck/following{/other_user}","gists_url":"https://api.github.com/users/devrck/gists{/gist_id}","starred_url":"https://api.github.com/users/devrck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devrck/subscriptions","organizations_url":"https://api.github.com/users/devrck/orgs","repos_url":"https://api.github.com/users/devrck/repos","events_url":"https://api.github.com/users/devrck/events{/privacy}","received_events_url":"https://api.github.com/users/devrck/received_events","type":"User","site_admin":false},"repo":{"id":76098226,"name":"cachebundle","full_name":"devrck/cachebundle","owner":{"login":"devrck","id":16414298,"avatar_url":"https://avatars.githubusercontent.com/u/16414298?v=3","gravatar_id":"","url":"https://api.github.com/users/devrck","html_url":"https://github.com/devrck","followers_url":"https://api.github.com/users/devrck/followers","following_url":"https://api.github.com/users/devrck/following{/other_user}","gists_url":"https://api.github.com/users/devrck/gists{/gist_id}","starred_url":"https://api.github.com/users/devrck/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/devrck/subscriptions","organizations_url":"https://api.github.com/users/devrck/orgs","repos_url":"https://api.github.com/users/devrck/repos","events_url":"https://api.github.com/users/devrck/events{/privacy}","received_events_url":"https://api.github.com/users/devrck/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/devrck/cachebundle","description":null,"fork":true,"url":"https://api.github.com/repos/devrck/cachebundle","forks_url":"https://api.github.com/repos/devrck/cachebundle/forks","keys_url":"https://api.github.com/repos/devrck/cachebundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/devrck/cachebundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/devrck/cachebundle/teams","hooks_url":"https://api.github.com/repos/devrck/cachebundle/hooks","issue_events_url":"https://api.github.com/repos/devrck/cachebundle/issues/events{/number}","events_url":"https://api.github.com/repos/devrck/cachebundle/events","assignees_url":"https://api.github.com/repos/devrck/cachebundle/assignees{/user}","branches_url":"https://api.github.com/repos/devrck/cachebundle/branches{/branch}","tags_url":"https://api.github.com/repos/devrck/cachebundle/tags","blobs_url":"https://api.github.com/repos/devrck/cachebundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/devrck/cachebundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/devrck/cachebundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/devrck/cachebundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/devrck/cachebundle/statuses/{sha}","languages_url":"https://api.github.com/repos/devrck/cachebundle/languages","stargazers_url":"https://api.github.com/repos/devrck/cachebundle/stargazers","contributors_url":"https://api.github.com/repos/devrck/cachebundle/contributors","subscribers_url":"https://api.github.com/repos/devrck/cachebundle/subscribers","subscription_url":"https://api.github.com/repos/devrck/cachebundle/subscription","commits_url":"https://api.github.com/repos/devrck/cachebundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/devrck/cachebundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/devrck/cachebundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/devrck/cachebundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/devrck/cachebundle/contents/{+path}","compare_url":"https://api.github.com/repos/devrck/cachebundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/devrck/cachebundle/merges","archive_url":"https://api.github.com/repos/devrck/cachebundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/devrck/cachebundle/downloads","issues_url":"https://api.github.com/repos/devrck/cachebundle/issues{/number}","pulls_url":"https://api.github.com/repos/devrck/cachebundle/pulls{/number}","milestones_url":"https://api.github.com/repos/devrck/cachebundle/milestones{/number}","notifications_url":"https://api.github.com/repos/devrck/cachebundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/devrck/cachebundle/labels{/name}","releases_url":"https://api.github.com/repos/devrck/cachebundle/releases{/id}","deployments_url":"https://api.github.com/repos/devrck/cachebundle/deployments","created_at":"2016-12-10T07:42:34Z","updated_at":"2016-12-10T07:42:36Z","pushed_at":"2016-12-27T14:12:19Z","git_url":"git://github.com/devrck/cachebundle.git","ssh_url":"git@github.com:devrck/cachebundle.git","clone_url":"https://github.com/devrck/cachebundle.git","svn_url":"https://github.com/devrck/cachebundle","homepage":null,"size":140,"stargazers_count":0,"watchers_count":0,"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":0,"default_branch":"master"}},"base":{"label":"eMAGTechLabs:master","ref":"master","sha":"bf9c1aef6c719df2017e8f5ee89c215487cad9ca","user":{"login":"eMAGTechLabs","id":10501283,"avatar_url":"https://avatars.githubusercontent.com/u/10501283?v=3","gravatar_id":"","url":"https://api.github.com/users/eMAGTechLabs","html_url":"https://github.com/eMAGTechLabs","followers_url":"https://api.github.com/users/eMAGTechLabs/followers","following_url":"https://api.github.com/users/eMAGTechLabs/following{/other_user}","gists_url":"https://api.github.com/users/eMAGTechLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/eMAGTechLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eMAGTechLabs/subscriptions","organizations_url":"https://api.github.com/users/eMAGTechLabs/orgs","repos_url":"https://api.github.com/users/eMAGTechLabs/repos","events_url":"https://api.github.com/users/eMAGTechLabs/events{/privacy}","received_events_url":"https://api.github.com/users/eMAGTechLabs/received_events","type":"Organization","site_admin":false},"repo":{"id":58373725,"name":"cachebundle","full_name":"eMAGTechLabs/cachebundle","owner":{"login":"eMAGTechLabs","id":10501283,"avatar_url":"https://avatars.githubusercontent.com/u/10501283?v=3","gravatar_id":"","url":"https://api.github.com/users/eMAGTechLabs","html_url":"https://github.com/eMAGTechLabs","followers_url":"https://api.github.com/users/eMAGTechLabs/followers","following_url":"https://api.github.com/users/eMAGTechLabs/following{/other_user}","gists_url":"https://api.github.com/users/eMAGTechLabs/gists{/gist_id}","starred_url":"https://api.github.com/users/eMAGTechLabs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eMAGTechLabs/subscriptions","organizations_url":"https://api.github.com/users/eMAGTechLabs/orgs","repos_url":"https://api.github.com/users/eMAGTechLabs/repos","events_url":"https://api.github.com/users/eMAGTechLabs/events{/privacy}","received_events_url":"https://api.github.com/users/eMAGTechLabs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/eMAGTechLabs/cachebundle","description":"Annotation based caching for services inside a symfony container","fork":false,"url":"https://api.github.com/repos/eMAGTechLabs/cachebundle","forks_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/forks","keys_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/keys{/key_id}","collaborators_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/teams","hooks_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/hooks","issue_events_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/issues/events{/number}","events_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/events","assignees_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/assignees{/user}","branches_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/branches{/branch}","tags_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/tags","blobs_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/git/refs{/sha}","trees_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/git/trees{/sha}","statuses_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/statuses/{sha}","languages_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/languages","stargazers_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/stargazers","contributors_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/contributors","subscribers_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/subscribers","subscription_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/subscription","commits_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/commits{/sha}","git_commits_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/git/commits{/sha}","comments_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/comments{/number}","issue_comment_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/issues/comments{/number}","contents_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/contents/{+path}","compare_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/compare/{base}...{head}","merges_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/merges","archive_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/downloads","issues_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/issues{/number}","pulls_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls{/number}","milestones_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/milestones{/number}","notifications_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/labels{/name}","releases_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/releases{/id}","deployments_url":"https://api.github.com/repos/eMAGTechLabs/cachebundle/deployments","created_at":"2016-05-09T12:11:13Z","updated_at":"2016-12-15T07:39:06Z","pushed_at":"2016-12-27T14:17:09Z","git_url":"git://github.com/eMAGTechLabs/cachebundle.git","ssh_url":"git@github.com:eMAGTechLabs/cachebundle.git","clone_url":"https://github.com/eMAGTechLabs/cachebundle.git","svn_url":"https://github.com/eMAGTechLabs/cachebundle","homepage":"","size":66,"stargazers_count":7,"watchers_count":7,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":4,"forks":3,"open_issues":4,"watchers":7,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/16"},"html":{"href":"https://github.com/eMAGTechLabs/cachebundle/pull/16"},"issue":{"href":"https://api.github.com/repos/eMAGTechLabs/cachebundle/issues/16"},"comments":{"href":"https://api.github.com/repos/eMAGTechLabs/cachebundle/issues/16/comments"},"review_comments":{"href":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/16/comments"},"review_comment":{"href":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/eMAGTechLabs/cachebundle/pulls/16/commits"},"statuses":{"href":"https://api.github.com/repos/eMAGTechLabs/cachebundle/statuses/0c8645c597cc434f4e2572e7d2031cd1567039e3"}}}}
{"actor":{"display_login":"devrck"}}