{"action":"created","issue":{"url":"https://api.github.com/repos/laravel/ideas/issues/114","repository_url":"https://api.github.com/repos/laravel/ideas","labels_url":"https://api.github.com/repos/laravel/ideas/issues/114/labels{/name}","comments_url":"https://api.github.com/repos/laravel/ideas/issues/114/comments","events_url":"https://api.github.com/repos/laravel/ideas/issues/114/events","html_url":"https://github.com/laravel/ideas/issues/114","id":160056189,"number":114,"title":"Forbid call to method Request::get()","user":{"login":"vlakoff","id":544424,"avatar_url":"https://avatars1.githubusercontent.com/u/544424?v=4","gravatar_id":"","url":"https://api.github.com/users/vlakoff","html_url":"https://github.com/vlakoff","followers_url":"https://api.github.com/users/vlakoff/followers","following_url":"https://api.github.com/users/vlakoff/following{/other_user}","gists_url":"https://api.github.com/users/vlakoff/gists{/gist_id}","starred_url":"https://api.github.com/users/vlakoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlakoff/subscriptions","organizations_url":"https://api.github.com/users/vlakoff/orgs","repos_url":"https://api.github.com/users/vlakoff/repos","events_url":"https://api.github.com/users/vlakoff/events{/privacy}","received_events_url":"https://api.github.com/users/vlakoff/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":18,"created_at":"2016-06-13T22:08:52Z","updated_at":"2018-03-17T19:49:07Z","closed_at":"2018-03-09T16:16:35Z","author_association":"NONE","body":"Laravel Request extends Symfony Request, thus it has a `get()` method. However, you are not expected to use it. Never. You should always use Laravel's `input()` instead. Otherwise you are likely to encounter some \"hard to track down\" bugs (immediately or even worse, later).\n\nRefs:\n- https://github.com/laravel/docs/pull/2269\n- https://github.com/laravel/framework/issues/13138\n\nSo, maybe we should completely forbid its use, by extending it and throwing an exception.\n"},"comment":{"url":"https://api.github.com/repos/laravel/ideas/issues/comments/373947773","html_url":"https://github.com/laravel/ideas/issues/114#issuecomment-373947773","issue_url":"https://api.github.com/repos/laravel/ideas/issues/114","id":373947773,"user":{"login":"vlakoff","id":544424,"avatar_url":"https://avatars1.githubusercontent.com/u/544424?v=4","gravatar_id":"","url":"https://api.github.com/users/vlakoff","html_url":"https://github.com/vlakoff","followers_url":"https://api.github.com/users/vlakoff/followers","following_url":"https://api.github.com/users/vlakoff/following{/other_user}","gists_url":"https://api.github.com/users/vlakoff/gists{/gist_id}","starred_url":"https://api.github.com/users/vlakoff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vlakoff/subscriptions","organizations_url":"https://api.github.com/users/vlakoff/orgs","repos_url":"https://api.github.com/users/vlakoff/repos","events_url":"https://api.github.com/users/vlakoff/events{/privacy}","received_events_url":"https://api.github.com/users/vlakoff/received_events","type":"User","site_admin":false},"created_at":"2018-03-17T19:49:07Z","updated_at":"2018-03-17T19:49:07Z","author_association":"NONE","body":"I think it would precisely be a misuse of inheritance. In this example, `PublicDataSource` shouldn't extend `DataSource` and you should rather use [composition](https://en.wikipedia.org/wiki/Object_composition):\r\n\r\n```php\r\nclass PublicDataSource {\r\n\r\n    protected $dataSource; // instance of DataSource\r\n\r\n    public function get($key) {\r\n\r\n        // just a basic example\r\n        if (Str::startsWith($key, 'hidden_')) {\r\n            return false;\r\n        }\r\n\r\n        return $this->dataSource->get($key);\r\n    }\r\n}\r\n```\r\n\r\nLong story short, unsubscribing. Couldn't we just apply [mfn's suggestion](https://github.com/laravel/ideas/issues/114#issuecomment-373509373)..."}}
{"actor":{"display_login":"vlakoff"}}