{"action":"created","comment":{"url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/comments/30817064","id":30817064,"diff_hunk":"@@ -0,0 +1,71 @@\n+<?php\n+\n+use EngineBlock_Log_Monolog_Handler_FingersCrossed_ActivationStrategyFactory as ActivationStrategyFactory;\n+use EngineBlock_Log_Monolog_Handler_FingersCrossed_ManualOrDecoratedActivationStrategy as ManualOrDecoratedActivationStrategy;\n+use EngineBlock_Log_InvalidConfigurationException as InvalidConfigurationException;\n+use EngineBlock_Log_LogLevel as LogLevel;\n+use Monolog\\Handler\\FingersCrossed\\ErrorLevelActivationStrategy;\n+\n+final class EngineBlock_Log_Monolog_Handler_FingersCrossed_ManualOrErrorLevelActivationStrategyFactory implements\n+    ActivationStrategyFactory\n+{\n+    /**\n+     * @var ManualOrDecoratedActivationStrategy|null\n+     */\n+    private static $strategy;\n+\n+    /**\n+     * @param array $config\n+     * @return ManualOrDecoratedActivationStrategy\n+     * @throws InvalidConfigurationException\n+     */\n+    public static function factory(array $config)\n+    {\n+        if (isset(self::$strategy)) {\n+            throw new RuntimeException(\n+                \"Cannot manufacture a second instance of this strategy, as the current instance is required for \" .\n+                \"explicit flushing of the log message buffer\"\n+            );\n+        }\n+\n+        $config = self::validateAndNormaliseConfig($config);\n+\n+        self::$strategy = new ManualOrDecoratedActivationStrategy(\n+            new ErrorLevelActivationStrategy($config['action_level'])\n+        );\n+\n+        return self::$strategy;\n+    }\n+\n+    /**\n+     * @return ManualOrDecoratedActivationStrategy|null\n+     */\n+    public static function getManufacturedStrategy()\n+    {\n+        return self::$strategy;\n+    }\n+\n+    /**\n+     * @param array $config\n+     * @return array\n+     * @throws InvalidConfigurationException\n+     */\n+    private static function validateAndNormaliseConfig(array $config)\n+    {\n+        if (!isset($config['action_level'])) {\n+            throw InvalidConfigurationException::missing('action_level', 'string');\n+        } elseif (!is_string($config['action_level'])) {","path":"library/EngineBlock/Log/Monolog/Handler/FingersCrossed/ManualOrErrorLevelActivationStrategyFactory.php","position":57,"original_position":57,"commit_id":"a657785d4399421e8385c29210c34edf20242d72","original_commit_id":"a657785d4399421e8385c29210c34edf20242d72","user":{"login":"relaxnow","id":524386,"avatar_url":"https://avatars.githubusercontent.com/u/524386?v=3","gravatar_id":"","url":"https://api.github.com/users/relaxnow","html_url":"https://github.com/relaxnow","followers_url":"https://api.github.com/users/relaxnow/followers","following_url":"https://api.github.com/users/relaxnow/following{/other_user}","gists_url":"https://api.github.com/users/relaxnow/gists{/gist_id}","starred_url":"https://api.github.com/users/relaxnow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/relaxnow/subscriptions","organizations_url":"https://api.github.com/users/relaxnow/orgs","repos_url":"https://api.github.com/users/relaxnow/repos","events_url":"https://api.github.com/users/relaxnow/events{/privacy}","received_events_url":"https://api.github.com/users/relaxnow/received_events","type":"User","site_admin":false},"body":"It's shorter only in the sense that you're omitting whitespace by conflating two dependant but otherwise independent guard clauses. It's longer because you're using 4 more letters :wink:\r\nBut I would have to disagree on the legibility, it is much easier to debug 2 simple if statements than 1 long one. Also more maintainable as it is less tempting to add more clauses as else branches.\r\nThen again, certainly for this use case and in this code base, it is very much picking at tiny nits an otherwise excellent PR.","created_at":"2015-05-21T15:58:48Z","updated_at":"2015-05-21T15:58:48Z","html_url":"https://github.com/OpenConext/OpenConext-engineblock/pull/145#discussion_r30817064","pull_request_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/145","_links":{"self":{"href":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/comments/30817064"},"html":{"href":"https://github.com/OpenConext/OpenConext-engineblock/pull/145#discussion_r30817064"},"pull_request":{"href":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/145"}}},"pull_request":{"url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/145","id":34799366,"html_url":"https://github.com/OpenConext/OpenConext-engineblock/pull/145","diff_url":"https://github.com/OpenConext/OpenConext-engineblock/pull/145.diff","patch_url":"https://github.com/OpenConext/OpenConext-engineblock/pull/145.patch","issue_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/issues/145","number":145,"state":"open","locked":false,"title":"Monilog","user":{"login":"rjkip","id":1734555,"avatar_url":"https://avatars.githubusercontent.com/u/1734555?v=3","gravatar_id":"","url":"https://api.github.com/users/rjkip","html_url":"https://github.com/rjkip","followers_url":"https://api.github.com/users/rjkip/followers","following_url":"https://api.github.com/users/rjkip/following{/other_user}","gists_url":"https://api.github.com/users/rjkip/gists{/gist_id}","starred_url":"https://api.github.com/users/rjkip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjkip/subscriptions","organizations_url":"https://api.github.com/users/rjkip/orgs","repos_url":"https://api.github.com/users/rjkip/repos","events_url":"https://api.github.com/users/rjkip/events{/privacy}","received_events_url":"https://api.github.com/users/rjkip/received_events","type":"User","site_admin":false},"body":"This is a work-in-progress PR for the Monilog project for easy feedback. Branch is subject to rebasing at @rjkip's discretion.\r\n\r\n[Pivotal](https://www.pivotaltracker.com/n/projects/1327084)","created_at":"2015-05-06T09:07:45Z","updated_at":"2015-05-21T15:58:48Z","closed_at":null,"merged_at":null,"merge_commit_sha":"319cc868a94e36e55d91b36eea1d48e40ceabe7b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/145/commits","review_comments_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/145/comments","review_comment_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/comments{/number}","comments_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/issues/145/comments","statuses_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/statuses/a657785d4399421e8385c29210c34edf20242d72","head":{"label":"rjkip:maintenance/logging","ref":"maintenance/logging","sha":"a657785d4399421e8385c29210c34edf20242d72","user":{"login":"rjkip","id":1734555,"avatar_url":"https://avatars.githubusercontent.com/u/1734555?v=3","gravatar_id":"","url":"https://api.github.com/users/rjkip","html_url":"https://github.com/rjkip","followers_url":"https://api.github.com/users/rjkip/followers","following_url":"https://api.github.com/users/rjkip/following{/other_user}","gists_url":"https://api.github.com/users/rjkip/gists{/gist_id}","starred_url":"https://api.github.com/users/rjkip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjkip/subscriptions","organizations_url":"https://api.github.com/users/rjkip/orgs","repos_url":"https://api.github.com/users/rjkip/repos","events_url":"https://api.github.com/users/rjkip/events{/privacy}","received_events_url":"https://api.github.com/users/rjkip/received_events","type":"User","site_admin":false},"repo":{"id":35039919,"name":"OpenConext-engineblock","full_name":"rjkip/OpenConext-engineblock","owner":{"login":"rjkip","id":1734555,"avatar_url":"https://avatars.githubusercontent.com/u/1734555?v=3","gravatar_id":"","url":"https://api.github.com/users/rjkip","html_url":"https://github.com/rjkip","followers_url":"https://api.github.com/users/rjkip/followers","following_url":"https://api.github.com/users/rjkip/following{/other_user}","gists_url":"https://api.github.com/users/rjkip/gists{/gist_id}","starred_url":"https://api.github.com/users/rjkip/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rjkip/subscriptions","organizations_url":"https://api.github.com/users/rjkip/orgs","repos_url":"https://api.github.com/users/rjkip/repos","events_url":"https://api.github.com/users/rjkip/events{/privacy}","received_events_url":"https://api.github.com/users/rjkip/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rjkip/OpenConext-engineblock","description":"OpenConext SAML 2.0 IdP/SP Gateway","fork":true,"url":"https://api.github.com/repos/rjkip/OpenConext-engineblock","forks_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/forks","keys_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/teams","hooks_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/hooks","issue_events_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/issues/events{/number}","events_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/events","assignees_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/assignees{/user}","branches_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/branches{/branch}","tags_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/tags","blobs_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/git/refs{/sha}","trees_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/statuses/{sha}","languages_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/languages","stargazers_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/stargazers","contributors_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/contributors","subscribers_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/subscribers","subscription_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/subscription","commits_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/commits{/sha}","git_commits_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/git/commits{/sha}","comments_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/comments{/number}","issue_comment_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/issues/comments{/number}","contents_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/contents/{+path}","compare_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/merges","archive_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/downloads","issues_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/issues{/number}","pulls_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/pulls{/number}","milestones_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/milestones{/number}","notifications_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/labels{/name}","releases_url":"https://api.github.com/repos/rjkip/OpenConext-engineblock/releases{/id}","created_at":"2015-05-04T14:36:21Z","updated_at":"2015-05-04T14:36:23Z","pushed_at":"2015-05-18T08:30:10Z","git_url":"git://github.com/rjkip/OpenConext-engineblock.git","ssh_url":"git@github.com:rjkip/OpenConext-engineblock.git","clone_url":"https://github.com/rjkip/OpenConext-engineblock.git","svn_url":"https://github.com/rjkip/OpenConext-engineblock","homepage":"","size":15291,"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":"OpenConext:develop","ref":"develop","sha":"2c744d9e9d6861d7b53113f149c6785e18406983","user":{"login":"OpenConext","id":1457650,"avatar_url":"https://avatars.githubusercontent.com/u/1457650?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenConext","html_url":"https://github.com/OpenConext","followers_url":"https://api.github.com/users/OpenConext/followers","following_url":"https://api.github.com/users/OpenConext/following{/other_user}","gists_url":"https://api.github.com/users/OpenConext/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenConext/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenConext/subscriptions","organizations_url":"https://api.github.com/users/OpenConext/orgs","repos_url":"https://api.github.com/users/OpenConext/repos","events_url":"https://api.github.com/users/OpenConext/events{/privacy}","received_events_url":"https://api.github.com/users/OpenConext/received_events","type":"Organization","site_admin":false},"repo":{"id":3900071,"name":"OpenConext-engineblock","full_name":"OpenConext/OpenConext-engineblock","owner":{"login":"OpenConext","id":1457650,"avatar_url":"https://avatars.githubusercontent.com/u/1457650?v=3","gravatar_id":"","url":"https://api.github.com/users/OpenConext","html_url":"https://github.com/OpenConext","followers_url":"https://api.github.com/users/OpenConext/followers","following_url":"https://api.github.com/users/OpenConext/following{/other_user}","gists_url":"https://api.github.com/users/OpenConext/gists{/gist_id}","starred_url":"https://api.github.com/users/OpenConext/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/OpenConext/subscriptions","organizations_url":"https://api.github.com/users/OpenConext/orgs","repos_url":"https://api.github.com/users/OpenConext/repos","events_url":"https://api.github.com/users/OpenConext/events{/privacy}","received_events_url":"https://api.github.com/users/OpenConext/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/OpenConext/OpenConext-engineblock","description":"OpenConext SAML 2.0 IdP/SP Gateway","fork":false,"url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock","forks_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/forks","keys_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/keys{/key_id}","collaborators_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/teams","hooks_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/hooks","issue_events_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/issues/events{/number}","events_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/events","assignees_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/assignees{/user}","branches_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/branches{/branch}","tags_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/tags","blobs_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/git/refs{/sha}","trees_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/git/trees{/sha}","statuses_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/statuses/{sha}","languages_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/languages","stargazers_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/stargazers","contributors_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/contributors","subscribers_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/subscribers","subscription_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/subscription","commits_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/commits{/sha}","git_commits_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/git/commits{/sha}","comments_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/comments{/number}","issue_comment_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/issues/comments{/number}","contents_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/contents/{+path}","compare_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/compare/{base}...{head}","merges_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/merges","archive_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/downloads","issues_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/issues{/number}","pulls_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls{/number}","milestones_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/milestones{/number}","notifications_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/labels{/name}","releases_url":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/releases{/id}","created_at":"2012-04-02T11:49:31Z","updated_at":"2015-05-08T14:33:24Z","pushed_at":"2015-05-20T12:54:33Z","git_url":"git://github.com/OpenConext/OpenConext-engineblock.git","ssh_url":"git@github.com:OpenConext/OpenConext-engineblock.git","clone_url":"https://github.com/OpenConext/OpenConext-engineblock.git","svn_url":"https://github.com/OpenConext/OpenConext-engineblock","homepage":"","size":19237,"stargazers_count":3,"watchers_count":3,"language":"PHP","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":11,"mirror_url":null,"open_issues_count":44,"forks":11,"open_issues":44,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/145"},"html":{"href":"https://github.com/OpenConext/OpenConext-engineblock/pull/145"},"issue":{"href":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/issues/145"},"comments":{"href":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/issues/145/comments"},"review_comments":{"href":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/145/comments"},"review_comment":{"href":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/pulls/145/commits"},"statuses":{"href":"https://api.github.com/repos/OpenConext/OpenConext-engineblock/statuses/a657785d4399421e8385c29210c34edf20242d72"}}}}