{"action":"created","comment":{"url":"https://api.github.com/repos/symfony/symfony/pulls/comments/56438710","id":56438710,"diff_hunk":"@@ -858,13 +858,90 @@ private function registerAnnotationsConfiguration(array $config, ContainerBuilde\n         }\n     }\n \n-    private function registerPropertyAccessConfiguration(array $config, ContainerBuilder $container)\n+    /**\n+     * Loads the PropertyAccess configuration.\n+     *\n+     * @param array            $config    A serializer configuration array\n+     * @param ContainerBuilder $container A ContainerBuilder instance\n+     * @param XmlFileLoader    $loader    An XmlFileLoader instance\n+     */\n+    private function registerPropertyAccessConfiguration(array $config, ContainerBuilder $container, XmlFileLoader $loader)\n     {\n         $container\n             ->getDefinition('property_accessor')\n             ->replaceArgument(0, $config['magic_call'])\n             ->replaceArgument(1, $config['throw_exception_on_invalid_index'])\n         ;\n+\n+        if (!$this->isConfigEnabled($container, $config)) {\n+            return;\n+        }\n+\n+        $loader->load('property_access.xml');\n+        $chainLoader = $container->getDefinition('property_access.mapping.chain_loader');\n+\n+        $serializerLoaders = array();\n+        if (isset($config['enable_annotations']) && $config['enable_annotations']) {\n+            $annotationLoader = new Definition(\n+                'Symfony\\Component\\PropertyAccess\\Mapping\\Loader\\AnnotationLoader',\n+                array(new Reference('annotation_reader'))\n+            );\n+            $annotationLoader->setPublic(false);\n+\n+            $serializerLoaders[] = $annotationLoader;\n+        }\n+\n+        $bundles = $container->getParameter('kernel.bundles');\n+        foreach ($bundles as $bundle) {\n+            $reflection = new \\ReflectionClass($bundle);\n+            $dirname = dirname($reflection->getFileName());\n+\n+            if (is_file($file = $dirname.'/Resources/config/property_access.xml')) {\n+                $definition = new Definition('Symfony\\Component\\PropertyAccess\\Mapping\\Loader\\XmlFileLoader', array(realpath($file)));\n+                $definition->setPublic(false);\n+\n+                $serializerLoaders[] = $definition;\n+                $container->addResource(new FileResource($file));\n+            }\n+\n+            if (is_file($file = $dirname.'/Resources/config/property_access.yml')) {\n+                $definition = new Definition('Symfony\\Component\\PropertyAccess\\Mapping\\Loader\\YamlFileLoader', array(realpath($file)));\n+                $definition->setPublic(false);\n+\n+                $serializerLoaders[] = $definition;\n+                $container->addResource(new FileResource($file));\n+            }\n+\n+            if (is_dir($dir = $dirname.'/Resources/config/property_access')) {\n+                foreach (Finder::create()->files()->in($dir)->name('*.xml') as $file) {\n+                    $definition = new Definition('Symfony\\Component\\PropertyAccess\\Mapping\\Loader\\XmlFileLoader', array($file->getRealpath()));\n+                    $definition->setPublic(false);\n+\n+                    $serializerLoaders[] = $definition;\n+                }\n+                foreach (Finder::create()->files()->in($dir)->name('*.yml') as $file) {\n+                    $definition = new Definition('Symfony\\Component\\PropertyAccess\\Mapping\\Loader\\YamlFileLoader', array($file->getRealpath()));\n+                    $definition->setPublic(false);\n+\n+                    $serializerLoaders[] = $definition;\n+                }\n+\n+                $container->addResource(new DirectoryResource($dir));\n+            }\n+        }\n+\n+        $chainLoader->replaceArgument(0, $serializerLoaders);\n+\n+        if (isset($config['cache']) && $config['cache']) {","path":"src/Symfony/Bundle/FrameworkBundle/DependencyInjection/FrameworkExtension.php","position":88,"original_position":88,"commit_id":"d649294ee4128ec254b6fb08bdbfa6698d5432fe","original_commit_id":"18ad32830def9ac8f76babec5be78c84dd1e26bf","user":{"login":"lrlopez","id":547387,"avatar_url":"https://avatars.githubusercontent.com/u/547387?v=3","gravatar_id":"","url":"https://api.github.com/users/lrlopez","html_url":"https://github.com/lrlopez","followers_url":"https://api.github.com/users/lrlopez/followers","following_url":"https://api.github.com/users/lrlopez/following{/other_user}","gists_url":"https://api.github.com/users/lrlopez/gists{/gist_id}","starred_url":"https://api.github.com/users/lrlopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrlopez/subscriptions","organizations_url":"https://api.github.com/users/lrlopez/orgs","repos_url":"https://api.github.com/users/lrlopez/repos","events_url":"https://api.github.com/users/lrlopez/events{/privacy}","received_events_url":"https://api.github.com/users/lrlopez/received_events","type":"User","site_admin":false},"body":"I'm not sure #17868 will be merged before the 3.1 feature freeze. Could we skip this and work on it after the new Cache component is ready?","created_at":"2016-03-17T00:19:56Z","updated_at":"2016-03-17T00:19:56Z","html_url":"https://github.com/symfony/symfony/pull/18016#discussion_r56438710","pull_request_url":"https://api.github.com/repos/symfony/symfony/pulls/18016","_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments/56438710"},"html":{"href":"https://github.com/symfony/symfony/pull/18016#discussion_r56438710"},"pull_request":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18016"}}},"pull_request":{"url":"https://api.github.com/repos/symfony/symfony/pulls/18016","id":61792592,"html_url":"https://github.com/symfony/symfony/pull/18016","diff_url":"https://github.com/symfony/symfony/pull/18016.diff","patch_url":"https://github.com/symfony/symfony/pull/18016.patch","issue_url":"https://api.github.com/repos/symfony/symfony/issues/18016","number":18016,"state":"open","locked":false,"title":"[PropertyAccess] [RFC] [WIP] Allow custom methods on property accesses","user":{"login":"lrlopez","id":547387,"avatar_url":"https://avatars.githubusercontent.com/u/547387?v=3","gravatar_id":"","url":"https://api.github.com/users/lrlopez","html_url":"https://github.com/lrlopez","followers_url":"https://api.github.com/users/lrlopez/followers","following_url":"https://api.github.com/users/lrlopez/following{/other_user}","gists_url":"https://api.github.com/users/lrlopez/gists{/gist_id}","starred_url":"https://api.github.com/users/lrlopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrlopez/subscriptions","organizations_url":"https://api.github.com/users/lrlopez/orgs","repos_url":"https://api.github.com/users/lrlopez/repos","events_url":"https://api.github.com/users/lrlopez/events{/privacy}","received_events_url":"https://api.github.com/users/lrlopez/received_events","type":"User","site_admin":false},"body":"**WARNING!** This is a Work-In-Progress feature. _It is not ready for merging yet_.\r\n\r\n| Q             | A\r\n| ------------- | ---\r\n| Branch        | master\r\n| Bug fix?      | no\r\n| New feature?  | yes\r\n| BC breaks?    | no\r\n| Deprecations? | no\r\n| Tests pass?   | yes\r\n| Fixed tickets | #5013, #9336, #5219, among others\r\n| License       | MIT\r\n| Doc PR        | Not yet (WIP!)\r\n\r\nTest do not pass but the failure is not related to the changes of this PR ([check here](https://travis-ci.org/lrlopez/symfony/jobs/113812386#L2464))\r\n\r\nSome examples of how to use the new feature:\r\n\r\nAnnotations:\r\n```php\r\n\r\n/**\r\n * @PropertyAccessor(getter=\"getCurrentValue\", setter=\"updateValue\")\r\n */\r\nprotected $value;\r\n\r\n/**\r\n * @PropertyAccessor(adder=\"joinMember\", remover=\"detachMember\")\r\n */\r\nprotected $members;\r\n\r\npublic function getCurrentValue()\r\n{\r\n    return $this->value;\r\n}\r\n\r\npublic function updateValue($newValue)\r\n{\r\n    $this->value = $newValue;\r\n    return $this;\r\n}\r\n\r\npublic function joinMember($newMember)\r\n{\r\n    // Add $newMember to the collection\r\n}\r\n\r\npublic function detachMember($oldMember)\r\n{\r\n    // Remove $oldMember from the collection\r\n}\r\n```\r\nYAML:\r\n```YAML\r\n'AppBundle\\Entity\\Example':\r\n  attributes:\r\n    value:\r\n      getter: getCurrentValue\r\n      setter: updateValue\r\n    members:\r\n      adder: joinMember\r\n      remover: detachMember\r\n```\r\nXML:\r\n```xml\r\n<?xml version=\"1.0\" ?>\r\n\r\n<property-access xmlns=\"http://symfony.com/schema/dic/property-access-mapping\"\r\n                    xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\"\r\n                    xsi:schemaLocation=\"http://symfony.com/schema/dic/property-access-mapping http://symfony.com/schema/dic/property-access-mapping/property-access-mapping-1.0.xsd\">\r\n\r\n    <class name=\"AppBundle\\Entity\\Example\">\r\n        <attribute name=\"value\" getter=\"getCurrentValue\" setter=\"updateValue\" />\r\n        <attribute name=\"members\" adder=\"joinMember\" remover=\"detachMember\" />\r\n    </class>\r\n\r\n</property-access>\r\n```\r\nCheck-list:\r\n\r\n- [ ] Implement `gettersetter` override\r\n- [x] Implement YAML & XML mappings\r\n- [ ] Add more options (suggestions please!)\r\n- [ ] Address @dunglas and @webmozart comments\r\n- [ ] Wait until PR #17868 is merged (`Cache` component)\r\n- [ ] Write documentation","created_at":"2016-03-05T00:43:42Z","updated_at":"2016-03-17T00:19:56Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6598e6625d1c665295dda067bdc05d37e0b337a0","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/symfony/symfony/pulls/18016/commits","review_comments_url":"https://api.github.com/repos/symfony/symfony/pulls/18016/comments","review_comment_url":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}","comments_url":"https://api.github.com/repos/symfony/symfony/issues/18016/comments","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/d649294ee4128ec254b6fb08bdbfa6698d5432fe","head":{"label":"lrlopez:property-accessor-config","ref":"property-accessor-config","sha":"d649294ee4128ec254b6fb08bdbfa6698d5432fe","user":{"login":"lrlopez","id":547387,"avatar_url":"https://avatars.githubusercontent.com/u/547387?v=3","gravatar_id":"","url":"https://api.github.com/users/lrlopez","html_url":"https://github.com/lrlopez","followers_url":"https://api.github.com/users/lrlopez/followers","following_url":"https://api.github.com/users/lrlopez/following{/other_user}","gists_url":"https://api.github.com/users/lrlopez/gists{/gist_id}","starred_url":"https://api.github.com/users/lrlopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrlopez/subscriptions","organizations_url":"https://api.github.com/users/lrlopez/orgs","repos_url":"https://api.github.com/users/lrlopez/repos","events_url":"https://api.github.com/users/lrlopez/events{/privacy}","received_events_url":"https://api.github.com/users/lrlopez/received_events","type":"User","site_admin":false},"repo":{"id":27345500,"name":"symfony","full_name":"lrlopez/symfony","owner":{"login":"lrlopez","id":547387,"avatar_url":"https://avatars.githubusercontent.com/u/547387?v=3","gravatar_id":"","url":"https://api.github.com/users/lrlopez","html_url":"https://github.com/lrlopez","followers_url":"https://api.github.com/users/lrlopez/followers","following_url":"https://api.github.com/users/lrlopez/following{/other_user}","gists_url":"https://api.github.com/users/lrlopez/gists{/gist_id}","starred_url":"https://api.github.com/users/lrlopez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrlopez/subscriptions","organizations_url":"https://api.github.com/users/lrlopez/orgs","repos_url":"https://api.github.com/users/lrlopez/repos","events_url":"https://api.github.com/users/lrlopez/events{/privacy}","received_events_url":"https://api.github.com/users/lrlopez/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/lrlopez/symfony","description":"The Symfony PHP framework","fork":true,"url":"https://api.github.com/repos/lrlopez/symfony","forks_url":"https://api.github.com/repos/lrlopez/symfony/forks","keys_url":"https://api.github.com/repos/lrlopez/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lrlopez/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lrlopez/symfony/teams","hooks_url":"https://api.github.com/repos/lrlopez/symfony/hooks","issue_events_url":"https://api.github.com/repos/lrlopez/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/lrlopez/symfony/events","assignees_url":"https://api.github.com/repos/lrlopez/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/lrlopez/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/lrlopez/symfony/tags","blobs_url":"https://api.github.com/repos/lrlopez/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lrlopez/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lrlopez/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/lrlopez/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lrlopez/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/lrlopez/symfony/languages","stargazers_url":"https://api.github.com/repos/lrlopez/symfony/stargazers","contributors_url":"https://api.github.com/repos/lrlopez/symfony/contributors","subscribers_url":"https://api.github.com/repos/lrlopez/symfony/subscribers","subscription_url":"https://api.github.com/repos/lrlopez/symfony/subscription","commits_url":"https://api.github.com/repos/lrlopez/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/lrlopez/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/lrlopez/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/lrlopez/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/lrlopez/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/lrlopez/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lrlopez/symfony/merges","archive_url":"https://api.github.com/repos/lrlopez/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lrlopez/symfony/downloads","issues_url":"https://api.github.com/repos/lrlopez/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/lrlopez/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/lrlopez/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/lrlopez/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lrlopez/symfony/labels{/name}","releases_url":"https://api.github.com/repos/lrlopez/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/lrlopez/symfony/deployments","created_at":"2014-11-30T18:25:54Z","updated_at":"2014-11-30T18:26:06Z","pushed_at":"2016-03-17T00:07:38Z","git_url":"git://github.com/lrlopez/symfony.git","ssh_url":"git@github.com:lrlopez/symfony.git","clone_url":"https://github.com/lrlopez/symfony.git","svn_url":"https://github.com/lrlopez/symfony","homepage":"symfony.com","size":68809,"stargazers_count":0,"watchers_count":0,"language":"PHP","has_issues":false,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"2.7"}},"base":{"label":"symfony:master","ref":"master","sha":"83ebf97df3a65199ce9ee218d176758104f2ac23","user":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"repo":{"id":458058,"name":"symfony","full_name":"symfony/symfony","owner":{"login":"symfony","id":143937,"avatar_url":"https://avatars.githubusercontent.com/u/143937?v=3","gravatar_id":"","url":"https://api.github.com/users/symfony","html_url":"https://github.com/symfony","followers_url":"https://api.github.com/users/symfony/followers","following_url":"https://api.github.com/users/symfony/following{/other_user}","gists_url":"https://api.github.com/users/symfony/gists{/gist_id}","starred_url":"https://api.github.com/users/symfony/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/symfony/subscriptions","organizations_url":"https://api.github.com/users/symfony/orgs","repos_url":"https://api.github.com/users/symfony/repos","events_url":"https://api.github.com/users/symfony/events{/privacy}","received_events_url":"https://api.github.com/users/symfony/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/symfony/symfony","description":"The Symfony PHP framework","fork":false,"url":"https://api.github.com/repos/symfony/symfony","forks_url":"https://api.github.com/repos/symfony/symfony/forks","keys_url":"https://api.github.com/repos/symfony/symfony/keys{/key_id}","collaborators_url":"https://api.github.com/repos/symfony/symfony/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/symfony/symfony/teams","hooks_url":"https://api.github.com/repos/symfony/symfony/hooks","issue_events_url":"https://api.github.com/repos/symfony/symfony/issues/events{/number}","events_url":"https://api.github.com/repos/symfony/symfony/events","assignees_url":"https://api.github.com/repos/symfony/symfony/assignees{/user}","branches_url":"https://api.github.com/repos/symfony/symfony/branches{/branch}","tags_url":"https://api.github.com/repos/symfony/symfony/tags","blobs_url":"https://api.github.com/repos/symfony/symfony/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/symfony/symfony/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/symfony/symfony/git/refs{/sha}","trees_url":"https://api.github.com/repos/symfony/symfony/git/trees{/sha}","statuses_url":"https://api.github.com/repos/symfony/symfony/statuses/{sha}","languages_url":"https://api.github.com/repos/symfony/symfony/languages","stargazers_url":"https://api.github.com/repos/symfony/symfony/stargazers","contributors_url":"https://api.github.com/repos/symfony/symfony/contributors","subscribers_url":"https://api.github.com/repos/symfony/symfony/subscribers","subscription_url":"https://api.github.com/repos/symfony/symfony/subscription","commits_url":"https://api.github.com/repos/symfony/symfony/commits{/sha}","git_commits_url":"https://api.github.com/repos/symfony/symfony/git/commits{/sha}","comments_url":"https://api.github.com/repos/symfony/symfony/comments{/number}","issue_comment_url":"https://api.github.com/repos/symfony/symfony/issues/comments{/number}","contents_url":"https://api.github.com/repos/symfony/symfony/contents/{+path}","compare_url":"https://api.github.com/repos/symfony/symfony/compare/{base}...{head}","merges_url":"https://api.github.com/repos/symfony/symfony/merges","archive_url":"https://api.github.com/repos/symfony/symfony/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/symfony/symfony/downloads","issues_url":"https://api.github.com/repos/symfony/symfony/issues{/number}","pulls_url":"https://api.github.com/repos/symfony/symfony/pulls{/number}","milestones_url":"https://api.github.com/repos/symfony/symfony/milestones{/number}","notifications_url":"https://api.github.com/repos/symfony/symfony/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/symfony/symfony/labels{/name}","releases_url":"https://api.github.com/repos/symfony/symfony/releases{/id}","deployments_url":"https://api.github.com/repos/symfony/symfony/deployments","created_at":"2010-01-04T14:21:21Z","updated_at":"2016-03-16T19:27:04Z","pushed_at":"2016-03-17T00:07:39Z","git_url":"git://github.com/symfony/symfony.git","ssh_url":"git@github.com:symfony/symfony.git","clone_url":"https://github.com/symfony/symfony.git","svn_url":"https://github.com/symfony/symfony","homepage":"symfony.com","size":104295,"stargazers_count":11938,"watchers_count":11938,"language":"PHP","has_issues":true,"has_downloads":false,"has_wiki":false,"has_pages":false,"forks_count":4707,"mirror_url":null,"open_issues_count":704,"forks":4707,"open_issues":704,"watchers":11938,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18016"},"html":{"href":"https://github.com/symfony/symfony/pull/18016"},"issue":{"href":"https://api.github.com/repos/symfony/symfony/issues/18016"},"comments":{"href":"https://api.github.com/repos/symfony/symfony/issues/18016/comments"},"review_comments":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18016/comments"},"review_comment":{"href":"https://api.github.com/repos/symfony/symfony/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/symfony/symfony/pulls/18016/commits"},"statuses":{"href":"https://api.github.com/repos/symfony/symfony/statuses/d649294ee4128ec254b6fb08bdbfa6698d5432fe"}}}}