{"action":"created","comment":{"url":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments/42324425","id":42324425,"diff_hunk":"@@ -0,0 +1,134 @@\n+# Config Meta Document\n+\n+## 1. Introduction\n+This document describes the process and discussions that led to the Config PSR. It's goal is to explain the reasons \n+behind each decision.\n+\n+The word `Container` in this document is to be interpreted as the `ContainerInterface` of the PSR Container proposal.\n+\n+## 2. Why bother?\n+The configuration of instances via factories is not uniform, uses different ways to retrieve and check the needed \n+options and it's not clear which configuration options needs the factory to create the instance.\n+\n+## 3. Scope\n+\n+### 3.1 Goals\n+The goal set by the Config PSR is to standardize how factories uses a configuration to create instances, support for \n+auto discovery of needed configuration, to reduce boilerplate code and to make it more readable and easier to understand. \n+It can also be used to build the name of the *Container* entry.\n+\n+### 3.2 Non-goals\n+* It's not a goal to define a whole project/library configuration structure.\n+* It's not a goal to validate the configuration option values.\n+\n+## 4. History\n+Before submitting the Config PSR to the PHP-FIG, the interfaces was first proposed in a project named \n+[interop-config](https://github.com/sandrokeil/interop-config).\n+\n+The goal of the project was to provide a test-bed for implementing the interfaces and implementation and to pave the way \n+for the Config PSR.\n+\n+## 5. Interfaces\n+There are six interfaces and some interfaces extends from another interface to ensure the uniform configuration structure. \n+If you confused about the naming of the interfaces or methods, note that I have used the Domain Driven Design approach.\n+\n+### 5.1 RequiresConfig\n+This is the main interface and describes the default configuration structure. Since we have Composer more and more \n+libraries can be combined to create individual projects. So it is only logical to start the configuration structure \n+with a `vendorName`. A vendor has multiple packages so the next structure depth is `packageName`.\n+\n+As an array it looks like this:\n+\n+```php\n+[\n+    // vendor name\n+    'doctrine' => [\n+        // package name\n+        'connection' => [\n+        ],\n+    ],\n+];\n+```\n+\n+The factory retrieves the configuration options e.g. from the *Container*. The method `options($config)` extracts the \n+configuration options from the given array or an object which implements `ArrayAccess` depending on the implemented \n+interfaces and optionally does a mandatory option check. If `ProvidesDefaultOptions` interface is defined, the default \n+options are merged and overridden of the provided config.\n+\n+\n+The `options` method:\n+\n+* returns the options depending on the implemented interfaces, optionally mandatory option check and merging of default options\n+* throws an `InvalidArgumentException` if the parameter `config` has the wrong type\n+* throws an `OutOfBoundsException` If the vendor name was not found in configuration\n+* throws an `OptionNotFoundException` if no options are found\n+* throws a `MandatoryOptionNotFoundException` if a mandatory option is missing\n+\n+\n+The `canRetrieveOptions` method:\n+\n+* checks if options are available depending on implemented interfaces and checks that the retrieved options are an array \n+or have implemented \\ArrayAccess. The `RequiresContainerId` interface is optional but MUST be supported.\n+\n+### 5.2 RequiresContainerId\n+Factories allow to create more than one instance of the same class with another configuration. This can be achieved with \n+the third structure depth `containerId`. Now the structure is fully expanded.","path":"proposed/config-meta.md","position":75,"original_position":75,"commit_id":"00d3beb0ed8f9a8f585933e128f66a22c027cb16","original_commit_id":"00d3beb0ed8f9a8f585933e128f66a22c027cb16","user":{"login":"samdark","id":47294,"avatar_url":"https://avatars.githubusercontent.com/u/47294?v=3","gravatar_id":"","url":"https://api.github.com/users/samdark","html_url":"https://github.com/samdark","followers_url":"https://api.github.com/users/samdark/followers","following_url":"https://api.github.com/users/samdark/following{/other_user}","gists_url":"https://api.github.com/users/samdark/gists{/gist_id}","starred_url":"https://api.github.com/users/samdark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/samdark/subscriptions","organizations_url":"https://api.github.com/users/samdark/orgs","repos_url":"https://api.github.com/users/samdark/repos","events_url":"https://api.github.com/users/samdark/events{/privacy}","received_events_url":"https://api.github.com/users/samdark/received_events","type":"User","site_admin":false},"body":"Couldn't it be achieved by using another package name for the same class instead?","created_at":"2015-10-18T18:40:38Z","updated_at":"2015-10-18T18:40:38Z","html_url":"https://github.com/php-fig/fig-standards/pull/620#discussion_r42324425","pull_request_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/620","_links":{"self":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments/42324425"},"html":{"href":"https://github.com/php-fig/fig-standards/pull/620#discussion_r42324425"},"pull_request":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/620"}}},"pull_request":{"url":"https://api.github.com/repos/php-fig/fig-standards/pulls/620","id":44154600,"html_url":"https://github.com/php-fig/fig-standards/pull/620","diff_url":"https://github.com/php-fig/fig-standards/pull/620.diff","patch_url":"https://github.com/php-fig/fig-standards/pull/620.patch","issue_url":"https://api.github.com/repos/php-fig/fig-standards/issues/620","number":620,"state":"open","locked":false,"title":"PSR Config","user":{"login":"sandrokeil","id":3597436,"avatar_url":"https://avatars.githubusercontent.com/u/3597436?v=3","gravatar_id":"","url":"https://api.github.com/users/sandrokeil","html_url":"https://github.com/sandrokeil","followers_url":"https://api.github.com/users/sandrokeil/followers","following_url":"https://api.github.com/users/sandrokeil/following{/other_user}","gists_url":"https://api.github.com/users/sandrokeil/gists{/gist_id}","starred_url":"https://api.github.com/users/sandrokeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandrokeil/subscriptions","organizations_url":"https://api.github.com/users/sandrokeil/orgs","repos_url":"https://api.github.com/users/sandrokeil/repos","events_url":"https://api.github.com/users/sandrokeil/events{/privacy}","received_events_url":"https://api.github.com/users/sandrokeil/received_events","type":"User","site_admin":false},"body":"Please take a look at the [config-meta.md](https://github.com/sandrokeil/fig-standards/blob/config/proposed/config-meta.md) and [config.md](https://github.com/sandrokeil/fig-standards/blob/config/proposed/config.md) for details. This is a draft, so if you have any suggestions, please leave a comment.","created_at":"2015-09-03T20:40:05Z","updated_at":"2015-10-18T18:40:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7067ea5d98b6d2dfdcb131bd2b5d717ca71336a1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/620/commits","review_comments_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/620/comments","review_comment_url":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments{/number}","comments_url":"https://api.github.com/repos/php-fig/fig-standards/issues/620/comments","statuses_url":"https://api.github.com/repos/php-fig/fig-standards/statuses/00d3beb0ed8f9a8f585933e128f66a22c027cb16","head":{"label":"sandrokeil:config","ref":"config","sha":"00d3beb0ed8f9a8f585933e128f66a22c027cb16","user":{"login":"sandrokeil","id":3597436,"avatar_url":"https://avatars.githubusercontent.com/u/3597436?v=3","gravatar_id":"","url":"https://api.github.com/users/sandrokeil","html_url":"https://github.com/sandrokeil","followers_url":"https://api.github.com/users/sandrokeil/followers","following_url":"https://api.github.com/users/sandrokeil/following{/other_user}","gists_url":"https://api.github.com/users/sandrokeil/gists{/gist_id}","starred_url":"https://api.github.com/users/sandrokeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandrokeil/subscriptions","organizations_url":"https://api.github.com/users/sandrokeil/orgs","repos_url":"https://api.github.com/users/sandrokeil/repos","events_url":"https://api.github.com/users/sandrokeil/events{/privacy}","received_events_url":"https://api.github.com/users/sandrokeil/received_events","type":"User","site_admin":false},"repo":{"id":41867454,"name":"fig-standards","full_name":"sandrokeil/fig-standards","owner":{"login":"sandrokeil","id":3597436,"avatar_url":"https://avatars.githubusercontent.com/u/3597436?v=3","gravatar_id":"","url":"https://api.github.com/users/sandrokeil","html_url":"https://github.com/sandrokeil","followers_url":"https://api.github.com/users/sandrokeil/followers","following_url":"https://api.github.com/users/sandrokeil/following{/other_user}","gists_url":"https://api.github.com/users/sandrokeil/gists{/gist_id}","starred_url":"https://api.github.com/users/sandrokeil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sandrokeil/subscriptions","organizations_url":"https://api.github.com/users/sandrokeil/orgs","repos_url":"https://api.github.com/users/sandrokeil/repos","events_url":"https://api.github.com/users/sandrokeil/events{/privacy}","received_events_url":"https://api.github.com/users/sandrokeil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sandrokeil/fig-standards","description":"Standards either proposed or approved by the Framework Interop Group","fork":true,"url":"https://api.github.com/repos/sandrokeil/fig-standards","forks_url":"https://api.github.com/repos/sandrokeil/fig-standards/forks","keys_url":"https://api.github.com/repos/sandrokeil/fig-standards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sandrokeil/fig-standards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sandrokeil/fig-standards/teams","hooks_url":"https://api.github.com/repos/sandrokeil/fig-standards/hooks","issue_events_url":"https://api.github.com/repos/sandrokeil/fig-standards/issues/events{/number}","events_url":"https://api.github.com/repos/sandrokeil/fig-standards/events","assignees_url":"https://api.github.com/repos/sandrokeil/fig-standards/assignees{/user}","branches_url":"https://api.github.com/repos/sandrokeil/fig-standards/branches{/branch}","tags_url":"https://api.github.com/repos/sandrokeil/fig-standards/tags","blobs_url":"https://api.github.com/repos/sandrokeil/fig-standards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sandrokeil/fig-standards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sandrokeil/fig-standards/git/refs{/sha}","trees_url":"https://api.github.com/repos/sandrokeil/fig-standards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sandrokeil/fig-standards/statuses/{sha}","languages_url":"https://api.github.com/repos/sandrokeil/fig-standards/languages","stargazers_url":"https://api.github.com/repos/sandrokeil/fig-standards/stargazers","contributors_url":"https://api.github.com/repos/sandrokeil/fig-standards/contributors","subscribers_url":"https://api.github.com/repos/sandrokeil/fig-standards/subscribers","subscription_url":"https://api.github.com/repos/sandrokeil/fig-standards/subscription","commits_url":"https://api.github.com/repos/sandrokeil/fig-standards/commits{/sha}","git_commits_url":"https://api.github.com/repos/sandrokeil/fig-standards/git/commits{/sha}","comments_url":"https://api.github.com/repos/sandrokeil/fig-standards/comments{/number}","issue_comment_url":"https://api.github.com/repos/sandrokeil/fig-standards/issues/comments{/number}","contents_url":"https://api.github.com/repos/sandrokeil/fig-standards/contents/{+path}","compare_url":"https://api.github.com/repos/sandrokeil/fig-standards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sandrokeil/fig-standards/merges","archive_url":"https://api.github.com/repos/sandrokeil/fig-standards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sandrokeil/fig-standards/downloads","issues_url":"https://api.github.com/repos/sandrokeil/fig-standards/issues{/number}","pulls_url":"https://api.github.com/repos/sandrokeil/fig-standards/pulls{/number}","milestones_url":"https://api.github.com/repos/sandrokeil/fig-standards/milestones{/number}","notifications_url":"https://api.github.com/repos/sandrokeil/fig-standards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sandrokeil/fig-standards/labels{/name}","releases_url":"https://api.github.com/repos/sandrokeil/fig-standards/releases{/id}","created_at":"2015-09-03T15:26:57Z","updated_at":"2015-09-09T21:29:06Z","pushed_at":"2015-10-18T08:59:59Z","git_url":"git://github.com/sandrokeil/fig-standards.git","ssh_url":"git@github.com:sandrokeil/fig-standards.git","clone_url":"https://github.com/sandrokeil/fig-standards.git","svn_url":"https://github.com/sandrokeil/fig-standards","homepage":"http://www.php-fig.org/","size":1731,"stargazers_count":1,"watchers_count":1,"language":null,"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":1,"default_branch":"master"}},"base":{"label":"php-fig:master","ref":"master","sha":"301e81aa10810fbe6eedcf262d59c48d8cacfbc5","user":{"login":"php-fig","id":468401,"avatar_url":"https://avatars.githubusercontent.com/u/468401?v=3","gravatar_id":"","url":"https://api.github.com/users/php-fig","html_url":"https://github.com/php-fig","followers_url":"https://api.github.com/users/php-fig/followers","following_url":"https://api.github.com/users/php-fig/following{/other_user}","gists_url":"https://api.github.com/users/php-fig/gists{/gist_id}","starred_url":"https://api.github.com/users/php-fig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-fig/subscriptions","organizations_url":"https://api.github.com/users/php-fig/orgs","repos_url":"https://api.github.com/users/php-fig/repos","events_url":"https://api.github.com/users/php-fig/events{/privacy}","received_events_url":"https://api.github.com/users/php-fig/received_events","type":"Organization","site_admin":false},"repo":{"id":1053270,"name":"fig-standards","full_name":"php-fig/fig-standards","owner":{"login":"php-fig","id":468401,"avatar_url":"https://avatars.githubusercontent.com/u/468401?v=3","gravatar_id":"","url":"https://api.github.com/users/php-fig","html_url":"https://github.com/php-fig","followers_url":"https://api.github.com/users/php-fig/followers","following_url":"https://api.github.com/users/php-fig/following{/other_user}","gists_url":"https://api.github.com/users/php-fig/gists{/gist_id}","starred_url":"https://api.github.com/users/php-fig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/php-fig/subscriptions","organizations_url":"https://api.github.com/users/php-fig/orgs","repos_url":"https://api.github.com/users/php-fig/repos","events_url":"https://api.github.com/users/php-fig/events{/privacy}","received_events_url":"https://api.github.com/users/php-fig/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/php-fig/fig-standards","description":"Standards either proposed or approved by the Framework Interop Group","fork":false,"url":"https://api.github.com/repos/php-fig/fig-standards","forks_url":"https://api.github.com/repos/php-fig/fig-standards/forks","keys_url":"https://api.github.com/repos/php-fig/fig-standards/keys{/key_id}","collaborators_url":"https://api.github.com/repos/php-fig/fig-standards/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/php-fig/fig-standards/teams","hooks_url":"https://api.github.com/repos/php-fig/fig-standards/hooks","issue_events_url":"https://api.github.com/repos/php-fig/fig-standards/issues/events{/number}","events_url":"https://api.github.com/repos/php-fig/fig-standards/events","assignees_url":"https://api.github.com/repos/php-fig/fig-standards/assignees{/user}","branches_url":"https://api.github.com/repos/php-fig/fig-standards/branches{/branch}","tags_url":"https://api.github.com/repos/php-fig/fig-standards/tags","blobs_url":"https://api.github.com/repos/php-fig/fig-standards/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/php-fig/fig-standards/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/php-fig/fig-standards/git/refs{/sha}","trees_url":"https://api.github.com/repos/php-fig/fig-standards/git/trees{/sha}","statuses_url":"https://api.github.com/repos/php-fig/fig-standards/statuses/{sha}","languages_url":"https://api.github.com/repos/php-fig/fig-standards/languages","stargazers_url":"https://api.github.com/repos/php-fig/fig-standards/stargazers","contributors_url":"https://api.github.com/repos/php-fig/fig-standards/contributors","subscribers_url":"https://api.github.com/repos/php-fig/fig-standards/subscribers","subscription_url":"https://api.github.com/repos/php-fig/fig-standards/subscription","commits_url":"https://api.github.com/repos/php-fig/fig-standards/commits{/sha}","git_commits_url":"https://api.github.com/repos/php-fig/fig-standards/git/commits{/sha}","comments_url":"https://api.github.com/repos/php-fig/fig-standards/comments{/number}","issue_comment_url":"https://api.github.com/repos/php-fig/fig-standards/issues/comments{/number}","contents_url":"https://api.github.com/repos/php-fig/fig-standards/contents/{+path}","compare_url":"https://api.github.com/repos/php-fig/fig-standards/compare/{base}...{head}","merges_url":"https://api.github.com/repos/php-fig/fig-standards/merges","archive_url":"https://api.github.com/repos/php-fig/fig-standards/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/php-fig/fig-standards/downloads","issues_url":"https://api.github.com/repos/php-fig/fig-standards/issues{/number}","pulls_url":"https://api.github.com/repos/php-fig/fig-standards/pulls{/number}","milestones_url":"https://api.github.com/repos/php-fig/fig-standards/milestones{/number}","notifications_url":"https://api.github.com/repos/php-fig/fig-standards/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/php-fig/fig-standards/labels{/name}","releases_url":"https://api.github.com/repos/php-fig/fig-standards/releases{/id}","created_at":"2010-11-05T04:44:12Z","updated_at":"2015-10-18T05:07:03Z","pushed_at":"2015-10-18T16:12:26Z","git_url":"git://github.com/php-fig/fig-standards.git","ssh_url":"git@github.com:php-fig/fig-standards.git","clone_url":"https://github.com/php-fig/fig-standards.git","svn_url":"https://github.com/php-fig/fig-standards","homepage":"http://www.php-fig.org/","size":7193,"stargazers_count":6939,"watchers_count":6939,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1758,"mirror_url":null,"open_issues_count":103,"forks":1758,"open_issues":103,"watchers":6939,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/620"},"html":{"href":"https://github.com/php-fig/fig-standards/pull/620"},"issue":{"href":"https://api.github.com/repos/php-fig/fig-standards/issues/620"},"comments":{"href":"https://api.github.com/repos/php-fig/fig-standards/issues/620/comments"},"review_comments":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/620/comments"},"review_comment":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/php-fig/fig-standards/pulls/620/commits"},"statuses":{"href":"https://api.github.com/repos/php-fig/fig-standards/statuses/00d3beb0ed8f9a8f585933e128f66a22c027cb16"}}}}