{"action":"created","issue":{"url":"https://api.github.com/repos/magento/magento2/issues/4726","repository_url":"https://api.github.com/repos/magento/magento2","labels_url":"https://api.github.com/repos/magento/magento2/issues/4726/labels{/name}","comments_url":"https://api.github.com/repos/magento/magento2/issues/4726/comments","events_url":"https://api.github.com/repos/magento/magento2/issues/4726/events","html_url":"https://github.com/magento/magento2/pull/4726","id":157088004,"number":4726,"title":"Fixing direct use of object manager with injected block factory.","user":{"login":"astorm","id":184372,"avatar_url":"https://avatars.githubusercontent.com/u/184372?v=3","gravatar_id":"","url":"https://api.github.com/users/astorm","html_url":"https://github.com/astorm","followers_url":"https://api.github.com/users/astorm/followers","following_url":"https://api.github.com/users/astorm/following{/other_user}","gists_url":"https://api.github.com/users/astorm/gists{/gist_id}","starred_url":"https://api.github.com/users/astorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astorm/subscriptions","organizations_url":"https://api.github.com/users/astorm/orgs","repos_url":"https://api.github.com/users/astorm/repos","events_url":"https://api.github.com/users/astorm/events{/privacy}","received_events_url":"https://api.github.com/users/astorm/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2016-05-26T21:55:20Z","updated_at":"2016-05-27T17:35:07Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/magento/magento2/pulls/4726","html_url":"https://github.com/magento/magento2/pull/4726","diff_url":"https://github.com/magento/magento2/pull/4726.diff","patch_url":"https://github.com/magento/magento2/pull/4726.patch"},"body":"Statements by Magento team members have indicated that objects should **not** be instantiated directly in method code.  Instead, new objects should be **injected** via automatic constructor dependency injection.  \r\n\r\nThe following pull requests swaps a direct instantiation in \r\n\r\n    app/code/Magento/Cms/Controller/Adminhtml/Block/Delete.php\r\n\r\nwith an injected factory object.  The object manager call itself is replaced with a call to the factory method's `create` method.  This moves this dependency into the controller class's constructor. \r\n\r\nThis pull requests adds no new functionality, and fixes no new bugs.  It brings a single PHP file better into line with Magento's stated coding conventions.  \r\n\r\nIf these changes are not welcome, please indicate that in the ticket responses.\r\n\r\nIf these tickets **are** welcome, but there's addition unstated steps/context, please let me know what needs to be addressed.\r\n\r\nThis is a contribution to the Magento source code repository.  My contribution consists of code, files, and text  explicitly added to this GitHub pull request by myself.  My contribution does not consist of code, files, or text outside of this specific pull request, and nothing said in this pull request or elsewhere will be constituted as expanding the scope of this contribution. "},"comment":{"url":"https://api.github.com/repos/magento/magento2/issues/comments/222207681","html_url":"https://github.com/magento/magento2/pull/4726#issuecomment-222207681","issue_url":"https://api.github.com/repos/magento/magento2/issues/4726","id":222207681,"user":{"login":"astorm","id":184372,"avatar_url":"https://avatars.githubusercontent.com/u/184372?v=3","gravatar_id":"","url":"https://api.github.com/users/astorm","html_url":"https://github.com/astorm","followers_url":"https://api.github.com/users/astorm/followers","following_url":"https://api.github.com/users/astorm/following{/other_user}","gists_url":"https://api.github.com/users/astorm/gists{/gist_id}","starred_url":"https://api.github.com/users/astorm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/astorm/subscriptions","organizations_url":"https://api.github.com/users/astorm/orgs","repos_url":"https://api.github.com/users/astorm/repos","events_url":"https://api.github.com/users/astorm/events{/privacy}","received_events_url":"https://api.github.com/users/astorm/received_events","type":"User","site_admin":false},"created_at":"2016-05-27T17:35:07Z","updated_at":"2016-05-27T17:35:07Z","body":"@Vinai Right there with you on meaningless comments -- this pull request is mostly about clarifying what would be involved/needed to fix all those object manager calls.   Also, thanks for the feedback on the breaking unit tests question (http://magento.stackexchange.com/questions/117170/magento-2-fixing-call-to-undefined-method-mock-blockfactory-4b440480create) -- was just what I was looking for.  (mentioned here in case future googlers end up at this ticket)"}}
{"actor":{"display_login":"astorm"}}