{"action":"created","issue":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/7324","labels_url":"https://api.github.com/repos/yiisoft/yii2/issues/7324/labels{/name}","comments_url":"https://api.github.com/repos/yiisoft/yii2/issues/7324/comments","events_url":"https://api.github.com/repos/yiisoft/yii2/issues/7324/events","html_url":"https://github.com/yiisoft/yii2/pull/7324","id":57956070,"number":7324,"title":"[WIP] Introduced \\yii\\di\\ConfiguratorInterface","user":{"login":"creocoder","id":896494,"avatar_url":"https://avatars.githubusercontent.com/u/896494?v=3","gravatar_id":"","url":"https://api.github.com/users/creocoder","html_url":"https://github.com/creocoder","followers_url":"https://api.github.com/users/creocoder/followers","following_url":"https://api.github.com/users/creocoder/following{/other_user}","gists_url":"https://api.github.com/users/creocoder/gists{/gist_id}","starred_url":"https://api.github.com/users/creocoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/creocoder/subscriptions","organizations_url":"https://api.github.com/users/creocoder/orgs","repos_url":"https://api.github.com/users/creocoder/repos","events_url":"https://api.github.com/users/creocoder/events{/privacy}","received_events_url":"https://api.github.com/users/creocoder/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/yiisoft/yii2/labels/type:enhancement","name":"type:enhancement","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/yiisoft/yii2/milestones/9","labels_url":"https://api.github.com/repos/yiisoft/yii2/milestones/9/labels","id":831720,"number":9,"title":"2.0.x","description":"","creator":{"login":"cebe","id":189796,"avatar_url":"https://avatars.githubusercontent.com/u/189796?v=3","gravatar_id":"","url":"https://api.github.com/users/cebe","html_url":"https://github.com/cebe","followers_url":"https://api.github.com/users/cebe/followers","following_url":"https://api.github.com/users/cebe/following{/other_user}","gists_url":"https://api.github.com/users/cebe/gists{/gist_id}","starred_url":"https://api.github.com/users/cebe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cebe/subscriptions","organizations_url":"https://api.github.com/users/cebe/orgs","repos_url":"https://api.github.com/users/cebe/repos","events_url":"https://api.github.com/users/cebe/events{/privacy}","received_events_url":"https://api.github.com/users/cebe/received_events","type":"User","site_admin":false},"open_issues":285,"closed_issues":2,"state":"open","created_at":"2014-10-19T13:49:45Z","updated_at":"2015-02-18T11:18:30Z","due_on":null,"closed_at":null},"comments":46,"created_at":"2015-02-17T17:39:56Z","updated_at":"2015-02-18T19:07:13Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/yiisoft/yii2/pulls/7324","html_url":"https://github.com/yiisoft/yii2/pull/7324","diff_url":"https://github.com/yiisoft/yii2/pull/7324.diff","patch_url":"https://github.com/yiisoft/yii2/pull/7324.patch"},"body":"There is many 3rd party libraries and currently there is no option around integration it to Yii 2 instead of using Proxy pattern which is **very** slow and magic.\r\n\r\nThis new interface solve all those troubles. Use case:\r\n\r\n```php\r\nclass ThirdPartyLibConfigurator extends Object implements ConfiguratorInterface\r\n{\r\n    public $foo;\r\n    public $bar;\r\n\r\n    public function build() {\r\n        $this->bar = Yii::getAlias($this->bar);\r\n\r\n        // other complex logic to proof configurator needs its own instance\r\n        // ...\r\n\r\n        return new ThirdPartyLib($this->foo, $this->bar);\r\n    }\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/yiisoft/yii2/issues/comments/74926181","html_url":"https://github.com/yiisoft/yii2/pull/7324#issuecomment-74926181","issue_url":"https://api.github.com/repos/yiisoft/yii2/issues/7324","id":74926181,"user":{"login":"qiangxue","id":993322,"avatar_url":"https://avatars.githubusercontent.com/u/993322?v=3","gravatar_id":"","url":"https://api.github.com/users/qiangxue","html_url":"https://github.com/qiangxue","followers_url":"https://api.github.com/users/qiangxue/followers","following_url":"https://api.github.com/users/qiangxue/following{/other_user}","gists_url":"https://api.github.com/users/qiangxue/gists{/gist_id}","starred_url":"https://api.github.com/users/qiangxue/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qiangxue/subscriptions","organizations_url":"https://api.github.com/users/qiangxue/orgs","repos_url":"https://api.github.com/users/qiangxue/repos","events_url":"https://api.github.com/users/qiangxue/events{/privacy}","received_events_url":"https://api.github.com/users/qiangxue/received_events","type":"User","site_admin":false},"created_at":"2015-02-18T19:07:13Z","updated_at":"2015-02-18T19:07:13Z","body":"I still think this implementation is unnecessary, and the desired feature can be readily done with the current implementation already.\r\n\r\n```php\r\nclass FacebookSDK {\r\n    public static function service(...) {\r\n        return function () {\r\n        };\r\n    }\r\n}\r\n\r\n// app config\r\nreturn [\r\n    'components' => [\r\n         'facebook' => FacebookSDK::service(...),\r\n    ],\r\n];\r\n```\r\n\r\n@creocoder Please give more concrete examples that we can learn about from other frameworks."}}