From 28dcec29a20c2fc6a7c5a208b67043ead03edf89 Mon Sep 17 00:00:00 2001 From: mage2-team <mage2-team@magento.com> Date: Fri, 6 Dec 2013 09:33:16 -0800 Subject: [PATCH] 2.0.0.0-dev55 * Modularity improvements: * Session configuration moved to library * FormKey logic was moved from Session * SessionIdFlags from Session was removed * Move Page logic to the Theme module and library * Created integration module UX * Created authorization service (Magento_Authz module) * Fixed bugs: * Fixed the issue that prevented a customer group's shopping cart rules from applying properly to prices. The issue occurred when a customer was manually assigned to a customer group and automatic group assignment was enabled. * Fixed the bug with schema upgrade scripts not running after installation * Fixed the error with a blank page when user tries to get access to a restricted resource via URL (add Secret Key for URL set to "No") --- CHANGELOG.md | 14 + .../Block/System/Messages.php | 22 +- .../System/Messages/UnreadMessagePopup.php | 22 +- .../AdminNotification/Block/ToolbarEntry.php | 22 +- .../AdminNotification/Block/Window.php | 26 +- .../Resource/System/Message/Collection.php | 12 +- .../Magento/AdminNotification/etc/module.xml | 2 +- .../view/adminhtml/layout/default.xml | 6 +- .../view/adminhtml/notification/window.phtml | 2 +- .../adminhtml/system/messages/popup.phtml | 13 +- .../view/adminhtml/toolbar_entry.js | 11 +- .../Magento/Adminhtml/Block/Urlrewrite.php | 22 +- .../Urlrewrite/Catalog/Category/Edit.php | 30 +- .../Urlrewrite/Catalog/Category/Tree.php | 48 +- .../Block/Urlrewrite/Catalog/Edit/Form.php | 3 - .../Block/Urlrewrite/Catalog/Product/Edit.php | 34 +- .../Block/Urlrewrite/Cms/Page/Edit.php | 30 +- .../Block/Urlrewrite/Cms/Page/Edit/Form.php | 3 - .../Adminhtml/Block/Urlrewrite/Edit.php | 26 +- .../Adminhtml/Block/Urlrewrite/Edit/Form.php | 4 +- .../Adminhtml/Block/Urlrewrite/Link.php | 2 +- .../Adminhtml/Block/Urlrewrite/Selector.php | 2 +- .../Magento/Adminhtml/Model/Session/Quote.php | 8 +- .../adminhtml/urlrewrite/categories.phtml | 2 +- .../view/adminhtml/urlrewrite/selector.phtml | 2 +- .../Authorizenet/Block/Directpost/Form.php | 8 +- .../Authorizenet/Block/Directpost/Iframe.php | 12 +- .../Authorizenet/Directpost/Payment.php | 4 +- .../Model/Directpost/Observer.php | 2 +- .../Authorizenet/Model/Directpost/Session.php | 8 +- app/code/Magento/Authorizenet/etc/module.xml | 2 +- .../layout/sales_order_create_index.xml | 2 +- .../layout/checkout_onepage_index.xml | 2 +- .../Magento/Authz/Model/UserIdentifier.php | 130 ++++ .../Authz/Model/UserIdentifier/Factory.php | 42 +- .../Magento/Authz/Model/UserLocator/Admin.php | 64 ++ .../Magento/Authz/Model/UserLocator/Guest.php | 50 ++ .../Model/UserLocatorInterface.php} | 25 +- .../Magento/Authz/Service/AuthorizationV1.php | 254 +++++++ .../Service/AuthorizationV1Interface.php | 72 ++ app/code/Magento/Authz/etc/adminhtml/di.xml | 28 + app/code/Magento/Authz/etc/di.xml | 29 + .../Magento/{Page => Authz}/etc/module.xml | 10 +- .../Magento/Backend/App/AbstractAction.php | 22 +- .../Magento/Backend/App/Action/Context.php | 2 +- .../Magento/Backend/Block/AbstractBlock.php | 2 +- .../Magento/Backend/Block/Admin/Formkey.php | 2 +- .../Block/Cache/Grid/Column/Statuses.php | 4 +- app/code/Magento/Backend/Block/Context.php | 31 +- .../Block/Dashboard/AbstractDashboard.php | 22 +- .../Magento/Backend/Block/Dashboard/Graph.php | 26 +- .../Backend/Block/Dashboard/Orders/Grid.php | 36 +- .../Magento/Backend/Block/Dashboard/Sales.php | 25 +- .../Backend/Block/Dashboard/Searches/Last.php | 36 +- .../Backend/Block/Dashboard/Searches/Top.php | 36 +- .../Block/Dashboard/Tab/Customers/Most.php | 26 +- .../Block/Dashboard/Tab/Customers/Newest.php | 26 +- .../Block/Dashboard/Tab/Products/Ordered.php | 36 +- .../Block/Dashboard/Tab/Products/Viewed.php | 26 +- .../Backend/Block/Dashboard/Totals.php | 25 +- app/code/Magento/Backend/Block/Denied.php | 22 +- .../Magento/Backend/Block/Media/Uploader.php | 6 +- app/code/Magento/Backend/Block/Menu.php | 34 +- app/code/Magento/Backend/Block/Page/Head.php | 33 +- .../Magento/Backend/Block/Page/Header.php | 26 +- .../Block/Page/System/Config/Robots/Reset.php | 35 +- .../Magento/Backend/Block/Store/Switcher.php | 30 +- .../Block/System/Account/Edit/Form.php | 34 +- .../Backend/Block/System/Cache/Form.php | 23 + .../Backend/Block/System/Config/Edit.php | 25 +- .../Backend/Block/System/Config/Form.php | 6 +- .../Field/FieldArray/AbstractFieldArray.php | 2 +- .../Config/Form/Field/Regexceptions.php | 26 +- .../Backend/Block/System/Config/Switcher.php | 6 +- .../System/Storage/Media/Synchronize.php | 22 +- .../Backend/Block/System/Config/Tabs.php | 22 +- .../Backend/Block/System/Design/Edit.php | 22 +- .../Block/System/Design/Edit/Tab/General.php | 34 +- .../Backend/Block/System/Shipping/Ups.php | 26 +- .../Backend/Block/System/Store/Edit.php | 22 +- .../Block/System/Store/Edit/Form/Group.php | 38 +- .../Block/System/Store/Edit/Form/Store.php | 34 +- .../Block/System/Store/Edit/Form/Website.php | 30 +- .../Backend/Block/System/Variable/Edit.php | 22 +- app/code/Magento/Backend/Block/Template.php | 14 +- .../Backend/Block/Template/Context.php | 22 +- .../Magento/Backend/Block/Text/ListText.php | 2 +- .../Backend/Block/Widget/Accordion.php | 2 +- .../Backend/Block/Widget/Accordion/Item.php | 2 +- .../Magento/Backend/Block/Widget/Button.php | 2 +- .../Backend/Block/Widget/Container.php | 2 +- .../Magento/Backend/Block/Widget/Form.php | 22 +- .../Backend/Block/Widget/Form/Container.php | 2 +- .../Block/Widget/Form/Element/Dependence.php | 52 +- .../Backend/Block/Widget/Form/Generic.php | 26 +- .../Magento/Backend/Block/Widget/Grid.php | 12 +- .../Block/Widget/Grid/Column/Extended.php | 18 +- .../Block/Widget/Grid/Column/Multistore.php | 4 +- .../Widget/Grid/Column/Renderer/Action.php | 32 +- .../Backend/Block/Widget/Grid/ColumnSet.php | 12 +- .../Backend/Block/Widget/Grid/Export.php | 24 +- .../Backend/Block/Widget/Grid/Extended.php | 4 +- .../Grid/Massaction/AbstractMassaction.php | 23 +- .../Widget/Grid/Massaction/Additional.php | 30 +- .../Block/Widget/Grid/Massaction/Extended.php | 34 +- .../Block/Widget/Grid/Massaction/Item.php | 6 +- .../Backend/Block/Widget/Grid/Serializer.php | 25 +- .../Magento/Backend/Block/Widget/Tabs.php | 31 +- .../Backend/Controller/Adminhtml/Cache.php | 44 +- .../Controller/Adminhtml/System/Variable.php | 2 +- .../Magento/Backend/Model/Auth/Session.php | 27 +- .../Model/Cache/Resource/Grid/Collection.php | 6 +- .../Model/Config/Backend/Admin/Observer.php | 3 +- .../Backend/Model/Config/Backend/Baseurl.php | 6 +- .../Backend/Model/Config/Backend/File.php | 6 +- .../Backend/Model/Config/Backend/Secure.php | 6 +- .../Config/Backend/Storage/Media/Database.php | 4 +- app/code/Magento/Backend/Model/Session.php | 24 +- app/code/Magento/Backend/Model/Url.php | 30 +- app/code/Magento/Backend/etc/adminhtml/di.xml | 28 - app/code/Magento/Backend/etc/di.xml | 31 + app/code/Magento/Backend/etc/module.xml | 2 +- .../Backend/view/adminhtml/admin/login.phtml | 6 +- .../view/adminhtml/admin/overlay_popup.phtml | 4 +- .../Backend/view/adminhtml/admin/page.phtml | 2 +- .../Backend/view/adminhtml/admin/popup.phtml | 10 +- .../adminhtml/layout/adminhtml_noroute.xml | 2 +- .../layout/adminhtml_system_config_edit.xml | 2 +- .../Backend/view/adminhtml/layout/default.xml | 94 +-- .../Backend/view/adminhtml/layout/editor.xml | 18 +- .../Backend/view/adminhtml/page/head.phtml | 6 +- .../view/adminhtml/page/js/calendar.phtml | 2 +- .../view/adminhtml/page/js/components.phtml | 2 +- .../view/adminhtml/page/js/translate.phtml | 2 +- .../Backend/view/adminhtml/widget/grid.phtml | 2 +- .../view/adminhtml/widget/grid/extended.phtml | 2 +- .../Backup/Block/Adminhtml/Dialogs.php | 4 +- .../Backup/Controller/Adminhtml/Index.php | 3 +- .../Magento/Backup/Model/Fs/Collection.php | 4 +- .../Product/Composite/Fieldset/Bundle.php | 7 +- .../Product/Edit/Tab/Attributes/Extend.php | 22 +- .../Catalog/Product/Edit/Tab/Bundle.php | 22 +- .../Product/Edit/Tab/Bundle/Option.php | 8 +- .../Edit/Tab/Bundle/Option/Search/Grid.php | 30 +- .../Edit/Tab/Bundle/Option/Selection.php | 8 +- .../Bundle/Block/Catalog/Product/Price.php | 10 +- .../Catalog/Product/View/Type/Bundle.php | 60 +- .../Block/Checkout/Cart/Item/Renderer.php | 8 +- .../Helper/Catalog/Product/Configuration.php | 4 +- app/code/Magento/Bundle/Model/Price/Index.php | 8 +- .../Magento/Bundle/Model/Resource/Bundle.php | 8 +- .../Bundle/Model/Resource/Price/Index.php | 8 +- .../Sales/Order/Pdf/Items/Creditmemo.php | 14 +- .../Model/Sales/Order/Pdf/Items/Invoice.php | 14 +- .../Model/Sales/Order/Pdf/Items/Shipment.php | 14 +- app/code/Magento/Bundle/Model/Selection.php | 4 +- app/code/Magento/Bundle/etc/module.xml | 2 +- .../layout/catalog_product_bundle.xml | 2 +- .../composite/fieldset/options/bundle.phtml | 20 +- .../fieldset/options/type/checkbox.phtml | 51 +- .../fieldset/options/type/multi.phtml | 37 +- .../fieldset/options/type/radio.phtml | 81 ++- .../fieldset/options/type/select.phtml | 56 +- .../catalog_product_view_type_bundle.xml | 4 +- .../Adminhtml/Captcha/DefaultCaptcha.php | 8 +- app/code/Magento/Captcha/Block/Captcha.php | 10 +- .../Captcha/Block/Captcha/DefaultCaptcha.php | 10 +- app/code/Magento/Captcha/etc/module.xml | 2 +- .../layout/checkout_onepage_index.xml | 2 +- .../Adminhtml/Category/AbstractCategory.php | 26 +- .../Block/Adminhtml/Category/Edit/Form.php | 29 +- .../Adminhtml/Category/Tab/Attributes.php | 30 +- .../Block/Adminhtml/Category/Tab/Product.php | 30 +- .../Catalog/Block/Adminhtml/Category/Tabs.php | 36 +- .../Catalog/Block/Adminhtml/Category/Tree.php | 52 +- .../Form/Renderer/Attribute/Urlkey.php | 26 +- .../Adminhtml/Helper/Form/Wysiwyg/Content.php | 30 +- .../Catalog/Block/Adminhtml/Product.php | 26 +- .../Adminhtml/Product/Attribute/Edit.php | 22 +- .../Product/Attribute/Edit/Tab/Advanced.php | 34 +- .../Product/Attribute/Edit/Tab/Front.php | 30 +- .../Adminhtml/Product/Attribute/Grid.php | 26 +- .../NewAttribute/Product/Created.php | 40 +- .../Adminhtml/Product/Attribute/Set/Main.php | 54 +- .../Product/Attribute/Set/Main/Formgroup.php | 30 +- .../Product/Attribute/Set/Main/Formset.php | 30 +- .../Attribute/Set/Toolbar/Main/Filter.php | 30 +- .../Adminhtml/Product/Composite/Configure.php | 26 +- .../Adminhtml/Product/Composite/Error.php | 34 +- .../Adminhtml/Product/Composite/Fieldset.php | 4 +- .../Product/Composite/Fieldset/Grouped.php | 8 +- .../Product/Composite/Fieldset/Qty.php | 24 +- .../Product/Composite/Update/Result.php | 38 +- .../Block/Adminhtml/Product/Created.php | 32 +- .../Catalog/Block/Adminhtml/Product/Edit.php | 36 +- .../Product/Edit/Action/Attribute.php | 22 +- .../Edit/Action/Attribute/Tab/Attributes.php | 4 +- .../Edit/Action/Attribute/Tab/Inventory.php | 22 +- .../Adminhtml/Product/Edit/AttributeSet.php | 22 +- .../Block/Adminhtml/Product/Edit/Js.php | 22 +- .../Adminhtml/Product/Edit/NewCategory.php | 40 +- .../Product/Edit/Tab/Ajax/Serializer.php | 2 +- .../Product/Edit/Tab/Alerts/Price.php | 30 +- .../Product/Edit/Tab/Alerts/Stock.php | 30 +- .../Adminhtml/Product/Edit/Tab/Attributes.php | 34 +- .../Product/Edit/Tab/Attributes/Search.php | 30 +- .../Adminhtml/Product/Edit/Tab/Crosssell.php | 50 +- .../Adminhtml/Product/Edit/Tab/Inventory.php | 36 +- .../Product/Edit/Tab/Options/Option.php | 8 +- .../Edit/Tab/Options/Type/AbstractType.php | 6 +- .../Edit/Tab/Price/Group/AbstractGroup.php | 34 +- .../Product/Edit/Tab/Price/Recurring.php | 22 +- .../Adminhtml/Product/Edit/Tab/Related.php | 50 +- .../Product/Edit/Tab/Super/Config.php | 13 +- .../Super/Config/Grid/Renderer/Checkbox.php | 34 +- .../Product/Edit/Tab/Super/Config/Matrix.php | 35 +- .../Product/Edit/Tab/Super/Config/Simple.php | 38 +- .../Product/Edit/Tab/Super/Settings.php | 30 +- .../Adminhtml/Product/Edit/Tab/Upsell.php | 50 +- .../Adminhtml/Product/Edit/Tab/Websites.php | 34 +- .../Block/Adminhtml/Product/Edit/Tabs.php | 50 +- .../Product/Frontend/Product/Watermark.php | 30 +- .../Catalog/Block/Adminhtml/Product/Grid.php | 50 +- .../Product/Helper/Form/Category.php | 13 +- .../Product/Helper/Form/Gallery/Content.php | 18 +- .../Block/Adminhtml/Product/Options/Ajax.php | 36 +- .../Adminhtml/Product/Widget/Chooser.php | 38 +- .../Catalog/Block/Adminhtml/Search/Edit.php | 22 +- .../Block/Adminhtml/Search/Edit/Form.php | 30 +- .../Magento/Catalog/Block/Breadcrumbs.php | 10 +- .../Magento/Catalog/Block/Category/View.php | 12 +- .../Catalog/Block/Category/Widget/Link.php | 8 +- .../Block/Layer/Filter/AbstractFilter.php | 10 +- .../Magento/Catalog/Block/Layer/State.php | 10 +- app/code/Magento/Catalog/Block/Layer/View.php | 10 +- app/code/Magento/Catalog/Block/Navigation.php | 10 +- app/code/Magento/Catalog/Block/Product.php | 10 +- .../Catalog/Block/Product/AbstractProduct.php | 14 +- .../Block/Product/Compare/AbstractCompare.php | 8 +- .../Block/Product/Compare/ListCompare.php | 13 +- .../Backend/Grid/ColumnSet.php | 8 +- .../Configurable/AttributeSelector.php | 26 +- .../Magento/Catalog/Block/Product/Gallery.php | 10 +- .../ListAssociatedProducts.php | 22 +- .../Magento/Catalog/Block/Product/Image.php | 10 +- .../Catalog/Block/Product/ListProduct.php | 8 +- .../Catalog/Block/Product/NewProduct.php | 10 +- .../Magento/Catalog/Block/Product/Price.php | 20 +- .../Catalog/Block/Product/Price/Template.php | 2 +- .../Block/Product/ProductList/Promotion.php | 7 +- .../Block/Product/ProductList/Random.php | 7 +- .../Block/Product/ProductList/Related.php | 8 +- .../Block/Product/ProductList/Toolbar.php | 12 +- .../Block/Product/ProductList/Upsell.php | 8 +- .../Magento/Catalog/Block/Product/Send.php | 8 +- .../Block/Product/TemplateSelector.php | 10 +- .../Magento/Catalog/Block/Product/View.php | 28 +- .../Block/Product/View/AbstractView.php | 8 +- .../Catalog/Block/Product/View/Additional.php | 2 +- .../Catalog/Block/Product/View/Attributes.php | 10 +- .../Block/Product/View/Description.php | 10 +- .../Catalog/Block/Product/View/Options.php | 24 +- .../Product/View/Options/AbstractOptions.php | 10 +- .../Block/Product/View/Options/Type/Date.php | 14 +- .../Product/View/Options/Type/Select.php | 2 +- .../Catalog/Block/Product/View/Price.php | 10 +- .../Catalog/Block/Product/View/Tabs.php | 2 +- .../Block/Product/View/Type/Configurable.php | 28 +- .../Block/Product/Widget/Html/Pager.php | 2 +- .../Catalog/Block/Product/Widget/Link.php | 8 +- .../Block/Product/Widget/NewWidget.php | 2 +- .../Magento/Catalog/Block/Widget/Link.php | 18 +- .../Catalog/Controller/Adminhtml/Category.php | 4 +- .../Controller/Adminhtml/Product/Set.php | 4 +- .../Magento/Catalog/Controller/Category.php | 2 +- app/code/Magento/Catalog/Helper/Catalog.php | 4 +- app/code/Magento/Catalog/Helper/Category.php | 6 +- .../Magento/Catalog/Helper/Category/Flat.php | 2 - app/code/Magento/Catalog/Helper/Data.php | 8 +- .../Catalog/Helper/Flat/AbstractFlat.php | 2 - app/code/Magento/Catalog/Helper/Image.php | 6 +- app/code/Magento/Catalog/Helper/Output.php | 6 +- app/code/Magento/Catalog/Helper/Product.php | 12 +- .../Catalog/Helper/Product/Compare.php | 12 +- .../Catalog/Helper/Product/Composite.php | 4 +- .../Catalog/Helper/Product/Configuration.php | 4 +- .../Magento/Catalog/Helper/Product/Flat.php | 2 - .../Magento/Catalog/Helper/Product/Url.php | 8 +- .../Magento/Catalog/Helper/Product/View.php | 10 +- .../Magento/Catalog/Model/AbstractModel.php | 6 +- app/code/Magento/Catalog/Model/Category.php | 18 +- .../Category/Attribute/Source/Layout.php | 6 +- .../Catalog/Model/Category/Indexer/Flat.php | 10 +- .../Catalog/Model/Config/Backend/Category.php | 6 +- .../Model/Config/CatalogClone/Media/Image.php | 10 +- app/code/Magento/Catalog/Model/Design.php | 10 +- .../Magento/Catalog/Model/Indexer/Url.php | 10 +- .../Catalog/Model/Layer/Filter/Category.php | 2 +- .../Catalog/Model/Layer/Filter/Item.php | 6 +- app/code/Magento/Catalog/Model/Product.php | 46 +- .../Magento/Catalog/Model/Product/Action.php | 10 +- .../Catalog/Model/Product/Attribute/Group.php | 6 +- .../Model/Product/Attribute/Source/Layout.php | 6 +- .../Catalog/Model/Product/Compare/Item.php | 10 +- .../Catalog/Model/Product/Flat/Indexer.php | 10 +- .../Magento/Catalog/Model/Product/Image.php | 12 +- .../Catalog/Model/Product/Indexer/Eav.php | 6 +- .../Catalog/Model/Product/Indexer/Flat.php | 10 +- .../Magento/Catalog/Model/Product/Link.php | 10 +- .../Magento/Catalog/Model/Product/Option.php | 6 +- .../Catalog/Model/Product/Option/Value.php | 6 +- .../Magento/Catalog/Model/Product/Status.php | 10 +- .../Category/Attribute/Collection.php | 18 +- .../Resource/Category/Flat/Collection.php | 18 +- .../Resource/Category/Indexer/Product.php | 10 +- .../Collection/AbstractCollection.php | 30 +- .../Magento/Catalog/Model/Resource/Config.php | 8 +- .../Model/Resource/Layer/Filter/Price.php | 12 +- .../Resource/Product/Attribute/Collection.php | 18 +- .../Model/Resource/Product/Collection.php | 35 +- .../Product/Collection/AssociatedProduct.php | 40 +- .../Product/Compare/Item/Collection.php | 41 +- .../Catalog/Model/Resource/Product/Flat.php | 8 +- .../Model/Resource/Product/Flat/Indexer.php | 8 +- .../Model/Resource/Product/Indexer/Eav.php | 12 +- .../Model/Resource/Product/Indexer/Price.php | 6 +- .../Catalog/Model/Resource/Product/Link.php | 8 +- .../Resource/Product/Option/Collection.php | 22 +- .../Catalog/Model/Resource/Product/Status.php | 8 +- .../Resource/Product/Type/Configurable.php | 8 +- .../Product/Type/Configurable/Attribute.php | 8 +- .../Configurable/Attribute/Collection.php | 24 +- .../Grouped/AssociatedProductsCollection.php | 43 +- .../Model/Resource/Product/Website.php | 8 +- .../Magento/Catalog/Model/Resource/Setup.php | 8 +- .../Magento/Catalog/Model/Resource/Url.php | 6 +- app/code/Magento/Catalog/Model/Session.php | 8 +- .../Config/Backend/Catalog/Category/Flat.php | 6 +- .../Config/Backend/Catalog/Product/Flat.php | 6 +- .../Backend/Catalog/Url/Rewrite/Suffix.php | 4 +- app/code/Magento/Catalog/etc/module.xml | 2 +- .../edit/super/attribute-js-template.phtml | 2 +- .../edit/super/attribute-template.phtml | 2 +- .../CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml | 2 +- .../layout/catalog_category_edit.xml | 14 +- .../layout/catalog_product_grouped.xml | 4 +- .../adminhtml/layout/catalog_product_new.xml | 38 +- .../layout/catalog_product_review_new.xml | 2 +- .../form.phtml | 2 +- .../adminhtml/product/grouped/grouped.phtml | 4 +- .../category/widget/link/link_block.phtml | 2 +- .../category/widget/link/link_inline.phtml | 2 +- .../view/frontend/layout/MAP_popup.xml | 2 +- .../frontend/layout/catalog_category_view.xml | 2 +- .../frontend/layout/catalog_product_view.xml | 8 +- .../product/widget/link/link_block.phtml | 2 +- .../product/widget/link/link_inline.phtml | 2 +- .../Adminhtml/Form/Field/Customergroup.php | 6 +- .../CatalogInventory/Block/Qtyincrements.php | 10 +- .../Block/Stockqty/AbstractStockqty.php | 10 +- .../Model/Config/Backend/Managestock.php | 4 +- .../CatalogInventory/Model/Indexer/Stock.php | 4 +- .../Model/Resource/Stock/Item/Collection.php | 12 +- .../Magento/CatalogInventory/Model/Stock.php | 4 +- .../CatalogInventory/Model/Stock/Item.php | 10 +- .../System/Config/Backend/Minsaleqty.php | 4 +- .../Block/Adminhtml/Promo/Catalog/Edit.php | 22 +- .../Promo/Catalog/Edit/Tab/Conditions.php | 34 +- .../Adminhtml/Promo/Catalog/Edit/Tab/Main.php | 4 +- .../Block/Adminhtml/Promo/Widget/Chooser.php | 26 +- .../Adminhtml/Promo/Widget/Chooser/Sku.php | 38 +- app/code/Magento/CatalogRule/Model/Rule.php | 24 +- .../CatalogSearch/Block/Advanced/Form.php | 14 +- .../CatalogSearch/Block/Advanced/Result.php | 10 +- .../CatalogSearch/Block/Autocomplete.php | 2 +- .../Magento/CatalogSearch/Block/Layer.php | 8 +- .../Magento/CatalogSearch/Block/Result.php | 10 +- app/code/Magento/CatalogSearch/Block/Term.php | 10 +- .../Model/Config/Backend/Search/Type.php | 6 +- .../Magento/CatalogSearch/Model/Fulltext.php | 4 +- .../Model/Resource/Advanced/Collection.php | 42 +- .../Model/Resource/Fulltext/Collection.php | 42 +- .../Model/Resource/Query/Collection.php | 14 +- .../Model/Resource/Search/Collection.php | 41 +- app/code/Magento/CatalogSearch/etc/module.xml | 2 +- .../view/frontend/form.mini.phtml | 2 +- .../layout/catalogsearch_advanced_index.xml | 2 +- .../layout/catalogsearch_advanced_result.xml | 2 +- .../layout/catalogsearch_result_index.xml | 2 +- .../view/frontend/layout/default.xml | 6 +- .../Magento/Centinel/Block/Authentication.php | 10 +- .../Block/Authentication/Complete.php | 10 +- .../Centinel/Block/Authentication/Start.php | 10 +- app/code/Magento/Centinel/Block/Logo.php | 2 +- app/code/Magento/Centinel/Model/Service.php | 20 +- app/code/Magento/Centinel/etc/module.xml | 2 +- .../layout/sales_order_create_index.xml | 2 +- .../checkout_multishipping_overview.xml | 2 +- .../layout/checkout_onepage_index.xml | 2 +- .../Block/Adminhtml/Agreement/Edit.php | 22 +- .../Block/Adminhtml/Agreement/Edit/Form.php | 30 +- .../Block/Adminhtml/Agreement/Grid.php | 26 +- .../Magento/Checkout/Block/Agreements.php | 10 +- app/code/Magento/Checkout/Block/Cart.php | 8 +- .../Checkout/Block/Cart/AbstractCart.php | 12 +- .../Magento/Checkout/Block/Cart/Crosssell.php | 8 +- .../Checkout/Block/Cart/Item/Configure.php | 2 +- .../Checkout/Block/Cart/Item/Renderer.php | 12 +- app/code/Magento/Checkout/Block/Cart/Link.php | 10 +- .../Magento/Checkout/Block/Cart/Shipping.php | 8 +- .../Magento/Checkout/Block/Cart/Sidebar.php | 10 +- .../Magento/Checkout/Block/Cart/Totals.php | 8 +- app/code/Magento/Checkout/Block/Link.php | 10 +- .../Multishipping/AbstractMultishipping.php | 10 +- .../Block/Multishipping/Addresses.php | 10 +- .../Checkout/Block/Multishipping/Billing.php | 8 +- .../Block/Multishipping/Billing/Items.php | 8 +- .../Checkout/Block/Multishipping/Link.php | 10 +- .../Checkout/Block/Multishipping/Overview.php | 10 +- .../Block/Multishipping/Payment/Info.php | 8 +- .../Checkout/Block/Multishipping/Shipping.php | 8 +- .../Checkout/Block/Multishipping/State.php | 10 +- .../Checkout/Block/Multishipping/Success.php | 8 +- .../Block/Onepage/AbstractOnepage.php | 20 +- .../Checkout/Block/Onepage/Billing.php | 4 +- .../Checkout/Block/Onepage/Failure.php | 10 +- .../Magento/Checkout/Block/Onepage/Link.php | 10 +- .../Magento/Checkout/Block/Onepage/Login.php | 4 +- .../Checkout/Block/Onepage/Payment/Info.php | 8 +- .../Block/Onepage/Payment/Methods.php | 8 +- .../Checkout/Block/Onepage/Review/Info.php | 8 +- .../Checkout/Block/Onepage/Shipping.php | 4 +- .../Onepage/Shipping/Method/Available.php | 4 +- .../Checkout/Block/Onepage/Success.php | 10 +- app/code/Magento/Checkout/Block/Success.php | 10 +- .../Checkout/Controller/Multishipping.php | 4 +- .../Magento/Checkout/Controller/Onepage.php | 2 +- app/code/Magento/Checkout/Model/Observer.php | 2 +- .../Checkout/Model/Resource/Agreement.php | 8 +- .../Magento/Checkout/Model/Resource/Setup.php | 6 +- app/code/Magento/Checkout/Model/Session.php | 40 +- app/code/Magento/Checkout/etc/module.xml | 1 - .../frontend/layout/checkout_cart_index.xml | 2 +- .../checkout_multishipping_addresses.xml | 2 +- .../checkout_multishipping_overview.xml | 2 +- .../checkout_multishipping_shipping.xml | 2 +- .../layout/checkout_onepage_index.xml | 4 +- .../layout/checkout_onepage_paymentmethod.xml | 4 +- .../layout/checkout_onepage_review.xml | 4 +- .../Checkout/view/frontend/layout/default.xml | 2 +- .../Cms/Block/Adminhtml/Block/Edit.php | 22 +- .../Cms/Block/Adminhtml/Block/Edit/Form.php | 34 +- .../Block/Adminhtml/Block/Widget/Chooser.php | 30 +- .../Magento/Cms/Block/Adminhtml/Page/Edit.php | 24 +- .../Block/Adminhtml/Page/Edit/Tab/Content.php | 30 +- .../Block/Adminhtml/Page/Edit/Tab/Design.php | 36 +- .../Block/Adminhtml/Page/Edit/Tab/Main.php | 30 +- .../Magento/Cms/Block/Adminhtml/Page/Grid.php | 36 +- .../Block/Adminhtml/Page/Widget/Chooser.php | 40 +- .../Adminhtml/Wysiwyg/Images/Content.php | 23 +- .../Wysiwyg/Images/Content/Files.php | 26 +- .../Wysiwyg/Images/Content/Uploader.php | 26 +- .../Block/Adminhtml/Wysiwyg/Images/Tree.php | 26 +- app/code/Magento/Cms/Block/Block.php | 8 +- app/code/Magento/Cms/Block/Page.php | 8 +- app/code/Magento/Cms/Block/Widget/Block.php | 10 +- .../Magento/Cms/Block/Widget/Page/Link.php | 14 +- app/code/Magento/Cms/Helper/Page.php | 6 +- .../Cms/Model/Resource/Page/Collection.php | 14 +- app/code/Magento/Cms/Model/Resource/Setup.php | 2 +- .../Cms/Model/Wysiwyg/Images/Storage.php | 2 +- .../Wysiwyg/Images/Storage/Collection.php | 10 +- app/code/Magento/Cms/etc/module.xml | 4 +- .../view/adminhtml/layout/cms_block_edit.xml | 12 +- .../view/adminhtml/layout/cms_page_edit.xml | 14 +- .../layout/cms_index_defaultindex.xml | 2 +- .../layout/cms_index_defaultnoroute.xml | 2 +- .../view/frontend/layout/cms_page_view.xml | 2 +- .../frontend/widget/link/link_block.phtml | 2 +- .../frontend/widget/link/link_inline.phtml | 2 +- .../Extension/Custom/Edit/Tab/AbstractTab.php | 30 +- .../Extension/Custom/Edit/Tab/Authors.php | 29 +- .../Extension/Custom/Edit/Tab/Contents.php | 34 +- .../Extension/Custom/Edit/Tab/Grid.php | 26 +- .../Connect/Model/Extension/Collection.php | 6 +- app/code/Magento/Connect/Model/Session.php | 8 +- app/code/Magento/Contacts/etc/frontend/di.xml | 2 +- .../frontend/layout/contacts_index_index.xml | 2 +- .../Contacts/view/frontend/layout/default.xml | 2 +- .../Core/App/Action/FormKeyValidator.php | 14 +- .../Core/App/Action/Plugin/Session.php | 27 +- .../Magento/Core/App/Response/Redirect.php | 10 +- app/code/Magento/Core/App/Router/Base.php | 13 +- app/code/Magento/Core/Block/Formkey.php | 23 +- .../Magento/Core/Block/Store/Switcher.php | 10 +- .../Magento/{Page => Core}/Block/Switcher.php | 6 +- app/code/Magento/Core/Helper/Cookie.php | 34 +- app/code/Magento/Core/Helper/File/Storage.php | 4 +- app/code/Magento/Core/Helper/Js.php | 6 +- app/code/Magento/Core/Helper/Theme.php | 6 +- app/code/Magento/Core/Model/App.php | 8 +- app/code/Magento/Core/Model/AppInterface.php | 2 +- app/code/Magento/Core/Model/Asset/Config.php | 108 +++ .../Model/Asset/Plugin/CleanMergedJsCss.php | 65 ++ app/code/Magento/Core/Model/Cookie.php | 349 ---------- .../Core/Model/Design/Backend/Exceptions.php | 4 +- .../Core/Model/Design/Backend/Theme.php | 4 +- app/code/Magento/Core/Model/File/Storage.php | 4 +- .../Core/Model/File/Storage/Database.php | 14 +- .../Storage/Database/AbstractDatabase.php | 8 +- .../Model/File/Storage/Directory/Database.php | 8 +- app/code/Magento/Core/Model/Layout.php | 122 ++-- .../Core/Model/Layout/PageType/Config.php | 2 - app/code/Magento/Core/Model/Observer.php | 14 +- .../Config/Value/Collection/Scoped.php | 16 +- .../Db/Collection/AbstractCollection.php | 12 +- .../Magento/Core/Model/Resource/Design.php | 8 +- .../Core/Model/Resource/Design/Collection.php | 12 +- .../Model/Resource/Layout/Link/Collection.php | 12 +- .../Resource/Layout/Update/Collection.php | 12 +- .../Core/Model/Resource/Setup/Migration.php | 8 +- .../Model/Resource/Url/Rewrite/Collection.php | 12 +- app/code/Magento/Core/Model/Session.php | 34 +- .../Core/Model/Session/AbstractSession.php | 394 +++++------ .../Magento/Core/Model/Session/Config.php | 626 ++++++++++++++++++ .../Magento/Core/Model/Session/Context.php | 106 +-- .../Magento/Core/Model/Session/Generic.php | 8 +- .../Core/Model/Session/SidResolver.php | 113 ++++ .../Magento/Core/Model/Session/Validator.php | 2 +- app/code/Magento/Core/Model/Store.php | 39 +- .../Magento/Core/Model/Store/Storage/Db.php | 7 +- .../Core/Model/Store/StorageFactory.php | 2 +- app/code/Magento/Core/Model/Template.php | 4 +- .../Magento/Core/Model/Theme/Collection.php | 6 +- .../Magento/Core/Model/Translate/Inline.php | 4 +- app/code/Magento/Core/Model/Url.php | 28 +- app/code/Magento/Core/Model/Variable.php | 4 +- app/code/Magento/Core/etc/di.xml | 20 +- app/code/Magento/Core/etc/module.xml | 1 - .../Core/view/adminhtml/prototype/magento.css | 5 + .../view/frontend/switch/flags.phtml | 0 .../view/frontend/switch/languages.phtml | 4 +- .../view/frontend/switch/stores.phtml | 0 .../Model/Config/Backend/Product/Alert.php | 4 +- .../Cron/Model/Config/Backend/Sitemap.php | 4 +- app/code/Magento/Cron/Model/Schedule.php | 4 +- .../Adminhtml/System/Currency/Rate/Matrix.php | 22 +- .../System/Currency/Rate/Services.php | 8 +- .../Block/Adminhtml/System/Currencysymbol.php | 26 +- .../Block/Account/AuthorizationLink.php | 10 +- .../Customer/Block/Account/Customer.php | 10 +- .../Customer/Block/Account/Dashboard.php | 10 +- .../Block/Account/Dashboard/Address.php | 10 +- .../Block/Account/Dashboard/Block.php | 2 +- .../Block/Account/Dashboard/Hello.php | 10 +- .../Customer/Block/Account/Dashboard/Info.php | 10 +- .../Block/Account/Dashboard/Newsletter.php | 10 +- .../Block/Account/Dashboard/Sidebar.php | 10 +- .../Customer/Block/Account/Forgotpassword.php | 2 +- .../Magento/Customer/Block/Account/Link.php | 2 +- .../Customer/Block/Account/RegisterLink.php | 10 +- .../Customer/Block/Account/Resetpassword.php | 2 +- .../Magento/Customer/Block/Address/Book.php | 10 +- .../Magento/Customer/Block/Address/Edit.php | 10 +- .../Address/Renderer/DefaultRenderer.php | 6 +- .../Magento/Customer/Block/Adminhtml/Edit.php | 22 +- .../Edit/Renderer/Attribute/Group.php | 26 +- .../Block/Adminhtml/Edit/Tab/Account.php | 44 +- .../Block/Adminhtml/Edit/Tab/Addresses.php | 64 +- .../Block/Adminhtml/Edit/Tab/Cart.php | 34 +- .../Block/Adminhtml/Edit/Tab/Carts.php | 22 +- .../Block/Adminhtml/Edit/Tab/Newsletter.php | 30 +- .../Adminhtml/Edit/Tab/Newsletter/Grid.php | 30 +- .../Block/Adminhtml/Edit/Tab/Orders.php | 34 +- .../Block/Adminhtml/Edit/Tab/View.php | 39 +- .../Adminhtml/Edit/Tab/View/Accordion.php | 30 +- .../Block/Adminhtml/Edit/Tab/View/Cart.php | 34 +- .../Block/Adminhtml/Edit/Tab/View/Orders.php | 30 +- .../Block/Adminhtml/Edit/Tab/View/Sales.php | 31 +- .../Adminhtml/Edit/Tab/View/Wishlist.php | 30 +- .../Customer/Block/Adminhtml/Edit/Tabs.php | 28 +- .../Magento/Customer/Block/Adminhtml/Grid.php | 34 +- .../Customer/Block/Adminhtml/Group/Edit.php | 22 +- .../Block/Adminhtml/Group/Edit/Form.php | 30 +- .../Sales/Order/Address/Form/Renderer/Vat.php | 23 +- .../Magento/Customer/Block/Form/Login.php | 10 +- .../Magento/Customer/Block/Form/Register.php | 20 +- .../Magento/Customer/Block/Newsletter.php | 2 +- .../Customer/Block/Widget/AbstractWidget.php | 10 +- .../Magento/Customer/Block/Widget/Gender.php | 8 +- .../Magento/Customer/Block/Widget/Taxvat.php | 8 +- .../Magento/Customer/Controller/Account.php | 2 +- .../Customer/Controller/Adminhtml/Group.php | 16 +- app/code/Magento/Customer/Helper/Data.php | 4 +- app/code/Magento/Customer/Model/Address.php | 18 +- .../Model/Address/AbstractAddress.php | 4 +- app/code/Magento/Customer/Model/Customer.php | 9 +- .../Customer/Model/Renderer/Region.php | 6 +- .../Model/Resource/Customer/Collection.php | 19 +- .../Magento/Customer/Model/Resource/Group.php | 6 +- .../Magento/Customer/Model/Resource/Setup.php | 6 +- app/code/Magento/Customer/Model/Session.php | 31 +- app/code/Magento/Customer/etc/module.xml | 2 +- .../adminhtml/layout/customer_index_edit.xml | 6 +- .../view/frontend/account/navigation.phtml | 2 +- .../view/frontend/layout/customer_account.xml | 8 +- .../layout/customer_account_confirmation.xml | 2 +- .../layout/customer_account_index.xml | 2 +- .../layout/customer_account_logoutsuccess.xml | 2 +- .../Form/Renderer/BackgroundUploader.php | 22 +- .../Editor/Form/Renderer/LogoUploader.php | 26 +- .../Adminhtml/Editor/Toolbar/Buttons/Edit.php | 26 +- .../Block/Adminhtml/Editor/Tools.php | 22 +- .../Block/Adminhtml/Editor/Tools/Block.php | 2 +- .../Block/Adminhtml/Editor/Tools/Code/Css.php | 2 +- .../Adminhtml/Editor/Tools/Code/Custom.php | 30 +- .../Editor/Tools/Code/ImageSizing.php | 38 +- .../Block/Adminhtml/Editor/Tools/Code/Js.php | 34 +- .../Editor/Tools/QuickStyles/AbstractTab.php | 26 +- .../Block/Adminhtml/Editor/Tools/Settings.php | 2 +- .../Editor/Tools/Tabs/AbstractTabs.php | 2 +- .../Adminhtml/Editor/Tools/Tabs/Body.php | 2 +- .../Block/Adminhtml/Theme/Button.php | 2 +- .../Adminhtml/Theme/Selector/StoreView.php | 26 +- .../Magento/DesignEditor/Model/Observer.php | 9 +- .../Model/Theme/Resource/Change.php | 4 +- .../Model/Translate/InlineVde.php | 4 +- .../DesignEditor/Model/Url/NavigationMode.php | 13 +- app/code/Magento/DesignEditor/etc/module.xml | 2 - .../view/adminhtml/editor/toolbar.phtml | 2 +- ...tml_system_design_editor_firstentrance.xml | 12 +- .../adminhtml_system_design_editor_index.xml | 14 +- .../adminhtml_system_design_editor_launch.xml | 42 +- .../view/frontend/translate_inline.phtml | 2 +- app/code/Magento/Directory/Block/Currency.php | 10 +- app/code/Magento/Directory/Block/Data.php | 28 +- app/code/Magento/Directory/Helper/Url.php | 6 +- .../Model/Resource/Country/Collection.php | 12 +- .../Model/Resource/Region/Collection.php | 14 +- .../Directory/Model/Resource/Setup.php | 4 +- .../Catalog/Product/Edit/Tab/Downloadable.php | 22 +- .../Product/Edit/Tab/Downloadable/Links.php | 23 +- .../Product/Edit/Tab/Downloadable/Samples.php | 53 +- .../Sales/Items/Column/Downloadable/Name.php | 30 +- .../Block/Catalog/Product/Links.php | 28 +- .../Block/Checkout/Cart/Item/Renderer.php | 8 +- .../Block/Customer/Products/ListProducts.php | 12 +- .../Sales/Order/Email/Items/Downloadable.php | 10 +- .../Order/Email/Items/Order/Downloadable.php | 10 +- .../Order/Item/Renderer/Downloadable.php | 8 +- .../Adminhtml/Downloadable/File.php | 2 +- .../Helper/Catalog/Product/Configuration.php | 6 +- .../Magento/Downloadable/Helper/Download.php | 4 +- app/code/Magento/Downloadable/Helper/File.php | 4 +- .../Downloadable/Model/Resource/Link.php | 4 +- .../Sales/Order/Pdf/Items/AbstractItems.php | 6 +- .../Sales/Order/Pdf/Items/Creditmemo.php | 10 +- .../Model/Sales/Order/Pdf/Items/Invoice.php | 10 +- app/code/Magento/Downloadable/etc/module.xml | 2 +- .../composite/fieldset/downloadable.phtml | 75 +-- .../view/frontend/catalog/product/links.phtml | 4 +- .../view/frontend/layout/customer_account.xml | 2 +- .../Attribute/Edit/Main/AbstractMain.php | 42 +- .../Edit/Options/AbstractOptions.php | 2 +- .../Attribute/Edit/Options/Labels.php | 22 +- .../Attribute/Edit/Options/Options.php | 30 +- .../Entity/Collection/AbstractCollection.php | 14 +- app/code/Magento/Eav/Model/Entity/Setup.php | 4 +- .../Model/Resource/Attribute/Collection.php | 12 +- .../Entity/Attribute/Grid/Collection.php | 12 +- .../Entity/Attribute/Option/Collection.php | 12 +- .../Resource/Form/Attribute/Collection.php | 12 +- .../Resource/Form/Fieldset/Collection.php | 12 +- .../Email/Block/Adminhtml/Template.php | 2 +- .../Email/Block/Adminhtml/Template/Edit.php | 14 +- .../Block/Adminhtml/Template/Edit/Form.php | 12 +- .../Block/Adminhtml/Template/Preview.php | 4 +- .../Magento/Email/Model/BackendTemplate.php | 12 +- .../Magento/Email/Model/Resource/Template.php | 4 +- app/code/Magento/Email/Model/Template.php | 10 +- .../Magento/Email/Model/Template/Filter.php | 2 +- .../view/adminhtml/layout/systemPreview.xml | 2 +- .../Adminhtml/Sales/Order/Create/Form.php | 22 +- .../Block/Adminhtml/Sales/Order/View/Form.php | 22 +- .../GiftMessage/Block/Message/Inline.php | 10 +- .../GiftMessage/Model/Resource/Setup.php | 12 +- app/code/Magento/GiftMessage/etc/module.xml | 2 +- .../adminhtml/layout/sales_order_view.xml | 2 +- app/code/Magento/GoogleAdwords/Block/Code.php | 10 +- .../Config/Backend/AbstractConversion.php | 13 +- app/code/Magento/GoogleAnalytics/Block/Ga.php | 10 +- .../Block/Adminhtml/Shipping/Merchant.php | 30 +- .../Magento/GoogleCheckout/Block/Link.php | 10 +- .../Magento/GoogleCheckout/Block/Redirect.php | 33 +- .../GoogleCheckout/Controller/Redirect.php | 3 +- .../Magento/GoogleCheckout/etc/module.xml | 1 - .../googlecheckout_redirect_redirect.xml | 2 +- .../GoogleOptimizer/Block/AbstractCode.php | 10 +- .../Block/Adminhtml/AbstractTab.php | 38 +- .../Category/Edit/Tab/Googleoptimizer.php | 34 +- .../GoogleOptimizer/Block/Code/Page.php | 8 +- .../GoogleShopping/Block/Adminhtml/Items.php | 22 +- .../Block/Adminhtml/Items/Item.php | 26 +- .../Block/Adminhtml/Items/Product.php | 38 +- .../Block/Adminhtml/Types/Edit.php | 24 +- .../Block/Adminhtml/Types/Edit/Attributes.php | 18 +- .../Block/Adminhtml/Types/Edit/Form.php | 50 +- .../GoogleShopping/Block/SiteVerification.php | 7 +- .../Magento/GoogleShopping/Helper/Data.php | 6 +- .../GoogleShopping/Model/Attribute.php | 8 +- .../Model/Attribute/ContentLanguage.php | 25 +- .../Model/Attribute/Destinations.php | 25 +- .../Model/Attribute/GoogleProductCategory.php | 29 +- .../Model/Attribute/ImageLink.php | 25 +- .../GoogleShopping/Model/Attribute/Link.php | 25 +- .../GoogleShopping/Model/Attribute/Price.php | 33 +- .../Model/Attribute/ProductType.php | 25 +- .../Model/Attribute/TargetCountry.php | 25 +- .../GoogleShopping/Model/Attribute/Tax.php | 29 +- .../Magento/GoogleShopping/Model/Item.php | 12 +- .../Model/Resource/Item/Collection.php | 20 +- .../GoogleShopping/Model/Resource/Setup.php | 4 +- .../Magento/GoogleShopping/Model/Type.php | 8 +- .../Magento/GoogleShopping/etc/module.xml | 2 +- .../adminhtml_googleshopping_items_index.xml | 2 +- .../Block/Adminhtml/Export/Edit/Form.php | 34 +- .../Block/Adminhtml/Export/Filter.php | 38 +- .../Block/Adminhtml/Form/After.php | 22 +- .../Block/Adminhtml/Import/Edit/Before.php | 34 +- .../Block/Adminhtml/Import/Edit/Form.php | 38 +- .../Block/Adminhtml/Import/Frame/Result.php | 27 +- .../layout/adminhtml_import_busy.xml | 2 +- .../Index/Block/Adminhtml/Process/Edit.php | 22 +- .../Index/Block/Adminhtml/Process/Grid.php | 34 +- app/code/Magento/Index/Model/Event.php | 4 +- app/code/Magento/Index/Model/Process.php | 10 +- .../Magento/Index/Model/Resource/Process.php | 4 +- .../Magento/Index/Model/Resource/Setup.php | 4 +- .../Magento/Install/Block/AbstractBlock.php | 10 +- app/code/Magento/Install/Block/Begin.php | 15 +- app/code/Magento/Install/Block/Config.php | 10 +- app/code/Magento/Install/Block/Db/Main.php | 12 +- app/code/Magento/Install/Block/Db/Type.php | 10 +- app/code/Magento/Install/Block/Download.php | 8 +- app/code/Magento/Install/Block/End.php | 8 +- app/code/Magento/Install/Block/Locale.php | 6 +- app/code/Magento/Install/Block/State.php | 40 +- .../Magento/Install/Controller/Wizard.php | 2 +- app/code/Magento/Install/etc/module.xml | 1 - .../Magento/Install/view/install/begin.phtml | 4 +- .../Magento/Install/view/install/config.phtml | 2 +- .../Install/view/install/create_admin.phtml | 2 +- .../Install/view/install/download.phtml | 2 +- .../view/install/layout/install_wizard.xml | 2 +- .../Magento/Install/view/install/locale.phtml | 2 +- .../Magento/Install/view/install/page.phtml | 6 +- .../Integration/Activate/Permissions/Tabs.php | 39 ++ .../Block/Adminhtml/Integration/Edit.php | 24 +- .../Adminhtml/Integration/Edit/Tab/Info.php | 71 +- .../Block/Adminhtml/Integration/Edit/Tabs.php | 2 +- .../Adminhtml/Integration/Grid.php} | 32 +- .../Block/Adminhtml/Integration/Token.php | 82 +++ .../Widget/Grid/Column/Renderer/Button.php | 122 ++++ .../Grid/Column/Renderer/Button/Delete.php | 54 ++ .../Grid/Column/Renderer/Button/Edit.php | 54 ++ .../Renderer/Button/IntegrationAbstract.php | 46 ++ .../Widget/Grid/Column/Renderer/Link.php | 164 +++++ .../Grid/Column/Renderer/Link/Activate.php | 78 +++ .../Grid/Column/Renderer/Link/Reauthorize.php | 41 ++ .../Controller/Adminhtml/Integration.php | 125 +++- app/code/Magento/Integration/Helper/Data.php | 25 +- .../Magento/Integration/Model/Cache/Type.php | 35 +- app/code/Magento/Integration/Model/Config.php | 85 +++ .../Integration/Model/Config/Converter.php | 30 +- .../Integration/Model/Config/Reader.php | 3 +- .../Magento/Integration/Model/Integration.php | 28 +- .../Magento/Integration/Model/Manager.php | 100 +++ .../Integration/Model/Oauth/Consumer.php | 8 +- .../Magento/Integration/Model/Oauth/Nonce.php | 4 +- .../Magento/Integration/Model/Oauth/Token.php | 9 +- .../Model/Resource/Integration.php | 5 +- .../Model/Resource/Oauth/Consumer.php | 4 +- .../Model/Resource/Oauth/Token.php | 4 +- .../Integration/Model/Resource/Setup.php | 69 ++ .../Integration/Service/IntegrationV1.php | 123 +++- .../Service/IntegrationV1Interface.php | 9 + app/code/Magento/Integration/etc/cache.xml | 31 + .../Integration/etc/integration/config.xsd | 20 +- app/code/Magento/Integration/etc/module.xml | 2 +- .../sql/integration_setup/install-1.0.0.0.php | 43 +- .../upgrade-1.0.0.0-1.0.0.1.php | 39 ++ .../view/adminhtml/integration.css | 91 +++ .../integration/activate/permissions.phtml} | 25 +- .../integration/popup_container.phtml | 37 ++ .../view/adminhtml/js/integration.js | 159 +++-- ...integration_activate_permissions_popup.xml | 32 + ...html_integration_activate_tokens_popup.xml | 29 + .../layout/adminhtml_integration_edit.xml | 7 - .../adminhtml_integration_grid_block.xml | 46 +- .../layout/adminhtml_integration_index.xml | 15 + .../layout/adminhtml_integration_new.xml | 7 - app/code/Magento/Log/Model/Aggregation.php | 4 +- app/code/Magento/Log/Model/Cron.php | 8 +- app/code/Magento/Log/Model/Resource/Log.php | 6 +- .../Magento/Log/Model/Resource/Visitor.php | 6 +- .../Log/Model/Resource/Visitor/Online.php | 8 +- .../Resource/Visitor/Online/Collection.php | 16 +- .../Visitor/Online/Grid/Collection.php | 28 +- app/code/Magento/Log/Model/Visitor.php | 14 +- .../Newsletter/Block/Adminhtml/Problem.php | 22 +- .../Newsletter/Block/Adminhtml/Queue/Edit.php | 26 +- .../Block/Adminhtml/Queue/Edit/Form.php | 38 +- .../Block/Adminhtml/Queue/Preview.php | 30 +- .../Newsletter/Block/Adminhtml/Subscriber.php | 22 +- .../Block/Adminhtml/Subscriber/Grid.php | 26 +- .../Subscriber/Grid/Filter/Website.php | 30 +- .../Block/Adminhtml/Template/Edit.php | 26 +- .../Block/Adminhtml/Template/Edit/Form.php | 30 +- .../Block/Adminhtml/Template/Grid.php | 26 +- .../Block/Adminhtml/Template/Preview.php | 26 +- .../Magento/Newsletter/Block/Subscribe.php | 10 +- .../Controller/Adminhtml/Problem.php | 27 +- app/code/Magento/Newsletter/Model/Queue.php | 8 +- .../Model/Resource/Problem/Collection.php | 14 +- .../Model/Resource/Queue/Collection.php | 14 +- .../Model/Resource/Subscriber/Collection.php | 14 +- .../Newsletter/Model/Resource/Template.php | 8 +- app/code/Magento/Newsletter/Model/Session.php | 8 +- .../Magento/Newsletter/Model/Template.php | 10 +- app/code/Magento/Newsletter/etc/module.xml | 1 - .../layout/newsletter_queue_edit.xml | 8 +- .../layout/newsletter_queue_preview_popup.xml | 2 +- .../layout/newsletter_template_edit.xml | 12 +- .../newsletter_template_preview_popup.xml | 2 +- .../view/adminhtml/layout/preview.xml | 2 +- .../view/frontend/layout/customer_account.xml | 2 +- app/code/Magento/Ogone/Block/Paypage.php | 2 +- app/code/Magento/Ogone/Block/Placeform.php | 10 +- app/code/Magento/Ogone/Controller/Api.php | 2 +- .../Page/Block/Template/Links/Block.php | 195 ------ app/code/Magento/Page/Helper/Robots.php | 70 -- app/code/Magento/Page/etc/config.xml | 80 --- app/code/Magento/Page/etc/di.xml | 57 -- .../Page/view/frontend/js/splitbutton.js | 74 --- .../Block/Adminhtml/Cache/Additional.php | 22 +- app/code/Magento/PageCache/Helper/Data.php | 16 +- .../frontend/layout/catalog_product_view.xml | 2 +- .../Paygate/Block/Authorizenet/Info/Cc.php | 23 + .../Block/Catalog/Product/View/Profile.php | 12 +- app/code/Magento/Payment/Block/Form.php | 2 +- app/code/Magento/Payment/Block/Form/Cc.php | 8 +- .../Magento/Payment/Block/Form/Container.php | 2 +- app/code/Magento/Payment/Block/Info.php | 2 +- .../Payment/Block/Info/AbstractContainer.php | 10 +- app/code/Magento/Payment/Block/Info/Cc.php | 8 +- app/code/Magento/Payment/Helper/Data.php | 2 +- .../Model/Billing/AbstractAgreement.php | 4 +- app/code/Magento/Payment/Model/Info.php | 4 +- .../Payment/Model/Recurring/Profile.php | 4 +- .../Adminhtml/Settlement/Details/Form.php | 30 +- .../System/Config/Fieldset/Store.php | 4 +- .../Magento/Paypal/Block/Express/Form.php | 10 +- .../Magento/Paypal/Block/Express/Review.php | 2 +- .../Magento/Paypal/Block/Express/Shortcut.php | 12 +- app/code/Magento/Paypal/Block/Iframe.php | 10 +- app/code/Magento/Paypal/Block/Logo.php | 10 +- .../Paypal/Block/Payflow/Link/Iframe.php | 8 +- .../Magento/Paypal/Block/Payment/Info.php | 8 +- .../Magento/Paypal/Block/Standard/Form.php | 12 +- .../Paypal/Block/Standard/Redirect.php | 6 +- app/code/Magento/Paypal/Helper/Checkout.php | 2 +- app/code/Magento/Paypal/Helper/Data.php | 4 +- app/code/Magento/Paypal/Model/Observer.php | 5 +- .../System/Config/Backend/MerchantCountry.php | 4 +- app/code/Magento/Paypal/etc/module.xml | 2 +- .../layout/adminhtml_system_config_edit.xml | 2 +- .../Paypal/view/frontend/express/review.phtml | 2 +- .../frontend/layout/paypal_express_review.xml | 2 +- .../Persistent/Block/Form/Remember.php | 10 +- .../Persistent/Block/Header/Additional.php | 10 +- .../Magento/Persistent/Controller/Index.php | 2 +- .../Magento/Persistent/Model/Observer.php | 10 +- .../Persistent/Model/Observer/Session.php | 6 +- app/code/Magento/Persistent/Model/Session.php | 13 +- .../Magento/Persistent/etc/persistent.xml | 4 +- .../layout/checkout_onepage_index.xml | 4 +- .../layout/customer_account_create.xml | 2 +- .../layout/customer_account_login.xml | 2 +- .../view/frontend/remember_me_tooltip.phtml | 2 +- .../Block/Email/AbstractEmail.php | 2 +- .../ProductAlert/Block/Product/View.php | 10 +- app/code/Magento/ProductAlert/Helper/Data.php | 6 +- app/code/Magento/ProductAlert/Model/Email.php | 4 +- .../Magento/Rating/Block/Adminhtml/Edit.php | 26 +- .../Rating/Block/Adminhtml/Edit/Tab/Form.php | 4 +- .../Block/Adminhtml/Edit/Tab/Options.php | 30 +- .../Magento/Rating/Block/Entity/Detailed.php | 10 +- .../Magento/Rating/Model/Resource/Rating.php | 4 +- .../Model/Resource/Rating/Collection.php | 12 +- .../Model/Resource/Rating/Grid/Collection.php | 22 +- .../Rating/Option/Vote/Collection.php | 12 +- .../Block/Adminhtml/Grid/AbstractGrid.php | 4 +- .../Adminhtml/Product/Downloads/Grid.php | 26 +- .../Reports/Block/Adminhtml/Product/Grid.php | 26 +- .../Block/Adminhtml/Product/Lowstock/Grid.php | 26 +- .../Reports/Block/Adminhtml/Review/Detail.php | 22 +- .../Block/Adminhtml/Review/Detail/Grid.php | 26 +- .../Block/Adminhtml/Sales/Tax/Grid.php | 38 +- .../Adminhtml/Shopcart/Abandoned/Grid.php | 26 +- .../Adminhtml/Shopcart/Customer/Grid.php | 26 +- .../Block/Adminhtml/Shopcart/Product/Grid.php | 26 +- .../Reports/Block/Adminhtml/Wishlist.php | 22 +- .../Reports/Block/Adminhtml/Wishlist/Grid.php | 26 +- .../Reports/Block/Product/AbstractProduct.php | 8 +- .../Reports/Model/Product/Index/Compared.php | 17 +- .../Model/Resource/Customer/Collection.php | 27 +- .../Summary/Collection/AbstractCollection.php | 8 +- .../Model/Resource/Order/Collection.php | 24 +- .../Model/Resource/Product/Collection.php | 43 +- .../Index/Collection/AbstractCollection.php | 43 +- .../Resource/Product/Lowstock/Collection.php | 47 +- .../Model/Resource/Quote/Collection.php | 7 +- .../Model/Resource/Report/AbstractReport.php | 4 +- .../Model/Resource/Report/Collection.php | 8 +- .../Model/Resource/Report/Product/Viewed.php | 6 +- .../Report/Product/Viewed/Collection.php | 14 +- .../Resource/Review/Customer/Collection.php | 25 +- .../Magento/Reports/Model/Resource/Setup.php | 4 +- .../Model/Resource/Wishlist/Collection.php | 12 +- .../Magento/Reports/view/adminhtml/grid.phtml | 33 +- .../Review/Block/Adminhtml/Add/Form.php | 34 +- .../Magento/Review/Block/Adminhtml/Edit.php | 30 +- .../Review/Block/Adminhtml/Edit/Form.php | 42 +- .../Magento/Review/Block/Adminhtml/Grid.php | 42 +- .../Magento/Review/Block/Adminhtml/Main.php | 30 +- .../Review/Block/Adminhtml/Product/Grid.php | 3 - .../Block/Adminhtml/Rating/Detailed.php | 30 +- .../Review/Block/Adminhtml/Rating/Summary.php | 30 +- .../Review/Block/Customer/ListCustomer.php | 14 +- .../Magento/Review/Block/Customer/Recent.php | 10 +- .../Magento/Review/Block/Customer/View.php | 8 +- app/code/Magento/Review/Block/Form.php | 14 +- app/code/Magento/Review/Block/Helper.php | 10 +- .../Magento/Review/Block/Product/View.php | 11 +- .../Review/Block/Product/View/Other.php | 10 +- app/code/Magento/Review/Block/View.php | 8 +- .../Magento/Review/Controller/Product.php | 4 +- .../Magento/Review/Helper/Action/Pager.php | 6 +- .../Model/Resource/Review/Collection.php | 16 +- .../Resource/Review/Product/Collection.php | 41 +- .../Resource/Review/Summary/Collection.php | 6 +- app/code/Magento/Review/etc/module.xml | 2 +- .../view/frontend/layout/customer_account.xml | 2 +- .../frontend/layout/review_product_list.xml | 6 +- .../Rss/App/Action/Plugin/Authentication.php | 2 +- app/code/Magento/Rss/Block/AbstractBlock.php | 10 +- .../Rss/Block/Catalog/AbstractCatalog.php | 10 +- .../Magento/Rss/Block/Catalog/Category.php | 8 +- .../Magento/Rss/Block/Catalog/NewCatalog.php | 8 +- .../Magento/Rss/Block/Catalog/Salesrule.php | 8 +- .../Magento/Rss/Block/Catalog/Special.php | 14 +- app/code/Magento/Rss/Block/ListBlock.php | 10 +- app/code/Magento/Rss/Block/Order/Details.php | 2 +- app/code/Magento/Rss/Block/Order/Status.php | 10 +- app/code/Magento/Rss/Block/Wishlist.php | 13 +- .../Rss/Model/System/Config/Backend/Links.php | 2 +- app/code/Magento/Rss/etc/module.xml | 1 - .../Rss/view/frontend/layout/default.xml | 2 +- app/code/Magento/Rule/Block/Editable.php | 25 +- app/code/Magento/Rule/Block/Newchild.php | 2 +- app/code/Magento/Rule/Block/Rule.php | 2 +- app/code/Magento/Rule/Model/AbstractModel.php | 4 +- app/code/Magento/Rule/Model/Rule.php | 6 +- .../Adminhtml/Billing/Agreement/Grid.php | 34 +- .../Adminhtml/Billing/Agreement/View.php | 22 +- .../Billing/Agreement/View/Tab/Info.php | 26 +- .../Billing/Agreement/View/Tab/Orders.php | 2 +- .../Sales/Block/Adminhtml/Creditmemo/Grid.php | 30 +- .../Adminhtml/Customer/Edit/Tab/Agreement.php | 38 +- .../Customer/Edit/Tab/Recurring/Profile.php | 38 +- .../Sales/Block/Adminhtml/Invoice/Grid.php | 30 +- .../Block/Adminhtml/Items/AbstractItems.php | 32 +- .../Adminhtml/Items/Column/DefaultColumn.php | 22 +- .../Block/Adminhtml/Order/AbstractOrder.php | 22 +- .../Sales/Block/Adminhtml/Order/Address.php | 22 +- .../Block/Adminhtml/Order/Address/Form.php | 69 +- .../Block/Adminhtml/Order/Comments/View.php | 22 +- .../Sales/Block/Adminhtml/Order/Create.php | 22 +- .../Adminhtml/Order/Create/AbstractCreate.php | 15 +- .../Order/Create/Billing/Method/Form.php | 8 +- .../Block/Adminhtml/Order/Create/Data.php | 30 +- .../Block/Adminhtml/Order/Create/Form.php | 40 +- .../Order/Create/Form/AbstractForm.php | 30 +- .../Adminhtml/Order/Create/Form/Account.php | 38 +- .../Adminhtml/Order/Create/Form/Address.php | 60 +- .../Adminhtml/Order/Create/Giftmessage.php | 4 +- .../Order/Create/Giftmessage/Form.php | 4 +- .../Adminhtml/Order/Create/Items/Grid.php | 6 +- .../Block/Adminhtml/Order/Create/Load.php | 20 +- .../Block/Adminhtml/Order/Create/Messages.php | 12 +- .../Adminhtml/Order/Create/Search/Grid.php | 38 +- .../Order/Create/Shipping/Method/Form.php | 30 +- .../Order/Create/Sidebar/AbstractSidebar.php | 4 +- .../Order/Create/Sidebar/Pcompared.php | 38 +- .../Order/Create/Sidebar/Pviewed.php | 38 +- .../Order/Create/Sidebar/Reorder.php | 34 +- .../Block/Adminhtml/Order/Create/Totals.php | 34 +- .../Order/Create/Totals/Discount.php | 38 +- .../Order/Create/Totals/Grandtotal.php | 38 +- .../Order/Create/Totals/Shipping.php | 38 +- .../Order/Create/Totals/Subtotal.php | 38 +- .../Adminhtml/Order/Creditmemo/Create.php | 22 +- .../Order/Creditmemo/Create/Adjustments.php | 22 +- .../Order/Creditmemo/Create/Items.php | 30 +- .../Block/Adminhtml/Order/Creditmemo/View.php | 22 +- .../Order/Creditmemo/View/Comments.php | 4 +- .../Block/Adminhtml/Order/Invoice/Create.php | 22 +- .../Adminhtml/Order/Invoice/Create/Items.php | 30 +- .../Order/Invoice/Create/Tracking.php | 26 +- .../Block/Adminhtml/Order/Invoice/View.php | 26 +- .../Adminhtml/Order/Invoice/View/Comments.php | 4 +- .../Sales/Block/Adminhtml/Order/Payment.php | 22 +- .../Block/Adminhtml/Order/Shipment/Create.php | 22 +- .../Adminhtml/Order/Shipment/Create/Items.php | 30 +- .../Order/Shipment/Create/Tracking.php | 26 +- .../Adminhtml/Order/Shipment/Packaging.php | 36 +- .../Order/Shipment/Packaging/Grid.php | 26 +- .../Block/Adminhtml/Order/Shipment/View.php | 22 +- .../Order/Shipment/View/Comments.php | 4 +- .../Order/Shipment/View/Tracking.php | 4 +- .../Adminhtml/Order/Status/Assign/Form.php | 34 +- .../Block/Adminhtml/Order/Totals/Tax.php | 4 +- .../Sales/Block/Adminhtml/Order/View.php | 26 +- .../Adminhtml/Order/View/Giftmessage.php | 4 +- .../Block/Adminhtml/Order/View/History.php | 26 +- .../Sales/Block/Adminhtml/Order/View/Info.php | 38 +- .../Block/Adminhtml/Order/View/Messages.php | 10 +- .../Adminhtml/Order/View/Tab/Creditmemos.php | 34 +- .../Adminhtml/Order/View/Tab/History.php | 22 +- .../Adminhtml/Order/View/Tab/Invoices.php | 34 +- .../Adminhtml/Order/View/Tab/Shipments.php | 30 +- .../Sales/Block/Adminhtml/Order/View/Tabs.php | 28 +- .../Adminhtml/Recurring/Profile/Grid.php | 34 +- .../Adminhtml/Recurring/Profile/View.php | 4 +- .../Recurring/Profile/View/Getawayinfo.php | 22 +- .../Adminhtml/Recurring/Profile/View/Info.php | 22 +- .../Recurring/Profile/View/Tab/Orders.php | 34 +- .../Block/Adminhtml/Report/Filter/Form.php | 30 +- .../Adminhtml/Report/Filter/Form/Coupon.php | 34 +- .../Sales/Block/Adminhtml/Shipment/Grid.php | 26 +- .../Block/Adminhtml/Transactions/Detail.php | 22 +- .../Adminhtml/Transactions/Detail/Grid.php | 30 +- .../Block/Adminhtml/Transactions/Grid.php | 38 +- .../Sales/Block/Billing/Agreement/View.php | 14 +- .../Sales/Block/Billing/Agreements.php | 14 +- app/code/Magento/Sales/Block/Guest/Link.php | 12 +- .../Sales/Block/Items/AbstractItems.php | 8 +- .../Magento/Sales/Block/Order/Comments.php | 10 +- .../Magento/Sales/Block/Order/Creditmemo.php | 8 +- .../Sales/Block/Order/Creditmemo/Items.php | 8 +- .../Block/Order/Email/Creditmemo/Items.php | 4 +- .../Sales/Block/Order/Email/Invoice/Items.php | 4 +- .../Block/Order/Email/Items/DefaultItems.php | 4 +- .../Order/Email/Items/Order/DefaultOrder.php | 4 +- .../Block/Order/Email/Shipment/Items.php | 4 +- .../Magento/Sales/Block/Order/History.php | 14 +- app/code/Magento/Sales/Block/Order/Info.php | 10 +- .../Sales/Block/Order/Info/Buttons.php | 10 +- .../Magento/Sales/Block/Order/Invoice.php | 8 +- .../Sales/Block/Order/Invoice/Items.php | 8 +- .../Order/Item/Renderer/DefaultRenderer.php | 12 +- app/code/Magento/Sales/Block/Order/Items.php | 8 +- app/code/Magento/Sales/Block/Order/Link.php | 10 +- .../Block/Order/PrintOrder/Creditmemo.php | 10 +- .../Sales/Block/Order/PrintOrder/Invoice.php | 10 +- .../Sales/Block/Order/PrintOrder/Shipment.php | 10 +- .../Sales/Block/Order/PrintShipment.php | 10 +- app/code/Magento/Sales/Block/Order/Recent.php | 10 +- .../Magento/Sales/Block/Order/Shipment.php | 10 +- .../Sales/Block/Order/Shipment/Items.php | 8 +- app/code/Magento/Sales/Block/Order/Totals.php | 10 +- app/code/Magento/Sales/Block/Order/View.php | 10 +- .../Block/Payment/Form/Billing/Agreement.php | 8 +- .../Sales/Block/Recurring/Profile/Grid.php | 10 +- .../Recurring/Profile/Related/Orders/Grid.php | 10 +- .../Sales/Block/Recurring/Profile/View.php | 10 +- .../Block/Recurring/Profile/View/Address.php | 8 +- .../Block/Recurring/Profile/View/Item.php | 8 +- .../Sales/Block/Recurring/Profiles.php | 2 +- .../Magento/Sales/Block/Reorder/Sidebar.php | 10 +- .../Sales/Block/Status/Grid/Column/State.php | 22 +- .../Magento/Sales/Block/Widget/Guest/Form.php | 12 +- .../Controller/Adminhtml/Order/Create.php | 10 +- .../Sales/Controller/Adminhtml/Order/Edit.php | 5 +- app/code/Magento/Sales/Helper/Admin.php | 4 +- app/code/Magento/Sales/Helper/Guest.php | 6 +- .../Magento/Sales/Model/Billing/Agreement.php | 6 +- app/code/Magento/Sales/Model/Observer.php | 86 --- .../Frontend/Quote/Address/CollectTotals.php | 107 +++ .../Frontend/Quote/Address/VatValidator.php | 128 ++++ app/code/Magento/Sales/Model/Order.php | 26 +- .../Magento/Sales/Model/Order/Address.php | 8 +- .../Magento/Sales/Model/Order/Creditmemo.php | 18 +- .../Magento/Sales/Model/Order/Invoice.php | 18 +- .../Magento/Sales/Model/Order/Payment.php | 6 +- .../Model/Order/Pdf/Items/AbstractItems.php | 4 +- .../Items/Creditmemo/DefaultCreditmemo.php | 10 +- .../Pdf/Items/Invoice/DefaultInvoice.php | 10 +- .../Pdf/Items/Shipment/DefaultShipment.php | 10 +- .../Magento/Sales/Model/Order/Shipment.php | 14 +- app/code/Magento/Sales/Model/Quote.php | 11 +- .../Magento/Sales/Model/Quote/Address.php | 16 +- .../Magento/Sales/Model/Recurring/Profile.php | 8 +- .../Resource/Billing/Agreement/Collection.php | 12 +- .../Model/Resource/Order/AbstractOrder.php | 4 +- .../Sales/Model/Resource/Order/Address.php | 6 +- .../Sales/Model/Resource/Order/Collection.php | 12 +- .../Sales/Model/Resource/Order/Payment.php | 6 +- .../Resource/Order/Payment/Collection.php | 12 +- .../Model/Resource/Quote/Item/Collection.php | 12 +- .../Resource/Quote/Payment/Collection.php | 12 +- .../Model/Resource/Report/Bestsellers.php | 6 +- .../Report/Bestsellers/Collection.php | 14 +- .../Report/Collection/AbstractCollection.php | 14 +- .../Report/Invoiced/Collection/Invoiced.php | 14 +- .../Report/Invoiced/Collection/Order.php | 14 +- .../Sales/Model/Resource/Report/Order.php | 10 +- .../Resource/Report/Order/Collection.php | 14 +- .../Report/Refunded/Collection/Order.php | 14 +- .../Report/Refunded/Collection/Refunded.php | 14 +- .../Report/Shipping/Collection/Order.php | 14 +- .../Report/Shipping/Collection/Shipment.php | 14 +- .../Sales/Model/Resource/Sale/Collection.php | 19 +- .../Magento/Sales/Model/Resource/Setup.php | 6 +- app/code/Magento/Sales/etc/adminhtml/menu.xml | 2 +- .../Magento/Sales/etc/frontend/events.xml | 2 +- app/code/Magento/Sales/etc/module.xml | 2 +- .../layout/sales_order_create_index.xml | 14 +- .../sales_order_create_load_block_data.xml | 2 +- .../sales_order_create_load_block_items.xml | 2 +- .../layout/sales_order_creditmemo_new.xml | 2 +- .../sales_order_creditmemo_updateqty.xml | 2 +- .../layout/sales_order_creditmemo_view.xml | 2 +- .../layout/sales_order_invoice_new.xml | 2 +- .../layout/sales_order_invoice_updateqty.xml | 2 +- .../layout/sales_order_invoice_view.xml | 2 +- .../layout/sales_order_shipment_new.xml | 4 +- .../layout/sales_order_shipment_view.xml | 4 +- .../adminhtml/layout/sales_order_view.xml | 6 +- .../adminhtml/order/create/giftmessage.phtml | 24 +- .../view/adminhtml/order/giftoptions.phtml | 4 +- .../adminhtml/order/view/giftmessage.phtml | 61 +- .../Sales/view/email/shipment_new.html | 4 +- .../Sales/view/email/shipment_new_guest.html | 4 +- .../view/frontend/layout/customer_account.xml | 6 +- .../sales_email_order_creditmemo_items.xml | 2 +- .../sales_email_order_invoice_items.xml | 2 +- .../layout/sales_email_order_items.xml | 2 +- .../sales_email_order_shipment_items.xml | 2 +- .../layout/sales_order_creditmemo.xml | 2 +- .../layout/sales_order_guest_info_links.xml | 2 +- .../layout/sales_order_info_links.xml | 2 +- .../frontend/layout/sales_order_invoice.xml | 2 +- .../frontend/layout/sales_order_print.xml | 2 +- .../layout/sales_order_printcreditmemo.xml | 2 +- .../layout/sales_order_printinvoice.xml | 2 +- .../layout/sales_order_printshipment.xml | 2 +- .../frontend/layout/sales_order_shipment.xml | 2 +- .../view/frontend/layout/sales_order_view.xml | 2 +- .../sales_recurring_profile_view__tabs.xml | 8 +- .../Sales/view/frontend/recurring/grid.phtml | 2 +- .../Block/Adminhtml/Promo/Quote/Edit.php | 22 +- .../Promo/Quote/Edit/Tab/Actions.php | 38 +- .../Promo/Quote/Edit/Tab/Conditions.php | 34 +- .../Promo/Quote/Edit/Tab/Coupons.php | 4 +- .../Promo/Quote/Edit/Tab/Coupons/Form.php | 30 +- .../Promo/Quote/Edit/Tab/Coupons/Grid.php | 30 +- .../Adminhtml/Promo/Quote/Edit/Tab/Labels.php | 4 +- .../Adminhtml/Promo/Quote/Edit/Tab/Main.php | 4 +- .../SalesRule/Model/Coupon/Massgenerator.php | 4 +- .../Model/Resource/Report/Collection.php | 18 +- .../SalesRule/Model/Resource/Report/Rule.php | 10 +- .../Model/Resource/Rule/Collection.php | 12 +- app/code/Magento/SalesRule/Model/Rule.php | 10 +- .../Magento/SalesRule/Model/Validator.php | 8 +- app/code/Magento/Sendfriend/Block/Send.php | 10 +- .../Magento/Sendfriend/Controller/Product.php | 4 +- .../Magento/Sendfriend/Model/Sendfriend.php | 14 +- app/code/Magento/Sendfriend/etc/module.xml | 1 - .../Sendfriend/view/frontend/send.phtml | 2 +- .../Adminhtml/Carrier/Tablerate/Grid.php | 30 +- .../Magento/Shipping/Block/Tracking/Ajax.php | 2 +- .../Magento/Shipping/Block/Tracking/Popup.php | 10 +- .../Magento/Shipping/Controller/Tracking.php | 4 +- app/code/Magento/Shipping/Helper/Data.php | 4 +- .../Model/Resource/Carrier/Tablerate.php | 4 +- .../Magento/Sitemap/Block/Adminhtml/Edit.php | 22 +- .../Sitemap/Block/Adminhtml/Edit/Form.php | 30 +- .../Block/Adminhtml/Grid/Renderer/Link.php | 22 +- .../Block/Adminhtml/Grid/Renderer/Time.php | 18 +- .../Model/Resource/Catalog/Product.php | 2 +- app/code/Magento/Sitemap/Model/Sitemap.php | 8 +- .../Magento/Tax/Block/Adminhtml/Rate/Form.php | 52 +- .../Tax/Block/Adminhtml/Rate/ImportExport.php | 18 +- .../Tax/Block/Adminhtml/Rate/Title.php | 10 +- .../Magento/Tax/Block/Adminhtml/Rule/Edit.php | 22 +- .../Tax/Block/Adminhtml/Rule/Edit/Form.php | 38 +- .../Magento/Tax/Block/Checkout/Discount.php | 8 +- .../Magento/Tax/Block/Checkout/Grandtotal.php | 8 +- .../Magento/Tax/Block/Checkout/Shipping.php | 8 +- .../Magento/Tax/Block/Checkout/Subtotal.php | 8 +- .../Magento/Tax/Block/Sales/Order/Tax.php | 10 +- app/code/Magento/Tax/Helper/Data.php | 4 +- app/code/Magento/Tax/Model/Calculation.php | 4 +- .../Tax/Model/Resource/Calculation.php | 8 +- .../Resource/Calculation/Rate/Collection.php | 16 +- .../Tax/Model/Resource/Report/Collection.php | 14 +- .../Magento/Tax/Model/Resource/Report/Tax.php | 10 +- app/code/Magento/Tax/Model/Resource/Setup.php | 8 +- .../view/adminhtml/layout/tax_rule_edit.xml | 10 +- .../Adminhtml/System/Design/Theme/Edit.php | 24 +- .../System/Design/Theme/Edit/AbstractTab.php | 30 +- .../System/Design/Theme/Edit/Tab/Css.php | 34 +- .../System/Design/Theme/Edit/Tab/General.php | 38 +- .../Magento/{Page => Theme}/Block/Html.php | 96 ++- .../Block/Html/Breadcrumbs.php | 65 +- .../{Page => Theme}/Block/Html/Footer.php | 50 +- .../{Page => Theme}/Block/Html/Head.php | 90 ++- .../Block/Html/Head/AssetBlockInterface.php} | 9 +- .../{Page => Theme}/Block/Html/Head/Css.php | 19 +- .../{Page => Theme}/Block/Html/Head/Link.php | 24 +- .../Block/Html/Head/Script.php | 20 +- .../{Page => Theme}/Block/Html/Header.php | 58 +- .../{Page => Theme}/Block/Html/Notices.php | 22 +- .../{Page => Theme}/Block/Html/Pager.php | 269 ++++++-- .../{Page => Theme}/Block/Html/Title.php | 13 +- .../{Page => Theme}/Block/Html/Topmenu.php | 61 +- app/code/Magento/Theme/Block/Html/Welcome.php | 41 ++ .../Magento/{Page => Theme}/Helper/Layout.php | 29 +- app/code/Magento/Theme/Helper/Storage.php | 6 +- .../Model => Theme/Model/Layout}/Config.php | 8 +- .../Model/Layout}/Config/Converter.php | 2 +- .../Model/Layout}/Config/Reader.php | 2 +- .../Model/Layout}/Config/SchemaLocator.php | 6 +- .../Model/Layout}/Source/Layout.php | 19 +- .../Magento/Theme/Model/Wysiwyg/Storage.php | 2 +- .../{Page => Theme}/etc/adminhtml/system.xml | 2 - app/code/Magento/Theme/etc/config.xml | 49 ++ app/code/Magento/Theme/etc/di.xml | 24 + app/code/Magento/Theme/etc/module.xml | 6 +- .../{Page => Theme}/etc/page_layouts.xml | 0 .../{Page => Theme}/etc/page_layouts.xsd | 0 .../{Page => Theme}/etc/page_layouts_file.xsd | 0 .../Magento/{Page => Theme}/i18n/de_DE.csv | 0 .../Magento/{Page => Theme}/i18n/en_US.csv | 0 .../Magento/{Page => Theme}/i18n/es_ES.csv | 0 .../Magento/{Page => Theme}/i18n/fr_FR.csv | 0 .../Magento/{Page => Theme}/i18n/nl_NL.csv | 0 .../Magento/{Page => Theme}/i18n/pt_BR.csv | 0 .../Magento/{Page => Theme}/i18n/zh_CN.csv | 0 .../view/adminhtml/empty.phtml | 0 .../view/adminhtml/favicon.ico | Bin .../adminhtml_system_design_theme_edit.xml | 28 +- .../view/adminhtml/title.phtml | 2 +- .../view/frontend/1column.phtml | 2 +- .../view/frontend/2columns-left.phtml | 2 +- .../view/frontend/2columns-right.phtml | 2 +- .../view/frontend/3columns.phtml | 2 +- .../{Page => Theme}/view/frontend/blank.phtml | 2 +- .../view/frontend/callouts/left_col.phtml | 0 .../view/frontend/callouts/right_col.phtml | 0 .../view/frontend/css/tabs.css | 0 .../view/frontend/css/validate.css | 0 .../{Page => Theme}/view/frontend/empty.phtml | 2 +- .../{Page => Theme}/view/frontend/favicon.ico | Bin .../view/frontend/html/block.phtml | 0 .../view/frontend/html/breadcrumbs.phtml | 0 .../view/frontend/html/bugreport.phtml | 0 .../view/frontend/html/copyright.phtml | 0 .../view/frontend/html/footer.phtml | 0 .../view/frontend/html/head.phtml | 0 .../view/frontend/html/header.phtml | 4 +- .../view/frontend/html/notices.phtml | 4 +- .../view/frontend/html/pager.phtml | 4 +- .../view/frontend/html/title.phtml | 2 +- .../view/frontend/html/topmenu.phtml | 4 +- .../frontend/images/validation_advice_bg.gif | Bin .../view/frontend/js/calendar.phtml | 2 +- .../view/frontend/js/components.phtml | 0 .../view/frontend/js/cookie.phtml | 2 +- .../view/frontend/js/notices.js | 0 .../view/frontend/js/row-builder.js | 0 .../view/frontend/js/truncate.js | 0 .../view/frontend/layout/default.xml | 66 +- .../frontend/layout/default_head_blocks.xml | 40 +- .../view/frontend/layout/page_calendar.xml | 6 +- .../view/frontend/layout/page_empty.xml | 0 .../view/frontend/layout/page_one_column.xml | 0 .../frontend/layout/page_three_columns.xml | 0 .../frontend/layout/page_two_columns_left.xml | 0 .../layout/page_two_columns_right.xml | 0 .../view/frontend/layout/print.xml | 6 +- .../{Page => Theme}/view/frontend/link.phtml | 2 +- .../{Page => Theme}/view/frontend/menu.js | 0 .../{Page => Theme}/view/frontend/page.phtml | 2 +- .../{Page => Theme}/view/frontend/popup.phtml | 2 +- .../{Page => Theme}/view/frontend/print.phtml | 2 +- .../{Page => Theme}/view/install/favicon.ico | Bin .../Usa/Block/Adminhtml/Dhl/Unitofmeasure.php | 26 +- app/code/Magento/Usa/Helper/Data.php | 8 +- app/code/Magento/User/Block/Buttons.php | 22 +- app/code/Magento/User/Block/Role/Edit.php | 28 +- .../Magento/User/Block/Role/Grid/User.php | 40 +- app/code/Magento/User/Block/Role/Tab/Edit.php | 67 +- .../Magento/User/Block/Role/Tab/Users.php | 28 +- app/code/Magento/User/Block/User.php | 22 +- app/code/Magento/User/Block/User/Edit.php | 22 +- .../Magento/User/Block/User/Edit/Tab/Main.php | 30 +- .../User/Block/User/Edit/Tab/Roles.php | 40 +- .../User/Controller/Adminhtml/User/Role.php | 14 +- .../Magento/User/Model/Acl/Loader/Role.php | 23 +- .../Magento/User/Model/Acl/Loader/Rule.php | 4 +- app/code/Magento/User/Model/Resource/Role.php | 8 +- .../User/Model/Resource/Role/Collection.php | 18 +- .../Model/Resource/Role/Grid/Collection.php | 13 +- .../Magento/User/Model/Resource/Rules.php | 14 +- .../Magento/User/Model/Resource/Setup.php | 4 +- app/code/Magento/User/Model/Resource/User.php | 7 +- app/code/Magento/User/Model/Role.php | 17 +- app/code/Magento/User/Model/Rules.php | 12 +- app/code/Magento/User/Model/User.php | 3 +- .../data/user_setup/data-install-1.6.0.0.php | 10 +- app/code/Magento/User/etc/adminhtml/di.xml | 8 - app/code/Magento/User/etc/di.xml | 9 + app/code/Magento/User/etc/module.xml | 2 +- .../user_setup/upgrade-1.6.1.4-1.6.1.5.php | 37 ++ .../view/adminhtml/admin/forgotpassword.phtml | 6 +- .../admin/resetforgottenpassword.phtml | 6 +- .../User/view/adminhtml/js/roles-tree.js | 8 + .../Activate/Permissions/Tab/Webapi.php | 180 +++++ .../Adminhtml/Integration/Edit/Tab/Webapi.php | 162 +++++ .../Adminhtml/Role/Edit/Tab/Resource.php | 30 +- .../Webapi/Block/Adminhtml/Role/Edit/Tabs.php | 2 +- .../Webapi/Block/Adminhtml/User/Edit/Tabs.php | 2 +- app/code/Magento/Webapi/Helper/Data.php | 24 + .../Webapi/Model/Cache/TypeIntegration.php | 51 ++ .../Model/Config/Integration}/Converter.php | 10 +- .../Model/Config/Integration}/Reader.php | 14 +- .../Config/Integration}/SchemaLocator.php | 4 +- .../Webapi/Model/IntegrationConfig.php | 91 +++ .../Magento/Webapi/Model/Plugin/Setup.php | 114 ++++ .../Magento/Webapi/etc/adminhtml/routes.xml | 2 +- app/code/Magento/Webapi/etc/cache.xml | 4 + app/code/Magento/Webapi/etc/di.xml | 133 ---- app/code/Magento/Webapi/etc/frontend/di.xml | 31 + .../etc/integration/api.xsd | 4 +- app/code/Magento/Webapi/etc/module.xml | 1 + app/code/Magento/Webapi/etc/webapi.xsd | 2 +- .../Magento/Webapi/etc/webapi_rest/di.xml | 125 ++++ .../Magento/Webapi/etc/webapi_soap/di.xml | 71 ++ .../activate/permissions/tab/webapi.phtml | 55 ++ ...ntegration_activate_permissions_webapi.xml | 36 + .../layout/adminhtml_integration_edit.xml | 39 ++ .../layout/adminhtml_webapi_role_edit.xml | 2 +- ..._webapi_user_edit_tab_roles_grid_block.xml | 1 + .../Webapi/view/adminhtml/resourcetree.phtml | 62 ++ .../view/adminhtml/rolesusersgridjs.phtml | 2 +- .../Activate/Permissions/Tab/Webhook.php | 64 ++ .../Block/Adminhtml/Registration/Activate.php | 22 +- .../Registration/Create/Form/Container.php | 22 +- .../Block/Adminhtml/Subscription/Edit.php | 22 +- .../Adminhtml/Subscription/Edit/Form.php | 38 +- app/code/Magento/Webhook/Model/Job.php | 10 +- .../Model/Resource/Event/Collection.php | 14 +- .../Webhook/Model/Resource/Job/Collection.php | 14 +- .../Resource/Subscription/Collection.php | 16 +- .../Resource/Subscription/Grid/Collection.php | 30 +- .../Magento/Webhook/Model/Subscription.php | 10 +- app/code/Magento/Webhook/etc/module.xml | 2 +- app/code/Magento/Webhook/etc/webapi.xml | 10 +- ...tegration_activate_permissions_webhook.xml | 36 + ...dminhtml_webhook_registration_activate.xml | 16 +- .../adminhtml_webhook_registration_failed.xml | 14 +- ...minhtml_webhook_registration_succeeded.xml | 16 +- .../adminhtml_webhook_registration_user.xml | 20 +- .../adminhtml_webhook_subscription_index.xml | 4 +- .../Magento/Weee/Block/Renderer/Weee/Tax.php | 4 +- app/code/Magento/Weee/Helper/Data.php | 4 +- app/code/Magento/Weee/Model/Observer.php | 8 +- .../Resource/Attribute/Backend/Weee/Tax.php | 6 +- app/code/Magento/Weee/Model/Tax.php | 10 +- app/code/Magento/Weee/etc/module.xml | 2 +- .../adminhtml/layout/catalog_product_new.xml | 2 +- .../Weee/view/frontend/layout/default.xml | 2 +- .../Widget/Block/Adminhtml/Widget/Chooser.php | 32 +- .../Widget/Block/Adminhtml/Widget/Form.php | 31 +- .../Block/Adminhtml/Widget/Instance/Edit.php | 22 +- .../Instance/Edit/Chooser/Container.php | 8 +- .../Edit/Chooser/DesignAbstraction.php | 8 +- .../Widget/Instance/Edit/Chooser/Layout.php | 8 +- .../Widget/Instance/Edit/Chooser/Template.php | 2 +- .../Widget/Instance/Edit/Tab/Main.php | 4 +- .../Widget/Instance/Edit/Tab/Main/Layout.php | 24 +- .../Widget/Instance/Edit/Tab/Settings.php | 30 +- .../Widget/Block/Adminhtml/Widget/Options.php | 34 +- .../Magento/Widget/Model/Widget/Instance.php | 8 +- app/code/Magento/Widget/etc/module.xml | 2 +- .../layout/adminhtml_widget_instance_edit.xml | 8 +- .../Magento/Wishlist/Block/AbstractBlock.php | 10 +- .../Wishlist/Block/Customer/Sharing.php | 10 +- .../Wishlist/Block/Customer/Wishlist.php | 7 +- .../Block/Customer/Wishlist/Button.php | 10 +- .../Block/Customer/Wishlist/Item/Options.php | 7 +- .../Block/Customer/Wishlist/Items.php | 2 +- .../Magento/Wishlist/Block/Item/Configure.php | 10 +- app/code/Magento/Wishlist/Block/Link.php | 2 +- .../Wishlist/Block/Render/Item/Price.php | 2 +- .../Wishlist/Block/Share/Email/Rss.php | 2 +- .../Magento/Wishlist/Block/Share/Wishlist.php | 7 +- app/code/Magento/Wishlist/Helper/Data.php | 4 +- app/code/Magento/Wishlist/Model/Observer.php | 4 +- .../Model/Resource/Item/Collection.php | 24 +- .../Model/Resource/Item/Collection/Grid.php | 49 +- app/code/Magento/Wishlist/Model/Wishlist.php | 16 +- app/code/Magento/Wishlist/etc/module.xml | 2 +- .../customer/edit/tab/wishlist.phtml | 2 +- .../layout/customer_index_wishlist.xml | 2 +- .../view/frontend/layout/customer_account.xml | 2 +- .../wishlist_index_configure_type_bundle.xml | 4 +- .../Magento_Adminhtml/layout/default.xml | 34 +- .../adminhtml/magento_backend/css/styles.css | 305 ++++++--- .../magento_backend/less/styles/admin.less | 26 +- .../magento_backend/less/styles/pages.less | 116 +++- .../Magento_Catalog/layout/default.xml | 2 +- .../layout/checkout_cart_index.xml | 2 +- .../Magento_Core/template.phtml | 2 +- .../Magento_Customer/layout/default.xml | 2 +- .../layout/default.xml | 20 +- .../frontend/magento_plushe/css/styles.css | 2 +- .../frontend/magento_plushe/less/styles.less | 2 +- app/etc/di.xml | 7 +- .../Magento/TestFramework/Cookie.php | 54 +- .../ObjectManager/Configurator.php | 2 +- .../TestFramework/ObjectManagerFactory.php | 3 +- .../TestCase/AbstractController.php | 2 +- .../testsuite/Magento/Test/CookieTest.php | 13 - .../Block/Widget/Form/ContainerTest.php | 5 +- .../Block/Widget/Grid/Massaction/ItemTest.php | 2 +- .../Adminhtml/Block/Widget/GridTest.php | 2 +- .../FrontController/Plugin/InstallTest.php | 82 +++ .../Authz/Service/AuthorizationV1Test.php | 237 +++++++ .../AuthorizationV1Test/UserLocatorStub.php | 28 +- .../Backend/Block/System/Config/FormTest.php | 4 +- .../Block/Widget/Grid/ColumnSetTest.php | 2 +- .../Magento/Backend/Block/Widget/GridTest.php | 3 +- .../Controller/Adminhtml/CacheTest.php | 3 +- .../Magento/Backend/Model/AuthTest.php | 16 +- .../Magento/Backend/Model/UrlTest.php | 4 +- .../Magento/Backend/Utility/Controller.php | 23 +- .../Product/Attribute/Set/Toolbar/AddTest.php | 2 +- .../Edit/Tab/Super/Config/MatrixTest.php | 2 +- .../Product/Edit/Tab/Super/ConfigTest.php | 2 +- .../Block/Adminhtml/Product/Edit/TabsTest.php | 2 +- .../Backend/Grid/ColumnSetTest.php | 1 + .../Catalog/Block/Product/ListTest.php | 6 +- .../Block/Product/ProductList/ToolbarTest.php | 4 +- .../Block/Product/View/AdditionalTest.php | 8 +- .../Catalog/Block/Product/ViewTest.php | 2 +- .../Catalog/Helper/Product/ViewTest.php | 2 +- .../Model/Layer/Filter/AttributeTest.php | 4 +- .../Model/Layer/Filter/CategoryTest.php | 4 +- .../Model/Layer/Filter/DecimalTest.php | 6 +- .../Catalog/Model/Layer/Filter/ItemTest.php | 2 +- .../Filter/Price/AlgorithmAdvancedTest.php | 2 +- .../Catalog/Model/Layer/Filter/PriceTest.php | 6 +- .../Block/Advanced/ResultTest.php | 10 +- .../CatalogSearch/Block/ResultTest.php | 4 +- .../Magento/Checkout/Block/CartTest.php | 8 +- .../Block/Onepage/Payment/MethodsTest.php | 2 +- .../Magento/Checkout/Controller/CartTest.php | 79 ++- .../_files/quote_with_bundle_product.php | 4 - .../quote_with_configurable_product.php | 4 - .../quote_with_downloadable_product.php | 4 - .../_files/quote_with_simple_product.php | 4 - ..._with_simple_product_and_custom_option.php | 4 - .../testsuite/Magento/Core/Model/AppTest.php | 2 +- .../DataService/LayoutTest/layout_update.xml | 2 +- .../Core/Model/LayoutDirectivesTest.php | 4 +- .../Magento/Core/Model/LayoutTest.php | 65 +- .../Resource/Db/Collection/AbstractTest.php | 2 +- ...stractTest.php => AbstractSessionTest.php} | 90 +-- .../Magento/Core/Model/Session/ConfigTest.php | 71 ++ .../Core/Model/Session/SidResolverTest.php | 173 +++++ .../Magento/Core/Model/StoreTest.php | 4 +- .../testsuite/Magento/Core/Model/UrlTest.php | 2 +- .../Magento/Core/Model/View/DesignTest.php | 12 +- .../layout_test_handle.xml | 2 +- .../Magento_Core/layout_test_handle_main.xml | 2 +- .../layout_test_handle_sample.xml | 6 +- .../test_test_theme/layout_test_handle.xml | 2 +- .../frontend/vendor_default/css/file.css | 2 +- .../_files/layout/container_attributes.xml | 8 +- .../action_for_anonymous_parent_block.xml | 8 +- .../layout_directives_test/arguments.xml | 2 +- .../arguments_complex_values.xml | 2 +- .../arguments_object_type.xml | 2 +- .../arguments_object_type_updaters.xml | 2 +- .../arguments_url_type.xml | 2 +- .../layout_directives_test/get_block.xml | 4 +- .../get_block_exception.xml | 2 +- .../_files/layout_directives_test/group.xml | 8 +- .../layout_directives_test/ifconfig.xml | 8 +- .../_files/layout_directives_test/move.xml | 14 +- .../move_alias_broken.xml | 4 +- .../layout_directives_test/move_broken.xml | 2 +- .../layout_directives_test/move_new_alias.xml | 4 +- .../move_the_same_alias.xml | 4 +- .../_files/layout_directives_test/remove.xml | 8 +- .../layout_directives_test/remove_broken.xml | 4 +- .../_files/layout_directives_test/render.xml | 4 +- .../sort_after_after.xml | 6 +- .../sort_after_previous.xml | 6 +- .../sort_before_after.xml | 6 +- .../sort_before_before.xml | 6 +- .../Core/Utility/_files/layout/handle_one.xml | 2 +- .../_files/layout_merged/multiple_handles.xml | 2 +- .../Controller/Adminhtml/GroupTest.php | 4 +- .../DesignEditor/Model/ObserverTest.php | 13 +- .../Edit/Tab/Downloadable/LinksTest.php | 11 +- .../Attribute/Edit/Main/AbstractTest.php | 1 - .../Email/Model/Template/FilterTest.php | 4 +- .../Magento/Email/Model/TemplateTest.php | 16 +- .../layout/email_template_test_handle.xml | 4 +- .../Block/Adminhtml/Items/ProductTest.php | 4 +- .../Controller/Adminhtml/IntegrationTest.php | 17 +- .../Integration/Model/Config/ReaderTest.php | 67 ++ .../Model/Config/_files/integration.php | 32 +- .../Model/Config/_files/integrationA.xml | 34 + .../Model/Config/_files/integrationB.xml | 34 + .../Block/Adminhtml/SubscriberTest.php | 4 +- .../Adminhtml/NewsletterTemplateTest.php | 2 +- .../Magento/Newsletter/Model/QueueTest.php | 8 +- .../Magento/Newsletter/Model/TemplateTest.php | 6 +- .../testsuite/Magento/Page/_files/robots.txt | 19 - .../Magento/PageCache/Helper/DataTest.php | 12 +- .../Magento/PageCache/Model/ObserverTest.php | 8 +- .../Magento/Payment/Block/InfoTest.php | 2 +- .../Magento/Review/Controller/ProductTest.php | 2 +- .../Block/Adminhtml/Items/AbstractTest.php | 4 +- .../Order/Create/Form/AbstractTest.php | 1 - .../Block/Order/Creditmemo/ItemsTest.php | 4 +- .../Sales/Block/Order/Invoice/ItemsTest.php | 4 +- .../Block/Order/PrintOrder/CreditmemoTest.php | 2 +- .../Block/Order/PrintOrder/InvoiceTest.php | 2 +- .../Sales/Block/Order/Shipment/ItemsTest.php | 2 +- .../Magento/Sales/Block/Order/TotalsTest.php | 8 +- .../Block/Recurring/Profile/ViewTest.php | 4 +- .../Quote/Address/CollectTotalsTest.php | 109 +++ .../Integrity/Magento/Payment/MethodsTest.php | 2 +- .../Magento/Widget/TemplateFilesTest.php | 6 +- .../Modular/BlockInstantiationTest.php | 2 +- .../Integrity/Modular/TemplateFilesTest.php | 2 +- ...FilesTest.php => ThemeConfigFilesTest.php} | 6 +- .../Modular/_files/view_files_ce.php | 6 +- .../Integrity/Theme/TemplateFilesTest.php | 2 +- .../Test/Integrity/Theme/ViewFilesTest.php | 2 +- .../Layout/Reference/_files/layoutInvalid.xml | 6 +- .../Layout/Reference/_files/layoutValid.xml | 4 +- .../_files/layoutValidExpectUpdated.xml | 4 +- .../Block/Html/BreadcrumbsTest.php | 8 +- .../{Page => Theme}/Block/Html/FooterTest.php | 6 +- .../{Page => Theme}/Block/Html/HeadTest.php | 42 +- .../{Page => Theme}/Block/HtmlTest.php | 9 +- .../Model/Layout}/Config/ReaderTest.php | 8 +- .../Model/Layout}/ConfigTest.php | 12 +- .../Model/Layout}/_files/page_layouts.xml | 2 +- .../Model/Layout}/_files/page_layouts2.xml | 2 +- .../Model/Resource/Role/CollectionTest.php | 4 +- .../testsuite/Magento/User/Model/UserTest.php | 4 +- .../Model/Page => View}/Asset/MergedTest.php | 14 +- .../{Block => Element}/AbstractBlockTest.php | 144 ++-- .../View/{Block => Element}/TemplateTest.php | 15 +- .../View/{Block => Element}/Text/ListTest.php | 18 +- .../View/{Block => Element}/TextTest.php | 6 +- .../frontend/magento_plushe/css/wrong.css | 0 .../View/Layout/_files/_layout_update.xml | 14 +- .../Magento/View/PublicationTest.php | 6 +- .../design/adminhtml/vendor_test/theme.xml | 28 + .../design/area_two/vendor_theme_one/file | 0 .../area_two/vendor_theme_one/theme.xml | 28 + .../design/design_area/vendor_theme_one/file | 0 .../design_area/vendor_theme_one/theme.xml | 28 + .../design/frontend/access_violation.php | 13 +- .../design/frontend/magento_default/theme.xml | 31 + .../frontend/magento_default_iphone/theme.xml | 35 + .../layout_test_handle.xml | 35 + .../frontend/test_cache_test_theme/theme.xml | 32 + .../Magento_Catalog/catalog_category_view.xml | 29 + .../catalog_category_view_type_default.xml | 29 + .../Magento_Catalog/catalog_product_view.xml | 29 + .../catalog_product_view_type_simple.xml | 29 + .../Magento_Catalog/theme_file.txt | 0 .../theme_file_with_2_dots..txt | 0 .../Magento_Catalog/theme_template.phtml | 14 +- .../Magento_Cms/layout_test_handle_extra.xml | 29 + .../Magento_Core/layout_test_handle_main.xml | 46 ++ .../layout_test_handle_sample.xml | 51 ++ .../test_default/Magento_Core/test.phtml | 27 + .../test_default/Namespace_Module/favicon.ico | 0 .../frontend/test_default/css/styles.css | 14 +- .../frontend/test_default/i18n/en_US.csv | 2 + .../frontend/test_default/i18n/fr_FR/logo.gif | 0 .../frontend/test_default/images/logo.gif | 0 .../test_default/images/logo_email.gif | 0 .../design/frontend/test_default/js/tabs.js | 25 + .../design/frontend/test_default/theme.xml | 31 + .../design/frontend/test_default/view.xml | 37 ++ .../test_publication/images/rectangle.gif | Bin 0 -> 52 bytes .../test_publication/images/square.gif | Bin 0 -> 46 bytes .../frontend/test_publication/style.css | 17 +- .../design/frontend/test_publication/sub.css | 26 + .../frontend/test_publication/theme.xml | 31 + .../test_test_theme/layout_test_handle.xml | 35 + .../design/frontend/test_test_theme/theme.xml | 32 + .../Fixture_Module/fixture_script.js | 26 + .../frontend/vendor_custom_theme/theme.xml | 32 + .../absolute_valid_module.gif | Bin 0 -> 810 bytes .../vendor_default/access_violation.php | 15 +- .../design/frontend/vendor_default/css/1.gif | Bin 0 -> 810 bytes .../frontend/vendor_default/css/base64.css | 29 + .../frontend/vendor_default/css/body.gif | Bin 0 -> 810 bytes .../vendor_default/css/deep/recursive.css | 26 + .../frontend/vendor_default/css/exception.css | 27 + .../frontend/vendor_default/css/file.css | 24 +- .../design/frontend/vendor_default/h1.gif | Bin 0 -> 810 bytes .../frontend/vendor_default/images/h2.gif | Bin 0 -> 810 bytes .../frontend/vendor_default/recursive.css | 26 + .../frontend/vendor_default/recursive.gif | Bin 0 -> 810 bytes .../frontend/vendor_default/recursive2.gif | Bin 0 -> 810 bytes .../design/frontend/vendor_default/scripts.js | 26 + .../design/frontend/vendor_default/theme.xml | 31 + .../Magento/View/_files/design/themes.php | 43 ++ .../Block/Adminhtml/User/Edit/TabsTest.php | 4 +- .../Model/Config/Integration/ReaderTest.php | 67 ++ .../Model/Config/Integration/_files/api.php | 46 ++ .../Model/Config/Integration/_files/apiA.xml | 42 ++ .../Model/Config/Integration/_files/apiB.xml | 40 ++ .../Webapi/Model/Config/ReaderTest.php | 67 ++ .../Webapi/Model/Config/_files/webapi.php | 93 +++ .../Webapi/Model/Config/_files/webapiA.xml | 38 ++ .../Webapi/Model/Config/_files/webapiB.xml | 38 ++ .../Adminhtml/Registration/ActivateTest.php | 4 +- .../Create/Form/ContainerTest.php | 4 +- .../Webhook/Model/SubscriptionTest.php | 9 +- .../Edit/Chooser/DesignAbstractionTest.php | 2 +- .../Instance/Edit/Chooser/LayoutTest.php | 2 +- .../Magento/Wishlist/Block/AbstractTest.php | 3 +- .../Customer/Wishlist/Item/ColumnTest.php | 2 +- .../Block/Customer/Wishlist/ItemsTest.php | 4 +- .../Magento/Wishlist/Controller/IndexTest.php | 2 +- dev/tests/performance/testsuite/checkout.jmx | 2 +- .../TestFramework/Dependency/LayoutRule.php | 2 +- .../TestFramework/Dependency/TemplateRule.php | 2 +- .../Integrity/Library/_files/blacklist.txt | 17 +- .../Persistent/_files/invalid_persistent.xml | 4 +- .../Persistent/_files/valid_persistent.xml | 4 +- .../Config/ReferentialTest.php | 2 +- .../Magento/{Page => Theme}/ConfigTest.php | 6 +- .../_files/invalid_page_layouts.xml | 2 +- .../_files/invalid_page_layouts_partial.xml | 0 .../_files/valid_page_layouts.xml | 2 +- .../_files/valid_page_layouts_partial.xml | 2 +- .../Magento/Test/Js/_files/blacklist/core.txt | 2 +- .../Magento/Test/Js/_files/whitelist/core.txt | 2 +- .../Magento/Test/Legacy/LayoutTest.php | 12 +- .../Magento/Core/Block/AbstractBlockTest.php | 2 +- .../Magento/Test/Legacy/ObsoleteCodeTest.php | 2 +- .../Test/Legacy/_files/obsolete_classes.php | 77 ++- .../Test/Legacy/_files/obsolete_constants.php | 72 +- .../Test/Legacy/_files/obsolete_methods.php | 130 +++- .../Legacy/_files/obsolete_properties.php | 72 +- .../Magento/Test/Php/LiveCodeTest.php | 1 - .../Test/Php/_files/blacklist/common.txt | 2 + .../Php/_files/phpcpd/blacklist/common.txt | 4 + .../Php/_files/phpcs/blacklist/common.txt | 2 - .../Test/Php/_files/whitelist/common.txt | 8 +- .../Magento/Test/Block/Adminhtml.php | 14 +- .../Helper/ObjectManagerTest.php | 14 +- .../Magento/Acl/Resource/ProviderTest.php | 17 +- .../Authz/Model/UserIdentifierTest.php | 93 +++ .../Page/System/Config/Robots/ResetTest.php | 38 +- .../Backend/Block/Widget/Grid/ColumnTest.php | 2 +- .../Controller/Adminhtml/CacheTest.php | 14 +- .../Model/Config/Backend/BaseurlTest.php | 2 +- .../Model/Config/Backend/SecureTest.php | 2 +- .../Magento/Backend/Model/CookieTest.php | 44 -- .../Magento/Backend/Model/UrlTest.php | 10 +- .../Catalog/Product/View/Type/BundleTest.php | 4 +- .../Magento/Captcha/Helper/DataTest.php | 6 +- .../Magento/Captcha/Model/DefaultTest.php | 6 +- .../Magento/Captcha/Model/ObserverTest.php | 9 +- .../Composite/Fieldset/OptionsTest.php | 2 +- .../Product/Helper/Form/WeightTest.php | 4 +- .../Block/Product/View/OptionsTest.php | 2 +- .../Catalog/Block/Product/View/TabsTest.php | 2 +- .../Magento/Catalog/Helper/UrlTest.php | 6 +- .../Category/Attribute/Backend/SortbyTest.php | 10 +- .../Catalog/Model/Observer/ReindexTest.php | 2 +- .../Plugin/QuoteItemProductOptionTest.php | 8 +- .../Backend/Groupprice/AbstractTest.php | 2 +- .../Product/Attribute/Backend/MediaTest.php | 11 +- .../Product/Attribute/Backend/StockTest.php | 9 +- .../Model/Product/Indexer/FlatTest.php | 10 +- .../Catalog/Model/Resource/AbstractTest.php | 6 +- .../Model/Resource/Category/FlatTest.php | 4 +- .../AssociatedProductUpdaterTest.php | 2 +- .../Model/Adminhtml/Stock/ItemTest.php | 4 +- .../Model/Resource/EngineProviderTest.php | 13 +- .../Checkout/Block/Cart/AbstractTest.php | 4 +- .../Checkout/Block/Cart/Item/RendererTest.php | 14 +- .../Magento/Checkout/Block/Cart/LinkTest.php | 10 +- .../Checkout/Block/Cart/SidebarTest.php | 2 +- .../Magento/Checkout/Block/LinkTest.php | 6 +- .../Magento/Cms/Model/Page/UrlrewriteTest.php | 2 +- .../Code/Reader/ArgumentsReaderTest.php | 4 +- .../Code/Validator/ArgumentSequenceTest.php | 48 +- .../_files/ClassesForArgumentSequence.php | 375 +---------- .../Core/App/Action/FormKeyValidatorTest.php | 10 +- .../{Page => Core}/Block/SwitchTest.php | 8 +- .../Magento/Core/Helper/CookieTest.php | 73 +- .../Magento/Core/Helper/ThemeTest.php | 38 +- .../Magento/Core/Helper/Url/RewriteTest.php | 22 - .../File/Storage/SynchronizationTest.php | 9 +- .../Magento/Core/Model/Layout/MergeTest.php | 6 +- .../_files/layout/fixture_handle_one.xml | 2 +- .../_files/layout/fixture_handle_two.xml | 2 +- .../Core/Model/Layout/_files/merged.xml | 4 +- .../Magento/Core/Model/ObserverTest.php | 9 +- .../Resource/Layout/Link/CollectionTest.php | 5 +- .../Resource/Layout/Update/CollectionTest.php | 5 +- .../Model/Resource/Setup/MigrationTest.php | 2 +- .../Magento/Core/Model/Session/ConfigTest.php | 492 ++++++++++++++ .../Core/Model/Store/Storage/DefaultTest.php | 17 +- .../Core/Model/Store/StorageFactoryTest.php | 2 +- .../Magento/Core/Model/ThemeTest.php | 8 +- .../Core/Model/Url/SecurityInfoTest.php | 8 +- .../testsuite/Magento/Core/Model/UrlTest.php | 12 +- .../Block/Account/AuthorizationLinkTest.php | 2 +- .../Customer/Block/Account/LinkTest.php | 2 +- .../Block/Account/RegisterLinkTest.php | 4 +- .../Controller/Adminhtml/IndexTest.php | 4 +- .../Magento/Data/Collection/DbTest.php | 4 +- .../unit/testsuite/Magento/Data/FormTest.php | 10 +- .../Editor/Tools/Code/CustomTest.php | 9 +- .../Adminhtml/Editor/Tools/Code/JsTest.php | 9 +- .../Adminhtml/System/Design/EditorTest.php | 11 +- .../Model/Plugin/ThemeCopyServiceTest.php | 18 +- .../Magento/DesignEditor/Model/StateTest.php | 2 +- .../DesignEditor/Model/Theme/ContextTest.php | 9 +- .../Model/Url/NavigationModeTest.php | 68 +- .../Model/Resource/Country/CollectionTest.php | 11 +- .../Downloadable/Model/ObserverTest.php | 28 +- .../Magento/Eav/Model/Entity/AbstractTest.php | 10 +- .../Entity/Attribute/Backend/AbstractTest.php | 2 +- .../Entity/Attribute/Backend/ArrayTest.php | 6 +- .../Eav/Model/Entity/AttributeTest.php | 2 +- .../Model/Validator/Attribute/DataTest.php | 4 +- .../Model/Plugin/QuoteItemTest.php | 4 +- .../GoogleOptimizer/Helper/FormTest.php | 9 +- .../Model/Observer/Product/DeleteTest.php | 8 +- .../Block/SiteVerificationTest.php | 2 +- .../Model/Export/Entity/AbstractEavTest.php | 22 +- .../Model/Import/Entity/AbstractTest.php | 31 - .../Model/Import/Entity/Eav/CustomerTest.php | 2 +- .../Import/Entity/Product/OptionTest.php | 2 +- .../CollectionByPagesIteratorTest.php | 2 +- .../Magento/Index/App/IndexerTest.php | 9 +- .../Magento/Index/Model/ProcessTest.php | 7 +- .../Controller/Adminhtml/IntegrationTest.php | 30 +- .../Integration/Model/Config/XsdTest.php | 227 ++----- .../Model/Config/_files/integration.php | 12 +- .../Model/Config/_files/integration.xml | 11 +- .../Model/Integration/FactoryTest.php | 3 +- .../Integration/Source/AuthenticationTest.php | 40 -- .../Magento/Integration/Model/ManagerTest.php | 139 ++++ .../Integration/Service/IntegrationV1Test.php | 26 +- .../Magento/Newsletter/Model/TemplateTest.php | 4 +- .../Payment/Block/Form/ContainerTest.php | 4 +- .../Block/Info/ContainerAbstractTest.php | 2 +- .../Payment/Model/Config/ConverterTest.php | 2 +- .../Magento/Paypal/Helper/CheckoutTest.php | 4 +- .../Paypal/Model/PayflowadvancedTest.php | 2 +- .../Magento/Paypal/Model/PayflowlinkTest.php | 2 +- .../Magento/Paypal/Model/ProTest.php | 2 +- .../Block/Product/View/PriceTest.php | 2 +- .../Block/Product/View/StockTest.php | 2 +- .../Review/Helper/Action/PagerTest.php | 2 +- .../Block/Adminhtml/Items/AbstractTest.php | 2 +- .../Adminhtml/Order/Create/Items/GridTest.php | 4 +- .../Adminhtml/Order/Invoice/ViewTest.php | 2 +- .../Block/Adminhtml/Order/Totals/TaxTest.php | 2 +- .../Magento/Sales/Block/Guest/LinkTest.php | 2 +- .../Sales/Block/Items/AbstractTest.php | 2 +- .../Block/Recurring/Profile/GridTest.php | 8 +- .../Profile/Related/Orders/GridTest.php | 5 +- .../Recurring/Profile/View/AddressTest.php | 6 +- .../Block/Recurring/Profile/View/DataTest.php | 2 +- .../Block/Recurring/Profile/View/FeesTest.php | 2 +- .../Block/Recurring/Profile/View/ItemTest.php | 2 +- .../Recurring/Profile/View/ReferenceTest.php | 2 +- .../Recurring/Profile/View/ScheduleTest.php | 2 +- .../Adminhtml/Order/CreditmemoTest.php | 15 +- .../Billing/Agreement/OrdersUpdaterTest.php | 2 +- .../Backend/CatalogProductQuoteTest.php | 16 +- .../Observer/Backend/CustomerQuoteTest.php | 8 +- .../Quote/Address/CollectTotalsTest.php | 263 ++++++++ .../Quote/Address/VatValidatorTest.php | 235 +++++++ .../Order/Invoice/Total/ShippingTest.php | 11 +- .../Magento/Sales/Model/Order/InvoiceTest.php | 6 +- .../Sales/Model/Order/Shipment/TrackTest.php | 8 +- .../Magento/Sales/Model/OrderTest.php | 4 +- .../Magento/Sales/Model/Quote/ItemTest.php | 17 +- .../Magento/SalesRule/Model/ValidatorTest.php | 39 +- .../Magento/Sitemap/Model/SitemapTest.php | 4 +- .../Tax/Model/TaxClass/FactoryTest.php | 16 +- .../Tax/Model/TaxClass/Type/CustomerTest.php | 2 +- .../Tax/Model/TaxClass/Type/ProductTest.php | 2 +- .../Tools/View/Generator/CopyRuleTest.php | 4 +- .../System/Design/Theme/Tab/JsTest.php | 8 +- .../System/Design/Theme/TabAbstractTest.php | 9 +- .../{Page => Theme}/Block/Html/HeadTest.php | 18 +- .../{Page => Theme}/Block/Html/HeaderTest.php | 8 +- .../Block/Html/_files/logo/default/image.gif | Bin .../Adminhtml/System/Design/ThemeTest.php | 9 +- .../Model/Layout}/Config/ConverterTest.php | 8 +- .../Layout}/Config/_files/page_layouts.xml | 2 +- .../User/Model/Acl/Loader/RoleTest.php | 12 +- .../User/Model/Acl/Loader/RuleTest.php | 13 +- .../Page => View}/Asset/CollectionTest.php | 14 +- .../Asset/GroupedCollectionTest.php | 45 +- .../Page => View}/Asset/MergeServiceTest.php | 83 +-- .../Asset/MergeStrategy/ChecksumTest.php | 8 +- .../Asset/MergeStrategy/DirectTest.php | 6 +- .../Asset/MergeStrategy/FileExistsTest.php | 8 +- .../Model/Page => View}/Asset/MergedTest.php | 32 +- .../Page => View}/Asset/MinifiedTest.php | 10 +- .../Page => View}/Asset/MinifyServiceTest.php | 75 ++- .../Asset/PropertyGroupTest.php | 9 +- .../Page => View}/Asset/PublicFileTest.php | 6 +- .../Model/Page => View}/Asset/RemoteTest.php | 6 +- .../Page => View}/Asset/ViewFileTest.php | 8 +- .../{Block => Element}/AbstractBlockTest.php | 12 +- .../Element/Html}/Link/CurrentTest.php | 18 +- .../Block => View/Element/Html}/LinksTest.php | 18 +- .../View/{Block => Element}/TemplateTest.php | 6 +- .../Magento/View/TemplateEngine/PhpTest.php | 4 +- .../Magento/View/Url/_files/result.css | 2 +- .../Magento/View/Url/_files/source.css | 2 +- .../Block/Adminhtml/Role/Edit/TabsTest.php | 6 +- .../Magento/Webapi/Model/Acl/RoleTest.php | 2 +- .../Magento/Webapi/Model/Acl/RuleTest.php | 2 +- .../Magento/Webapi/Model/Acl/UserTest.php | 2 +- .../Config/Integration}/ConverterTest.php | 4 +- .../Model/Config/Integration}/XsdTest.php | 50 +- .../Model/Config/Integration}/_files/api.php | 6 +- .../Model/Config/Integration}/_files/api.xml | 8 +- .../Magento/Webapi/Model/Plugin/SetupTest.php | 182 +++++ .../Registration/Create/FormTest.php | 5 - .../Adminhtml/Subscription/Edit/FormTest.php | 5 - .../Block/Adminhtml/Subscription/EditTest.php | 11 - .../Adminhtml/Webhook/RegistrationTest.php | 18 +- .../Adminhtml/Webhook/SubscriptionTest.php | 16 +- .../Magento/Webhook/Model/JobTest.php | 32 +- .../Magento/Webhook/Model/ObserverTest.php | 4 +- .../Model/Resource/Event/CollectionTest.php | 2 +- .../Model/Resource/Job/CollectionTest.php | 2 +- .../Resource/Subscription/CollectionTest.php | 40 +- .../Subscription/Grid/CollectionTest.php | 4 +- .../Webhook/Model/Subscription/ConfigTest.php | 2 +- .../Webhook/Model/SubscriptionTest.php | 8 +- .../Webhook/Model/Webapi/User/FactoryTest.php | 11 +- .../Wishlist/Block/Item/ConfigureTest.php | 14 +- dev/tools/Magento/Tools/View/generator.php | 2 +- dev/tools/layout/processors/headBlocks.xsl | 4 +- lib/Magento/Acl/Resource/Provider.php | 13 +- lib/Magento/App/Request/Http.php | 2 + lib/Magento/Code/Reader/ArgumentsReader.php | 16 +- .../Code/Validator/ArgumentSequence.php | 231 ++----- lib/Magento/Data/Collection/Db.php | 12 +- lib/Magento/Data/Form.php | 47 +- .../Data/Form/Element/AbstractElement.php | 2 +- lib/Magento/Data/Form/FormKey.php | 72 ++ lib/Magento/Json/Decoder.php | 40 ++ lib/Magento/Json/DecoderInterface.php | 38 ++ .../Links.php => lib/Magento/Json/Encoder.php | 37 +- lib/Magento/Json/EncoderInterface.php | 38 ++ .../Module/FrontController/Plugin/Install.php | 2 +- lib/Magento/Oauth/Helper/Oauth.php | 1 - .../Session/Config/ConfigInterface.php | 16 +- .../Magento/Session/SidResolverInterface.php | 33 +- lib/Magento/Stdlib/Cookie.php | 117 ++++ .../Magento/View}/Asset/AssetInterface.php | 6 +- .../Magento/View}/Asset/Collection.php | 24 +- lib/Magento/View/Asset/ConfigInterface.php | 61 ++ .../Magento/View}/Asset/GroupedCollection.php | 54 +- .../Magento/View}/Asset/LocalInterface.php | 6 +- .../Magento/View}/Asset/MergeService.php | 63 +- .../View}/Asset/MergeStrategy/Checksum.php | 31 +- .../View}/Asset/MergeStrategy/Direct.php | 32 +- .../View}/Asset/MergeStrategy/FileExists.php | 25 +- .../View}/Asset/MergeStrategyInterface.php | 4 +- .../View}/Asset/MergeableInterface.php | 8 +- .../Magento/View}/Asset/Merged.php | 115 ++-- .../Magento/View}/Asset/Minified.php | 62 +- .../Magento/View}/Asset/MinifyService.php | 82 ++- .../Magento/View}/Asset/PropertyGroup.php | 16 +- .../View/Asset/PropertyGroupFactory.php | 37 +- .../Magento/View}/Asset/PublicFile.php | 26 +- .../Magento/View}/Asset/Remote.php | 20 +- .../Magento/View}/Asset/ViewFile.php | 26 +- .../View/{Block => Element}/AbstractBlock.php | 199 ++---- .../View/{Block => Element}/Context.php | 18 +- .../View/{Block => Element}/Html/Calendar.php | 47 +- .../View/{Block => Element}/Html/Date.php | 4 +- .../View/{Block => Element}/Html/Link.php | 18 +- .../View/Element/Html}/Link/Current.php | 43 +- lib/Magento/View/Element/Html/Links.php | 73 ++ .../View/{Block => Element}/Html/Select.php | 4 +- .../Magento/View/Element}/Js/Components.php | 11 +- .../Magento/View/Element}/Js/Cookie.php | 41 +- .../View/{Block => Element}/Messages.php | 32 +- .../Magento/View/Element}/Redirect.php | 125 ++-- .../View/{Block => Element}/Template.php | 23 +- .../{Block => Element}/Template/Context.php | 7 +- lib/Magento/View/{Block => Element}/Text.php | 4 +- .../View/{Block => Element}/Text/ListText.php | 6 +- .../{Block => Element}/Text/TextList/Item.php | 6 +- .../{Block => Element}/Text/TextList/Link.php | 6 +- lib/Magento/View/Layout/Element.php | 9 + lib/Magento/View/LayoutInterface.php | 4 +- lib/Zend/Session/Config/ConfigInterface.php | 52 ++ pub/lib/mage/adminhtml/wysiwyg/widget.js | 4 + pub/lib/mage/bootstrap.js | 2 - 1943 files changed, 21996 insertions(+), 14989 deletions(-) create mode 100644 app/code/Magento/Authz/Model/UserIdentifier.php rename dev/tests/integration/testsuite/Magento/Page/Helper/RobotsTest.php => app/code/Magento/Authz/Model/UserIdentifier/Factory.php (55%) create mode 100644 app/code/Magento/Authz/Model/UserLocator/Admin.php create mode 100644 app/code/Magento/Authz/Model/UserLocator/Guest.php rename app/code/Magento/{Page/Block/Link.php => Authz/Model/UserLocatorInterface.php} (72%) create mode 100644 app/code/Magento/Authz/Service/AuthorizationV1.php create mode 100644 app/code/Magento/Authz/Service/AuthorizationV1Interface.php create mode 100644 app/code/Magento/Authz/etc/adminhtml/di.xml create mode 100644 app/code/Magento/Authz/etc/di.xml rename app/code/Magento/{Page => Authz}/etc/module.xml (79%) mode change 100755 => 100644 rename app/code/Magento/{Page => Core}/Block/Switcher.php (97%) create mode 100644 app/code/Magento/Core/Model/Asset/Config.php create mode 100644 app/code/Magento/Core/Model/Asset/Plugin/CleanMergedJsCss.php delete mode 100644 app/code/Magento/Core/Model/Cookie.php create mode 100644 app/code/Magento/Core/Model/Session/Config.php create mode 100644 app/code/Magento/Core/Model/Session/SidResolver.php rename app/code/Magento/{Page => Core}/view/frontend/switch/flags.phtml (100%) rename app/code/Magento/{Page => Core}/view/frontend/switch/languages.phtml (96%) rename app/code/Magento/{Page => Core}/view/frontend/switch/stores.phtml (100%) create mode 100644 app/code/Magento/Integration/Block/Adminhtml/Integration/Activate/Permissions/Tabs.php rename app/code/Magento/Integration/{Model/Integration/Source/Authentication.php => Block/Adminhtml/Integration/Grid.php} (66%) create mode 100644 app/code/Magento/Integration/Block/Adminhtml/Integration/Token.php create mode 100644 app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php create mode 100644 app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Delete.php create mode 100644 app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Edit.php create mode 100644 app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/IntegrationAbstract.php create mode 100644 app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php create mode 100644 app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link/Activate.php create mode 100644 app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link/Reauthorize.php rename dev/tests/unit/testsuite/Magento/Core/Model/PageTest.php => app/code/Magento/Integration/Model/Cache/Type.php (60%) create mode 100644 app/code/Magento/Integration/Model/Config.php create mode 100644 app/code/Magento/Integration/Model/Manager.php create mode 100644 app/code/Magento/Integration/Model/Resource/Setup.php create mode 100644 app/code/Magento/Integration/etc/cache.xml create mode 100644 app/code/Magento/Integration/sql/integration_setup/upgrade-1.0.0.0-1.0.0.1.php create mode 100644 app/code/Magento/Integration/view/adminhtml/integration.css rename app/code/Magento/{Page/view/frontend/link/current.phtml => Integration/view/adminhtml/integration/activate/permissions.phtml} (64%) create mode 100644 app/code/Magento/Integration/view/adminhtml/integration/popup_container.phtml create mode 100644 app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_permissions_popup.xml create mode 100644 app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_tokens_popup.xml delete mode 100644 app/code/Magento/Page/Block/Template/Links/Block.php delete mode 100644 app/code/Magento/Page/Helper/Robots.php delete mode 100644 app/code/Magento/Page/etc/config.xml delete mode 100644 app/code/Magento/Page/etc/di.xml delete mode 100644 app/code/Magento/Page/view/frontend/js/splitbutton.js create mode 100644 app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotals.php create mode 100644 app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidator.php rename app/code/Magento/{Page => Theme}/Block/Html.php (70%) rename app/code/Magento/{Page => Theme}/Block/Html/Breadcrumbs.php (73%) rename app/code/Magento/{Page => Theme}/Block/Html/Footer.php (71%) rename app/code/Magento/{Page => Theme}/Block/Html/Head.php (80%) rename app/code/Magento/{Page/Block/Html/Head/AssetBlock.php => Theme/Block/Html/Head/AssetBlockInterface.php} (85%) rename app/code/Magento/{Page => Theme}/Block/Html/Head/Css.php (72%) rename app/code/Magento/{Page => Theme}/Block/Html/Head/Link.php (68%) rename app/code/Magento/{Page => Theme}/Block/Html/Head/Script.php (72%) rename app/code/Magento/{Page => Theme}/Block/Html/Header.php (79%) rename app/code/Magento/{Page => Theme}/Block/Html/Notices.php (78%) rename app/code/Magento/{Page => Theme}/Block/Html/Pager.php (74%) rename app/code/Magento/{Page => Theme}/Block/Html/Title.php (85%) rename app/code/Magento/{Page => Theme}/Block/Html/Topmenu.php (91%) create mode 100644 app/code/Magento/Theme/Block/Html/Welcome.php rename app/code/Magento/{Page => Theme}/Helper/Layout.php (86%) rename app/code/Magento/{Page/Model => Theme/Model/Layout}/Config.php (94%) rename app/code/Magento/{Page/Model => Theme/Model/Layout}/Config/Converter.php (97%) rename app/code/Magento/{Page/Model => Theme/Model/Layout}/Config/Reader.php (96%) rename app/code/Magento/{Page/Model => Theme/Model/Layout}/Config/SchemaLocator.php (93%) rename app/code/Magento/{Page/Model => Theme/Model/Layout}/Source/Layout.php (87%) rename app/code/Magento/{Page => Theme}/etc/adminhtml/system.xml (99%) rename app/code/Magento/{Page => Theme}/etc/page_layouts.xml (100%) rename app/code/Magento/{Page => Theme}/etc/page_layouts.xsd (100%) rename app/code/Magento/{Page => Theme}/etc/page_layouts_file.xsd (100%) rename app/code/Magento/{Page => Theme}/i18n/de_DE.csv (100%) rename app/code/Magento/{Page => Theme}/i18n/en_US.csv (100%) rename app/code/Magento/{Page => Theme}/i18n/es_ES.csv (100%) rename app/code/Magento/{Page => Theme}/i18n/fr_FR.csv (100%) rename app/code/Magento/{Page => Theme}/i18n/nl_NL.csv (100%) rename app/code/Magento/{Page => Theme}/i18n/pt_BR.csv (100%) rename app/code/Magento/{Page => Theme}/i18n/zh_CN.csv (100%) rename app/code/Magento/{Page => Theme}/view/adminhtml/empty.phtml (100%) rename app/code/Magento/{Page => Theme}/view/adminhtml/favicon.ico (100%) rename app/code/Magento/{Page => Theme}/view/adminhtml/title.phtml (97%) rename app/code/Magento/{Page => Theme}/view/frontend/1column.phtml (98%) rename app/code/Magento/{Page => Theme}/view/frontend/2columns-left.phtml (98%) rename app/code/Magento/{Page => Theme}/view/frontend/2columns-right.phtml (98%) rename app/code/Magento/{Page => Theme}/view/frontend/3columns.phtml (98%) rename app/code/Magento/{Page => Theme}/view/frontend/blank.phtml (95%) rename app/code/Magento/{Page => Theme}/view/frontend/callouts/left_col.phtml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/callouts/right_col.phtml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/css/tabs.css (100%) rename app/code/Magento/{Page => Theme}/view/frontend/css/validate.css (100%) rename app/code/Magento/{Page => Theme}/view/frontend/empty.phtml (98%) rename app/code/Magento/{Page => Theme}/view/frontend/favicon.ico (100%) rename app/code/Magento/{Page => Theme}/view/frontend/html/block.phtml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/html/breadcrumbs.phtml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/html/bugreport.phtml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/html/copyright.phtml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/html/footer.phtml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/html/head.phtml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/html/header.phtml (95%) rename app/code/Magento/{Page => Theme}/view/frontend/html/notices.phtml (96%) rename app/code/Magento/{Page => Theme}/view/frontend/html/pager.phtml (98%) rename app/code/Magento/{Page => Theme}/view/frontend/html/title.phtml (97%) rename app/code/Magento/{Page => Theme}/view/frontend/html/topmenu.phtml (92%) rename app/code/Magento/{Page => Theme}/view/frontend/images/validation_advice_bg.gif (100%) rename app/code/Magento/{Page => Theme}/view/frontend/js/calendar.phtml (98%) rename app/code/Magento/{Page => Theme}/view/frontend/js/components.phtml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/js/cookie.phtml (97%) rename app/code/Magento/{Page => Theme}/view/frontend/js/notices.js (100%) rename app/code/Magento/{Page => Theme}/view/frontend/js/row-builder.js (100%) rename app/code/Magento/{Page => Theme}/view/frontend/js/truncate.js (100%) rename app/code/Magento/{Page => Theme}/view/frontend/layout/default.xml (68%) rename app/code/Magento/{Page => Theme}/view/frontend/layout/default_head_blocks.xml (69%) rename app/code/Magento/{Page => Theme}/view/frontend/layout/page_calendar.xml (81%) rename app/code/Magento/{Page => Theme}/view/frontend/layout/page_empty.xml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/layout/page_one_column.xml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/layout/page_three_columns.xml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/layout/page_two_columns_left.xml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/layout/page_two_columns_right.xml (100%) rename app/code/Magento/{Page => Theme}/view/frontend/layout/print.xml (85%) rename app/code/Magento/{Page => Theme}/view/frontend/link.phtml (96%) rename app/code/Magento/{Page => Theme}/view/frontend/menu.js (100%) rename app/code/Magento/{Page => Theme}/view/frontend/page.phtml (98%) rename app/code/Magento/{Page => Theme}/view/frontend/popup.phtml (97%) rename app/code/Magento/{Page => Theme}/view/frontend/print.phtml (98%) rename app/code/Magento/{Page => Theme}/view/install/favicon.ico (100%) create mode 100644 app/code/Magento/User/sql/user_setup/upgrade-1.6.1.4-1.6.1.5.php create mode 100644 app/code/Magento/Webapi/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webapi.php create mode 100644 app/code/Magento/Webapi/Block/Adminhtml/Integration/Edit/Tab/Webapi.php create mode 100644 app/code/Magento/Webapi/Model/Cache/TypeIntegration.php rename app/code/Magento/{Integration/Model/Config/Api => Webapi/Model/Config/Integration}/Converter.php (86%) rename app/code/Magento/{Integration/Model/Config/Api => Webapi/Model/Config/Integration}/Reader.php (77%) rename app/code/Magento/{Integration/Model/Config/Api => Webapi/Model/Config/Integration}/SchemaLocator.php (95%) create mode 100644 app/code/Magento/Webapi/Model/IntegrationConfig.php create mode 100644 app/code/Magento/Webapi/Model/Plugin/Setup.php create mode 100644 app/code/Magento/Webapi/etc/frontend/di.xml rename app/code/Magento/{Integration => Webapi}/etc/integration/api.xsd (94%) create mode 100644 app/code/Magento/Webapi/view/adminhtml/integration/activate/permissions/tab/webapi.phtml create mode 100644 app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_activate_permissions_webapi.xml create mode 100644 app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml create mode 100644 app/code/Magento/Webapi/view/adminhtml/resourcetree.phtml create mode 100644 app/code/Magento/Webhook/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webhook.php create mode 100644 app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_integration_activate_permissions_webhook.xml rename app/design/frontend/magento_plushe/{Magento_Page => Magento_Theme}/layout/default.xml (80%) create mode 100644 dev/tests/integration/testsuite/Magento/App/FrontController/Plugin/InstallTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Authz/Service/AuthorizationV1Test.php rename app/code/Magento/Backend/Model/Cookie.php => dev/tests/integration/testsuite/Magento/Authz/Service/AuthorizationV1Test/UserLocatorStub.php (73%) rename dev/tests/integration/testsuite/Magento/Core/Model/Session/{AbstractTest.php => AbstractSessionTest.php} (63%) create mode 100644 dev/tests/integration/testsuite/Magento/Core/Model/Session/ConfigTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Core/Model/Session/SidResolverTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Integration/Model/Config/ReaderTest.php rename app/code/Magento/Page/Block/Template/Container.php => dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integration.php (69%) create mode 100644 dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integrationA.xml create mode 100644 dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integrationB.xml delete mode 100644 dev/tests/integration/testsuite/Magento/Page/_files/robots.txt create mode 100644 dev/tests/integration/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotalsTest.php rename dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/{PageConfigFilesTest.php => ThemeConfigFilesTest.php} (89%) rename dev/tests/integration/testsuite/Magento/{Page => Theme}/Block/Html/BreadcrumbsTest.php (93%) rename dev/tests/integration/testsuite/Magento/{Page => Theme}/Block/Html/FooterTest.php (93%) rename dev/tests/integration/testsuite/Magento/{Page => Theme}/Block/Html/HeadTest.php (90%) rename dev/tests/integration/testsuite/Magento/{Page => Theme}/Block/HtmlTest.php (93%) rename dev/tests/integration/testsuite/Magento/{Page/Model => Theme/Model/Layout}/Config/ReaderTest.php (94%) rename dev/tests/integration/testsuite/Magento/{Page/Model => Theme/Model/Layout}/ConfigTest.php (87%) rename dev/tests/integration/testsuite/Magento/{Page/Model => Theme/Model/Layout}/_files/page_layouts.xml (96%) rename dev/tests/integration/testsuite/Magento/{Page/Model => Theme/Model/Layout}/_files/page_layouts2.xml (96%) rename dev/tests/integration/testsuite/Magento/{Core/Model/Page => View}/Asset/MergedTest.php (93%) rename dev/tests/integration/testsuite/Magento/View/{Block => Element}/AbstractBlockTest.php (82%) rename dev/tests/integration/testsuite/Magento/View/{Block => Element}/TemplateTest.php (86%) rename dev/tests/integration/testsuite/Magento/View/{Block => Element}/Text/ListTest.php (78%) rename dev/tests/integration/testsuite/Magento/View/{Block => Element}/TextTest.php (93%) rename dev/tests/integration/testsuite/Magento/View/{Block => Element}/_files/frontend/magento_plushe/css/wrong.css (100%) create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/adminhtml/vendor_test/theme.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/area_two/vendor_theme_one/file create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/area_two/vendor_theme_one/theme.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/design_area/vendor_theme_one/file create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/design_area/vendor_theme_one/theme.xml rename app/code/Magento/Page/Helper/Data.php => dev/tests/integration/testsuite/Magento/View/_files/design/frontend/access_violation.php (86%) create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/magento_default/theme.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/magento_default_iphone/theme.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_cache_test_theme/layout_test_handle.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_cache_test_theme/theme.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view_type_default.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view_type_simple.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/theme_file.txt create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/theme_file_with_2_dots..txt rename app/code/Magento/Page/view/frontend/links.phtml => dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/theme_template.phtml (73%) create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Cms/layout_test_handle_extra.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/layout_test_handle_main.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/layout_test_handle_sample.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/test.phtml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Namespace_Module/favicon.ico rename app/code/Magento/Page/view/frontend/template/container.phtml => dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/css/styles.css (81%) create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/i18n/en_US.csv create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/i18n/fr_FR/logo.gif create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/images/logo.gif create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/images/logo_email.gif create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/js/tabs.js create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/theme.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/view.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/images/rectangle.gif create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/images/square.gif rename app/code/Magento/Page/view/frontend/redirect.phtml => dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/style.css (69%) create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/sub.css create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/theme.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_test_theme/layout_test_handle.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_test_theme/theme.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_custom_theme/Fixture_Module/fixture_script.js create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_custom_theme/theme.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/Namespace_Module/absolute_valid_module.gif rename app/code/Magento/Page/Block/Js/Translate.php => dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/access_violation.php (75%) create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/1.gif create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/base64.css create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/body.gif create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/deep/recursive.css create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/exception.css rename app/code/Magento/Page/view/frontend/template/linksblock.phtml => dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/file.css (59%) create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/h1.gif create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/images/h2.gif create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive.css create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive.gif create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive2.gif create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/scripts.js create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/theme.xml create mode 100644 dev/tests/integration/testsuite/Magento/View/_files/design/themes.php create mode 100644 dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/ReaderTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/api.php create mode 100644 dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/apiA.xml create mode 100644 dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/apiB.xml create mode 100644 dev/tests/integration/testsuite/Magento/Webapi/Model/Config/ReaderTest.php create mode 100644 dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapi.php create mode 100644 dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiA.xml create mode 100644 dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiB.xml rename dev/tests/static/testsuite/Magento/Test/Integrity/Magento/{Page => Theme}/Config/ReferentialTest.php (98%) rename dev/tests/static/testsuite/Magento/Test/Integrity/Magento/{Page => Theme}/ConfigTest.php (95%) rename dev/tests/static/testsuite/Magento/Test/Integrity/Magento/{Page => Theme}/_files/invalid_page_layouts.xml (95%) rename dev/tests/static/testsuite/Magento/Test/Integrity/Magento/{Page => Theme}/_files/invalid_page_layouts_partial.xml (100%) rename dev/tests/static/testsuite/Magento/Test/Integrity/Magento/{Page => Theme}/_files/valid_page_layouts.xml (95%) rename dev/tests/static/testsuite/Magento/Test/Integrity/Magento/{Page => Theme}/_files/valid_page_layouts_partial.xml (96%) create mode 100644 dev/tests/unit/testsuite/Magento/Authz/Model/UserIdentifierTest.php delete mode 100644 dev/tests/unit/testsuite/Magento/Backend/Model/CookieTest.php rename dev/tests/unit/testsuite/Magento/{Page => Core}/Block/SwitchTest.php (93%) create mode 100644 dev/tests/unit/testsuite/Magento/Core/Model/Session/ConfigTest.php delete mode 100644 dev/tests/unit/testsuite/Magento/Integration/Model/Integration/Source/AuthenticationTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Integration/Model/ManagerTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotalsTest.php create mode 100644 dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidatorTest.php rename dev/tests/unit/testsuite/Magento/{Page => Theme}/Block/Html/HeadTest.php (77%) rename dev/tests/unit/testsuite/Magento/{Page => Theme}/Block/Html/HeaderTest.php (92%) rename dev/tests/unit/testsuite/Magento/{Page => Theme}/Block/Html/_files/logo/default/image.gif (100%) rename dev/tests/unit/testsuite/Magento/{Page/Model => Theme/Model/Layout}/Config/ConverterTest.php (89%) rename dev/tests/unit/testsuite/Magento/{Page/Model => Theme/Model/Layout}/Config/_files/page_layouts.xml (96%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Page => View}/Asset/CollectionTest.php (80%) rename dev/tests/unit/testsuite/Magento/{Page/Model => View}/Asset/GroupedCollectionTest.php (78%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Page => View}/Asset/MergeServiceTest.php (62%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Page => View}/Asset/MergeStrategy/ChecksumTest.php (94%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Page => View}/Asset/MergeStrategy/DirectTest.php (94%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Page => View}/Asset/MergeStrategy/FileExistsTest.php (89%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Page => View}/Asset/MergedTest.php (84%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Page => View}/Asset/MinifiedTest.php (92%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Page => View}/Asset/MinifyServiceTest.php (69%) rename dev/tests/unit/testsuite/Magento/{Page/Model => View}/Asset/PropertyGroupTest.php (83%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Page => View}/Asset/PublicFileTest.php (90%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Page => View}/Asset/RemoteTest.php (87%) rename dev/tests/unit/testsuite/Magento/{Core/Model/Page => View}/Asset/ViewFileTest.php (89%) rename dev/tests/unit/testsuite/Magento/View/{Block => Element}/AbstractBlockTest.php (87%) rename dev/tests/unit/testsuite/Magento/{Page/Block => View/Element/Html}/Link/CurrentTest.php (86%) rename dev/tests/unit/testsuite/Magento/{Page/Block => View/Element/Html}/LinksTest.php (81%) rename dev/tests/unit/testsuite/Magento/View/{Block => Element}/TemplateTest.php (96%) rename dev/tests/unit/testsuite/Magento/{Integration/Model/Config/Api => Webapi/Model/Config/Integration}/ConverterTest.php (93%) rename dev/tests/unit/testsuite/Magento/{Integration/Model/Config/Api => Webapi/Model/Config/Integration}/XsdTest.php (88%) rename dev/tests/unit/testsuite/Magento/{Integration/Model/Config/Api => Webapi/Model/Config/Integration}/_files/api.php (89%) rename dev/tests/unit/testsuite/Magento/{Integration/Model/Config/Api => Webapi/Model/Config/Integration}/_files/api.xml (87%) create mode 100644 dev/tests/unit/testsuite/Magento/Webapi/Model/Plugin/SetupTest.php create mode 100644 lib/Magento/Data/Form/FormKey.php create mode 100644 lib/Magento/Json/Decoder.php create mode 100644 lib/Magento/Json/DecoderInterface.php rename app/code/Magento/Page/Block/Links.php => lib/Magento/Json/Encoder.php (62%) create mode 100644 lib/Magento/Json/EncoderInterface.php rename app/code/Magento/Page/Helper/Html.php => lib/Magento/Session/Config/ConfigInterface.php (82%) rename app/code/Magento/Core/Model/Page.php => lib/Magento/Session/SidResolverInterface.php (63%) create mode 100644 lib/Magento/Stdlib/Cookie.php rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/AssetInterface.php (92%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/Collection.php (73%) create mode 100644 lib/Magento/View/Asset/ConfigInterface.php rename {app/code/Magento/Page/Model => lib/Magento/View}/Asset/GroupedCollection.php (61%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/LocalInterface.php (90%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/MergeService.php (58%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/MergeStrategy/Checksum.php (64%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/MergeStrategy/Direct.php (78%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/MergeStrategy/FileExists.php (68%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/MergeStrategyInterface.php (97%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/MergeableInterface.php (84%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/Merged.php (57%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/Minified.php (58%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/MinifyService.php (60%) rename {app/code/Magento/Page/Model => lib/Magento/View}/Asset/PropertyGroup.php (80%) rename app/code/Magento/Page/Block/Html/Welcome.php => lib/Magento/View/Asset/PropertyGroupFactory.php (61%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/PublicFile.php (76%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/Remote.php (79%) rename {app/code/Magento/Core/Model/Page => lib/Magento/View}/Asset/ViewFile.php (77%) rename lib/Magento/View/{Block => Element}/AbstractBlock.php (83%) rename lib/Magento/View/{Block => Element}/Context.php (94%) rename lib/Magento/View/{Block => Element}/Html/Calendar.php (65%) rename lib/Magento/View/{Block => Element}/Html/Date.php (96%) rename lib/Magento/View/{Block => Element}/Html/Link.php (86%) rename {app/code/Magento/Page/Block => lib/Magento/View/Element/Html}/Link/Current.php (71%) create mode 100644 lib/Magento/View/Element/Html/Links.php rename lib/Magento/View/{Block => Element}/Html/Select.php (98%) rename {app/code/Magento/Page/Block => lib/Magento/View/Element}/Js/Components.php (81%) rename {app/code/Magento/Page/Block => lib/Magento/View/Element}/Js/Cookie.php (62%) rename lib/Magento/View/{Block => Element}/Messages.php (92%) rename {app/code/Magento/Page/Block => lib/Magento/View/Element}/Redirect.php (54%) rename lib/Magento/View/{Block => Element}/Template.php (94%) rename lib/Magento/View/{Block => Element}/Template/Context.php (95%) rename lib/Magento/View/{Block => Element}/Text.php (95%) rename lib/Magento/View/{Block => Element}/Text/ListText.php (91%) rename lib/Magento/View/{Block => Element}/Text/TextList/Item.php (93%) rename lib/Magento/View/{Block => Element}/Text/TextList/Link.php (95%) create mode 100644 lib/Zend/Session/Config/ConfigInterface.php diff --git a/CHANGELOG.md b/CHANGELOG.md index c440cb6de5b..1c8730a6634 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,17 @@ +2.0.0.0-dev55 +============= +* Modularity improvements: + * Session configuration moved to library + * FormKey logic was moved from Session + * SessionIdFlags from Session was removed + * Move Page logic to the Theme module and library +* Created integration module UX +* Created authorization service (Magento_Authz module) +* Fixed bugs: + * Fixed the issue that prevented a customer group's shopping cart rules from applying properly to prices. The issue occurred when a customer was manually assigned to a customer group and automatic group assignment was enabled. + * Fixed the bug with schema upgrade scripts not running after installation + * Fixed the error with a blank page when user tries to get access to a restricted resource via URL (add Secret Key for URL set to "No") + 2.0.0.0-dev54 ============= * Modularity improvements: diff --git a/app/code/Magento/AdminNotification/Block/System/Messages.php b/app/code/Magento/AdminNotification/Block/System/Messages.php index ce984ccf278..c856cf0f7b2 100644 --- a/app/code/Magento/AdminNotification/Block/System/Messages.php +++ b/app/code/Magento/AdminNotification/Block/System/Messages.php @@ -32,19 +32,17 @@ class Messages extends \Magento\Backend\Block\Template */ protected $_messages; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages, + array $data = array() + ) { + parent::__construct($context, $data); $this->_messages = $messages; } diff --git a/app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php b/app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php index 95635f6103c..977079f27a7 100644 --- a/app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php +++ b/app/code/Magento/AdminNotification/Block/System/Messages/UnreadMessagePopup.php @@ -42,19 +42,17 @@ class UnreadMessagePopup extends \Magento\Backend\Block\Template */ protected $_messages; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\AdminNotification\Model\Resource\System\Message\Collection\Synchronized $messages, + array $data = array() + ) { + parent::__construct($context, $data); $this->_messages = $messages; } diff --git a/app/code/Magento/AdminNotification/Block/ToolbarEntry.php b/app/code/Magento/AdminNotification/Block/ToolbarEntry.php index 3ad43a59117..71bdb06d6b8 100644 --- a/app/code/Magento/AdminNotification/Block/ToolbarEntry.php +++ b/app/code/Magento/AdminNotification/Block/ToolbarEntry.php @@ -42,19 +42,17 @@ class ToolbarEntry extends \Magento\Backend\Block\Template */ protected $_notificationList; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\AdminNotification\Model\Resource\Inbox\Collection\Unread $notificationList, + array $data = array() + ) { + parent::__construct($context, $data); $this->_notificationList = $notificationList; } diff --git a/app/code/Magento/AdminNotification/Block/Window.php b/app/code/Magento/AdminNotification/Block/Window.php index a2116a9fb02..fdf6faaaddd 100644 --- a/app/code/Magento/AdminNotification/Block/Window.php +++ b/app/code/Magento/AdminNotification/Block/Window.php @@ -60,21 +60,19 @@ class Window extends \Magento\Backend\Block\Template */ protected $_latestItem; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\AdminNotification\Model\Resource\Inbox\Collection\Critical $criticalCollection, + array $data = array() + ) { + parent::__construct($context, $data); $this->_authSession = $authSession; $this->_criticalCollection = $criticalCollection; } diff --git a/app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php b/app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php index 6ca88914496..64d24124c63 100644 --- a/app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php +++ b/app/code/Magento/AdminNotification/Model/Resource/System/Message/Collection.php @@ -42,23 +42,25 @@ class Collection protected $_countBySeverity = array(); /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\AdminNotification\Model\System\MessageList $messageList + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\AdminNotification\Model\System\MessageList $messageList, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_messageList = $messageList; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/AdminNotification/etc/module.xml b/app/code/Magento/AdminNotification/etc/module.xml index 8181e408161..8548afe579f 100755 --- a/app/code/Magento/AdminNotification/etc/module.xml +++ b/app/code/Magento/AdminNotification/etc/module.xml @@ -33,7 +33,7 @@ <module name="Magento_Core"/> <module name="Magento_Adminhtml"/> <module name="Magento_Backend"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml index 76cb3bd7b0c..6e753a4ffcf 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml +++ b/app/code/Magento/AdminNotification/view/adminhtml/layout/default.xml @@ -31,7 +31,7 @@ <block class="Magento\AdminNotification\Block\Window" name="notification_window" as="notification_window" acl="Magento_AdminNotification::show_toolbar" template="notification/window.phtml"/> </container> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminnotification-system-notification-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminnotification-system-notification-js"> <arguments> <argument name="file" xsi:type="string">Magento_AdminNotification::system/notification.js</argument> </arguments> @@ -42,12 +42,12 @@ <block class="Magento\AdminNotification\Block\ToolbarEntry" template="toolbar_entry.phtml" before="-"/> </referenceBlock> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> <arguments> <argument name="file" xsi:type="string">Magento_Core::prototype/magento.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminnotification-toolbar-entry-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminnotification-toolbar-entry-js"> <arguments> <argument name="file" xsi:type="string">Magento_AdminNotification::toolbar_entry.js</argument> </arguments> diff --git a/app/code/Magento/AdminNotification/view/adminhtml/notification/window.phtml b/app/code/Magento/AdminNotification/view/adminhtml/notification/window.phtml index affd5c6e266..d2f8102695e 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/notification/window.phtml +++ b/app/code/Magento/AdminNotification/view/adminhtml/notification/window.phtml @@ -39,7 +39,7 @@ <span><?php echo $this->getSeverityText();?></span> <p class="message-text"><?php echo $this->getNoticeMessageText(); ?></p> - <a href="<?php echo $this->getNoticeMessageUrl(); ?>" class="action-more"><?php echo $this->getReadDetailsText(); ?></a> + <a href="<?php echo $this->getNoticeMessageUrl(); ?>"><?php echo $this->getReadDetailsText(); ?></a> </div> <span class="close" data-dismiss="popup" title="<?php echo __('Close popup'); ?>"><?php echo __('Close'); ?></span> </div> diff --git a/app/code/Magento/AdminNotification/view/adminhtml/system/messages/popup.phtml b/app/code/Magento/AdminNotification/view/adminhtml/system/messages/popup.phtml index fe123bac700..5d170ced6d0 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/system/messages/popup.phtml +++ b/app/code/Magento/AdminNotification/view/adminhtml/system/messages/popup.phtml @@ -34,10 +34,19 @@ </div> <script type="text/javascript"> jQuery(function() { - jQuery( "#system_messages_list" ).dialog({ + jQuery("#system_messages_list").dialog({ autoOpen: true, resizable: false, - width: 650 + width: 650, + position: { + using: function(pos) { + jQuery(this).css({ + "position": "absolute", + "top": Math.ceil(jQuery(window).height()/2 - jQuery(this).height()/2), + "left": pos.left + }); + } + } }); }); </script> diff --git a/app/code/Magento/AdminNotification/view/adminhtml/toolbar_entry.js b/app/code/Magento/AdminNotification/view/adminhtml/toolbar_entry.js index adf3c25e676..4396ec907ac 100644 --- a/app/code/Magento/AdminNotification/view/adminhtml/toolbar_entry.js +++ b/app/code/Magento/AdminNotification/view/adminhtml/toolbar_entry.js @@ -39,11 +39,10 @@ showLoader: false }); }; - + var notificationCount = $('.notifications').attr('data-notification-count'); // Remove notification from the list var removeNotificationFromList = function(notificationEntry) { notificationEntry.remove(); - var notificationCount = $('.notifications').attr('data-notification-count'); notificationCount--; $('.notifications').attr('data-notification-count', notificationCount); @@ -54,6 +53,7 @@ notificationIcon.removeAttr('data-toggle'); notificationIcon.off('click.dropdown'); $('.notifications .notifications-icon .value').text(''); + $('.notifications .notifications-icon .value').hide(); } else { $('.notifications .notifications-icon .value').text(notificationCount); // Modify caption of the 'See All' link @@ -114,5 +114,12 @@ removeNotificationFromList(notificationEntry); event.stopPropagation(); }); + + // Hide notifications bubble + if (notificationCount == 0) { + $('.notifications .notifications-icon .value').hide(); + } else { + $('.notifications .notifications-icon .value').show(); + } }); })(window.jQuery); diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite.php b/app/code/Magento/Adminhtml/Block/Urlrewrite.php index cc6745ab129..d0368dadf97 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite.php @@ -50,20 +50,18 @@ class Urlrewrite extends \Magento\Adminhtml\Block\Widget\Grid\Container */ protected $_urlrewriteSelector; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Block\Urlrewrite\Selector $urlrewriteSelector, + array $data = array() + ) { $this->_urlrewriteSelector = $urlrewriteSelector; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php index 5d36e90c52d..d3847e57d1b 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Edit.php @@ -45,24 +45,22 @@ class Edit */ protected $_categoryFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory - * @param \Magento\Backend\Helper\Data $adminhtmlData - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory + * @param \Magento\Backend\Helper\Data $adminhtmlData + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, - \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, + \Magento\Backend\Helper\Data $adminhtmlData, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + array $data = array() + ) { $this->_categoryFactory = $categoryFactory; - parent::__construct($context, $coreData, $rewriteFactory, $adminhtmlData, $data); + parent::__construct($context, $rewriteFactory, $adminhtmlData, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php index 385ae7a4063..3d2ed64f2d1 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Category/Tree.php @@ -61,30 +61,36 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory */ protected $_productFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Backend\Helper\Data $adminhtmlData - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param \Magento\Backend\Helper\Data $adminhtmlData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, - \Magento\Core\Model\Registry $registry, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Backend\Helper\Data $adminhtmlData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, + \Magento\Core\Model\Registry $registry, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + \Magento\Backend\Helper\Data $adminhtmlData, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_categoryFactory = $categoryFactory; $this->_productFactory = $productFactory; $this->_adminhtmlData = $adminhtmlData; - parent::__construct($context, $coreData, $categoryTree, $registry, $data); + parent::__construct($context, $categoryTree, $registry, $data); } /** @@ -118,7 +124,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory } if ($asJson) { - return $this->_coreData->jsonEncode($result); + return $this->_jsonEncoder->encode($result); } $this->_allowedCategoryIds = null; diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php index bfa806ad3af..4bc9bb0d6d3 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Edit/Form.php @@ -62,7 +62,6 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory @@ -79,7 +78,6 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory, @@ -97,7 +95,6 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form $this->_catalogUrl = $catalogUrl; parent::__construct( $context, - $coreData, $registry, $formFactory, $typesFactory, diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php index da37c7a96d3..f43d6f80a11 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Catalog/Product/Edit.php @@ -52,27 +52,25 @@ class Edit extends \Magento\Adminhtml\Block\Urlrewrite\Edit */ protected $_categoryFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory - * @param \Magento\Backend\Helper\Data $adminhtmlData - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory + * @param \Magento\Backend\Helper\Data $adminhtmlData + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, - \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, + \Magento\Backend\Helper\Data $adminhtmlData, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + array $data = array() + ) { $this->_categoryFactory = $categoryFactory; $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $rewriteFactory, $adminhtmlData, $data); + parent::__construct($context, $rewriteFactory, $adminhtmlData, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php index be91545f67a..5c813ae2fcb 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit.php @@ -43,24 +43,22 @@ class Edit extends \Magento\Adminhtml\Block\Urlrewrite\Edit */ protected $_pageFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory - * @param \Magento\Backend\Helper\Data $adminhtmlData - * @param \Magento\Cms\Model\PageFactory $pageFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory + * @param \Magento\Backend\Helper\Data $adminhtmlData + * @param \Magento\Cms\Model\PageFactory $pageFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, - \Magento\Backend\Helper\Data $adminhtmlData, - \Magento\Cms\Model\PageFactory $pageFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, + \Magento\Backend\Helper\Data $adminhtmlData, + \Magento\Cms\Model\PageFactory $pageFactory, + array $data = array() + ) { $this->_pageFactory = $pageFactory; - parent::__construct($context, $coreData, $rewriteFactory, $adminhtmlData, $data); + parent::__construct($context, $rewriteFactory, $adminhtmlData, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php index b066a100577..3b1ffc4dfc5 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Cms/Page/Edit/Form.php @@ -55,7 +55,6 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory @@ -71,7 +70,6 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory, @@ -87,7 +85,6 @@ class Form extends \Magento\Adminhtml\Block\Urlrewrite\Edit\Form $this->_pageFactory = $pageFactory; parent::__construct( $context, - $coreData, $registry, $formFactory, $typesFactory, diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit.php index 62f85dd7de9..a412712b577 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit.php @@ -69,23 +69,21 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Container */ protected $_rewriteFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory - * @param \Magento\Backend\Helper\Data $adminhtmlData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url\RewriteFactory $rewriteFactory + * @param \Magento\Backend\Helper\Data $adminhtmlData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, - \Magento\Backend\Helper\Data $adminhtmlData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url\RewriteFactory $rewriteFactory, + \Magento\Backend\Helper\Data $adminhtmlData, + array $data = array() + ) { $this->_rewriteFactory = $rewriteFactory; $this->_adminhtmlData = $adminhtmlData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php index 640a40be19d..2769b31300a 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Edit/Form.php @@ -91,7 +91,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory @@ -105,7 +104,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Source\Urlrewrite\TypesFactory $typesFactory, @@ -120,7 +118,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic $this->_rewriteFactory = $rewriteFactory; $this->_systemStore = $systemStore; $this->_adminhtmlData = $adminhtmlData; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Link.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Link.php index b9e48dc84ac..333ffdfdd05 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Link.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Link.php @@ -37,7 +37,7 @@ */ namespace Magento\Adminhtml\Block\Urlrewrite; -class Link extends \Magento\View\Block\AbstractBlock +class Link extends \Magento\View\Element\AbstractBlock { /** * Render output diff --git a/app/code/Magento/Adminhtml/Block/Urlrewrite/Selector.php b/app/code/Magento/Adminhtml/Block/Urlrewrite/Selector.php index f9c3d255767..648f5d328e2 100644 --- a/app/code/Magento/Adminhtml/Block/Urlrewrite/Selector.php +++ b/app/code/Magento/Adminhtml/Block/Urlrewrite/Selector.php @@ -33,7 +33,7 @@ */ namespace Magento\Adminhtml\Block\Urlrewrite; -class Selector extends \Magento\View\Block\Template +class Selector extends \Magento\View\Element\Template { /** * List of available modes from source model diff --git a/app/code/Magento/Adminhtml/Model/Session/Quote.php b/app/code/Magento/Adminhtml/Model/Session/Quote.php index dc13f7485e3..9676de45bb8 100644 --- a/app/code/Magento/Adminhtml/Model/Session/Quote.php +++ b/app/code/Magento/Adminhtml/Model/Session/Quote.php @@ -78,6 +78,8 @@ class Quote extends \Magento\Core\Model\Session\AbstractSession /** * @param \Magento\Core\Model\Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Sales\Model\OrderFactory $orderFactory @@ -85,6 +87,8 @@ class Quote extends \Magento\Core\Model\Session\AbstractSession */ public function __construct( \Magento\Core\Model\Session\Context $context, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Sales\Model\OrderFactory $orderFactory, @@ -93,8 +97,8 @@ class Quote extends \Magento\Core\Model\Session\AbstractSession $this->_quoteFactory = $quoteFactory; $this->_customerFactory = $customerFactory; $this->_orderFactory = $orderFactory; - parent::__construct($context, $data); - $this->init('adminhtml_quote'); + parent::__construct($context, $sidResolver, $sessionConfig, $data); + $this->start('adminhtml_quote'); if ($this->_storeManager->hasSingleStore()) { $this->setStoreId($this->_storeManager->getStore(true)->getId()); } diff --git a/app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/categories.phtml b/app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/categories.phtml index 0939172917c..58e3f4248e1 100644 --- a/app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/categories.phtml +++ b/app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/categories.phtml @@ -23,7 +23,7 @@ */ /** @var $this \Magento\Adminhtml\Block\Urlrewrite\Catalog\Category\Tree */ ?> -<fieldset class="fieldset"> +<fieldset class="fieldset" data-ui-id="category-selector"> <legend class="legend"><span><?php echo __('Select Category') ?></span></legend> <div class="content" style="clear: both;"> <input type="hidden" name="categories" id="product_categories" value="" /> diff --git a/app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/selector.phtml b/app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/selector.phtml index 95e2cc91ba3..26f397b91dc 100644 --- a/app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/selector.phtml +++ b/app/code/Magento/Adminhtml/view/adminhtml/urlrewrite/selector.phtml @@ -31,7 +31,7 @@ */ ?> <div class="form-inline"> - <fieldset class="fieldset"> + <fieldset class="fieldset" data-ui-id="urlrewrite-type-selector"> <div class="field field-url-rewrite-option-select"> <label for="url-rewrite-option-select" class="label"><?php echo $this->getSelectorLabel() ?></label> <div class="control"> diff --git a/app/code/Magento/Authorizenet/Block/Directpost/Form.php b/app/code/Magento/Authorizenet/Block/Directpost/Form.php index 3c327bcd36e..a7c619f98ca 100644 --- a/app/code/Magento/Authorizenet/Block/Directpost/Form.php +++ b/app/code/Magento/Authorizenet/Block/Directpost/Form.php @@ -48,22 +48,20 @@ class Form extends \Magento\Payment\Block\Form\Cc protected $_checkoutModel; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Payment\Model\Config $paymentConfig * @param \Magento\Authorizenet\Model\Directpost $model * @param \Magento\Checkout\Model\Type\Onepage $checkoutModel * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Payment\Model\Config $paymentConfig, \Magento\Authorizenet\Model\Directpost $model, \Magento\Checkout\Model\Type\Onepage $checkoutModel, array $data = array() ) { - parent::__construct($context, $coreData, $paymentConfig, $data); + parent::__construct($context, $paymentConfig, $data); $this->_model = $model; $this->_checkoutModel = $checkoutModel; } diff --git a/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php b/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php index b5e66559d38..77dbcf0d00e 100644 --- a/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php +++ b/app/code/Magento/Authorizenet/Block/Directpost/Iframe.php @@ -33,7 +33,7 @@ */ namespace Magento\Authorizenet\Block\Directpost; -class Iframe extends \Magento\View\Block\Template +class Iframe extends \Magento\View\Element\Template { /** * Core registry @@ -43,19 +43,17 @@ class Iframe extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -63,7 +61,7 @@ class Iframe extends \Magento\View\Block\Template * * You can redefine this method in child classes for changing layout * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php index 668acee53e7..f9a951dd5bb 100644 --- a/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php +++ b/app/code/Magento/Authorizenet/Controller/Adminhtml/Authorizenet/Directpost/Payment.php @@ -204,9 +204,9 @@ class Payment } } //clear sessions - $this->_getSession()->clear(); + $this->_getSession()->clearStorage(); $this->_getDirectPostSession()->removeCheckoutOrderIncrementId($redirectParams['x_invoice_num']); - $this->_objectManager->get('Magento\Adminhtml\Model\Session')->clear(); + $this->_objectManager->get('Magento\Adminhtml\Model\Session')->clearStorage(); $this->_objectManager->get('Magento\Adminhtml\Model\Session')->addSuccess(__('You created the order.')); } diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Observer.php b/app/code/Magento/Authorizenet/Model/Directpost/Observer.php index bf71c6b3229..97b801df366 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost/Observer.php +++ b/app/code/Magento/Authorizenet/Model/Directpost/Observer.php @@ -126,7 +126,7 @@ class Observer if ($payment && $payment->getMethod() == $this->_modelFactory->create()->getCode()) { $request = $observer->getEvent()->getRequest(); $response = $observer->getEvent()->getResponse(); - $result = $this->_coreData->jsonDecode($response->getBody('default'), \Zend_Json::TYPE_ARRAY); + $result = $this->_coreData->jsonDecode($response->getBody('default')); if (empty($result['error'])) { $payment = $order->getPayment(); diff --git a/app/code/Magento/Authorizenet/Model/Directpost/Session.php b/app/code/Magento/Authorizenet/Model/Directpost/Session.php index 157f3013289..778a9f40922 100644 --- a/app/code/Magento/Authorizenet/Model/Directpost/Session.php +++ b/app/code/Magento/Authorizenet/Model/Directpost/Session.php @@ -37,16 +37,20 @@ class Session extends \Magento\Core\Model\Session\AbstractSession { /** * @param \Magento\Core\Model\Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param array $data * @param string|null $sessionName */ public function __construct( \Magento\Core\Model\Session\Context $context, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, array $data = array(), $sessionName = null ) { - parent::__construct($context, $data); - $this->init('authorizenet_directpost', $sessionName); + parent::__construct($context, $sidResolver, $sessionConfig, $data); + $this->start('authorizenet_directpost', $sessionName); } /** diff --git a/app/code/Magento/Authorizenet/etc/module.xml b/app/code/Magento/Authorizenet/etc/module.xml index 2258e1dbfd3..efba0d75d9c 100755 --- a/app/code/Magento/Authorizenet/etc/module.xml +++ b/app/code/Magento/Authorizenet/etc/module.xml @@ -38,7 +38,7 @@ <module name="Magento_Backend"/> <module name="Magento_Core"/> <module name="Magento_Payment"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> <module name="Magento_Centinel"/> </depends> </module> diff --git a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml index ffd10813b78..6ea4c18e07e 100644 --- a/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Authorizenet/view/adminhtml/layout/sales_order_create_index.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-directpost-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-directpost-js"> <arguments> <argument name="file" xsi:type="string">mage/directpost.js</argument> </arguments> diff --git a/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_index.xml index 213ec8a08a1..fe7f6655719 100644 --- a/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Authorizenet/view/frontend/layout/checkout_onepage_index.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-centinel-centinel-authenticate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-centinel-centinel-authenticate-js"> <arguments> <argument name="file" xsi:type="string">Magento_Authorizenet::js/directpost.js</argument> </arguments> diff --git a/app/code/Magento/Authz/Model/UserIdentifier.php b/app/code/Magento/Authz/Model/UserIdentifier.php new file mode 100644 index 00000000000..b26a6ddc580 --- /dev/null +++ b/app/code/Magento/Authz/Model/UserIdentifier.php @@ -0,0 +1,130 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Authz\Model; + +/** + * User identifier class. By user can be understood admin, customer, guest, web API integration. + */ +class UserIdentifier +{ + /**#@+ + * User types. + */ + const USER_TYPE_GUEST = 'Guest'; + const USER_TYPE_CUSTOMER = 'Customer'; + const USER_TYPE_ADMIN = 'Admin'; + const USER_TYPE_INTEGRATION = 'Integration'; + /**#@-*/ + + /** + * User type (admin, customer, guest, web API integration). + * + * @var string + */ + protected $_userType; + + /** @var int */ + protected $_userId; + + /** + * Initialize user type and user id. + * + * @param UserLocatorInterface $userLocator Locator of active user. + * @param string|null $userType + * @param int|null $userId + * @throws \LogicException + */ + public function __construct(UserLocatorInterface $userLocator, $userType = null, $userId = null) + { + $userType = isset($userType) ? $userType : $userLocator->getUserType(); + $userId = isset($userId) ? $userId : $userLocator->getUserId(); + if ($userType == self::USER_TYPE_GUEST && $userId) { + throw new \LogicException('Guest user must not have user ID set.'); + } + $this->_setUserId($userId); + $this->_setUserType($userType); + } + + /** + * Get user ID. Null is possible when user type is 'guest'. + * + * @return int + */ + public function getUserId() + { + return $this->_userId; + } + + /** + * Retrieve user type (admin, customer, guest, web API integration). + * + * @return string + */ + public function getUserType() + { + return $this->_userType; + } + + /** + * Set user ID. + * + * @param int + * @return UserIdentifier + * @throws \LogicException + */ + protected function _setUserId($userId) + { + $userId = is_numeric($userId) ? (int)$userId : $userId; + if (!is_integer($userId) || ($userId < 0)) { + throw new \LogicException("Invalid user ID: '{$userId}'."); + } + $this->_userId = $userId; + return $this; + } + + /** + * Set user type. + * + * @param string $userType + * @return UserIdentifier + * @throws \LogicException + */ + protected function _setUserType($userType) + { + $availableTypes = array( + self::USER_TYPE_GUEST, + self::USER_TYPE_CUSTOMER, + self::USER_TYPE_ADMIN, + self::USER_TYPE_INTEGRATION + ); + if (!in_array($userType, $availableTypes)) { + throw new \LogicException( + "Invalid user type: '{$userType}'. Allowed types: " . implode(", ", $availableTypes) + ); + } + $this->_userType = $userType; + return $this; + } +} diff --git a/dev/tests/integration/testsuite/Magento/Page/Helper/RobotsTest.php b/app/code/Magento/Authz/Model/UserIdentifier/Factory.php similarity index 55% rename from dev/tests/integration/testsuite/Magento/Page/Helper/RobotsTest.php rename to app/code/Magento/Authz/Model/UserIdentifier/Factory.php index 5c916bf7a51..19fcfecc6b1 100644 --- a/dev/tests/integration/testsuite/Magento/Page/Helper/RobotsTest.php +++ b/app/code/Magento/Authz/Model/UserIdentifier/Factory.php @@ -18,39 +18,47 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page - * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Authz\Model\UserIdentifier; + +use Magento\ObjectManager; +use Magento\Authz\Model\UserIdentifier; + /** - * Test class for \Magento\Page\Helper\Robots + * User identifier factory. */ -namespace Magento\Page\Helper; - -class RobotsTest extends \PHPUnit_Framework_TestCase +class Factory { /** - * @var \Magento\Page\Helper\Robots + * @var \Magento\ObjectManager */ - protected $_helper; + protected $_objectManager; - protected function setUp() + /** + * Initialize dependencies + * + * @param ObjectManager $objectManager + */ + public function __construct(ObjectManager $objectManager) { - $this->_helper = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Page\Helper\Robots'); + $this->_objectManager = $objectManager; } /** - * @covers \Magento\Page\Helper\Robots::getRobotsDefaultCustomInstructions + * Create instance of user identifier. + * + * @param string $userType + * @param int $userId + * @return UserIdentifier */ - public function testGetRobotsDefaultCustomInstructions() + public function create($userType, $userId = 0) { - $this->assertStringEqualsFile( - __DIR__ . '/../_files/robots.txt', - $this->_helper->getRobotsDefaultCustomInstructions(), - 'robots.txt default custom instructions are invalid' + return $this->_objectManager->create( + 'Magento\Authz\Model\UserIdentifier', + array('userType' => $userType, 'userId' => $userId) ); } } diff --git a/app/code/Magento/Authz/Model/UserLocator/Admin.php b/app/code/Magento/Authz/Model/UserLocator/Admin.php new file mode 100644 index 00000000000..8cecd7ee730 --- /dev/null +++ b/app/code/Magento/Authz/Model/UserLocator/Admin.php @@ -0,0 +1,64 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Authz\Model\UserLocator; + +use Magento\Authz\Model\UserLocatorInterface; +use Magento\Authz\Model\UserIdentifier; +use Magento\Backend\Model\Auth\Session as AdminSession; + +/** + * Admin user locator. + */ +class Admin implements UserLocatorInterface +{ + /** @var AdminSession */ + protected $_adminSession; + + /** + * Initialize dependencies. + * + * @param AdminSession $adminSession + */ + public function __construct(AdminSession $adminSession) + { + $this->_adminSession = $adminSession; + } + + /** + * {@inheritdoc} + */ + public function getUserId() + { + return $this->_adminSession->hasUser() ? (int)$this->_adminSession->getUser()->getId() : 0; + } + + /** + * {@inheritdoc} + */ + public function getUserType() + { + return UserIdentifier::USER_TYPE_ADMIN; + } +} diff --git a/app/code/Magento/Authz/Model/UserLocator/Guest.php b/app/code/Magento/Authz/Model/UserLocator/Guest.php new file mode 100644 index 00000000000..f27cc69b75b --- /dev/null +++ b/app/code/Magento/Authz/Model/UserLocator/Guest.php @@ -0,0 +1,50 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Authz\Model\UserLocator; + +use Magento\Authz\Model\UserIdentifier; +use Magento\Authz\Model\UserLocatorInterface; + +/** + * Guest user locator. + */ +class Guest implements UserLocatorInterface +{ + /** + * {@inheritdoc} + */ + public function getUserId() + { + return 0; + } + + /** + * {@inheritdoc} + */ + public function getUserType() + { + return UserIdentifier::USER_TYPE_GUEST; + } +} diff --git a/app/code/Magento/Page/Block/Link.php b/app/code/Magento/Authz/Model/UserLocatorInterface.php similarity index 72% rename from app/code/Magento/Page/Block/Link.php rename to app/code/Magento/Authz/Model/UserLocatorInterface.php index 621d1e8b3e0..5b5907260dd 100644 --- a/app/code/Magento/Page/Block/Link.php +++ b/app/code/Magento/Authz/Model/UserLocatorInterface.php @@ -22,25 +22,24 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block; +namespace Magento\Authz\Model; /** - * Block representing link - * - * @method string getLabel() - * @method string getPath() - * @method string getTitle() + * Interface for current user identification. */ -class Link extends \Magento\View\Block\Template +interface UserLocatorInterface { - /** @var string */ - protected $_template = 'Magento_Page::link.phtml'; + /** + * Identify current user ID. + * + * @return int + */ + public function getUserId(); /** + * Retrieve current user type (Admin, Customer, Guest, Integration). + * * @return string */ - public function getHref() - { - return $this->getUrl($this->getPath()); - } + public function getUserType(); } diff --git a/app/code/Magento/Authz/Service/AuthorizationV1.php b/app/code/Magento/Authz/Service/AuthorizationV1.php new file mode 100644 index 00000000000..cce2256d61a --- /dev/null +++ b/app/code/Magento/Authz/Service/AuthorizationV1.php @@ -0,0 +1,254 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Authz\Service; + +use Magento\Acl\Builder as AclBuilder; +use Magento\Acl; +use Magento\Authz\Model\UserIdentifier; +use Magento\Logger; +use Magento\Service\Exception as ServiceException; +use Magento\Service\ResourceNotFoundException; +use Magento\User\Model\Resource\Role\CollectionFactory as RoleCollectionFactory; +use Magento\User\Model\Resource\Rules\CollectionFactory as RulesCollectionFactory; +use Magento\User\Model\Role; +use Magento\User\Model\RoleFactory; +use Magento\User\Model\RulesFactory; +use Magento\Core\Model\Acl\RootResource as RootAclResource; + +/** + * Authorization service. + * + * @SuppressWarnings(PHPMD.LongVariable) + * @SuppressWarnings(PHPMD.CouplingBetweenObjects) + */ +class AuthorizationV1 implements AuthorizationV1Interface +{ + /** @var AclBuilder */ + protected $_aclBuilder; + + /** @var UserIdentifier */ + protected $_userIdentifier; + + /** @var RoleFactory */ + protected $_roleFactory; + + /** @var RoleCollectionFactory */ + protected $_roleCollectionFactory; + + /** @var RulesFactory */ + protected $_rulesFactory; + + /** @var RulesCollectionFactory */ + protected $_rulesCollectionFactory; + + /** @var Logger */ + protected $_logger; + + /** @var RootAclResource */ + protected $_rootAclResource; + + /** + * Initialize dependencies. + * + * @param AclBuilder $aclBuilder + * @param UserIdentifier $userIdentifier + * @param RoleFactory $roleFactory + * @param RoleCollectionFactory $roleCollectionFactory + * @param RulesFactory $rulesFactory + * @param RulesCollectionFactory $rulesCollectionFactory + * @param Logger $logger + * @param RootAclResource $rootAclResource + */ + public function __construct( + AclBuilder $aclBuilder, + UserIdentifier $userIdentifier, + RoleFactory $roleFactory, + RoleCollectionFactory $roleCollectionFactory, + RulesFactory $rulesFactory, + RulesCollectionFactory $rulesCollectionFactory, + Logger $logger, + RootAclResource $rootAclResource + ) { + $this->_aclBuilder = $aclBuilder; + $this->_userIdentifier = $userIdentifier; + $this->_roleFactory = $roleFactory; + $this->_rulesFactory = $rulesFactory; + $this->_rulesCollectionFactory = $rulesCollectionFactory; + $this->_roleCollectionFactory = $roleCollectionFactory; + $this->_logger = $logger; + $this->_rootAclResource = $rootAclResource; + } + + /** + * {@inheritdoc} + */ + public function isAllowed($resources, UserIdentifier $userIdentifier = null) + { + $resources = is_array($resources) ? $resources : array($resources); + $userIdentifier = $userIdentifier ? $userIdentifier : $this->_userIdentifier; + try { + $role = $this->_getUserRole($userIdentifier); + if (!$role) { + throw new ResourceNotFoundException( + __( + 'Role for user with ID "%1" and user type "%2" cannot be found.', + $userIdentifier->getUserId(), + $userIdentifier->getUserType() + ) + ); + } + foreach ($resources as $resource) { + if (!$this->_aclBuilder->getAcl()->isAllowed($role->getId(), $resource)) { + return false; + } + } + return true; + } catch (\Exception $e) { + $this->_logger->logException($e); + return false; + } + } + + /** + * {@inheritdoc} + */ + public function grantPermissions(UserIdentifier $userIdentifier, array $resources) + { + try { + $role = $this->_getUserRole($userIdentifier); + if (!$role) { + $role = $this->_createRole($userIdentifier); + } + $this->_associateResourcesWithRole($role, $resources); + } catch (ServiceException $e) { + throw $e; + } catch (\Exception $e) { + $this->_logger->logException($e); + throw new ServiceException( + __('Error happened while granting permissions. Check exception log for details.') + ); + } + } + + /** + * {@inheritdoc} + */ + public function grantAllPermissions(UserIdentifier $userIdentifier) + { + $this->grantPermissions($userIdentifier, array($this->_rootAclResource->getId())); + } + + /** + * {@inheritdoc} + */ + public function getAllowedResources(UserIdentifier $userIdentifier) + { + $allowedResources = array(); + try { + $role = $this->_getUserRole($userIdentifier); + if (!$role) { + throw new ServiceException(__('The role associated with the specified user cannot be found.')); + } + $rulesCollection = $this->_rulesCollectionFactory->create(); + $rulesCollection->getByRoles($role->getId())->load(); + $acl = $this->_aclBuilder->getAcl(); + /** @var \Magento\User\Model\Rules $ruleItem */ + foreach ($rulesCollection->getItems() as $ruleItem) { + $resourceId = $ruleItem->getResourceId(); + if ($acl->has($resourceId) && $acl->isAllowed($role->getId(), $resourceId)) { + $allowedResources[] = $resourceId; + } + } + } catch (ServiceException $e) { + throw $e; + } catch (\Exception $e) { + $this->_logger->logException($e); + throw new ServiceException( + __('Error happened while getting a list of allowed resources. Check exception log for details.') + ); + } + return $allowedResources; + } + + /** + * Create new ACL role. + * + * @param UserIdentifier $userIdentifier + * @return Role + * @throws \LogicException + */ + protected function _createRole($userIdentifier) + { + $userType = $userIdentifier->getUserType(); + $userId = $userIdentifier->getUserId(); + switch ($userType) { + case UserIdentifier::USER_TYPE_INTEGRATION: + $roleName = $userType . $userId; + $roleType = \Magento\User\Model\Acl\Role\User::ROLE_TYPE; + $parentId = 0; + $userId = $userIdentifier->getUserId(); + break; + default: + throw new \LogicException("Unknown user type: '{$userType}'."); + } + $role = $this->_roleFactory->create(); + $role->setRoleName($roleName) + ->setUserType($userType) + ->setUserId($userId) + ->setRoleType($roleType) + ->setParentId($parentId) + ->save(); + return $role; + } + + /** + * Identify user role from user identifier. + * + * @param UserIdentifier $userIdentifier + * @return Role|false Return false in case when no role associated with provided user was found. + */ + protected function _getUserRole($userIdentifier) + { + $roleCollection = $this->_roleCollectionFactory->create(); + $userType = $userIdentifier->getUserType(); + $userId = $userIdentifier->getUserId(); + /** @var Role $role */ + $role = $roleCollection->setUserFilter($userId, $userType)->getFirstItem(); + return $role->getId() ? $role : false; + } + + /** + * Associate resources with the specified role. All resources previously assigned to the role will be unassigned. + * + * @param Role $role + * @param string[] $resources + */ + protected function _associateResourcesWithRole($role, array $resources) + { + /** @var \Magento\User\Model\Rules $rules */ + $rules = $this->_rulesFactory->create(); + $rules->setRoleId($role->getId())->setResources($resources)->saveRel(); + } +} diff --git a/app/code/Magento/Authz/Service/AuthorizationV1Interface.php b/app/code/Magento/Authz/Service/AuthorizationV1Interface.php new file mode 100644 index 00000000000..02b6f60d2c1 --- /dev/null +++ b/app/code/Magento/Authz/Service/AuthorizationV1Interface.php @@ -0,0 +1,72 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Authz\Service; + +use Magento\Authz\Model\UserIdentifier; +use Magento\Service\Exception as ServiceException; + +/** + * Authorization service interface. + */ +interface AuthorizationV1Interface +{ + /** + * Grant permissions to user to access the specified resources. + * + * @param UserIdentifier $userIdentifier + * @param string[] $resources List of resources which should be available to the specified user. + * @throws ServiceException + */ + public function grantPermissions(UserIdentifier $userIdentifier, array $resources); + + /** + * Grant permissions to the user to access all resources available in the system. + * + * @param UserIdentifier $userIdentifier + * @throws ServiceException + */ + public function grantAllPermissions(UserIdentifier $userIdentifier); + + /** + * Check if the user has permission to access the requested resources. + * + * Access is prohibited if there is a lack of permissions to any of the requested resources. + * + * @param string|string[] $resources Single resource or a list of resources + * @param UserIdentifier|null $userIdentifier Context of current user is used by default + * @return bool + * @throws ServiceException + */ + public function isAllowed($resources, UserIdentifier $userIdentifier = null); + + /** + * Get a list of resources available to the specified user. + * + * @param UserIdentifier $userIdentifier + * @return string[] + * @throws ServiceException + */ + public function getAllowedResources(UserIdentifier $userIdentifier); +} diff --git a/app/code/Magento/Authz/etc/adminhtml/di.xml b/app/code/Magento/Authz/etc/adminhtml/di.xml new file mode 100644 index 00000000000..60c4f0bceb6 --- /dev/null +++ b/app/code/Magento/Authz/etc/adminhtml/di.xml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config> + <preference for="Magento\Authz\Model\UserLocatorInterface" type="Magento\Authz\Model\UserLocator\Admin"/> +</config> diff --git a/app/code/Magento/Authz/etc/di.xml b/app/code/Magento/Authz/etc/di.xml new file mode 100644 index 00000000000..4dbaf698ee8 --- /dev/null +++ b/app/code/Magento/Authz/etc/di.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config> + <preference for="Magento\Authz\Service\AuthorizationV1Interface" type="Magento\Authz\Service\AuthorizationV1"/> + <preference for="Magento\Authz\Model\UserLocatorInterface" type="Magento\Authz\Model\UserLocator\Guest"/> +</config> diff --git a/app/code/Magento/Page/etc/module.xml b/app/code/Magento/Authz/etc/module.xml old mode 100755 new mode 100644 similarity index 79% rename from app/code/Magento/Page/etc/module.xml rename to app/code/Magento/Authz/etc/module.xml index cc66376f9c6..91159766258 --- a/app/code/Magento/Page/etc/module.xml +++ b/app/code/Magento/Authz/etc/module.xml @@ -24,15 +24,11 @@ */ --> <config> - <module name="Magento_Page" version="1.6.0.0" active="true"> - <sequence> - <module name="Magento_Core"/> - </sequence> + <module name="Magento_Authz" version="1.0.0.0" active="true"> <depends> <module name="Magento_Core"/> - <module name="Magento_Customer"/> - <module name="Magento_Backend"/> - <module name="Magento_Cms"/> + <!--TODO: Dependency on Magento_User is temporary and should be eliminated when ACL is made global--> + <module name="Magento_User"/> </depends> </module> </config> diff --git a/app/code/Magento/Backend/App/AbstractAction.php b/app/code/Magento/Backend/App/AbstractAction.php index 308a1c84d84..58259d8b1fe 100644 --- a/app/code/Magento/Backend/App/AbstractAction.php +++ b/app/code/Magento/Backend/App/AbstractAction.php @@ -166,28 +166,28 @@ abstract class AbstractAction extends \Magento\App\Action\Action } /** - * @param \Magento\View\Block\AbstractBlock $block + * @param \Magento\View\Element\AbstractBlock $block * @return \Magento\Backend\App\AbstractAction */ - protected function _addContent(\Magento\View\Block\AbstractBlock $block) + protected function _addContent(\Magento\View\Element\AbstractBlock $block) { return $this->_moveBlockToContainer($block, 'content'); } /** - * @param \Magento\View\Block\AbstractBlock $block + * @param \Magento\View\Element\AbstractBlock $block * @return \Magento\Backend\App\AbstractAction */ - protected function _addLeft(\Magento\View\Block\AbstractBlock $block) + protected function _addLeft(\Magento\View\Element\AbstractBlock $block) { return $this->_moveBlockToContainer($block, 'left'); } /** - * @param \Magento\View\Block\AbstractBlock $block + * @param \Magento\View\Element\AbstractBlock $block * @return \Magento\Backend\App\AbstractAction */ - protected function _addJs(\Magento\View\Block\AbstractBlock $block) + protected function _addJs(\Magento\View\Element\AbstractBlock $block) { return $this->_moveBlockToContainer($block, 'js'); } @@ -197,11 +197,11 @@ abstract class AbstractAction extends \Magento\App\Action\Action * * The block will be moved to the container from previous parent after all other elements * - * @param \Magento\View\Block\AbstractBlock $block + * @param \Magento\View\Element\AbstractBlock $block * @param string $containerName * @return \Magento\Backend\App\AbstractAction */ - private function _moveBlockToContainer(\Magento\View\Block\AbstractBlock $block, $containerName) + private function _moveBlockToContainer(\Magento\View\Element\AbstractBlock $block, $containerName) { $this->_view->getLayout()->setChild($containerName, $block->getNameInLayout(), ''); return $this; @@ -218,9 +218,7 @@ abstract class AbstractAction extends \Magento\App\Action\Action } if ($request->isDispatched() && $request->getActionName() !== 'denied' && !$this->_isAllowed()) { - $this->_forward('denied'); - $this->_actionFlag->set('', self::FLAG_NO_DISPATCH, true); - return parent::dispatch($request); + return $this->_forward('denied'); } if ($this->_isUrlChecked()) { @@ -393,4 +391,4 @@ abstract class AbstractAction extends \Magento\App\Action\Action $this->_objectManager->get('Magento\Core\Model\Translate')->processResponseBody($html); $this->getResponse()->setBody($html); } -} \ No newline at end of file +} diff --git a/app/code/Magento/Backend/App/Action/Context.php b/app/code/Magento/Backend/App/Action/Context.php index 7774862ce12..1eec150730b 100644 --- a/app/code/Magento/Backend/App/Action/Context.php +++ b/app/code/Magento/Backend/App/Action/Context.php @@ -206,4 +206,4 @@ class Context extends \Magento\App\Action\Context { return $this->_session; } -} \ No newline at end of file +} diff --git a/app/code/Magento/Backend/Block/AbstractBlock.php b/app/code/Magento/Backend/Block/AbstractBlock.php index d2f15309be7..454167989a7 100644 --- a/app/code/Magento/Backend/Block/AbstractBlock.php +++ b/app/code/Magento/Backend/Block/AbstractBlock.php @@ -31,7 +31,7 @@ namespace Magento\Backend\Block; * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class AbstractBlock extends \Magento\View\Block\AbstractBlock +class AbstractBlock extends \Magento\View\Element\AbstractBlock { /** * @var \Magento\AuthorizationInterface diff --git a/app/code/Magento/Backend/Block/Admin/Formkey.php b/app/code/Magento/Backend/Block/Admin/Formkey.php index 0d5e6c6b706..ec71ca71908 100644 --- a/app/code/Magento/Backend/Block/Admin/Formkey.php +++ b/app/code/Magento/Backend/Block/Admin/Formkey.php @@ -38,6 +38,6 @@ class Formkey extends \Magento\Backend\Block\Template */ public function getFormKey() { - return $this->_session->getFormKey(); + return $this->formKey->getFormKey(); } } diff --git a/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php b/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php index 5fbf20e5c8f..bbe32dd6fc4 100644 --- a/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php +++ b/app/code/Magento/Backend/Block/Cache/Grid/Column/Statuses.php @@ -34,17 +34,15 @@ class Statuses extends \Magento\Backend\Block\Widget\Grid\Column /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Cache\TypeListInterface $cacheTypeList * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\App\Cache\TypeListInterface $cacheTypeList, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_cacheTypeList = $cacheTypeList; } diff --git a/app/code/Magento/Backend/Block/Context.php b/app/code/Magento/Backend/Block/Context.php index 55880dc9e89..be933a5adb5 100644 --- a/app/code/Magento/Backend/Block/Context.php +++ b/app/code/Magento/Backend/Block/Context.php @@ -28,7 +28,7 @@ namespace Magento\Backend\Block; * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Context extends \Magento\View\Block\Context +class Context extends \Magento\View\Element\Context { /** * @var \Magento\AuthorizationInterface @@ -44,6 +44,7 @@ class Context extends \Magento\View\Block\Context * @param \Magento\App\CacheInterface $cache * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Session\AbstractSession $session + * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\App\FrontController $frontController * @param \Magento\App\Helper\HelperFactory $helperFactory @@ -57,7 +58,7 @@ class Context extends \Magento\View\Block\Context * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\Core\Model\LocaleInterface $locale * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( @@ -69,6 +70,7 @@ class Context extends \Magento\View\Block\Context \Magento\App\CacheInterface $cache, \Magento\View\DesignInterface $design, \Magento\Core\Model\Session\AbstractSession $session, + \Magento\Session\SidResolverInterface $sidResolver, \Magento\Core\Model\Store\Config $storeConfig, \Magento\App\FrontController $frontController, \Magento\App\Helper\HelperFactory $helperFactory, @@ -84,9 +86,28 @@ class Context extends \Magento\View\Block\Context array $data = array() ) { $this->_authorization = $authorization; - parent::__construct($request, $layout, $eventManager, $urlBuilder, $translator, $cache, $design, - $session, $storeConfig, $frontController, $helperFactory, $viewUrl, $viewConfig, $cacheState, $logger, $app, - $escaper, $filterManager, $locale, $data + parent::__construct( + $request, + $layout, + $eventManager, + $urlBuilder, + $translator, + $cache, + $design, + $session, + $sidResolver, + $storeConfig, + $frontController, + $helperFactory, + $viewUrl, + $viewConfig, + $cacheState, + $logger, + $app, + $escaper, + $filterManager, + $locale, + $data ); } diff --git a/app/code/Magento/Backend/Block/Dashboard/AbstractDashboard.php b/app/code/Magento/Backend/Block/Dashboard/AbstractDashboard.php index 123848b6717..ef09ab5fc08 100644 --- a/app/code/Magento/Backend/Block/Dashboard/AbstractDashboard.php +++ b/app/code/Magento/Backend/Block/Dashboard/AbstractDashboard.php @@ -43,20 +43,18 @@ abstract class AbstractDashboard extends \Magento\Adminhtml\Block\Widget */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getCollection() diff --git a/app/code/Magento/Backend/Block/Dashboard/Graph.php b/app/code/Magento/Backend/Block/Dashboard/Graph.php index 797aaec69a2..ee642713d21 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Graph.php +++ b/app/code/Magento/Backend/Block/Dashboard/Graph.php @@ -120,22 +120,20 @@ class Graph extends \Magento\Backend\Block\Dashboard\AbstractDashboard */ protected $_dashboardData = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory - * @param \Magento\Backend\Helper\Dashboard\Data $dashboardData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory + * @param \Magento\Backend\Helper\Dashboard\Data $dashboardData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, - \Magento\Backend\Helper\Dashboard\Data $dashboardData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, + \Magento\Backend\Helper\Dashboard\Data $dashboardData, + array $data = array() + ) { $this->_dashboardData = $dashboardData; - parent::__construct($context, $coreData, $collectionFactory, $data); + parent::__construct($context, $collectionFactory, $data); } /** diff --git a/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php b/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php index 05cd859d92c..e2225b40488 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php +++ b/app/code/Magento/Backend/Block/Dashboard/Orders/Grid.php @@ -41,22 +41,28 @@ class Grid extends \Magento\Backend\Block\Dashboard\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory - * @param array $data + /** + * @var \Magento\Module\Manager + */ + protected $_moduleManager; + + /** + * @param \Magento\Module\Manager $moduleManager + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Module\Manager $moduleManager, + \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, + array $data = array() + ) { + $this->_moduleManager = $moduleManager; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() @@ -67,7 +73,7 @@ class Grid extends \Magento\Backend\Block\Dashboard\Grid protected function _prepareCollection() { - if (!$this->_coreData->isModuleEnabled('Magento_Reports')) { + if (!$this->_moduleManager->isEnabled('Magento_Reports')) { return $this; } $collection = $this->_collectionFactory->create() diff --git a/app/code/Magento/Backend/Block/Dashboard/Sales.php b/app/code/Magento/Backend/Block/Dashboard/Sales.php index 48893c077f2..a5366e2fe25 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Sales.php +++ b/app/code/Magento/Backend/Block/Dashboard/Sales.php @@ -34,13 +34,36 @@ namespace Magento\Backend\Block\Dashboard; +use Magento\Adminhtml\Block\Widget; + class Sales extends \Magento\Backend\Block\Dashboard\Bar { protected $_template = 'dashboard/salebar.phtml'; + /** + * @var \Magento\Module\Manager + */ + protected $_moduleManager; + + /** + * @param \Magento\Module\Manager $moduleManager + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, + \Magento\Module\Manager $moduleManager, + array $data = array() + ) { + $this->_moduleManager = $moduleManager; + parent::__construct($context, $collectionFactory, $data); + } + protected function _prepareLayout() { - if (!$this->_coreData->isModuleEnabled('Magento_Reports')) { + if (!$this->_moduleManager->isEnabled('Magento_Reports')) { return $this; } $isFilter = $this->getRequest()->getParam('store') diff --git a/app/code/Magento/Backend/Block/Dashboard/Searches/Last.php b/app/code/Magento/Backend/Block/Dashboard/Searches/Last.php index c340713e2b2..e6e83587bf9 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Searches/Last.php +++ b/app/code/Magento/Backend/Block/Dashboard/Searches/Last.php @@ -43,22 +43,28 @@ class Last extends \Magento\Backend\Block\Dashboard\Grid */ protected $_queriesFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory - * @param array $data + /** + * @var \Magento\Module\Manager + */ + protected $_moduleManager; + + /** + * @param \Magento\Module\Manager $moduleManager + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Module\Manager $moduleManager, + \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory, + array $data = array() + ) { + $this->_moduleManager = $moduleManager; $this->_queriesFactory = $queriesFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() @@ -69,7 +75,7 @@ class Last extends \Magento\Backend\Block\Dashboard\Grid protected function _prepareCollection() { - if (!$this->_coreData->isModuleEnabled('Magento_CatalogSearch')) { + if (!$this->_moduleManager->isEnabled('Magento_CatalogSearch')) { return parent::_prepareCollection(); } $this->_collection = $this->_queriesFactory->create(); diff --git a/app/code/Magento/Backend/Block/Dashboard/Searches/Top.php b/app/code/Magento/Backend/Block/Dashboard/Searches/Top.php index a525d9e8372..22052714318 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Searches/Top.php +++ b/app/code/Magento/Backend/Block/Dashboard/Searches/Top.php @@ -43,22 +43,28 @@ class Top extends \Magento\Backend\Block\Dashboard\Grid */ protected $_queriesFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory - * @param array $data + /** + * @var \Magento\Module\Manager + */ + protected $_moduleManager; + + /** + * @param \Magento\Module\Manager $moduleManager + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Module\Manager $moduleManager, + \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queriesFactory, + array $data = array() + ) { + $this->_moduleManager = $moduleManager; $this->_queriesFactory = $queriesFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() @@ -69,7 +75,7 @@ class Top extends \Magento\Backend\Block\Dashboard\Grid protected function _prepareCollection() { - if (!$this->_coreData->isModuleEnabled('Magento_CatalogSearch')) { + if (!$this->_moduleManager->isEnabled('Magento_CatalogSearch')) { return parent::_prepareCollection(); } $this->_collection = $this->_queriesFactory->create(); diff --git a/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php b/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php index 86fe59f32fe..1c0f19b593c 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php +++ b/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Most.php @@ -41,22 +41,20 @@ class Most extends \Magento\Backend\Block\Dashboard\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Newest.php b/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Newest.php index 237218ec3db..82289d9f94d 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Newest.php +++ b/app/code/Magento/Backend/Block/Dashboard/Tab/Customers/Newest.php @@ -41,22 +41,20 @@ class Newest extends \Magento\Backend\Block\Dashboard\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Customer\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Customer\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Customer\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Customer\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php b/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php index 24166c3530e..d93d9c02b11 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php +++ b/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Ordered.php @@ -41,22 +41,28 @@ class Ordered extends \Magento\Backend\Block\Dashboard\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\Resource\Report\Bestsellers\CollectionFactory $collectionFactory - * @param array $data + /** + * @var \Magento\Module\Manager + */ + protected $_moduleManager; + + /** + * @param \Magento\Module\Manager $moduleManager + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\Resource\Report\Bestsellers\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\Resource\Report\Bestsellers\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Module\Manager $moduleManager, + \Magento\Sales\Model\Resource\Report\Bestsellers\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + $this->_moduleManager = $moduleManager; + parent::__construct($context, $urlModel, $data); } protected function _construct() @@ -67,7 +73,7 @@ class Ordered extends \Magento\Backend\Block\Dashboard\Grid protected function _prepareCollection() { - if (!$this->_coreData->isModuleEnabled('Magento_Sales')) { + if (!$this->_moduleManager->isEnabled('Magento_Sales')) { return $this; } if ($this->getParam('website')) { diff --git a/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Viewed.php b/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Viewed.php index ac246a749d4..a1298bdac49 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Viewed.php +++ b/app/code/Magento/Backend/Block/Dashboard/Tab/Products/Viewed.php @@ -41,22 +41,20 @@ class Viewed extends \Magento\Backend\Block\Dashboard\Grid */ protected $_productsFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Product\CollectionFactory $productsFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Product\CollectionFactory $productsFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Product\CollectionFactory $productsFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Product\CollectionFactory $productsFactory, + array $data = array() + ) { $this->_productsFactory = $productsFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Backend/Block/Dashboard/Totals.php b/app/code/Magento/Backend/Block/Dashboard/Totals.php index 3f6879a491e..6fdbcad87a0 100644 --- a/app/code/Magento/Backend/Block/Dashboard/Totals.php +++ b/app/code/Magento/Backend/Block/Dashboard/Totals.php @@ -34,13 +34,36 @@ */ namespace Magento\Backend\Block\Dashboard; +use Magento\Adminhtml\Block\Widget; + class Totals extends \Magento\Backend\Block\Dashboard\Bar { protected $_template = 'dashboard/totalbar.phtml'; + /** + * @var \Magento\Module\Manager + */ + protected $_moduleManager; + + /** + * @param \Magento\Module\Manager $moduleManager + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Reports\Model\Resource\Order\CollectionFactory $collectionFactory, + \Magento\Module\Manager $moduleManager, + array $data = array() + ) { + $this->_moduleManager = $moduleManager; + parent::__construct($context, $collectionFactory, $data); + } + protected function _prepareLayout() { - if (!$this->_coreData->isModuleEnabled('Magento_Reports')) { + if (!$this->_moduleManager->isEnabled('Magento_Reports')) { return $this; } $isFilter = $this->getRequest()->getParam('store') diff --git a/app/code/Magento/Backend/Block/Denied.php b/app/code/Magento/Backend/Block/Denied.php index 8de1d49d475..9070dc570f8 100644 --- a/app/code/Magento/Backend/Block/Denied.php +++ b/app/code/Magento/Backend/Block/Denied.php @@ -33,20 +33,18 @@ class Denied extends \Magento\Backend\Block\Template */ protected $_authSession; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Auth\Session $authSession, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Backend\Model\Auth\Session $authSession, + array $data = array() + ) { $this->_authSession = $authSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function hasAvailableResources() diff --git a/app/code/Magento/Backend/Block/Media/Uploader.php b/app/code/Magento/Backend/Block/Media/Uploader.php index 19418d994a0..8a393e05903 100644 --- a/app/code/Magento/Backend/Block/Media/Uploader.php +++ b/app/code/Magento/Backend/Block/Media/Uploader.php @@ -48,18 +48,16 @@ class Uploader extends \Magento\Adminhtml\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\File\Size $fileSize * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\File\Size $fileSize, array $data = array() ) { $this->_fileSizeService = $fileSize; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() @@ -109,7 +107,7 @@ class Uploader extends \Magento\Adminhtml\Block\Widget if ($head) { $head->addChild( 'jquery-fileUploader-css-jquery-fileupload-ui-css', - 'Magento\Page\Block\Html\Head\Css', + 'Magento\Theme\Block\Html\Head\Css', array( 'file' => 'jquery/fileUploader/css/jquery.fileupload-ui.css' ) diff --git a/app/code/Magento/Backend/Block/Menu.php b/app/code/Magento/Backend/Block/Menu.php index d7e946f5d27..2897995077c 100644 --- a/app/code/Magento/Backend/Block/Menu.php +++ b/app/code/Magento/Backend/Block/Menu.php @@ -75,29 +75,27 @@ class Menu extends \Magento\Backend\Block\Template */ protected $_menuConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Url $url - * @param \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Backend\Model\Menu\Config $menuConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Backend\Model\Url $url + * @param \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\Backend\Model\Menu\Config $menuConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Url $url, - \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Backend\Model\Menu\Config $menuConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Backend\Model\Url $url, + \Magento\Backend\Model\Menu\Filter\IteratorFactory $iteratorFactory, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\Backend\Model\Menu\Config $menuConfig, + array $data = array() + ) { $this->_url = $url; $this->_iteratorFactory = $iteratorFactory; $this->_authSession = $authSession; $this->_menuConfig = $menuConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Backend/Block/Page/Head.php b/app/code/Magento/Backend/Block/Page/Head.php index db71c6f792b..96505249f40 100644 --- a/app/code/Magento/Backend/Block/Page/Head.php +++ b/app/code/Magento/Backend/Block/Page/Head.php @@ -33,7 +33,7 @@ */ namespace Magento\Backend\Block\Page; -class Head extends \Magento\Page\Block\Html\Head +class Head extends \Magento\Theme\Block\Html\Head { /** * @var string @@ -46,34 +46,39 @@ class Head extends \Magento\Page\Block\Html\Head protected $_titles; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @var \Magento\Data\Form\FormKey + */ + protected $formKey; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDatabase * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\Page $page - * @param \Magento\Core\Model\Page\Asset\MergeService $assetMergeService - * @param \Magento\Core\Model\Page\Asset\MinifyService $assetMinifyService + * @param \Magento\View\Asset\GroupedCollection $assets + * @param \Magento\View\Asset\MergeService $assetMergeService + * @param \Magento\View\Asset\MinifyService $assetMinifyService * @param \Magento\App\Action\Title $titles + * @param \Magento\Data\Form\FormKey $formKey * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\File\Storage\Database $fileStorageDatabase, \Magento\ObjectManager $objectManager, - \Magento\Core\Model\Page $page, - \Magento\Core\Model\Page\Asset\MergeService $assetMergeService, - \Magento\Core\Model\Page\Asset\MinifyService $assetMinifyService, + \Magento\View\Asset\GroupedCollection $assets, + \Magento\View\Asset\MergeService $assetMergeService, + \Magento\View\Asset\MinifyService $assetMinifyService, \Magento\App\Action\Title $titles, + \Magento\Data\Form\FormKey $formKey, array $data = array() ) { $this->_titles = $titles; + $this->formKey = $formKey; parent::__construct( $context, - $coreData, $fileStorageDatabase, $objectManager, - $page, + $assets, $assetMergeService, $assetMinifyService, $data @@ -87,7 +92,7 @@ class Head extends \Magento\Page\Block\Html\Head */ public function getFormKey() { - return $this->_session->getFormKey(); + return $this->formKey->getFormKey(); } /** diff --git a/app/code/Magento/Backend/Block/Page/Header.php b/app/code/Magento/Backend/Block/Page/Header.php index 953723bfeb2..59b864a1ecc 100644 --- a/app/code/Magento/Backend/Block/Page/Header.php +++ b/app/code/Magento/Backend/Block/Page/Header.php @@ -49,23 +49,21 @@ class Header extends \Magento\Backend\Block\Template */ protected $_authSession; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Backend\Helper\Data $backendData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\Backend\Helper\Data $backendData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Backend\Helper\Data $backendData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\Backend\Helper\Data $backendData, + array $data = array() + ) { $this->_backendData = $backendData; $this->_authSession = $authSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getHomeLink() diff --git a/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php b/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php index 9b039a89577..f1434842a11 100644 --- a/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php +++ b/app/code/Magento/Backend/Block/Page/System/Config/Robots/Reset.php @@ -35,27 +35,30 @@ namespace Magento\Backend\Block\Page\System\Config\Robots; class Reset extends \Magento\Backend\Block\System\Config\Form\Field { + /** + * Pasge robots default instructions + */ + const XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS = 'design/search_engine_robots/default_custom_instructions'; + /** * Page robots * - * @var \Magento\Page\Helper\Robots + * @var \Magento\Theme\Helper\Robots */ - protected $_pageRobots = null; + protected $coreConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Page\Helper\Robots $pageRobots - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\ConfigInterface $coreConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Page\Helper\Robots $pageRobots, - array $data = array() - ) { - $this->_pageRobots = $pageRobots; - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\ConfigInterface $coreConfig, + array $data = array() + ) { + $this->coreConfig = $coreConfig; + parent::__construct($context, $data); } /* @@ -74,7 +77,7 @@ class Reset extends \Magento\Backend\Block\System\Config\Form\Field */ public function getRobotsDefaultCustomInstructions() { - return $this->_pageRobots->getRobotsDefaultCustomInstructions(); + return trim((string)$this->coreConfig->getValue(self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, 'default')); } /** diff --git a/app/code/Magento/Backend/Block/Store/Switcher.php b/app/code/Magento/Backend/Block/Store/Switcher.php index 9644f615211..159801a7510 100644 --- a/app/code/Magento/Backend/Block/Store/Switcher.php +++ b/app/code/Magento/Backend/Block/Store/Switcher.php @@ -95,23 +95,21 @@ class Switcher extends \Magento\Backend\Block\Template */ protected $_storeFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Website\Factory $websiteFactory - * @param \Magento\Core\Model\Store\Group\Factory $storeGroupFactory - * @param \Magento\Core\Model\StoreFactory $storeFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Website\Factory $websiteFactory + * @param \Magento\Core\Model\Store\Group\Factory $storeGroupFactory + * @param \Magento\Core\Model\StoreFactory $storeFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Website\Factory $websiteFactory, - \Magento\Core\Model\Store\Group\Factory $storeGroupFactory, - \Magento\Core\Model\StoreFactory $storeFactory, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Website\Factory $websiteFactory, + \Magento\Core\Model\Store\Group\Factory $storeGroupFactory, + \Magento\Core\Model\StoreFactory $storeFactory, + array $data = array() + ) { + parent::__construct($context, $data); $this->_websiteFactory = $websiteFactory; $this->_storeGroupFactory = $storeGroupFactory; $this->_storeFactory = $storeFactory; diff --git a/app/code/Magento/Backend/Block/System/Account/Edit/Form.php b/app/code/Magento/Backend/Block/System/Account/Edit/Form.php index 3f2a19901c1..a5b5f19a473 100644 --- a/app/code/Magento/Backend/Block/System/Account/Edit/Form.php +++ b/app/code/Magento/Backend/Block/System/Account/Edit/Form.php @@ -46,27 +46,25 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_userFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\User\Model\UserFactory $userFactory - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\User\Model\UserFactory $userFactory + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\User\Model\UserFactory $userFactory, - \Magento\Backend\Model\Auth\Session $authSession, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\User\Model\UserFactory $userFactory, + \Magento\Backend\Model\Auth\Session $authSession, + array $data = array() + ) { $this->_userFactory = $userFactory; $this->_authSession = $authSession; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Backend/Block/System/Cache/Form.php b/app/code/Magento/Backend/Block/System/Cache/Form.php index 2cf01c41a9e..43470b7b2a4 100644 --- a/app/code/Magento/Backend/Block/System/Cache/Form.php +++ b/app/code/Magento/Backend/Block/System/Cache/Form.php @@ -36,6 +36,29 @@ namespace Magento\Backend\Block\System\Cache; class Form extends \Magento\Backend\Block\Widget\Form\Generic { + /** + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Helper\Data $coreData, + array $data = array() + ) { + $this->_coreData = $coreData; + parent::__construct($context, $registry, $formFactory, $data); + } + /** * Initialize cache management form * diff --git a/app/code/Magento/Backend/Block/System/Config/Edit.php b/app/code/Magento/Backend/Block/System/Config/Edit.php index 81f16df2693..a5733b6c49b 100644 --- a/app/code/Magento/Backend/Block/System/Config/Edit.php +++ b/app/code/Magento/Backend/Block/System/Config/Edit.php @@ -61,26 +61,24 @@ class Edit extends \Magento\Backend\Block\Widget */ protected $_configStructure; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Config\Structure $configStructure - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Backend\Model\Config\Structure $configStructure + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Config\Structure $configStructure, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Backend\Model\Config\Structure $configStructure, + array $data = array() + ) { $this->_configStructure = $configStructure; + parent::__construct($context, $data); } /** * Prepare layout object * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { @@ -94,6 +92,7 @@ class Edit extends \Magento\Backend\Block\Widget $this->setHeaderCss($section->getHeaderCss()); $this->addChild('save_button', 'Magento\Backend\Block\Widget\Button', array( + 'id' => 'save', 'label' => __('Save Config'), 'class' => 'save primary', 'data_attribute' => array( diff --git a/app/code/Magento/Backend/Block/System/Config/Form.php b/app/code/Magento/Backend/Block/System/Config/Form.php index 20cc7cd2df2..b0e931d649d 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form.php +++ b/app/code/Magento/Backend/Block/System/Config/Form.php @@ -126,7 +126,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Backend\Model\Config\Factory $configFactory @@ -138,7 +137,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Backend\Model\Config\Factory $configFactory, @@ -148,7 +146,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic \Magento\Core\Model\Config $coreConfig, array $data = array() ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); $this->_configFactory = $configFactory; $this->_configStructure = $configStructure; $this->_fieldsetFactory = $fieldsetFactory; @@ -461,7 +459,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * * - * @return \Magento\Backend\Block\Widget\Form|\Magento\View\Block\AbstractBlock|void + * @return \Magento\Backend\Block\Widget\Form|\Magento\View\Element\AbstractBlock|void */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Backend/Block/System/Config/Form/Field/FieldArray/AbstractFieldArray.php b/app/code/Magento/Backend/Block/System/Config/Form/Field/FieldArray/AbstractFieldArray.php index adc4ed43bd7..42e8ff85708 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form/Field/FieldArray/AbstractFieldArray.php +++ b/app/code/Magento/Backend/Block/System/Config/Form/Field/FieldArray/AbstractFieldArray.php @@ -101,7 +101,7 @@ abstract class AbstractFieldArray 'class' => $this->_getParam($params, 'class'), 'renderer' => false, ); - if ((!empty($params['renderer'])) && ($params['renderer'] instanceof \Magento\View\Block\AbstractBlock)) { + if ((!empty($params['renderer'])) && ($params['renderer'] instanceof \Magento\View\Element\AbstractBlock)) { $this->_columns[$name]['renderer'] = $params['renderer']; } } diff --git a/app/code/Magento/Backend/Block/System/Config/Form/Field/Regexceptions.php b/app/code/Magento/Backend/Block/System/Config/Form/Field/Regexceptions.php index 28fd6d6b074..933a2a1986e 100644 --- a/app/code/Magento/Backend/Block/System/Config/Form/Field/Regexceptions.php +++ b/app/code/Magento/Backend/Block/System/Config/Form/Field/Regexceptions.php @@ -42,23 +42,21 @@ class Regexceptions */ protected $_labelFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Data\Form\Element\Factory $elementFactory - * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Data\Form\Element\Factory $elementFactory + * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Data\Form\Element\Factory $elementFactory, - \Magento\Core\Model\Theme\LabelFactory $labelFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Data\Form\Element\Factory $elementFactory, + \Magento\Core\Model\Theme\LabelFactory $labelFactory, + array $data = array() + ) { $this->_elementFactory = $elementFactory; $this->_labelFactory = $labelFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Config/Switcher.php b/app/code/Magento/Backend/Block/System/Config/Switcher.php index 6ab009aeb20..4b01635ab02 100644 --- a/app/code/Magento/Backend/Block/System/Config/Switcher.php +++ b/app/code/Magento/Backend/Block/System/Config/Switcher.php @@ -35,22 +35,20 @@ class Switcher extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\System\Store $systemStore * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\System\Store $systemStore, array $data = array() ) { $this->_systemStore = $systemStore; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Backend/Block/System/Config/System/Storage/Media/Synchronize.php b/app/code/Magento/Backend/Block/System/Config/System/Storage/Media/Synchronize.php index ca8c823a68f..d888cac68e3 100644 --- a/app/code/Magento/Backend/Block/System/Config/System/Storage/Media/Synchronize.php +++ b/app/code/Magento/Backend/Block/System/Config/System/Storage/Media/Synchronize.php @@ -39,20 +39,18 @@ class Synchronize */ protected $_fileStorage; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\File\Storage $fileStorage - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\File\Storage $fileStorage + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\File\Storage $fileStorage, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\File\Storage $fileStorage, + array $data = array() + ) { $this->_fileStorage = $fileStorage; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Config/Tabs.php b/app/code/Magento/Backend/Block/System/Config/Tabs.php index 83728b75fab..a59c7cc7f8a 100644 --- a/app/code/Magento/Backend/Block/System/Config/Tabs.php +++ b/app/code/Magento/Backend/Block/System/Config/Tabs.php @@ -76,19 +76,17 @@ class Tabs extends \Magento\Backend\Block\Widget */ protected $_storeCode; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Config\Structure $configStructure - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Backend\Model\Config\Structure $configStructure + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Config\Structure $configStructure, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Backend\Model\Config\Structure $configStructure, + array $data = array() + ) { + parent::__construct($context, $data); $this->_tabs = $configStructure->getTabs(); $this->setId('system_config_tabs'); diff --git a/app/code/Magento/Backend/Block/System/Design/Edit.php b/app/code/Magento/Backend/Block/System/Design/Edit.php index 751ea6b97c9..104d359393b 100644 --- a/app/code/Magento/Backend/Block/System/Design/Edit.php +++ b/app/code/Magento/Backend/Block/System/Design/Edit.php @@ -38,20 +38,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php b/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php index 32a3ef650fe..f41d6865dea 100644 --- a/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php +++ b/app/code/Magento/Backend/Block/System/Design/Edit/Tab/General.php @@ -37,27 +37,25 @@ class General extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory - * @param \Magento\Core\Model\System\Store $systemStore - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\Theme\LabelFactory $labelFactory, - \Magento\Core\Model\System\Store $systemStore, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\Theme\LabelFactory $labelFactory, + \Magento\Core\Model\System\Store $systemStore, + array $data = array() + ) { $this->_labelFactory = $labelFactory; $this->_systemStore = $systemStore; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Shipping/Ups.php b/app/code/Magento/Backend/Block/System/Shipping/Ups.php index 39c77447a8d..1c85a66774e 100644 --- a/app/code/Magento/Backend/Block/System/Shipping/Ups.php +++ b/app/code/Magento/Backend/Block/System/Shipping/Ups.php @@ -41,23 +41,21 @@ class Ups extends \Magento\Backend\Block\Template */ protected $_websiteModel; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Usa\Model\Shipping\Carrier\Ups $shippingModel - * @param \Magento\Core\Model\Website $websiteModel - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Usa\Model\Shipping\Carrier\Ups $shippingModel + * @param \Magento\Core\Model\Website $websiteModel + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Usa\Model\Shipping\Carrier\Ups $shippingModel, - \Magento\Core\Model\Website $websiteModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Usa\Model\Shipping\Carrier\Ups $shippingModel, + \Magento\Core\Model\Website $websiteModel, + array $data = array() + ) { $this->_shippingModel = $shippingModel; $this->_websiteModel = $websiteModel; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Store/Edit.php b/app/code/Magento/Backend/Block/System/Store/Edit.php index e43f5746b0f..519293e5442 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit.php @@ -39,20 +39,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php index 65fce16e9cb..b5ecebb8e41 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Group.php @@ -54,30 +54,28 @@ class Group */ protected $_websiteFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Catalog\Model\Config\Source\Category $category - * @param \Magento\Core\Model\StoreFactory $storeFactory - * @param \Magento\Core\Model\Website\Factory $websiteFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Catalog\Model\Config\Source\Category $category + * @param \Magento\Core\Model\StoreFactory $storeFactory + * @param \Magento\Core\Model\Website\Factory $websiteFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Catalog\Model\Config\Source\Category $category, - \Magento\Core\Model\StoreFactory $storeFactory, - \Magento\Core\Model\Website\Factory $websiteFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Catalog\Model\Config\Source\Category $category, + \Magento\Core\Model\StoreFactory $storeFactory, + \Magento\Core\Model\Website\Factory $websiteFactory, + array $data = array() + ) { $this->_category = $category; $this->_storeFactory = $storeFactory; $this->_websiteFactory = $websiteFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php index 43006b0954a..8ecc56346b0 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Store.php @@ -49,27 +49,25 @@ class Store */ protected $_groupFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\Store\Group\Factory $groupFactory - * @param \Magento\Core\Model\Website\Factory $websiteFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\Store\Group\Factory $groupFactory + * @param \Magento\Core\Model\Website\Factory $websiteFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\Store\Group\Factory $groupFactory, - \Magento\Core\Model\Website\Factory $websiteFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\Store\Group\Factory $groupFactory, + \Magento\Core\Model\Website\Factory $websiteFactory, + array $data = array() + ) { $this->_groupFactory = $groupFactory; $this->_websiteFactory = $websiteFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php index 284e0d7c0b7..fadb2f024df 100644 --- a/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php +++ b/app/code/Magento/Backend/Block/System/Store/Edit/Form/Website.php @@ -44,24 +44,22 @@ class Website */ protected $_groupFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\Store\GroupFactory $groupFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\Store\GroupFactory $groupFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\Store\GroupFactory $groupFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\Store\GroupFactory $groupFactory, + array $data = array() + ) { $this->_groupFactory = $groupFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Backend/Block/System/Variable/Edit.php b/app/code/Magento/Backend/Block/System/Variable/Edit.php index c1c4668a1ff..09b71ed2bca 100644 --- a/app/code/Magento/Backend/Block/System/Variable/Edit.php +++ b/app/code/Magento/Backend/Block/System/Variable/Edit.php @@ -38,20 +38,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Backend/Block/Template.php b/app/code/Magento/Backend/Block/Template.php index f7f0f0dbb6b..e13c3daf2d7 100644 --- a/app/code/Magento/Backend/Block/Template.php +++ b/app/code/Magento/Backend/Block/Template.php @@ -31,7 +31,7 @@ namespace Magento\Backend\Block; * * @SuppressWarnings(PHPMD.NumberOfChildren) */ -class Template extends \Magento\View\Block\Template +class Template extends \Magento\View\Element\Template { /** * @var \Magento\AuthorizationInterface @@ -53,21 +53,25 @@ class Template extends \Magento\View\Block\Template */ protected $_backendSession; + /** + * @var \Magento\Data\Form\FormKey + */ + protected $formKey; + /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, array $data = array() ) { $this->_locale = $context->getLocale(); $this->_authorization = $context->getAuthorization(); $this->mathRandom = $context->getMathRandom(); $this->_backendSession = $context->getBackendSession(); - parent::__construct($context, $coreData, $data); + $this->formKey = $context->getFormKey(); + parent::__construct($context, $data); } /** @@ -77,7 +81,7 @@ class Template extends \Magento\View\Block\Template */ public function getFormKey() { - return $this->_session->getFormKey(); + return $this->formKey->getFormKey(); } /** diff --git a/app/code/Magento/Backend/Block/Template/Context.php b/app/code/Magento/Backend/Block/Template/Context.php index ca04a1cafaa..cc5d8166fb1 100644 --- a/app/code/Magento/Backend/Block/Template/Context.php +++ b/app/code/Magento/Backend/Block/Template/Context.php @@ -28,7 +28,7 @@ namespace Magento\Backend\Block\Template; * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Context extends \Magento\View\Block\Template\Context +class Context extends \Magento\View\Element\Template\Context { /** * @var \Magento\AuthorizationInterface @@ -45,6 +45,11 @@ class Context extends \Magento\View\Block\Template\Context */ protected $_backendSession; + /** + * @var \Magento\Data\Form\FormKey + */ + protected $formKey; + /** * @param \Magento\App\RequestInterface $request * @param \Magento\View\LayoutInterface $layout @@ -54,6 +59,7 @@ class Context extends \Magento\View\Block\Template\Context * @param \Magento\App\CacheInterface $cache * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Session $session + * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\App\FrontController $frontController * @param \Magento\App\Helper\HelperFactory $helperFactory @@ -74,6 +80,7 @@ class Context extends \Magento\View\Block\Template\Context * @param \Magento\AuthorizationInterface $authorization * @param \Magento\Backend\Model\Session $backendSession * @param \Magento\Math\Random $mathRandom + * @param \Magento\Data\Form\FormKey $formKey * @param array $data * * @SuppressWarnings(PHPMD.ExcessiveParameterList) @@ -87,6 +94,7 @@ class Context extends \Magento\View\Block\Template\Context \Magento\App\CacheInterface $cache, \Magento\View\DesignInterface $design, \Magento\Core\Model\Session $session, + \Magento\Session\SidResolverInterface $sidResolver, \Magento\Core\Model\Store\Config $storeConfig, \Magento\App\FrontController $frontController, \Magento\App\Helper\HelperFactory $helperFactory, @@ -107,11 +115,13 @@ class Context extends \Magento\View\Block\Template\Context \Magento\AuthorizationInterface $authorization, \Magento\Backend\Model\Session $backendSession, \Magento\Math\Random $mathRandom, + \Magento\Data\Form\FormKey $formKey, array $data = array() ) { $this->_authorization = $authorization; $this->_backendSession = $backendSession; $this->mathRandom = $mathRandom; + $this->formKey = $formKey; parent::__construct( $request, $layout, @@ -121,6 +131,7 @@ class Context extends \Magento\View\Block\Template\Context $cache, $design, $session, + $sidResolver, $storeConfig, $frontController, $helperFactory, @@ -142,7 +153,6 @@ class Context extends \Magento\View\Block\Template\Context ); } - /** * Get store manager * @@ -186,4 +196,12 @@ class Context extends \Magento\View\Block\Template\Context { return $this->mathRandom; } + + /** + * @return \Magento\Data\Form\FormKey + */ + public function getFormKey() + { + return $this->formKey; + } } diff --git a/app/code/Magento/Backend/Block/Text/ListText.php b/app/code/Magento/Backend/Block/Text/ListText.php index cff54dcb7ad..6467570d39b 100644 --- a/app/code/Magento/Backend/Block/Text/ListText.php +++ b/app/code/Magento/Backend/Block/Text/ListText.php @@ -34,6 +34,6 @@ */ namespace Magento\Backend\Block\Text; -class ListText extends \Magento\View\Block\Text\ListText +class ListText extends \Magento\View\Element\Text\ListText { } diff --git a/app/code/Magento/Backend/Block/Widget/Accordion.php b/app/code/Magento/Backend/Block/Widget/Accordion.php index 7de430c0a74..092744bedd4 100644 --- a/app/code/Magento/Backend/Block/Widget/Accordion.php +++ b/app/code/Magento/Backend/Block/Widget/Accordion.php @@ -57,7 +57,7 @@ class Accordion extends \Magento\Backend\Block\Widget ->setData($config) ->setAccordion($this) ->setId($itemId); - if (isset($config['content']) && $config['content'] instanceof \Magento\View\Block\AbstractBlock) { + if (isset($config['content']) && $config['content'] instanceof \Magento\View\Element\AbstractBlock) { $this->_items[$itemId]->setChild($itemId.'_content', $config['content']); } diff --git a/app/code/Magento/Backend/Block/Widget/Accordion/Item.php b/app/code/Magento/Backend/Block/Widget/Accordion/Item.php index 85b65c92a21..63b55d67dd3 100644 --- a/app/code/Magento/Backend/Block/Widget/Accordion/Item.php +++ b/app/code/Magento/Backend/Block/Widget/Accordion/Item.php @@ -64,7 +64,7 @@ class Item extends \Magento\Backend\Block\Widget if (is_string($content)) { return $content; } - if ($content instanceof \Magento\View\Block\AbstractBlock) { + if ($content instanceof \Magento\View\Element\AbstractBlock) { return $content->toHtml(); } return null; diff --git a/app/code/Magento/Backend/Block/Widget/Button.php b/app/code/Magento/Backend/Block/Widget/Button.php index bcb67e46051..4abea54585f 100644 --- a/app/code/Magento/Backend/Block/Widget/Button.php +++ b/app/code/Magento/Backend/Block/Widget/Button.php @@ -113,7 +113,7 @@ class Button extends \Magento\Backend\Block\Widget 'onclick' => $this->getOnClick(), 'style' => $this->getStyle(), 'value' => $this->getValue(), - 'disabled' => $disabled + 'disabled' => $disabled, ); if ($this->getDataAttribute()) { foreach ($this->getDataAttribute() as $key => $attr) { diff --git a/app/code/Magento/Backend/Block/Widget/Container.php b/app/code/Magento/Backend/Block/Widget/Container.php index 3cdb73c67b4..558184496db 100644 --- a/app/code/Magento/Backend/Block/Widget/Container.php +++ b/app/code/Magento/Backend/Block/Widget/Container.php @@ -202,7 +202,7 @@ class Container extends \Magento\Backend\Block\Template /** * Preparing child blocks for each added button * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Backend/Block/Widget/Form.php b/app/code/Magento/Backend/Block/Widget/Form.php index d3f6dd06e7a..f1a5f5a5779 100644 --- a/app/code/Magento/Backend/Block/Widget/Form.php +++ b/app/code/Magento/Backend/Block/Widget/Form.php @@ -47,18 +47,16 @@ class Form extends \Magento\Backend\Block\Widget */ protected $_locale; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + array $data = array() + ) { $this->_locale = $context->getLocale(); - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -78,7 +76,7 @@ class Form extends \Magento\Backend\Block\Widget * * You can redefine this method in child classes for changing layout * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { @@ -154,7 +152,7 @@ class Form extends \Magento\Backend\Block\Widget /** * This method is called before rendering HTML * - * @return \Magento\Backend\Block\Widget\Form|\Magento\View\Block\AbstractBlock + * @return \Magento\Backend\Block\Widget\Form|\Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Backend/Block/Widget/Form/Container.php b/app/code/Magento/Backend/Block/Widget/Form/Container.php index a2494e34954..17a5670c428 100644 --- a/app/code/Magento/Backend/Block/Widget/Form/Container.php +++ b/app/code/Magento/Backend/Block/Widget/Form/Container.php @@ -84,7 +84,7 @@ class Container extends \Magento\Backend\Block\Widget\Container /** * Create form block * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php b/app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php index 8d9d9de344b..0a0f635a0ba 100644 --- a/app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php +++ b/app/code/Magento/Backend/Block/Widget/Form/Element/Dependence.php @@ -60,41 +60,39 @@ class Dependence extends \Magento\Backend\Block\AbstractBlock protected $_configOptions = array(); /** - * Add name => id mapping - * - * @param string $fieldId - element ID in DOM - * @param string $fieldName - element name in their fieldset/form namespace - * @return \Magento\Backend\Block\Widget\Form\Element\Dependence - */ - /** - * Core data - * - * @var \Magento\Core\Helper\Data + * @var \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory */ - protected $_coreData; + protected $_fieldFactory; /** - * @var \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory + * @var \Magento\Json\EncoderInterface */ - protected $_fieldFactory; + protected $_jsonEncoder; - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory, - array $data = array() - ) { - $this->_coreData = $coreData; + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Backend\Model\Config\Structure\Element\Dependency\FieldFactory $fieldFactory, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_fieldFactory = $fieldFactory; parent::__construct($context, $data); } + /** + * Add name => id mapping + * + * @param string $fieldId - element ID in DOM + * @param string $fieldName - element name in their fieldset/form namespace + * @return \Magento\Backend\Block\Widget\Form\Element\Dependence + */ public function addFieldMap($fieldId, $fieldName) { $this->_fields[$fieldName] = $fieldId; @@ -146,7 +144,7 @@ class Dependence extends \Magento\Backend\Block\AbstractBlock return '<script type="text/javascript"> new FormElementDependenceController(' . $this->_getDependsJson() . ($this->_configOptions ? ', ' - . $this->_coreData->jsonEncode($this->_configOptions) : '') + . $this->_jsonEncoder->encode($this->_configOptions) : '') . '); </script>'; } @@ -166,6 +164,6 @@ class Dependence extends \Magento\Backend\Block\AbstractBlock ); } } - return $this->_coreData->jsonEncode($result); + return $this->_jsonEncoder->encode($result); } } diff --git a/app/code/Magento/Backend/Block/Widget/Form/Generic.php b/app/code/Magento/Backend/Block/Widget/Form/Generic.php index 713f3e12161..383fb366ad5 100644 --- a/app/code/Magento/Backend/Block/Widget/Form/Generic.php +++ b/app/code/Magento/Backend/Block/Widget/Form/Generic.php @@ -47,22 +47,20 @@ class Generic extends \Magento\Backend\Block\Widget\Form */ protected $_coreRegistry; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_formFactory = $formFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } } diff --git a/app/code/Magento/Backend/Block/Widget/Grid.php b/app/code/Magento/Backend/Block/Widget/Grid.php index 1ccbc22101f..87423d607b7 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid.php +++ b/app/code/Magento/Backend/Block/Widget/Grid.php @@ -121,19 +121,17 @@ class Grid extends \Magento\Backend\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Url $urlModel * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Url $urlModel, array $data = array() ) { $this->_urlModel = $urlModel; $this->_backendSession = $context->getBackendSession(); - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() @@ -208,7 +206,7 @@ class Grid extends \Magento\Backend\Block\Widget * Retrieve export block * * @throws \Magento\Core\Exception - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function getExportBlock() { @@ -242,7 +240,7 @@ class Grid extends \Magento\Backend\Block\Widget * Retrieve column by id * * @param string $columnId - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function getColumn($columnId) { @@ -404,7 +402,7 @@ class Grid extends \Magento\Backend\Block\Widget /** * Get massaction block * - * @return bool|\Magento\View\Block\AbstractBlock + * @return bool|\Magento\View\Element\AbstractBlock */ public function getMassactionBlock() { @@ -436,7 +434,7 @@ class Grid extends \Magento\Backend\Block\Widget /** * Initialize grid before rendering * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Extended.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Extended.php index 4351f21f1ad..a56ea489a55 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Extended.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Extended.php @@ -25,22 +25,20 @@ namespace Magento\Backend\Block\Widget\Grid\Column; class Extended extends \Magento\Backend\Block\Widget\Grid\Column { - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + array $data = array() + ) { $this->_rendererTypes['options'] = 'Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Extended'; $this->_filterTypes['options'] = 'Magento\Backend\Block\Widget\Grid\Column\Filter\Select\Extended'; $this->_rendererTypes['select'] = 'Magento\Backend\Block\Widget\Grid\Column\Renderer\Select\Extended'; $this->_rendererTypes['checkbox'] = 'Magento\Backend\Block\Widget\Grid\Column\Renderer\Checkboxes\Extended'; $this->_rendererTypes['radio'] = 'Magento\Backend\Block\Widget\Grid\Column\Renderer\Radio\Extended'; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Multistore.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Multistore.php index 848a262308c..139159622f1 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Multistore.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Multistore.php @@ -37,15 +37,13 @@ class Multistore extends \Magento\Backend\Block\Widget\Grid\Column { /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php index 8c88e4caf3b..d6c8d668045 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Column/Renderer/Action.php @@ -33,28 +33,24 @@ */ namespace Magento\Backend\Block\Widget\Grid\Column\Renderer; -class Action - extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Text +class Action extends \Magento\Backend\Block\Widget\Grid\Column\Renderer\Text { - /** - * Core data - * - * @var \Magento\Core\Helper\Data + * @var \Magento\Json\EncoderInterface */ - protected $_coreData = null; + protected $_jsonEncoder; - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Core\Helper\Data $coreData, - array $data = array() - ) { - $this->_coreData = $coreData; + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; parent::__construct($context, $data); } @@ -106,7 +102,7 @@ class Action $actionCaption = ''; $this->_transformActionData($action, $actionCaption, $row); - $htmlAttibutes = array('value'=>$this->escapeHtml($this->_coreData->jsonEncode($action))); + $htmlAttibutes = array('value'=>$this->escapeHtml($this->_jsonEncoder->encode($action))); $actionAttributes->setData($htmlAttibutes); return '<option ' . $actionAttributes->serialize() . '>' . $actionCaption . '</option>'; } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php b/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php index 20771cbace8..051f06d6f57 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/ColumnSet.php @@ -34,7 +34,7 @@ namespace Magento\Backend\Block\Widget\Grid; /** * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class ColumnSet extends \Magento\View\Block\Template +class ColumnSet extends \Magento\View\Element\Template { /** * @var \Magento\Backend\Model\Widget\Grid\Row\UrlGenerator @@ -120,16 +120,14 @@ class ColumnSet extends \Magento\View\Block\Template protected $_totals = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Backend\Model\Widget\Grid\Row\UrlGeneratorFactory $generatorFactory * @param \Magento\Backend\Model\Widget\Grid\SubTotals $subtotals * @param \Magento\Backend\Model\Widget\Grid\Totals $totals * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Backend\Model\Widget\Grid\Row\UrlGeneratorFactory $generatorFactory, \Magento\Backend\Model\Widget\Grid\SubTotals $subtotals, \Magento\Backend\Model\Widget\Grid\Totals $totals, @@ -149,7 +147,7 @@ class ColumnSet extends \Magento\View\Block\Template array_key_exists('filter_visibility', $data) ? (bool) $data['filter_visibility'] : true ); - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->setEmptyText(__( isset($data['empty_text'])? $data['empty_text'] : 'We couldn\'t find any records.' @@ -242,7 +240,7 @@ class ColumnSet extends \Magento\View\Block\Template /** * Prepare block for rendering * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Export.php b/app/code/Magento/Backend/Block/Widget/Grid/Export.php index 1c7ea433520..c4a194c43cf 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Export.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Export.php @@ -64,20 +64,18 @@ class Export */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Data\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Data\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Data\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Data\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() @@ -157,7 +155,7 @@ class Export /** * Prepare export button * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Extended.php b/app/code/Magento/Backend/Block/Widget/Grid/Extended.php index c2a02a87822..27710cfc645 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Extended.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Extended.php @@ -190,7 +190,7 @@ class Extended /** * Initialize child blocks * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { @@ -223,7 +223,7 @@ class Extended /** * Retrieve column set block * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function getColumnSet() { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php index 88c70aad1f0..2b9c927caf6 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/AbstractMassaction.php @@ -35,8 +35,15 @@ */ namespace Magento\Backend\Block\Widget\Grid\Massaction; +use Magento\View\Element\Template; + abstract class AbstractMassaction extends \Magento\Backend\Block\Widget { + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + /** * Backend data helper * @@ -53,6 +60,20 @@ abstract class AbstractMassaction extends \Magento\Backend\Block\Widget protected $_template = 'Magento_Backend::widget/grid/massaction.phtml'; + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; + parent::__construct($context, $data); + } + protected function _construct() { parent::_construct(); @@ -134,7 +155,7 @@ abstract class AbstractMassaction extends \Magento\Backend\Block\Widget $result[$itemId] = $item->toArray(); } - return $this->_coreData->jsonEncode($result); + return $this->_jsonEncoder->encode($result); } /** diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php index 5695da8fee3..94ccea59c98 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Additional.php @@ -44,23 +44,21 @@ class Additional extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_handlerFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory, - array $data = array() - ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\Layout\Argument\HandlerFactory $handlerFactory, + array $data = array() + ) { + parent::__construct($context, $registry, $formFactory, $data); $this->_handlerFactory = $handlerFactory; } diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php index f706254a356..66f34d6e07c 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Extended.php @@ -59,20 +59,26 @@ class Extended extends \Magento\Backend\Block\Widget */ protected $_backendData = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Helper\Data $backendData - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Backend\Helper\Data $backendData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Helper\Data $backendData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Backend\Helper\Data $backendData, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_backendData = $backendData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -92,7 +98,7 @@ class Extended extends \Magento\Backend\Block\Widget * 'complete' => string, // Only for ajax enabled grid (optional) * 'url' => string, * 'confirm' => string, // text of confirmation of this action (optional) - * 'additional' => string|array|\Magento\View\Block\AbstractBlock // (optional) + * 'additional' => string|array|\Magento\View\Element\AbstractBlock // (optional) * ); * * @param string $itemId @@ -151,7 +157,7 @@ class Extended extends \Magento\Backend\Block\Widget $result[$itemId] = $item->toArray(); } - return $this->_coreData->jsonEncode($result); + return $this->_jsonEncoder->encode($result); } /** diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php index e573b5a3ce2..04f17c8c808 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Massaction/Item.php @@ -64,7 +64,7 @@ class Item extends \Magento\Backend\Block\Widget /** * Set additional action block for this item * - * @param string|\Magento\View\Block\AbstractBlock $block + * @param string|\Magento\View\Element\AbstractBlock $block * @return \Magento\Backend\Block\Widget\Grid\Massaction\Item * @throws \Magento\Core\Exception */ @@ -74,7 +74,7 @@ class Item extends \Magento\Backend\Block\Widget $block = $this->getLayout()->createBlock($block); } elseif (is_array($block)) { $block = $this->_createFromConfig($block); - } elseif (!($block instanceof \Magento\View\Block\AbstractBlock)) { + } elseif (!($block instanceof \Magento\View\Element\AbstractBlock)) { throw new \Magento\Core\Exception('Unknown block type'); } @@ -99,7 +99,7 @@ class Item extends \Magento\Backend\Block\Widget /** * Retrieve additional action block for this item * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function getAdditionalActionBlock() { diff --git a/app/code/Magento/Backend/Block/Widget/Grid/Serializer.php b/app/code/Magento/Backend/Block/Widget/Grid/Serializer.php index c28b6ef2cdc..e58e38e98e8 100644 --- a/app/code/Magento/Backend/Block/Widget/Grid/Serializer.php +++ b/app/code/Magento/Backend/Block/Widget/Grid/Serializer.php @@ -33,8 +33,27 @@ */ namespace Magento\Backend\Block\Widget\Grid; -class Serializer extends \Magento\View\Block\Template +class Serializer extends \Magento\View\Element\Template { + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param array $data + */ + public function __construct( + \Magento\View\Element\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; + parent::__construct($context, $data); + } + /** * Preparing global layout * @@ -72,7 +91,7 @@ class Serializer extends \Magento\View\Block\Template public function getColumnInputNames($asJSON = false) { if ($asJSON) { - return $this->_coreData->jsonEncode((array)$this->getInputNames()); + return $this->_jsonEncoder->encode((array)$this->getInputNames()); } return (array)$this->getInputNames(); } @@ -91,6 +110,6 @@ class Serializer extends \Magento\View\Block\Template } elseif (!empty($inputNames)) { return '{}'; } - return $this->_coreData->jsonEncode($result); + return $this->_jsonEncoder->encode($result); } } diff --git a/app/code/Magento/Backend/Block/Widget/Tabs.php b/app/code/Magento/Backend/Block/Widget/Tabs.php index 076d838ef9a..36ee1a2579f 100644 --- a/app/code/Magento/Backend/Block/Widget/Tabs.php +++ b/app/code/Magento/Backend/Block/Widget/Tabs.php @@ -59,21 +59,26 @@ class Tabs extends \Magento\Backend\Block\Widget * @var \Magento\Backend\Model\Auth\Session */ protected $_authSession; + /** + * @var \Magento\Json\EncoderInterface + */ + private $_jsonEncoder; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Auth\Session $authSession, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Backend\Model\Auth\Session $authSession, + array $data = array() + ) { $this->_authSession = $authSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); + $this->_jsonEncoder = $jsonEncoder; } /** @@ -402,7 +407,7 @@ class Tabs extends \Magento\Backend\Block\Widget } } if ($asJson) { - return $this->_coreData->jsonEncode($result); + return $this->_jsonEncoder->encode($result); } return $result; } diff --git a/app/code/Magento/Backend/Controller/Adminhtml/Cache.php b/app/code/Magento/Backend/Controller/Adminhtml/Cache.php index 51c97b9f6e3..5668dce84c5 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/Cache.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/Cache.php @@ -70,7 +70,7 @@ class Cache extends \Magento\Backend\App\Action */ protected function _getSession() { - return $this->_objectManager->get('Magento\Adminhtml\Model\Session'); + return $this->_objectManager->get('Magento\Core\Model\Session\AbstractSession'); } /** @@ -125,6 +125,9 @@ class Cache extends \Magento\Backend\App\Action try { $types = $this->getRequest()->getParam('types'); $updatedTypes = 0; + if (!is_array($types)) { + $types = array(); + } $this->_validateTypes($types); foreach ($types as $code) { if (!$this->_cacheState->isEnabled($code)) { @@ -158,6 +161,9 @@ class Cache extends \Magento\Backend\App\Action try { $types = $this->getRequest()->getParam('types'); $updatedTypes = 0; + if (!is_array($types)) { + $types = array(); + } $this->_validateTypes($types); foreach ($types as $code) { if ($this->_cacheState->isEnabled($code)) { @@ -174,8 +180,7 @@ class Cache extends \Magento\Backend\App\Action } } catch (\Magento\Core\Exception $e) { $this->_getSession()->addError($e->getMessage()); - } - catch (\Exception $e) { + } catch (\Exception $e) { $this->_getSession()->addException( $e, __('An error occurred while disabling cache.') @@ -192,6 +197,9 @@ class Cache extends \Magento\Backend\App\Action try { $types = $this->getRequest()->getParam('types'); $updatedTypes = 0; + if (!is_array($types)) { + $types = array(); + } $this->_validateTypes($types); foreach ($types as $type) { $this->_cacheTypeList->cleanType($type); @@ -199,18 +207,12 @@ class Cache extends \Magento\Backend\App\Action $updatedTypes++; } if ($updatedTypes > 0) { - $this->_getSession()->addSuccess( - __("%1 cache type(s) refreshed.", $updatedTypes) - ); + $this->_getSession()->addSuccess(__("%1 cache type(s) refreshed.", $updatedTypes)); } } catch (\Magento\Core\Exception $e) { $this->_getSession()->addError($e->getMessage()); - } - catch (\Exception $e) { - $this->_getSession()->addException( - $e, - __('An error occurred while refreshing cache.') - ); + } catch (\Exception $e) { + $this->_getSession()->addException($e, __('An error occurred while refreshing cache.')); } $this->_redirect('adminhtml/*'); } @@ -238,17 +240,13 @@ class Cache extends \Magento\Backend\App\Action public function cleanMediaAction() { try { - $this->_objectManager->get('Magento\Core\Model\Page\Asset\MergeService') + $this->_objectManager->get('Magento\View\Asset\MergeService') ->cleanMergedJsCss(); $this->_eventManager->dispatch('clean_media_cache_after'); - $this->_getSession()->addSuccess( - __('The JavaScript/CSS cache has been cleaned.') - ); - } - catch (\Magento\Core\Exception $e) { + $this->_getSession()->addSuccess(__('The JavaScript/CSS cache has been cleaned.')); + } catch (\Magento\Core\Exception $e) { $this->_getSession()->addError($e->getMessage()); - } - catch (\Exception $e) { + } catch (\Exception $e) { $this->_getSession()->addException( $e, __('An error occurred while clearing the JavaScript/CSS cache.') @@ -268,11 +266,9 @@ class Cache extends \Magento\Backend\App\Action $this->_getSession()->addSuccess( __('The image cache was cleaned.') ); - } - catch (\Magento\Core\Exception $e) { + } catch (\Magento\Core\Exception $e) { $this->_getSession()->addError($e->getMessage()); - } - catch (\Exception $e) { + } catch (\Exception $e) { $this->_getSession()->addException( $e, __('An error occurred while clearing the image cache.') diff --git a/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php b/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php index 47cba7c717e..d7203803eb7 100644 --- a/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php +++ b/app/code/Magento/Backend/Controller/Adminhtml/System/Variable.php @@ -120,7 +120,7 @@ class Variable extends \Magento\Backend\App\Action ->_addContent( $this->_view->getLayout()->createBlock('Magento\Backend\Block\System\Variable\Edit') ) - ->_addJs($this->_view->getLayout()->createBlock('Magento\View\Block\Template', '', array( + ->_addJs($this->_view->getLayout()->createBlock('Magento\View\Element\Template', '', array( 'data' => array('template' => 'Magento_Backend::system/variable/js.phtml') ))); $this->_view->renderLayout(); diff --git a/app/code/Magento/Backend/Model/Auth/Session.php b/app/code/Magento/Backend/Model/Auth/Session.php index d54df862667..fb023198b7c 100644 --- a/app/code/Magento/Backend/Model/Auth/Session.php +++ b/app/code/Magento/Backend/Model/Auth/Session.php @@ -63,6 +63,8 @@ class Session /** * @param \Magento\Core\Model\Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Acl\Builder $aclBuilder * @param \Magento\Backend\Model\Url $backendUrl * @param \Magento\Backend\App\ConfigInterface $config @@ -70,6 +72,8 @@ class Session */ public function __construct( \Magento\Core\Model\Session\Context $context, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Acl\Builder $aclBuilder, \Magento\Backend\Model\Url $backendUrl, \Magento\Backend\App\ConfigInterface $config, @@ -78,8 +82,8 @@ class Session $this->_config = $config; $this->_aclBuilder = $aclBuilder; $this->_backendUrl = $backendUrl; - parent::__construct($context, $data); - $this->init('admin'); + parent::__construct($context, $sidResolver, $sessionConfig, $data); + $this->start('admin'); } /** @@ -95,9 +99,9 @@ class Session * @return \Magento\Backend\Model\Auth\Session * @see self::login() */ - public function init($namespace, $sessionName = null) + public function start($namespace = 'default', $sessionName = null) { - parent::init($namespace, $sessionName); + parent::start($namespace, $sessionName); // @todo implement solution that keeps is_first_visit flag in session during redirects return $this; } @@ -209,7 +213,7 @@ class Session public function processLogin() { if ($this->getUser()) { - $this->renewSession(); + $this->regenerateId(); if ($this->_backendUrl->useSecretKey()) { $this->_backendUrl->renewSecretUrls(); @@ -229,8 +233,7 @@ class Session */ public function processLogout() { - $this->unsetAll(); - $this->getCookie()->delete($this->getSessionName()); + $this->destroy(); return $this; } @@ -244,14 +247,4 @@ class Session { return true; } - - /** - * Always try to get session id from query in backend area - * - * @return bool - */ - protected function _isSidUsedFromQueryParam() - { - return true; - } } diff --git a/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php b/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php index c378d6b8096..3f443e53d97 100644 --- a/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php +++ b/app/code/Magento/Backend/Model/Cache/Resource/Grid/Collection.php @@ -33,12 +33,12 @@ class Collection extends \Magento\Data\Collection protected $_cacheTypeList; /** - * @param \Magento\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\App\Cache\TypeListInterface $cacheTypeList */ public function __construct( - \Magento\App\Cache\TypeListInterface $cacheTypeList, - \Magento\Core\Model\EntityFactory $entityFactory + \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\App\Cache\TypeListInterface $cacheTypeList ) { $this->_cacheTypeList = $cacheTypeList; parent::__construct($entityFactory); diff --git a/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php b/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php index 78f025a1dde..73fccd88e4f 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Admin/Observer.php @@ -89,8 +89,7 @@ class Observer return; } - $this->_authSession->unsetAll(); - $this->_authSession->getCookie()->delete($this->_authSession->getSessionName()); + $this->_authSession->destroy(); $route = $this->_backendData->getAreaFrontName(); diff --git a/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php b/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php index b8e152f1627..6cc537374f6 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Baseurl.php @@ -26,7 +26,7 @@ namespace Magento\Backend\Model\Config\Backend; class Baseurl extends \Magento\Core\Model\Config\Value { /** - * @var \Magento\Core\Model\Page\Asset\MergeService + * @var \Magento\View\Asset\MergeService */ protected $_mergeService; @@ -35,7 +35,7 @@ class Baseurl extends \Magento\Core\Model\Config\Value * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config - * @param \Magento\Core\Model\Page\Asset\MergeService $mergeService + * @param \Magento\View\Asset\MergeService $mergeService * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -45,7 +45,7 @@ class Baseurl extends \Magento\Core\Model\Config\Value \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, - \Magento\Core\Model\Page\Asset\MergeService $mergeService, + \Magento\View\Asset\MergeService $mergeService, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Backend/Model/Config/Backend/File.php b/app/code/Magento/Backend/Model/Config/Backend/File.php index ad53e13aa4c..ba08ac5b49f 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/File.php +++ b/app/code/Magento/Backend/Model/Config/Backend/File.php @@ -61,26 +61,24 @@ class File extends \Magento\Core\Model\Config\Value protected $_dir; /** - * @param \Magento\Core\Model\File\UploaderFactory $uploaderFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\Core\Model\File\UploaderFactory $uploaderFactory * @param \Magento\Backend\Model\Config\Backend\File\RequestData\RequestDataInterface $requestData * @param \Magento\Filesystem $filesystem * @param \Magento\App\Dir $dir * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Core\Model\File\UploaderFactory $uploaderFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\Core\Model\File\UploaderFactory $uploaderFactory, \Magento\Backend\Model\Config\Backend\File\RequestData\RequestDataInterface $requestData, \Magento\Filesystem $filesystem, \Magento\App\Dir $dir, diff --git a/app/code/Magento/Backend/Model/Config/Backend/Secure.php b/app/code/Magento/Backend/Model/Config/Backend/Secure.php index 0dcb6e1dea5..8b5bc537377 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Secure.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Secure.php @@ -26,7 +26,7 @@ namespace Magento\Backend\Model\Config\Backend; class Secure extends \Magento\Core\Model\Config\Value { /** - * @var \Magento\Core\Model\Page\Asset\MergeService + * @var \Magento\View\Asset\MergeService */ protected $_mergeService; @@ -35,7 +35,7 @@ class Secure extends \Magento\Core\Model\Config\Value * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config - * @param \Magento\Core\Model\Page\Asset\MergeService $mergeService + * @param \Magento\View\Asset\MergeService $mergeService * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data @@ -45,7 +45,7 @@ class Secure extends \Magento\Core\Model\Config\Value \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, - \Magento\Core\Model\Page\Asset\MergeService $mergeService, + \Magento\View\Asset\MergeService $mergeService, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php b/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php index ec624916431..ae82e042325 100644 --- a/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php +++ b/app/code/Magento/Backend/Model/Config/Backend/Storage/Media/Database.php @@ -37,21 +37,21 @@ class Database extends \Magento\Core\Model\Config\Value protected $_coreFileStorage = null; /** - * @param \Magento\Core\Helper\File\Storage $coreFileStorage * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\Core\Helper\File\Storage $coreFileStorage * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Helper\File\Storage $coreFileStorage, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\Core\Helper\File\Storage $coreFileStorage, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Backend/Model/Session.php b/app/code/Magento/Backend/Model/Session.php index b5e2226d744..5f0e0863a50 100644 --- a/app/code/Magento/Backend/Model/Session.php +++ b/app/code/Magento/Backend/Model/Session.php @@ -29,12 +29,18 @@ class Session extends \Magento\Core\Model\Session\AbstractSession { /** * @param \Magento\Core\Model\Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param array $data */ - public function __construct(\Magento\Core\Model\Session\Context $context, array $data = array()) - { - parent::__construct($context, $data); - $this->init('adminhtml'); + public function __construct( + \Magento\Core\Model\Session\Context $context, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, + array $data = array() + ) { + parent::__construct($context, $sidResolver, $sessionConfig, $data); + $this->start('adminhtml'); } /** @@ -47,14 +53,4 @@ class Session extends \Magento\Core\Model\Session\AbstractSession { return true; } - - /** - * Always try to get session id from query in backend area - * - * @return bool - */ - protected function _isSidUsedFromQueryParam() - { - return true; - } } diff --git a/app/code/Magento/Backend/Model/Url.php b/app/code/Magento/Backend/Model/Url.php index fbc1d4e4260..f4e902d153c 100644 --- a/app/code/Magento/Backend/Model/Url.php +++ b/app/code/Magento/Backend/Model/Url.php @@ -69,11 +69,6 @@ class Url extends \Magento\Core\Model\Url */ protected $_backendHelper; - /** - * @var \Magento\Core\Model\Session - */ - protected $_coreSession; - /** * Menu config * @@ -106,6 +101,11 @@ class Url extends \Magento\Core\Model\Url */ protected $_coreConfig; + /** + * @var \Magento\Data\Form\FormKey + */ + protected $formKey; + /** * @param \Magento\App\Route\ConfigInterface $routeConfig * @param \Magento\App\RequestInterface $request @@ -113,6 +113,7 @@ class Url extends \Magento\Core\Model\Url * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Backend\Helper\Data $backendHelper * @param \Magento\Core\Model\Session $session + * @param \Magento\Session\SidResolverInterface $sidResolver * @param Menu\Config $menuConfig * @param \Magento\Core\Model\App $app * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -122,6 +123,7 @@ class Url extends \Magento\Core\Model\Url * @param \Magento\Backend\App\ConfigInterface $config * @param \Magento\Core\Model\StoreFactory $storeFactory * @param \Magento\Core\Model\ConfigInterface $coreConfig + * @param \Magento\Data\Form\FormKey $formKey * @param null $areaCode * @param array $data */ @@ -132,6 +134,7 @@ class Url extends \Magento\Core\Model\Url \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Backend\Helper\Data $backendHelper, \Magento\Core\Model\Session $session, + \Magento\Session\SidResolverInterface $sidResolver, \Magento\Backend\Model\Menu\Config $menuConfig, \Magento\Core\Model\App $app, \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -141,21 +144,30 @@ class Url extends \Magento\Core\Model\Url \Magento\Backend\App\ConfigInterface $config, \Magento\Core\Model\StoreFactory $storeFactory, \Magento\Core\Model\ConfigInterface $coreConfig, + \Magento\Data\Form\FormKey $formKey, $areaCode = null, array $data = array() ) { $this->_encryptor = $encryptor; parent::__construct( - $routeConfig, $request, $urlSecurityInfo, $coreStoreConfig, - $app, $storeManager, $session, $areaCode, $data + $routeConfig, + $request, + $urlSecurityInfo, + $coreStoreConfig, + $app, + $storeManager, + $session, + $sidResolver, + $areaCode, + $data ); $this->_config = $config; $this->_startupMenuItemId = $coreStoreConfig->getConfig(self::XML_PATH_STARTUP_MENU_ITEM); $this->_backendHelper = $backendHelper; - $this->_coreSession = $session; $this->_menuConfig = $menuConfig; $this->_cache = $cache; $this->_session = $authSession; + $this->formKey = $formKey; $this->_storeFactory = $storeFactory; $this->_coreConfig = $coreConfig; } @@ -241,7 +253,7 @@ class Url extends \Magento\Core\Model\Url */ public function getSecretKey($routeName = null, $controller = null, $action = null) { - $salt = $this->_coreSession->getFormKey(); + $salt = $this->formKey->getFormKey(); $request = $this->getRequest(); if (!$routeName) { if ($request->getBeforeForwardInfo('route_name') !== null) { diff --git a/app/code/Magento/Backend/etc/adminhtml/di.xml b/app/code/Magento/Backend/etc/adminhtml/di.xml index 81f6c2eeb0b..7d5fcda93e3 100644 --- a/app/code/Magento/Backend/etc/adminhtml/di.xml +++ b/app/code/Magento/Backend/etc/adminhtml/di.xml @@ -24,7 +24,6 @@ */ --> <config> - <preference for="Magento\Authorization\Policy" type="Magento\Authorization\Policy\Acl" /> <preference for="Magento\Authorization\RoleLocator" type="Magento\Backend\Model\Authorization\RoleLocator" /> <preference for="Magento\Core\Model\LocaleInterface" type="Magento\Backend\Model\Locale" /> <preference for="Magento\App\Action\Context" type="Magento\Backend\App\Action\Context" /> @@ -32,12 +31,10 @@ <preference for="Magento\Backend\Model\Auth\StorageInterface" type="Magento\Backend\Model\Auth\Session" /> <preference for="Magento\Backend\Model\Config\Structure\SearchInterface" type="Magento\Backend\Model\Config\Structure" /> <preference for="Magento\Backend\Model\Config\Backend\File\RequestData\RequestDataInterface" type="Magento\Backend\Model\Config\Backend\File\RequestData" /> - <preference for="Magento\Acl\Resource\ProviderInterface" type="Magento\Acl\Resource\Provider" /> <preference for="Magento\App\DefaultPathInterface" type="Magento\Backend\App\DefaultPath" /> <preference for="Magento\Backend\App\ConfigInterface" type="Magento\Backend\App\Config" /> <preference for="Magento\Core\Model\Translate\Inline\ConfigFactory" type="Magento\Backend\Model\Translate\Inline\ConfigFactory" /> <preference for="Magento\Core\Model\Translate\InlineInterface" type="Magento\Backend\Model\Translate\Inline" /> - <preference for="Magento\Core\Model\Cookie" type="Magento\Backend\Model\Cookie" /> <preference for="Magento\Core\Model\Resource\Translate\String" type="Magento\Backend\Model\Resource\Translate\String" /> <preference for="Magento\Core\Model\Resource\Translate" type="Magento\Backend\Model\Resource\Translate" /> <preference for="Magento\App\Response\Http\FileFactory" type="Magento\Backend\App\Response\Http\FileFactory" /> @@ -57,31 +54,6 @@ <instance type="Magento\Backend\Model\Url\Proxy" /> </param> </type> - <type name="Magento\Acl\Resource\Config\Reader\Filesystem"> - <param name="converter"> - <instance type="Magento\Acl\Resource\Config\Converter\Dom"/> - </param> - </type> - <type name="Magento\Acl\Resource\Provider"> - <param name="configReader"> - <instance type="Magento\Acl\Resource\Config\Reader\Filesystem"/> - </param> - </type> - <type name="Magento\Acl\Builder"> - <param name="resourceLoader"> - <instance type="Magento\Acl\Loader\Resource" /> - </param> - </type> - <type name="Magento\Core\Model\Acl\Cache"> - <param name="cacheKey"> - <value>backend_acl_resources</value> - </param> - </type> - <type name="Magento\Core\Model\Acl\RootResource"> - <param name="identifier"> - <value>Magento_Adminhtml::all</value> - </param> - </type> <type name="Magento\Core\Model\Session"> <param name="sessionName"> <value>adminhtml</value> diff --git a/app/code/Magento/Backend/etc/di.xml b/app/code/Magento/Backend/etc/di.xml index 7c9e596e484..638faa9da90 100644 --- a/app/code/Magento/Backend/etc/di.xml +++ b/app/code/Magento/Backend/etc/di.xml @@ -86,6 +86,9 @@ <param name="authSession"> <instance type="Magento\Backend\Model\Auth\Session\Proxy" /> </param> + <param name="formKey"> + <instance type="Magento\Data\Form\FormKey\Proxy" /> + </param> <param name="areaCode"> <value>adminhtml</value> </param> @@ -100,6 +103,34 @@ <value type="argument">Magento\App\State::PARAM_INSTALL_DATE</value> </param> </type> + <preference for="Magento\Authorization\RoleLocator" type="Magento\Backend\Model\Authorization\RoleLocator" /> + <preference for="Magento\Authorization\Policy" type="Magento\Authorization\Policy\Acl"/> + <preference for="Magento\Acl\Resource\ProviderInterface" type="Magento\Acl\Resource\Provider"/> + <type name="Magento\Acl\Resource\Config\Reader\Filesystem"> + <param name="converter"> + <instance type="Magento\Acl\Resource\Config\Converter\Dom"/> + </param> + </type> + <type name="Magento\Acl\Resource\Provider"> + <param name="configReader"> + <instance type="Magento\Acl\Resource\Config\Reader\Filesystem"/> + </param> + </type> + <type name="Magento\Acl\Builder"> + <param name="resourceLoader"> + <instance type="Magento\Acl\Loader\Resource"/> + </param> + </type> + <type name="Magento\Core\Model\Acl\Cache"> + <param name="cacheKey"> + <value>backend_acl_resources</value> + </param> + </type> + <type name="Magento\Core\Model\Acl\RootResource"> + <param name="identifier"> + <value>Magento_Adminhtml::all</value> + </param> + </type> <type name="Magento\Backend\Controller\Adminhtml\Index"> <param name="searchModules"> <value> diff --git a/app/code/Magento/Backend/etc/module.xml b/app/code/Magento/Backend/etc/module.xml index aef7d360109..1b227ac2789 100755 --- a/app/code/Magento/Backend/etc/module.xml +++ b/app/code/Magento/Backend/etc/module.xml @@ -36,7 +36,7 @@ <module name="Magento_AdminNotification"/> <module name="Magento_Cron"/> <module name="Magento_Sendfriend"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/Backend/view/adminhtml/admin/login.phtml b/app/code/Magento/Backend/view/adminhtml/admin/login.phtml index 5a63d7d2737..af9150cbc89 100644 --- a/app/code/Magento/Backend/view/adminhtml/admin/login.phtml +++ b/app/code/Magento/Backend/view/adminhtml/admin/login.phtml @@ -31,8 +31,8 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo __('Log into Magento Admin Page') ?></title> - <link rel="icon" href="<?php echo $this->getViewFileUrl('Magento_Page::favicon.ico') ?>" type="image/x-icon" /> - <link rel="shortcut icon" href="<?php echo $this->getViewFileUrl('Magento_Page::favicon.ico') ?>" type="image/x-icon" /> + <link rel="icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico') ?>" type="image/x-icon" /> + <link rel="shortcut icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico') ?>" type="image/x-icon" /> <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/reset.css') ?>" media="all" /> <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/base.css') ?>" media="all" /> @@ -66,7 +66,7 @@ <div class="logo" title="<?php echo __('Magento Admin Panel') ?>"><span><?php echo __('Magento Admin Panel') ?></span></div> </header> <div id="messages" data-container-for="messages"> - <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> </div> <form method="post" action="" id="login-form"> <fieldset class="fieldset"> diff --git a/app/code/Magento/Backend/view/adminhtml/admin/overlay_popup.phtml b/app/code/Magento/Backend/view/adminhtml/admin/overlay_popup.phtml index e851ea8a1eb..0aa8593cca2 100644 --- a/app/code/Magento/Backend/view/adminhtml/admin/overlay_popup.phtml +++ b/app/code/Magento/Backend/view/adminhtml/admin/overlay_popup.phtml @@ -34,13 +34,13 @@ </div> <div class="main-col" id="content"> <div class="main-col-inner"> - <div id="messages" data-container-for="messages"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div> + <div id="messages" data-container-for="messages"><?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?></div> <?php echo $this->getChildHtml('content') ?> </div> </div> </div> <?php else: ?> - <div id="messages" data-container-for="messages"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div> + <div id="messages" data-container-for="messages"><?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?></div> <?php echo $this->getChildHtml('content') ?> <?php endif; ?> </div> diff --git a/app/code/Magento/Backend/view/adminhtml/admin/page.phtml b/app/code/Magento/Backend/view/adminhtml/admin/page.phtml index a569ffcd121..0175d0b77c3 100644 --- a/app/code/Magento/Backend/view/adminhtml/admin/page.phtml +++ b/app/code/Magento/Backend/view/adminhtml/admin/page.phtml @@ -43,7 +43,7 @@ <section class="page-content" id="anchor-content"> <?php echo $this->getChildHtml('main-top'); ?> <div id="messages" data-container-for="messages" class="messages"> - <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> </div> <?php if($this->getChildHtml('left')): ?> diff --git a/app/code/Magento/Backend/view/adminhtml/admin/popup.phtml b/app/code/Magento/Backend/view/adminhtml/admin/popup.phtml index a56227e8af3..ef930159ab7 100644 --- a/app/code/Magento/Backend/view/adminhtml/admin/popup.phtml +++ b/app/code/Magento/Backend/view/adminhtml/admin/popup.phtml @@ -26,13 +26,13 @@ ?> <?php /*{ "label":"Root page layout", - "type":"Magento\View\Block\Template", + "type":"Magento\View\Element\Template", "children":{ "header":{ "label":"Header", "type":"Magento\Backend\Block\Page\Header" }, "menu":{ "label":"Top navigation", "type":"Magento\Backend\Block\Menu" }, "breadcrumbs":{ "label":"Breadcrumbs", "type":"Magento\Adminhtml\Block\Widget\Breadcrumbs" }, - "content":{ "label":"Content block", "type":"Magento\View\Block\Template" }, - "left":{ "label":"Left navigation", "type":"Magento\View\Block\Template" }, + "content":{ "label":"Content block", "type":"Magento\View\Element\Template" }, + "left":{ "label":"Left navigation", "type":"Magento\View\Element\Template" }, "footer":{ "label":"Footer", "type":"Magento\Backend\Block\Page\Footer" } }, "vars":{} @@ -53,13 +53,13 @@ </div> <div class="main-col" id="content"> <div class="main-col-inner"> - <div id="messages" data-container-for="messages"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div> + <div id="messages" data-container-for="messages"><?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?></div> <?php echo $this->getChildHtml('content') ?> </div> </div> </div> <?php else: ?> - <div id="messages" data-container-for="messages"><?php echo $this->getMessagesBlock()->getGroupedHtml() ?></div> + <div id="messages" data-container-for="messages"><?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?></div> <?php echo $this->getChildHtml('content') ?> <?php endif; ?> </div> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml index b214ee1b22e..6ad3f1a0039 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_noroute.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> - <block class="Magento\View\Block\Text" name="content.noRoute"> + <block class="Magento\View\Element\Text" name="content.noRoute"> <action method="setText"> <argument translate="true" name="text" xsi:type="string"> <![CDATA[<h1 class="page-heading">404 Error</h1><p>Page not found.</p>]]> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_config_edit.xml index 0c1c259cc62..31707580ba4 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-ba-hashchange-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-ba-hashchange-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.ba-hashchange.min.js</argument> </arguments> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/default.xml b/app/code/Magento/Backend/view/adminhtml/layout/default.xml index 8093941b8ac..7cae9191af9 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/default.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/default.xml @@ -29,162 +29,162 @@ <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Magento Admin</argument> </action> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-jquery-no-conflict-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-jquery-no-conflict-js"> <arguments> <argument name="file" xsi:type="string">mage/jquery-no-conflict.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-ui-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-ui-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery-ui.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="head-load-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="head-load-min-js"> <arguments> <argument name="file" xsi:type="string">head.load.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="underscore-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="underscore-js"> <arguments> <argument name="file" xsi:type="string">underscore.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-magento-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-magento-js"> <arguments> <argument name="file" xsi:type="string">mage/mage.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-tmpl-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-tmpl-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.tmpl.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-validate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-validate-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.validate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-hoverintent-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-hoverintent-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.hoverIntent.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-translate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-translate-js"> <arguments> <argument name="file" xsi:type="string">mage/translate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-backend-bootstrap-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-backend-bootstrap-js"> <arguments> <argument name="file" xsi:type="string">mage/backend/bootstrap.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-backend-floating-header-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-backend-floating-header-js"> <arguments> <argument name="file" xsi:type="string">mage/backend/floating-header.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-prototype-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-prototype-js"> <arguments> <argument name="file" xsi:type="string">prototype/prototype.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-window-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-window-js"> <arguments> <argument name="file" xsi:type="string">prototype/window.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="scriptaculous-builder-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="scriptaculous-builder-js"> <arguments> <argument name="file" xsi:type="string">scriptaculous/builder.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="scriptaculous-effects-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="scriptaculous-effects-js"> <arguments> <argument name="file" xsi:type="string">scriptaculous/effects.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="scriptaculous-dragdrop-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="scriptaculous-dragdrop-js"> <arguments> <argument name="file" xsi:type="string">scriptaculous/dragdrop.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="scriptaculous-controls-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="scriptaculous-controls-js"> <arguments> <argument name="file" xsi:type="string">scriptaculous/controls.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="scriptaculous-slider-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="scriptaculous-slider-js"> <arguments> <argument name="file" xsi:type="string">scriptaculous/slider.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="lib-ccard-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="lib-ccard-js"> <arguments> <argument name="file" xsi:type="string">lib/ccard.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-validation-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-validation-js"> <arguments> <argument name="file" xsi:type="string">prototype/validation.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="varien-js-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="varien-js-js"> <arguments> <argument name="file" xsi:type="string">varien/js.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-hash-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-hash-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/hash.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-events-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-events-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/events.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-varienloader-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-varienloader-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/varienLoader.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-grid-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-grid-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/grid.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-backend-tabs-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-backend-tabs-js"> <arguments> <argument name="file" xsi:type="string">mage/backend/tabs.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-form-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-form-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/form.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-accordion-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-accordion-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/accordion.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/tools.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-catalog-product-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-catalog-product-js"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::catalog/product.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="lib-ds-sleight-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="lib-ds-sleight-js"> <arguments> <argument name="file" xsi:type="string">lib/ds-sleight.js</argument> <argument name="properties" xsi:type="array"> @@ -193,7 +193,7 @@ </argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-calendar-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-calendar-css"> <arguments> <argument name="file" xsi:type="string">mage/calendar.css</argument> <argument name="properties" xsi:type="array"> @@ -201,17 +201,17 @@ </argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-ui-timepicker-addon-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-ui-timepicker-addon-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery-ui-timepicker-addon.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-calendar-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-calendar-js"> <arguments> <argument name="file" xsi:type="string">mage/calendar.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="extjs-ext-tree-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="extjs-ext-tree-js"> <arguments> <argument name="file" xsi:type="string">extjs/ext-tree.js</argument> <argument name="properties" xsi:type="array"> @@ -221,7 +221,7 @@ </argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="extjs-ext-tree-checkbox-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="extjs-ext-tree-checkbox-js"> <arguments> <argument name="file" xsi:type="string">extjs/ext-tree-checkbox.js</argument> <argument name="properties" xsi:type="array"> @@ -231,7 +231,7 @@ </argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="extjs-resources-css-ext-all-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="extjs-resources-css-ext-all-css"> <arguments> <argument name="file" xsi:type="string">extjs/resources/css/ext-all.css</argument> <argument name="properties" xsi:type="array"> @@ -241,7 +241,7 @@ </argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="extjs-resources-css-ytheme-magento-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="extjs-resources-css-ytheme-magento-css"> <arguments> <argument name="file" xsi:type="string">extjs/resources/css/ytheme-magento.css</argument> <argument name="properties" xsi:type="array"> @@ -251,7 +251,7 @@ </argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-promo-rules-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-promo-rules-js"> <arguments> <argument name="file" xsi:type="string">Magento_Rule::rules.js</argument> <argument name="properties" xsi:type="array"> @@ -261,7 +261,7 @@ </argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-wysiwyg-tiny-mce-setup-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-wysiwyg-tiny-mce-setup-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/wysiwyg/tiny_mce/setup.js</argument> <argument name="properties" xsi:type="array"> @@ -271,8 +271,8 @@ </argument> </arguments> </block> - <block class="Magento\Page\Block\Js\Components" name="head.components" as="components" template="Magento_Backend::page/js/components.phtml"/> - <block class="Magento\View\Block\Html\Calendar" name="head.calendar" as="calendar" template="Magento_Backend::page/js/calendar.phtml"/> + <block class="Magento\View\Element\Js\Components" name="head.components" as="components" template="Magento_Backend::page/js/components.phtml"/> + <block class="Magento\View\Element\Html\Calendar" name="head.calendar" as="calendar" template="Magento_Backend::page/js/calendar.phtml"/> </block> <block class="Magento\Backend\Block\Menu" name="menu" as="menu" template="Magento_Backend::menu.phtml"/> <block class="Magento\Backend\Block\Page\Notices" name="global_notices" as="global_notices" template="page/notices.phtml"/> @@ -282,14 +282,14 @@ <block class="Magento\Adminhtml\Block\Widget\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> <!--<update handle="formkey"/> this won't work, see the try/catch and a jammed exception in \Magento\Core\Model\Layout::createBlock() --> <block class="Magento\Backend\Block\Admin\Formkey" name="formkey" as="formkey" template="Magento_Backend::admin/formkey.phtml"/> - <!-- deprecated since 1.7.0.0 see \Magento\Page\Block\Js\Translate --> - <block class="Magento\Page\Block\Js\Translate" name="js_translate" as="js_translate" template="Magento_Backend::page/js/translate.phtml"/> + <!-- deprecated since 1.7.0.0 see \Magento\Theme\Block\Js\Translate --> + <block class="Magento\View\Element\Template" name="js_translate" as="js_translate" template="Magento_Backend::page/js/translate.phtml"/> <container name="main-top" label="main-top" as="main-top"> - <block class="Magento\Page\Block\Html\Title" name="page-title" template="title.phtml"/> + <block class="Magento\Theme\Block\Html\Title" name="page-title" template="title.phtml"/> </container> <container name="left" as="left" label="Left Column"/> <container name="content" as="content" label="Content"/> - <block class="Magento\View\Block\Messages" name="messages" as="messages"/> + <block class="Magento\View\Element\Messages" name="messages" as="messages"/> <container name="js" as="js" label="JavaScript"/> <block class="Magento\Backend\Block\Page\Footer" name="footer" as="footer"> <block class="Magento\Backend\Block\Page\Copyright" name="copyright" as="copyright"/> diff --git a/app/code/Magento/Backend/view/adminhtml/layout/editor.xml b/app/code/Magento/Backend/view/adminhtml/layout/editor.xml index 9bb06c3802b..b55806ea37c 100644 --- a/app/code/Magento/Backend/view/adminhtml/layout/editor.xml +++ b/app/code/Magento/Backend/view/adminhtml/layout/editor.xml @@ -28,47 +28,47 @@ <action method="setCanLoadExtJs"> <argument name="flag" xsi:type="string">1</argument> </action> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-variables-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-variables-js"> <arguments> <argument name="file" xsi:type="string">Magento_Backend::variables.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-wysiwyg-widget-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-wysiwyg-widget-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/wysiwyg/widget.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="lib-flex-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="lib-flex-js"> <arguments> <argument name="file" xsi:type="string">lib/flex.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="lib-fabridge-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="lib-fabridge-js"> <arguments> <argument name="file" xsi:type="string">lib/FABridge.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-flexuploader-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-flexuploader-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/flexuploader.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-browser-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-browser-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/browser.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-window-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-window-js"> <arguments> <argument name="file" xsi:type="string">prototype/window.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="prototype-windows-themes-default-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="prototype-windows-themes-default-css"> <arguments> <argument name="file" xsi:type="string">prototype/windows/themes/default.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> <arguments> <argument name="file" xsi:type="string">Magento_Core::prototype/magento.css</argument> </arguments> diff --git a/app/code/Magento/Backend/view/adminhtml/page/head.phtml b/app/code/Magento/Backend/view/adminhtml/page/head.phtml index ca3282a197b..73683d14858 100644 --- a/app/code/Magento/Backend/view/adminhtml/page/head.phtml +++ b/app/code/Magento/Backend/view/adminhtml/page/head.phtml @@ -24,13 +24,13 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -/** @var $this \Magento\Page\Block\Html\Head */ +/** @var $this \Magento\Theme\Block\Html\Head */ ?> <meta http-equiv="X-UA-Compatible" content="IE=edge" > <meta http-equiv="Content-Type" content="<?php echo $this->getContentType() ?>"/> <title><?php echo htmlspecialchars(html_entity_decode($this->getTitle())) ?></title> -<link rel="icon" href="<?php echo $this->getViewFileUrl('Magento_Page::favicon.ico') ?>" type="image/x-icon"/> -<link rel="shortcut icon" href="<?php echo $this->getViewFileUrl('Magento_Page::favicon.ico') ?>" type="image/x-icon"/> +<link rel="icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico') ?>" type="image/x-icon"/> +<link rel="shortcut icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico') ?>" type="image/x-icon"/> <script type="text/javascript"> var BLANK_URL = '<?php echo $this->getViewFileUrl('blank.html') ?>'; diff --git a/app/code/Magento/Backend/view/adminhtml/page/js/calendar.phtml b/app/code/Magento/Backend/view/adminhtml/page/js/calendar.phtml index a6083df04e9..a362ef4694d 100644 --- a/app/code/Magento/Backend/view/adminhtml/page/js/calendar.phtml +++ b/app/code/Magento/Backend/view/adminhtml/page/js/calendar.phtml @@ -30,7 +30,7 @@ /** * Calendar localization script. Should be put into page header. * - * @see \Magento\View\Block\Html\Calendar + * @see \Magento\View\Element\Html\Calendar */ ?> diff --git a/app/code/Magento/Backend/view/adminhtml/page/js/components.phtml b/app/code/Magento/Backend/view/adminhtml/page/js/components.phtml index d4194cfaa17..96c20d0c58f 100644 --- a/app/code/Magento/Backend/view/adminhtml/page/js/components.phtml +++ b/app/code/Magento/Backend/view/adminhtml/page/js/components.phtml @@ -31,7 +31,7 @@ */ ?> -<?php /** @var $this \Magento\Page\Block\Js\Components */ ?> +<?php /** @var $this \Magento\View\Element\Js\Components */ ?> <script type="text/javascript"> (function($) { diff --git a/app/code/Magento/Backend/view/adminhtml/page/js/translate.phtml b/app/code/Magento/Backend/view/adminhtml/page/js/translate.phtml index b02a07c66bb..b7ec7fb1ba1 100644 --- a/app/code/Magento/Backend/view/adminhtml/page/js/translate.phtml +++ b/app/code/Magento/Backend/view/adminhtml/page/js/translate.phtml @@ -27,7 +27,7 @@ <?php /** - * @var $this \Magento\Page\Block\Js\Translate + * @var $this \Magento\Theme\Block\Js\Translate */ ?> <?php diff --git a/app/code/Magento/Backend/view/adminhtml/widget/grid.phtml b/app/code/Magento/Backend/view/adminhtml/widget/grid.phtml index 91e7ae02746..299777a8fc1 100644 --- a/app/code/Magento/Backend/view/adminhtml/widget/grid.phtml +++ b/app/code/Magento/Backend/view/adminhtml/widget/grid.phtml @@ -50,7 +50,7 @@ $numColumns = sizeof($this->getColumns()); <div id="<?php echo $this->getId() ?>"> <?php else: ?> - <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> <?php endif; ?> <?php if ($this->getPagerVisibility() || $this->getExportTypes() || $this->getChildBlock('grid.columnSet')->getFilterVisibility()): ?> <div class="grid-actions"> diff --git a/app/code/Magento/Backend/view/adminhtml/widget/grid/extended.phtml b/app/code/Magento/Backend/view/adminhtml/widget/grid/extended.phtml index 2f8e7658414..ea117a5cbdb 100644 --- a/app/code/Magento/Backend/view/adminhtml/widget/grid/extended.phtml +++ b/app/code/Magento/Backend/view/adminhtml/widget/grid/extended.phtml @@ -52,7 +52,7 @@ $numColumns = sizeof($this->getColumns()); <div id="<?php echo $this->getId() ?>"> <?php else: ?> - <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> <?php endif; ?> <?php if ($this->getPagerVisibility() || $this->getExportTypes() || $this->getFilterVisibility()): ?> <div class="grid-actions"> diff --git a/app/code/Magento/Backup/Block/Adminhtml/Dialogs.php b/app/code/Magento/Backup/Block/Adminhtml/Dialogs.php index 577ff48d604..d7692dc3b77 100644 --- a/app/code/Magento/Backup/Block/Adminhtml/Dialogs.php +++ b/app/code/Magento/Backup/Block/Adminhtml/Dialogs.php @@ -45,13 +45,13 @@ class Dialogs extends \Magento\Backend\Block\Template /** * Include backup.js file in page before rendering * - * @see \Magento\View\Block\AbstractBlock::_prepareLayout() + * @see \Magento\View\Element\AbstractBlock::_prepareLayout() */ protected function _prepareLayout() { $this->getLayout()->getBlock('head')->addChild( 'magento-adminhtml-backup-js', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'mage/adminhtml/backup.js' ) diff --git a/app/code/Magento/Backup/Controller/Adminhtml/Index.php b/app/code/Magento/Backup/Controller/Adminhtml/Index.php index d5bd2bfdce2..9a4c21242a3 100644 --- a/app/code/Magento/Backup/Controller/Adminhtml/Index.php +++ b/app/code/Magento/Backup/Controller/Adminhtml/Index.php @@ -300,8 +300,7 @@ class Index extends \Magento\Backend\App\Action $helper->invalidateCache()->invalidateIndexer(); $adminSession = $this->_getSession(); - $adminSession->unsetAll(); - $adminSession->getCookie()->delete($adminSession->getSessionName()); + $adminSession->destroy(); $response->setRedirectUrl($this->getUrl('*')); } catch (\Magento\Backup\Exception\CantLoadSnapshot $e) { diff --git a/app/code/Magento/Backup/Model/Fs/Collection.php b/app/code/Magento/Backup/Model/Fs/Collection.php index 3d581477295..73272361df0 100644 --- a/app/code/Magento/Backup/Model/Fs/Collection.php +++ b/app/code/Magento/Backup/Model/Fs/Collection.php @@ -63,16 +63,16 @@ class Collection extends \Magento\Data\Collection\Filesystem protected $_backup = null; /** + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Backup\Helper\Data $backupData * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\App\Dir $dir * @param \Magento\Backup\Model\Backup $backup */ public function __construct( + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Backup\Helper\Data $backupData, \Magento\Filesystem $filesystem, - \Magento\Core\Model\EntityFactory $entityFactory, \Magento\App\Dir $dir, \Magento\Backup\Model\Backup $backup ) { diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php index 5133ce30234..85d2efdb696 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Composite/Fieldset/Bundle.php @@ -33,6 +33,8 @@ */ namespace Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset; +use Magento\Catalog\Block\Product\View\AbstractView; + class Bundle extends \Magento\Bundle\Block\Catalog\Product\View\Type\Bundle { @@ -41,7 +43,8 @@ class Bundle * * @return string */ - public function getJsonConfig() { + public function getJsonConfig() + { $options = array(); $optionsArray = $this->getOptions(); foreach ($optionsArray as $option) { @@ -55,6 +58,6 @@ class Bundle } } $config = array('options' => $options); - return $this->_coreData->jsonEncode($config); + return $this->jsonEncoder->encode($config); } } diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php index bb9c7224275..1761749ea94 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Attributes/Extend.php @@ -46,20 +46,18 @@ class Extend */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php index fd4b662c7ca..6c4f564d711 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle.php @@ -47,20 +47,18 @@ class Bundle extends \Magento\Adminhtml\Block\Widget */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getTabUrl() diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php index 503a75586ab..2a2faf272a4 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option.php @@ -86,7 +86,6 @@ class Option extends \Magento\Backend\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Backend\Model\Config\Source\Yesno $yesno * @param \Magento\Bundle\Model\Source\Option\Type $optionTypes * @param \Magento\Core\Model\Registry $registry @@ -94,7 +93,6 @@ class Option extends \Magento\Backend\Block\Widget */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Backend\Model\Config\Source\Yesno $yesno, \Magento\Bundle\Model\Source\Option\Type $optionTypes, \Magento\Core\Model\Registry $registry, @@ -103,7 +101,7 @@ class Option extends \Magento\Backend\Block\Widget $this->_coreRegistry = $registry; $this->_optionTypes = $optionTypes; $this->_yesno = $yesno; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -260,7 +258,7 @@ class Option extends \Magento\Backend\Block\Widget public function getTypeSelectHtml() { - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setData(array( 'id' => $this->getFieldId().'_{{index}}_type', 'class' => 'select select-product-option-type required-option-select', @@ -274,7 +272,7 @@ class Option extends \Magento\Backend\Block\Widget public function getRequireSelectHtml() { - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setData(array( 'id' => $this->getFieldId().'_{{index}}_required', 'class' => 'select' diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php index b7cf851e8b8..6407e722154 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Search/Grid.php @@ -48,25 +48,23 @@ class Grid */ protected $_productFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Bundle\Helper\Data $bundleData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Bundle\Helper\Data $bundleData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Bundle\Helper\Data $bundleData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Bundle\Helper\Data $bundleData, + array $data = array() + ) { $this->_bundleData = $bundleData; $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php index f95d01747dd..1cd874a223a 100644 --- a/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php +++ b/app/code/Magento/Bundle/Block/Adminhtml/Catalog/Product/Edit/Tab/Bundle/Option/Selection.php @@ -64,7 +64,6 @@ class Selection /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Backend\Model\Config\Source\Yesno $yesno * @param \Magento\Bundle\Model\Source\Option\Selection\Price\Type $priceType * @param \Magento\Catalog\Helper\Data $catalogData @@ -73,7 +72,6 @@ class Selection */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Backend\Model\Config\Source\Yesno $yesno, \Magento\Bundle\Model\Source\Option\Selection\Price\Type $priceType, \Magento\Catalog\Helper\Data $catalogData, @@ -84,7 +82,7 @@ class Selection $this->_coreRegistry = $registry; $this->_priceType = $priceType; $this->_yesno = $yesno; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -149,7 +147,7 @@ class Selection */ public function getPriceTypeSelectHtml() { - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setData(array( 'id' => $this->getFieldId() . '_{{index}}_price_type', 'class' => 'select select-product-option-type required-option-select' @@ -169,7 +167,7 @@ class Selection */ public function getQtyTypeSelectHtml() { - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setData(array( 'id' => $this->getFieldId().'_{{index}}_can_change_qty', 'class' => 'select' diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/Price.php b/app/code/Magento/Bundle/Block/Catalog/Product/Price.php index 1ab8e943a7b..1decc537fe1 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/Price.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/Price.php @@ -41,8 +41,8 @@ class Price extends \Magento\Catalog\Block\Product\Price protected $_taxCalc; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Registry $registry @@ -52,8 +52,8 @@ class Price extends \Magento\Catalog\Block\Product\Price * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Helper\Data $catalogData, \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Registry $registry, @@ -62,7 +62,7 @@ class Price extends \Magento\Catalog\Block\Product\Price \Magento\Tax\Model\Calculation $taxCalc, array $data = array() ) { - parent::__construct($context, $coreData, $catalogData, $taxData, $registry, $string, $mathRandom, $data); + parent::__construct($context, $jsonEncoder, $catalogData, $taxData, $registry, $string, $mathRandom, $data); $this->_taxCalc = $taxCalc; } diff --git a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php index 59eb3b11820..7c85978d31c 100644 --- a/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php +++ b/app/code/Magento/Bundle/Block/Catalog/Product/View/Type/Bundle.php @@ -58,8 +58,17 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView protected $_productPrice; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @var \Magento\Core\Helper\Data + */ + protected $coreData; + + /** + * @var \Magento\Json\EncoderInterface + */ + protected $jsonEncoder; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -68,11 +77,12 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView * @param \Magento\Stdlib\ArrayUtils $arrayUtils * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Bundle\Model\Product\PriceFactory $productPrice + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -81,13 +91,16 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView \Magento\Stdlib\ArrayUtils $arrayUtils, \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Bundle\Model\Product\PriceFactory $productPrice, + \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, array $data = array() ) { $this->_catalogProduct = $catalogProduct; $this->_productPrice = $productPrice; + $this->coreData = $coreData; + $this->jsonEncoder = $jsonEncoder; parent::__construct( $context, - $coreData, $catalogConfig, $registry, $taxData, @@ -140,12 +153,6 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView $options = array(); $selected = array(); $currentProduct = $this->getProduct(); - /* @var $coreHelper \Magento\Core\Helper\Data */ - $coreHelper = $this->_coreData; - /* @var $catalogHelper \Magento\Catalog\Helper\Data */ - $catalogHelper = $this->_catalogData; - /* @var $taxHelper \Magento\Tax\Helper\Data */ - $taxHelper = $this->_taxData; /* @var $bundlePriceModel \Magento\Bundle\Model\Product\Price */ $bundlePriceModel = $this->_productPrice->create(); @@ -178,7 +185,7 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView // recalculate currency $tierPrices = $_selection->getTierPrice(); foreach ($tierPrices as &$tierPriceInfo) { - $tierPriceInfo['price'] = $coreHelper->currency($tierPriceInfo['price'], false, false); + $tierPriceInfo['price'] = $this->coreData->currency($tierPriceInfo['price'], false, false); } unset($tierPriceInfo); // break the reference with the last element @@ -188,21 +195,23 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView $canApplyMAP = false; - $_priceInclTax = $taxHelper->getPrice($_selection, $itemPrice, true); - $_priceExclTax = $taxHelper->getPrice($_selection, $itemPrice); + $_priceInclTax = $this->_taxData->getPrice($_selection, $itemPrice, true); + $_priceExclTax = $this->_taxData->getPrice($_selection, $itemPrice); if ($currentProduct->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED) { - $_priceInclTax = $taxHelper->getPrice($currentProduct, $itemPrice, true); - $_priceExclTax = $taxHelper->getPrice($currentProduct, $itemPrice); + $_priceInclTax = $this->_taxData->getPrice($currentProduct, $itemPrice, true); + $_priceExclTax = $this->_taxData->getPrice($currentProduct, $itemPrice); } $selection = array ( 'qty' => $_qty, 'customQty' => $_selection->getSelectionCanChangeQty(), - 'price' => $coreHelper->currency($_selection->getFinalPrice(), false, false), - 'priceInclTax' => $coreHelper->currency($_priceInclTax, false, false), - 'priceExclTax' => $coreHelper->currency($_priceExclTax, false, false), - 'priceValue' => $coreHelper->currency($_selection->getSelectionPriceValue(), false, false), + 'price' => $this->coreData->currency($_selection->getFinalPrice(), false, false), + 'priceInclTax' => $this->coreData->currency($_priceInclTax, false, false), + 'priceExclTax' => $this->coreData->currency($_priceExclTax, false, false), + 'priceValue' => $this->coreData->currency( + $_selection->getSelectionPriceValue(), false, false + ), 'priceType' => $_selection->getSelectionPriceType(), 'tierPrice' => $tierPrices, 'name' => $_selection->getName(), @@ -237,25 +246,26 @@ class Bundle extends \Magento\Catalog\Block\Product\View\AbstractView } } } + $isFixedPrice = $this->getProduct()->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED; $config = array( 'options' => $options, 'selected' => $selected, 'bundleId' => $currentProduct->getId(), 'priceFormat' => $this->_locale->getJsPriceFormat(), - 'basePrice' => $coreHelper->currency($currentProduct->getPrice(), false, false), + 'basePrice' => $this->coreData->currency($currentProduct->getPrice(), false, false), 'priceType' => $currentProduct->getPriceType(), 'specialPrice' => $currentProduct->getSpecialPrice(), - 'includeTax' => $taxHelper->priceIncludesTax() ? 'true' : 'false', - 'isFixedPrice' => $this->getProduct()->getPriceType() == \Magento\Bundle\Model\Product\Price::PRICE_TYPE_FIXED, - 'isMAPAppliedDirectly' => $catalogHelper->canApplyMsrp($this->getProduct(), null, false) + 'includeTax' => $this->_taxData->priceIncludesTax() ? 'true' : 'false', + 'isFixedPrice' => $isFixedPrice, + 'isMAPAppliedDirectly' => $this->_catalogData->canApplyMsrp($this->getProduct(), null, false) ); if ($preConfiguredFlag && !empty($defaultValues)) { $config['defaultValues'] = $defaultValues; } - return $coreHelper->jsonEncode($config); + return $this->jsonEncoder->encode($config); } /** diff --git a/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php b/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php index 07f609cfde2..14a2ac636af 100644 --- a/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php +++ b/app/code/Magento/Bundle/Block/Checkout/Cart/Item/Renderer.php @@ -45,23 +45,21 @@ class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer protected $_bundleProdConfigur = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Product\Configuration $productConfig * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Bundle\Helper\Catalog\Product\Configuration $bundleProdConfigur * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Product\Configuration $productConfig, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Bundle\Helper\Catalog\Product\Configuration $bundleProdConfigur, array $data = array() ) { $this->_bundleProdConfigur = $bundleProdConfigur; - parent::__construct($context, $coreData, $productConfig, $checkoutSession, $data); + parent::__construct($context, $productConfig, $checkoutSession, $data); } protected function _construct() diff --git a/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php b/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php index 5e15017a597..27dfc41a32a 100644 --- a/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php +++ b/app/code/Magento/Bundle/Helper/Catalog/Product/Configuration.php @@ -56,15 +56,15 @@ class Configuration extends \Magento\App\Helper\AbstractHelper protected $_escaper; /** + * @param \Magento\App\Helper\Context $context * @param \Magento\Catalog\Helper\Product\Configuration $ctlgProdConfigur * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Helper\Context $context * @param \Magento\Escaper $escaper */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Catalog\Helper\Product\Configuration $ctlgProdConfigur, \Magento\Core\Helper\Data $coreData, - \Magento\App\Helper\Context $context, \Magento\Escaper $escaper ) { $this->_ctlgProdConfigur = $ctlgProdConfigur; diff --git a/app/code/Magento/Bundle/Model/Price/Index.php b/app/code/Magento/Bundle/Model/Price/Index.php index 1cd7e914e5c..aa1992a7837 100644 --- a/app/code/Magento/Bundle/Model/Price/Index.php +++ b/app/code/Magento/Bundle/Model/Price/Index.php @@ -58,19 +58,19 @@ class Index extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Customer\Model\Session $customerSession, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Customer\Model\Session $customerSession, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Bundle/Model/Resource/Bundle.php b/app/code/Magento/Bundle/Model/Resource/Bundle.php index 6831f8ca5f6..e09840c341a 100644 --- a/app/code/Magento/Bundle/Model/Resource/Bundle.php +++ b/app/code/Magento/Bundle/Model/Resource/Bundle.php @@ -42,14 +42,12 @@ class Bundle extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_productRelation; /** - * Class constructor - * - * @param \Magento\Catalog\Model\Resource\Product\Relation $productRelation * @param \Magento\App\Resource $resource + * @param \Magento\Catalog\Model\Resource\Product\Relation $productRelation */ public function __construct( - \Magento\Catalog\Model\Resource\Product\Relation $productRelation, - \Magento\App\Resource $resource + \Magento\App\Resource $resource, + \Magento\Catalog\Model\Resource\Product\Relation $productRelation ) { parent::__construct($resource); $this->_productRelation = $productRelation; diff --git a/app/code/Magento/Bundle/Model/Resource/Price/Index.php b/app/code/Magento/Bundle/Model/Resource/Price/Index.php index bb7665791fa..8961aa6d1c5 100644 --- a/app/code/Magento/Bundle/Model/Resource/Price/Index.php +++ b/app/code/Magento/Bundle/Model/Resource/Price/Index.php @@ -90,24 +90,22 @@ class Index extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * Class constructor - * + * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\CatalogRule\Model\Resource\RuleFactory $catalogRuleFactory * @param \Magento\Customer\Model\GroupFactory $customerGroup * @param \Magento\Catalog\Model\Config $config * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\App\Resource $resource */ public function __construct( + \Magento\App\Resource $resource, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\LocaleInterface $locale, \Magento\CatalogRule\Model\Resource\RuleFactory $catalogRuleFactory, \Magento\Customer\Model\GroupFactory $customerGroup, \Magento\Catalog\Model\Config $config, - \Magento\Event\ManagerInterface $eventManager, - \Magento\App\Resource $resource + \Magento\Event\ManagerInterface $eventManager ) { $this->_eventManager = $eventManager; parent::__construct($resource); diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php index 21d611a3e53..ec2eda68e64 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -43,27 +43,27 @@ class Creditmemo extends \Magento\Bundle\Model\Sales\Order\Pdf\Items\AbstractIte protected $string; /** - * @param \Magento\Stdlib\String $string - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Dir $coreDir - * @param \Magento\Data\Collection\Db $resourceCollection + * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Resource\AbstractResource $resource + * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Stdlib\String $string, - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Tax\Helper\Data $taxData, \Magento\App\Dir $coreDir, - \Magento\Data\Collection\Db $resourceCollection = null, + \Magento\Stdlib\String $string, \Magento\Core\Model\Resource\AbstractResource $resource = null, + \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->string = $string; - parent::__construct($taxData, $context, $registry, $coreDir, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $taxData, $coreDir, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php index 1bacf99654c..0e3c4b2254c 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Invoice.php @@ -41,27 +41,27 @@ class Invoice extends \Magento\Bundle\Model\Sales\Order\Pdf\Items\AbstractItems protected $string; /** - * @param \Magento\Stdlib\String $coreString - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Dir $coreDir - * @param \Magento\Data\Collection\Db $resourceCollection + * @param \Magento\Stdlib\String $coreString * @param \Magento\Core\Model\Resource\AbstractResource $resource + * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Stdlib\String $coreString, - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Tax\Helper\Data $taxData, \Magento\App\Dir $coreDir, - \Magento\Data\Collection\Db $resourceCollection = null, + \Magento\Stdlib\String $coreString, \Magento\Core\Model\Resource\AbstractResource $resource = null, + \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->string = $coreString; - parent::__construct($taxData, $context, $registry, $coreDir, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $taxData, $coreDir, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php index b03adadf349..cbf54f49749 100644 --- a/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php +++ b/app/code/Magento/Bundle/Model/Sales/Order/Pdf/Items/Shipment.php @@ -41,27 +41,27 @@ class Shipment extends \Magento\Bundle\Model\Sales\Order\Pdf\Items\AbstractItems protected $string; /** - * @param \Magento\Stdlib\String $string - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Dir $coreDir - * @param \Magento\Data\Collection\Db $resourceCollection + * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Resource\AbstractResource $resource + * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Stdlib\String $string, - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Tax\Helper\Data $taxData, \Magento\App\Dir $coreDir, - \Magento\Data\Collection\Db $resourceCollection = null, + \Magento\Stdlib\String $string, \Magento\Core\Model\Resource\AbstractResource $resource = null, + \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->string = $string; - parent::__construct($taxData, $context, $registry, $coreDir, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $taxData, $coreDir, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Bundle/Model/Selection.php b/app/code/Magento/Bundle/Model/Selection.php index 9be4697e459..47abb2f3f08 100644 --- a/app/code/Magento/Bundle/Model/Selection.php +++ b/app/code/Magento/Bundle/Model/Selection.php @@ -64,17 +64,17 @@ class Selection extends \Magento\Core\Model\AbstractModel protected $_catalogData = null; /** - * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Bundle\Model\Resource\Selection $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Bundle\Model\Resource\Selection $resource, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Bundle/etc/module.xml b/app/code/Magento/Bundle/etc/module.xml index 47d84bbd3e2..ca2aecc74c3 100755 --- a/app/code/Magento/Bundle/etc/module.xml +++ b/app/code/Magento/Bundle/etc/module.xml @@ -42,7 +42,7 @@ <module name="Magento_Eav"/> <module name="Magento_Weee"/> <module name="Magento_GiftMessage"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml index e22d4ebabe5..de127f01d0d 100644 --- a/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml +++ b/app/code/Magento/Bundle/view/adminhtml/layout/catalog_product_bundle.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-bundle-css-bundle-product-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-bundle-css-bundle-product-css"> <arguments> <argument name="file" xsi:type="string">Magento_Bundle::css/bundle-product.css</argument> </arguments> diff --git a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml index bd8db974b25..6c8f5274f1c 100644 --- a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/bundle.phtml @@ -28,18 +28,16 @@ <?php /* @var $this \Magento\Bundle\Block\Adminhtml\Catalog\Product\Composite\Fieldset\Bundle */ ?> <?php $options = $this->decorateArray($this->getOptions()); ?> <?php if (count($options)): ?> -<div id="catalog_product_composite_configure_fields_bundle" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>"> - <h4><?php echo __('Bundle Items') ?></h4> - <div class="product-options"> - <dl> - <?php foreach ($options as $option) : ?> - <?php if ($option->getSelections()) : ?> - <?php echo $this->getOptionHtml($option); ?> - <?php endif; ?> - <?php endforeach; ?> - </dl> +<fieldset id="catalog_product_composite_configure_fields_bundle" class="fieldset bundle<?php echo $this->getIsLastFieldset() ? ' last-fieldset' : '' ?>"> + <legend class="legend"><span><?php echo __('Bundle Items') ?></span></legend><br /> + <div class="fields options"> + <?php foreach ($options as $option) : ?> + <?php if ($option->getSelections()) : ?> + <?php echo $this->getOptionHtml($option); ?> + <?php endif; ?> + <?php endforeach; ?> </div> -</div> +</fieldset> <script> var BundleControl = Class.create(); diff --git a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml index b0d503a4433..1a4d7c029d5 100644 --- a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/checkbox.phtml @@ -29,24 +29,35 @@ <?php $_option = $this->getOption(); ?> <?php $_selections = $_option->getSelections(); ?> <?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?> -<dt><label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label></dt> -<dd<?php if ($_option->getDecoratedIsLast()):?> class="last"<?php endif; ?>> - <div class="input-box"> - <?php if (count($_selections) == 1 && $_option->getRequired()): ?> - <?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?> - <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"'/> - <?php else:?> - <ul class="options-list"> - <?php foreach($_selections as $_selection): ?> - <li><input class="change-container-classname checkbox bundle-option-<?php echo $_option->getId() ?> <?php if ($_option->getRequired()) echo 'validate-one-required-by-name' ?>" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" type="checkbox" name="bundle_option[<?php echo $_option->getId() ?>][]"<?php if ($this->isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> value="<?php echo $_selection->getSelectionId() ?>" onclick="ProductConfigure.bundleControl.changeSelection(this)" price="<?php echo $this->getSelectionPrice($_selection) ?>"/> - <span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php echo $this->getSelectionQtyTitlePrice($_selection) ?></label></span> - <?php if($_option->getRequired()): ?> - <?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?> - <?php endif; ?> - </li> - <?php endforeach; ?> - </ul> - <div id="bundle-option-<?php echo $_option->getId() ?>-container"></div> - <?php endif; ?> +<div class="field options<?php if ($_option->getRequired()) echo ' required' ?>"> + <label class="label"><span><?php echo $this->escapeHtml($_option->getTitle()) ?></span></label> + <div class="control"> + <div class="nested<?php if ($_option->getDecoratedIsLast()):?> last<?php endif; ?>"> + <?php if (count($_selections) == 1 && $_option->getRequired()): ?> + <?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?> + <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" + value="<?php echo $_selections[0]->getSelectionId() ?>" + price="<?php echo $this->getSelectionPrice($_selections[0]) ?>" /> + <?php else:?> + <?php foreach($_selections as $_selection): ?> + <div class="field choice"> + <input + class="change-container-classname checkbox bundle-option-<?php echo $_option->getId() ?> <?php if ($_option->getRequired()) echo 'validate-one-required-by-name' ?>" + id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" + type="checkbox" + name="bundle_option[<?php echo $_option->getId() ?>][]"<?php if ($this->isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> + value="<?php echo $_selection->getSelectionId() ?>" + onclick="ProductConfigure.bundleControl.changeSelection(this)" + price="<?php echo $this->getSelectionPrice($_selection) ?>" /> + <label class="label" + for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><span><?php echo $this->getSelectionQtyTitlePrice($_selection) ?></span></label> + <?php if($_option->getRequired()): ?> + <?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?> + <?php endif; ?> + </div> + <?php endforeach; ?> + <div id="bundle-option-<?php echo $_option->getId() ?>-container"></div> + <?php endif; ?> + </div> </div> -</dd> +</div> diff --git a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml index c14cc873433..989f7dca2d2 100644 --- a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/multi.phtml @@ -29,21 +29,26 @@ <?php $_option = $this->getOption(); ?> <?php $_selections = $_option->getSelections(); ?> <?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?> -<dt><label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label></dt> -<dd<?php if ($_option->getDecoratedIsLast()):?> class="last"<?php endif; ?>> - <div class="input-box"> - <?php if (count($_selections) == 1 && $_option->getRequired()): ?> - <?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?> - <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"/> - <?php else: ?> - <select multiple="multiple" size="5" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>][]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select multiselect change-container-classname" onchange="ProductConfigure.bundleControl.changeSelection(this)"> - <?php if(!$_option->getRequired()): ?> - <option value=""><?php echo __('None') ?></option> +<div class="field<?php if ($_option->getRequired()) echo ' required' ?><?php if ($_option->getDecoratedIsLast()):?> last<?php endif; ?>"> + <label class="label"><span><?php echo $this->escapeHtml($_option->getTitle()) ?></span></label> + <div class="control"> + <?php if (count($_selections) == 1 && $_option->getRequired()): ?> + <?php echo $this->getSelectionQtyTitlePrice($_selections[0]) ?> + <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" + value="<?php echo $_selections[0]->getSelectionId() ?>" + price="<?php echo $this->getSelectionPrice($_selections[0]) ?>" /> + <?php else: ?> + <select multiple="multiple" size="5" id="bundle-option-<?php echo $_option->getId() ?>" + name="bundle_option[<?php echo $_option->getId() ?>][]" + class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> multiselect change-container-classname" + onchange="ProductConfigure.bundleControl.changeSelection(this)"> + <?php if(!$_option->getRequired()): ?> + <option value=""><?php echo __('None') ?></option> + <?php endif; ?> + <?php foreach ($_selections as $_selection): ?> + <option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> price="<?php echo $this->getSelectionPrice($_selection) ?>"><?php echo $this->getSelectionQtyTitlePrice($_selection, false) ?></option> + <?php endforeach; ?> + </select> <?php endif; ?> - <?php foreach ($_selections as $_selection): ?> - <option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> price="<?php echo $this->getSelectionPrice($_selection) ?>"><?php echo $this->getSelectionQtyTitlePrice($_selection, false) ?></option> - <?php endforeach; ?> - </select> - <?php endif; ?> </div> -</dd> +</div> diff --git a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml index 5241294fa12..1adb20f4503 100644 --- a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/radio.phtml @@ -32,34 +32,57 @@ <?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?> <?php list($_defaultQty, $_canChangeQty) = $this->getDefaultValues(); ?> -<dt> - <span class="qty-holder"> - <label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo __('Qty:') ?> </label><input <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/> - </span> - <label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label> -</dt> -<dd<?php if ($_option->getDecoratedIsLast()):?> class="last"<?php endif; ?>> - <div class="input-box"> - <?php if ($this->showSingle()): ?> - <?php echo $this->getSelectionTitlePrice($_selections[0]) ?> - <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>" /> - <?php else:?> - <ul class="options-list"> - <?php if (!$_option->getRequired()): ?> - <li><input type="radio" class="radio" id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php echo ($_default && $_default->isSalable())?'':' checked="checked" ' ?> value="" onclick="ProductConfigure.bundleControl.changeSelection(this)"/> - <span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>"><?php echo __('None') ?></label></span> - </li> - <?php endif; ?> - <?php foreach ($_selections as $_selection): ?> - <li><input type="radio" class="radio<?php echo $_option->getRequired()?' validate-one-required-by-name':'' ?> change-container-classname" id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]"<?php if ($this->isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?>value="<?php echo $_selection->getSelectionId() ?>" onclick="ProductConfigure.bundleControl.changeSelection(this)" price="<?php echo $this->getSelectionPrice($_selection) ?>" qtyId="bundle-option-<?php echo $_option->getId() ?>-qty-input"/> - <span class="label"><label for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><?php echo $this->getSelectionTitlePrice($_selection) ?></label></span> - <?php if ($_option->getRequired()): ?> - <?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?> +<div class="field options<?php if ($_option->getRequired()) echo ' required' ?>"> + <label class="label"><span><?php echo $this->escapeHtml($_option->getTitle()) ?></span></label> + <div class="control"> + <div class="nested<?php if ($_option->getDecoratedIsLast()):?> last<?php endif; ?>"> + <?php if ($this->showSingle()): ?> + <?php echo $this->getSelectionTitlePrice($_selections[0]) ?> + <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" + value="<?php echo $_selections[0]->getSelectionId() ?>" + price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"/> + <?php else:?> + <?php if (!$_option->getRequired()): ?> + <div class="field choice"> + <input type="radio" + class="radio" + id="bundle-option-<?php echo $_option->getId() ?>" + name="bundle_option[<?php echo $_option->getId() ?>]"<?php echo ($_default && $_default->isSalable()) ? '' : ' checked="checked" ' ?> + value="" + onclick="ProductConfigure.bundleControl.changeSelection(this)" /> + <label class="label" + for="bundle-option-<?php echo $_option->getId() ?>"><span><?php echo __('None') ?></span></label> + </div> <?php endif; ?> - </li> - <?php endforeach; ?> - </ul> - <div id="bundle-option-<?php echo $_option->getId() ?>-container"></div> - <?php endif; ?> + <?php foreach ($_selections as $_selection): ?> + <div class="field choice"> + <input type="radio" + class="radio<?php echo $_option->getRequired() ? ' validate-one-required-by-name' : '' ?> change-container-classname" + id="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>" + name="bundle_option[<?php echo $_option->getId() ?>]" + <?php if ($this->isSelected($_selection)) echo ' checked="checked"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> + value="<?php echo $_selection->getSelectionId() ?>" + onclick="ProductConfigure.bundleControl.changeSelection(this)" + price="<?php echo $this->getSelectionPrice($_selection) ?>" + qtyId="bundle-option-<?php echo $_option->getId() ?>-qty-input" /> + <label class="label" + for="bundle-option-<?php echo $_option->getId() ?>-<?php echo $_selection->getSelectionId() ?>"><span><?php echo $this->getSelectionTitlePrice($_selection) ?></span></label> + <?php if ($_option->getRequired()): ?> + <?php echo $this->setValidationContainer('bundle-option-'.$_option->getId().'-'.$_selection->getSelectionId(), 'bundle-option-'.$_option->getId().'-container') ?> + <?php endif; ?> + </div> + <?php endforeach; ?> + <div id="bundle-option-<?php echo $_option->getId() ?>-container"></div> + <?php endif; ?> + <div class="field qty"> + <label class="label" + for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><span><?php echo __('Qty:') ?></span></label> + <div class="control"><input <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> + id="bundle-option-<?php echo $_option->getId() ?>-qty-input" + class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" + name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>" /> + </div> + </div> + </div> </div> -</dd> +</div> diff --git a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml index 62db14aaee5..7733a9c8acb 100644 --- a/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml +++ b/app/code/Magento/Bundle/view/adminhtml/product/composite/fieldset/options/type/select.phtml @@ -32,24 +32,40 @@ <?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?> <?php list($_defaultQty, $_canChangeQty) = $this->getDefaultValues(); ?> -<dt> - <span class="qty-holder"> - <label for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo __('Qty:') ?> </label><input <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> id="bundle-option-<?php echo $_option->getId() ?>-qty-input" class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>"/> - </span> - <label<?php if ($_option->getRequired()) echo ' class="required"' ?>><?php if ($_option->getRequired()) echo '<em>*</em>' ?><?php echo $this->escapeHtml($_option->getTitle()) ?></label> -</dt> -<dd<?php if ($_option->getDecoratedIsLast()):?> class="last"<?php endif; ?>> - <div class="input-box"> - <?php if ($this->showSingle()): ?> - <?php echo $this->getSelectionTitlePrice($_selections[0]) ?> - <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" value="<?php echo $_selections[0]->getSelectionId() ?>" price="<?php echo $this->getSelectionPrice($_selections[0]) ?>"/> - <?php else:?> - <select id="bundle-option-<?php echo $_option->getId() ?>" name="bundle_option[<?php echo $_option->getId() ?>]" class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> bundle-option-select change-container-classname" onchange="ProductConfigure.bundleControl.changeSelection(this)"> - <option value=""><?php echo __('Choose a selection...') ?></option> - <?php foreach ($_selections as $_selection): ?> - <option value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> price="<?php echo $this->getSelectionPrice($_selection) ?>" qtyId="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->getSelectionTitlePrice($_selection, false) ?></option> - <?php endforeach; ?> - </select> - <?php endif; ?> +<div class="field option<?php if ($_option->getDecoratedIsLast()):?> last<?php endif; ?><?php if ($_option->getRequired()) echo ' required' ?>"> + <label class="label"><span><?php echo $this->escapeHtml($_option->getTitle()) ?></span></label> + <div class="control"> + <?php if ($this->showSingle()): ?> + <?php echo $this->getSelectionTitlePrice($_selections[0]) ?> + <input type="hidden" name="bundle_option[<?php echo $_option->getId() ?>]" + value="<?php echo $_selections[0]->getSelectionId() ?>" + price="<?php echo $this->getSelectionPrice($_selections[0]) ?>" /> + <?php else:?> + <select id="bundle-option-<?php echo $_option->getId() ?>" + name="bundle_option[<?php echo $_option->getId() ?>]" + class="bundle-option-<?php echo $_option->getId() ?><?php if ($_option->getRequired()) echo ' required-entry' ?> select change-container-classname" + onchange="ProductConfigure.bundleControl.changeSelection(this)"> + <option value=""><?php echo __('Choose a selection...') ?></option> + <?php foreach ($_selections as $_selection): ?> + <option + value="<?php echo $_selection->getSelectionId() ?>"<?php if ($this->isSelected($_selection)) echo ' selected="selected"' ?><?php if (!$_selection->isSaleable() && !$_skipSaleableCheck) echo ' disabled="disabled"' ?> + price="<?php echo $this->getSelectionPrice($_selection) ?>" + qtyId="bundle-option-<?php echo $_option->getId() ?>-qty-input"><?php echo $this->getSelectionTitlePrice($_selection, false) ?></option> + <?php endforeach; ?> + </select> + <?php endif; ?> + + <div class="nested"> + <div class="field qty"> + <label class="label" + for="bundle-option-<?php echo $_option->getId() ?>-qty-input"><span><?php echo __('Qty:') ?></span></label> + <div class="control"> + <input <?php if (!$_canChangeQty) echo ' disabled="disabled"' ?> + id="bundle-option-<?php echo $_option->getId() ?>-qty-input" + class="input-text qty<?php if (!$_canChangeQty) echo ' qty-disabled' ?>" type="text" + name="bundle_option_qty[<?php echo $_option->getId() ?>]" value="<?php echo $_defaultQty ?>" /> + </div> + </div> + </div> </div> -</dd> +</div> diff --git a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml index 3e1666e39a9..bf9fa5c8741 100644 --- a/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml +++ b/app/code/Magento/Bundle/view/frontend/layout/catalog_product_view_type_bundle.xml @@ -25,12 +25,12 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-bundle-bundle-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-bundle-bundle-js"> <arguments> <argument name="file" xsi:type="string">Magento_Bundle::bundle.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-bundle-js-product-summary-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-bundle-js-product-summary-js"> <arguments> <argument name="file" xsi:type="string">Magento_Bundle::js/product-summary.js</argument> </arguments> diff --git a/app/code/Magento/Captcha/Block/Adminhtml/Captcha/DefaultCaptcha.php b/app/code/Magento/Captcha/Block/Adminhtml/Captcha/DefaultCaptcha.php index 74b0d87dc93..6ed0f6d35de 100644 --- a/app/code/Magento/Captcha/Block/Adminhtml/Captcha/DefaultCaptcha.php +++ b/app/code/Magento/Captcha/Block/Adminhtml/Captcha/DefaultCaptcha.php @@ -46,22 +46,20 @@ class DefaultCaptcha extends \Magento\Captcha\Block\Captcha\DefaultCaptcha protected $_config; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Captcha\Helper\Data $captchaData * @param \Magento\Backend\Model\Url $url * @param \Magento\Backend\App\ConfigInterface $config * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Captcha\Helper\Data $captchaData, \Magento\Backend\Model\Url $url, \Magento\Backend\App\ConfigInterface $config, array $data = array() ) { - parent::__construct($context, $coreData, $captchaData, $data); + parent::__construct($context, $captchaData, $data); $this->_url = $url; $this->_config = $config; } diff --git a/app/code/Magento/Captcha/Block/Captcha.php b/app/code/Magento/Captcha/Block/Captcha.php index 7b5596960bf..44f9e3ef9d5 100644 --- a/app/code/Magento/Captcha/Block/Captcha.php +++ b/app/code/Magento/Captcha/Block/Captcha.php @@ -33,7 +33,7 @@ */ namespace Magento\Captcha\Block; -class Captcha extends \Magento\View\Block\Template +class Captcha extends \Magento\View\Element\Template { /** * Captcha data @@ -43,19 +43,17 @@ class Captcha extends \Magento\View\Block\Template protected $_captchaData = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Captcha\Helper\Data $captchaData * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Captcha\Helper\Data $captchaData, array $data = array() ) { $this->_captchaData = $captchaData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php b/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php index 824eded230e..9d3a579e17e 100644 --- a/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php +++ b/app/code/Magento/Captcha/Block/Captcha/DefaultCaptcha.php @@ -33,7 +33,7 @@ */ namespace Magento\Captcha\Block\Captcha; -class DefaultCaptcha extends \Magento\View\Block\Template +class DefaultCaptcha extends \Magento\View\Element\Template { protected $_template = 'default.phtml'; @@ -48,18 +48,16 @@ class DefaultCaptcha extends \Magento\View\Block\Template protected $_captchaData; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Captcha\Helper\Data $captchaData * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Captcha\Helper\Data $captchaData, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_captchaData = $captchaData; } diff --git a/app/code/Magento/Captcha/etc/module.xml b/app/code/Magento/Captcha/etc/module.xml index 9182e4a8050..579fefbebe0 100755 --- a/app/code/Magento/Captcha/etc/module.xml +++ b/app/code/Magento/Captcha/etc/module.xml @@ -34,7 +34,7 @@ <module name="Magento_Checkout"/> <module name="Magento_Core"/> <module name="Magento_Backend"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml index 38d67235675..856a0cb1459 100644 --- a/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Captcha/view/frontend/layout/checkout_onepage_index.xml @@ -39,7 +39,7 @@ </referenceContainer> <referenceContainer name="form.billing.additional.info"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-captcha-onepage-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-captcha-onepage-js"> <arguments> <argument name="file" xsi:type="string">Magento_Captcha::onepage.js</argument> </arguments> diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php index 19db3f966ca..ae0c605db73 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/AbstractCategory.php @@ -47,23 +47,21 @@ class AbstractCategory extends \Magento\Backend\Block\Template */ protected $_categoryTree; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_categoryTree = $categoryTree; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php index a2ee233933d..ffec774c2c3 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Edit/Form.php @@ -33,6 +33,8 @@ */ namespace Magento\Catalog\Block\Adminhtml\Category\Edit; +use Magento\Backend\Block\Template; + class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory { /** @@ -47,12 +49,35 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory */ protected $_template = 'catalog/category/edit/form.phtml'; + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree + * @param \Magento\Core\Model\Registry $registry + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, + \Magento\Core\Model\Registry $registry, + \Magento\Json\EncoderInterface $jsonEncoder, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; + parent::__construct($context, $categoryTree, $registry, $data); + } + protected function _prepareLayout() { if ($head = $this->getLayout()->getBlock('head')) { $head->addChild( 'magento-adminhtml-catalog-category-edit-js', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'Magento_Catalog::catalog/category/edit.js' ) @@ -224,7 +249,7 @@ class Form extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory { $products = $this->getCategory()->getProductsPosition(); if (!empty($products)) { - return $this->_coreData->jsonEncode($products); + return $this->_jsonEncoder->encode($products); } return '{}'; } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php index 6ff20d407ae..91a7137b277 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Attributes.php @@ -41,24 +41,22 @@ class Attributes extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_wysiwygConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php index e073a3782af..9328febd433 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tab/Product.php @@ -47,25 +47,23 @@ class Product extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_productFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_productFactory = $productFactory; $this->_coreRegistry = $coreRegistry; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php index 3c8f365f731..64a0f1c7558 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tabs.php @@ -59,28 +59,28 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory - * @param \Magento\Catalog\Helper\Catalog $helperCatalog - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory + * @param \Magento\Catalog\Helper\Catalog $helperCatalog + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory, - \Magento\Catalog\Helper\Catalog $helperCatalog, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory, + \Magento\Catalog\Helper\Catalog $helperCatalog, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; $this->_coreRegistry = $registry; $this->_helperCatalog = $helperCatalog; - parent::__construct($context, $coreData, $authSession, $data); + parent::__construct($context, $jsonEncoder, $authSession, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php index 28883bd87f7..5c0e0a17a84 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Category/Tree.php @@ -55,30 +55,36 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory */ protected $_helperPool; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\Resource\HelperPool $helperPool - * @param \Magento\Backend\Model\Auth\Session $backendSession - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTree + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\Resource\HelperPool $helperPool + * @param \Magento\Backend\Model\Auth\Session $backendSession + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, - \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\Resource\HelperPool $helperPool, - \Magento\Backend\Model\Auth\Session $backendSession, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\Resource\Category\Tree $categoryTree, + \Magento\Core\Model\Registry $registry, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Core\Model\Resource\HelperPool $helperPool, + \Magento\Backend\Model\Auth\Session $backendSession, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_helperPool = $helperPool; $this->_backendSession = $backendSession; $this->_categoryFactory = $categoryFactory; - parent::__construct($context, $coreData, $categoryTree, $registry, $data); + parent::__construct($context, $categoryTree, $registry, $data); } protected function _construct() @@ -193,7 +199,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory $categoryById[$category->getParentId()]['children'][] = &$categoryById[$category->getId()]; } - return $this->_coreData->jsonEncode( + return $this->_jsonEncoder->encode( $categoryById[\Magento\Catalog\Model\Category::TREE_ROOT_ID]['children'] ); } @@ -267,7 +273,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory public function getTreeJson($parenNodeCategory=null) { $rootArray = $this->_getNodeJson($this->getRoot($parenNodeCategory)); - $json = $this->_coreData->jsonEncode( + $json = $this->_jsonEncoder->encode( isset($rootArray['children']) ? $rootArray['children'] : array() ); return $json; @@ -296,7 +302,7 @@ class Tree extends \Magento\Catalog\Block\Adminhtml\Category\AbstractCategory } return '<script type="text/javascript">' - . $javascriptVarName . ' = ' . $this->_coreData->jsonEncode($categories) . ';' + . $javascriptVarName . ' = ' . $this->_jsonEncoder->encode($categories) . ';' . ($this->canAddSubCategory() ? '$("add_subcategory_button").show();' : '$("add_subcategory_button").hide();') diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Attribute/Urlkey.php b/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Attribute/Urlkey.php index a1cf464d6d0..f77878d4408 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Attribute/Urlkey.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Form/Renderer/Attribute/Urlkey.php @@ -50,23 +50,21 @@ class Urlkey */ protected $_elementFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Data\Form\Element\Factory $elementFactory - * @param \Magento\Catalog\Helper\Data $catalogData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Data\Form\Element\Factory $elementFactory + * @param \Magento\Catalog\Helper\Data $catalogData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Data\Form\Element\Factory $elementFactory, - \Magento\Catalog\Helper\Data $catalogData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Data\Form\Element\Factory $elementFactory, + \Magento\Catalog\Helper\Data $catalogData, + array $data = array() + ) { $this->_elementFactory = $elementFactory; $this->_catalogData = $catalogData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getElementHtml() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php index c5b898f710d..e732d9182d4 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Helper/Form/Wysiwyg/Content.php @@ -41,24 +41,22 @@ class Content */ protected $_wysiwygConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product.php b/app/code/Magento/Catalog/Block/Adminhtml/Product.php index f7aac690456..35898e4a6d0 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product.php @@ -47,24 +47,22 @@ class Product extends \Magento\Adminhtml\Block\Widget\Container */ protected $_productFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\Product\TypeFactory $typeFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\Product\TypeFactory $typeFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\Product\TypeFactory $typeFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\Product\TypeFactory $typeFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { $this->_productFactory = $productFactory; $this->_typeFactory = $typeFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php index b4f277ec399..3eb3faff2d7 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit.php @@ -46,20 +46,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php index baa0d5a08c1..60792a268b0 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Advanced.php @@ -49,27 +49,25 @@ class Advanced */ protected $_yesNo; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Backend\Model\Config\Source\Yesno $yesNo - * @param \Magento\Eav\Helper\Data $eavData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Backend\Model\Config\Source\Yesno $yesNo + * @param \Magento\Eav\Helper\Data $eavData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Backend\Model\Config\Source\Yesno $yesNo, - \Magento\Eav\Helper\Data $eavData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Backend\Model\Config\Source\Yesno $yesNo, + \Magento\Eav\Helper\Data $eavData, + array $data = array() + ) { $this->_yesNo = $yesNo; $this->_eavData = $eavData; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php index d4c7b7c8b72..8ccfc9a5eba 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Edit/Tab/Front.php @@ -41,24 +41,22 @@ class Front extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_yesNo; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Backend\Model\Config\Source\Yesno $yesNo - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Backend\Model\Config\Source\Yesno $yesNo + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Backend\Model\Config\Source\Yesno $yesNo, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Backend\Model\Config\Source\Yesno $yesNo, + array $data = array() + ) { $this->_yesNo = $yesNo; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php index b53a3bf69a6..60203086445 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Grid.php @@ -40,23 +40,21 @@ class Grid extends \Magento\Eav\Block\Adminhtml\Attribute\Grid\AbstractGrid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; $this->_module = 'catalog'; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php index cc3d422af24..dfabc8eb050 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/NewAttribute/Product/Created.php @@ -55,26 +55,32 @@ class Created extends \Magento\Backend\Block\Widget */ protected $_setFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory - * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory + * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, - \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, + \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_setFactory = $setFactory; $this->_attributeFactory = $attributeFactory; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -138,6 +144,6 @@ class Created extends \Magento\Backend\Block\Widget ); } - return $this->_coreData->jsonEncode($result); + return $this->_jsonEncoder->encode($result); } } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php index 5b12d724600..3d558d56e81 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main.php @@ -71,35 +71,41 @@ class Main extends \Magento\Backend\Block\Template */ protected $_attributeFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Eav\Model\Entity\TypeFactory $typeFactory - * @param \Magento\Eav\Model\Entity\Attribute\GroupFactory $groupFactory - * @param \Magento\Catalog\Model\Resource\Product\Type\Configurable\AttributeFactory $attributeFactory - * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory - * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Eav\Model\Entity\TypeFactory $typeFactory + * @param \Magento\Eav\Model\Entity\Attribute\GroupFactory $groupFactory + * @param \Magento\Catalog\Model\Resource\Product\Type\Configurable\AttributeFactory $attributeFactory + * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory + * @param \Magento\Catalog\Helper\Product $catalogProduct + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Eav\Model\Entity\TypeFactory $typeFactory, - \Magento\Eav\Model\Entity\Attribute\GroupFactory $groupFactory, - \Magento\Catalog\Model\Resource\Product\Type\Configurable\AttributeFactory $attributeFactory, - \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, - \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Eav\Model\Entity\TypeFactory $typeFactory, + \Magento\Eav\Model\Entity\Attribute\GroupFactory $groupFactory, + \Magento\Catalog\Model\Resource\Product\Type\Configurable\AttributeFactory $attributeFactory, + \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, + \Magento\Catalog\Helper\Product $catalogProduct, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_typeFactory = $typeFactory; $this->_groupFactory = $groupFactory; $this->_attributeFactory = $attributeFactory; $this->_collectionFactory = $collectionFactory; $this->_coreRegistry = $registry; $this->_catalogProduct = $catalogProduct; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -270,7 +276,7 @@ class Main extends \Magento\Backend\Block\Template $items[] = $item; } - return $this->_coreData->jsonEncode($items); + return $this->_jsonEncoder->encode($items); } /** @@ -324,7 +330,7 @@ class Main extends \Magento\Backend\Block\Template ); } - return $this->_coreData->jsonEncode($items); + return $this->_jsonEncoder->encode($items); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php index 59a0ab8609e..4de91ca8c57 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formgroup.php @@ -40,24 +40,22 @@ class Formgroup */ protected $_typeFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Eav\Model\Entity\TypeFactory $typeFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Eav\Model\Entity\TypeFactory $typeFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Eav\Model\Entity\TypeFactory $typeFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Eav\Model\Entity\TypeFactory $typeFactory, + array $data = array() + ) { $this->_typeFactory = $typeFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php index 0828ebbab78..12825ead916 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Main/Formset.php @@ -34,24 +34,22 @@ class Formset */ protected $_setFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, + array $data = array() + ) { $this->_setFactory = $setFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php index 2cf4226a935..d8eee292f70 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/Main/Filter.php @@ -40,24 +40,22 @@ class Filter */ protected $_setFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Eav\Model\Entity\Attribute\SetFactory $setFactory, + array $data = array() + ) { $this->_setFactory = $setFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php index 2dc36feddfb..e1e6a0ccdcf 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Configure.php @@ -54,23 +54,21 @@ class Configure extends \Magento\Adminhtml\Block\Widget */ protected $_catalogProduct; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\Product $product - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\Product $product + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\Product $product, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\Product $product, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_catalogProduct = $product; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php index d005b863478..c2e72f780ef 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Error.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Adminhtml\Product\Composite; -class Error extends \Magento\View\Block\Template +class Error extends \Magento\View\Element\Template { /** * Core registry @@ -42,20 +42,26 @@ class Error extends \Magento\View\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -67,6 +73,6 @@ class Error extends \Magento\View\Block\Template public function _toHtml() { $message = $this->_coreRegistry->registry('composite_configure_result_error_message'); - return $this->_coreData->jsonEncode(array('error' => true, 'message' => $message)); + return $this->_jsonEncoder->encode(array('error' => true, 'message' => $message)); } } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset.php index bb81640b271..65f6ac7be93 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Adminhtml\Product\Composite; -class Fieldset extends \Magento\View\Block\Text\ListText +class Fieldset extends \Magento\View\Element\Text\ListText { /** * @@ -47,7 +47,7 @@ class Fieldset extends \Magento\View\Block\Text\ListText $total = count($children); $i = 0; $this->setText(''); - /** @var $block \Magento\View\Block\AbstractBlock */ + /** @var $block \Magento\View\Element\AbstractBlock */ foreach ($children as $block) { $i++; $block->setIsLastFieldset($i == $total); diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php index ed712a68f64..a62df00c006 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Grouped.php @@ -40,8 +40,7 @@ class Grouped protected $_priceBlockDefaultTemplate = 'catalog/product/price.phtml'; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -52,8 +51,7 @@ class Grouped * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -65,7 +63,7 @@ class Grouped ) { $this->_taxCalculation = $taxCalculation; parent::__construct( - $context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $arrayUtils, $data + $context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $arrayUtils, $data ); } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php index 10318696be4..a461d3d0367 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/Qty.php @@ -29,7 +29,7 @@ */ namespace Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset; -class Qty extends \Magento\View\Block\Template +class Qty extends \Magento\View\Element\Template { /** * Core registry @@ -38,20 +38,18 @@ class Qty extends \Magento\View\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php index dde58155e80..1a93e57ce42 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Composite/Update/Result.php @@ -35,7 +35,7 @@ */ namespace Magento\Catalog\Block\Adminhtml\Product\Composite\Update; -class Result extends \Magento\View\Block\Template +class Result extends \Magento\View\Element\Template { /** * Adminhtml js @@ -51,23 +51,29 @@ class Result extends \Magento\View\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Helper\Js $adminhtmlJs - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Adminhtml\Helper\Js $adminhtmlJs + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Helper\Js $adminhtmlJs, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Adminhtml\Helper\Js $adminhtmlJs, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_adminhtmlJs = $adminhtmlJs; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -78,7 +84,7 @@ class Result extends \Magento\View\Block\Template public function _toHtml() { $updateResult = $this->_coreRegistry->registry('composite_update_result'); - $resultJson = $this->_coreData->jsonEncode($updateResult); + $resultJson = $this->_jsonEncoder->encode($updateResult); $jsVarname = $updateResult->getJsVarName(); return $this->_adminhtmlJs->getScript(sprintf('var %s = %s', $jsVarname, $resultJson)); } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Created.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Created.php index 94993e6faf3..96625c7af42 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Created.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Created.php @@ -48,20 +48,26 @@ class Created extends \Magento\Adminhtml\Block\Widget */ protected $_productFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\ProductFactory $productFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() @@ -111,7 +117,7 @@ class Created extends \Magento\Adminhtml\Block\Widget ); } - return $this->_coreData->jsonEncode($result); + return $this->_jsonEncoder->encode($result); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php index 3f4a8026e08..42eed0e0272 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit.php @@ -49,23 +49,29 @@ class Edit extends \Magento\Backend\Block\Widget */ protected $_attributeSetFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Eav\Model\Entity\Attribute\SetFactory $attributeSetFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_attributeSetFactory = $attributeSetFactory; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + $this->jsonEncoder = $jsonEncoder; + parent::__construct($context, $data); } protected function _construct() @@ -276,7 +282,7 @@ class Edit extends \Magento\Backend\Block\Widget */ public function getTypeSwitcherData() { - return $this->_coreData->jsonEncode(array( + return $this->jsonEncoder->encode(array( 'tab_id' => 'product_info_tabs_downloadable_items', 'is_virtual_id' => \Magento\Catalog\Block\Adminhtml\Product\Helper\Form\Weight::VIRTUAL_FIELD_HTML_ID, 'weight_id' => 'weight', diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute.php index a3518827035..685fd157858 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute.php @@ -44,20 +44,18 @@ class Attribute extends \Magento\Adminhtml\Block\Widget */ protected $_helperActionAttribute = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Helper\Product\Edit\Action\Attribute $helperActionAttribute - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Helper\Product\Edit\Action\Attribute $helperActionAttribute + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Helper\Product\Edit\Action\Attribute $helperActionAttribute, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Helper\Product\Edit\Action\Attribute $helperActionAttribute, + array $data = array() + ) { $this->_helperActionAttribute = $helperActionAttribute; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php index 3de2bf5166f..466c38c56b8 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Attributes.php @@ -45,7 +45,6 @@ class Attributes /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -53,14 +52,13 @@ class Attributes */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Catalog\Model\ProductFactory $productFactory, array $data = array() ) { $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php index 16707d06ac9..d457b006777 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Action/Attribute/Tab/Inventory.php @@ -42,20 +42,18 @@ class Inventory */ protected $_backorders; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\CatalogInventory\Model\Source\Backorders $backorders - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\CatalogInventory\Model\Source\Backorders $backorders + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\CatalogInventory\Model\Source\Backorders $backorders, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\CatalogInventory\Model\Source\Backorders $backorders, + array $data = array() + ) { $this->_backorders = $backorders; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php index 480a1f8e60f..606f7ca4a40 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/AttributeSet.php @@ -42,20 +42,18 @@ class AttributeSet extends \Magento\Backend\Block\Widget\Form */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php index f3d3f7663de..2e78e31e6d1 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Js.php @@ -35,20 +35,18 @@ class Js extends \Magento\Backend\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php index ce1b092e0ab..521f1fa1b86 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/NewCategory.php @@ -38,23 +38,29 @@ namespace Magento\Catalog\Block\Adminhtml\Product\Edit; */ class NewCategory extends \Magento\Backend\Block\Widget\Form\Generic { - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - array $data = array() - ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; + parent::__construct($context, $registry, $formFactory, $data); $this->setUseContainer(true); $this->_categoryFactory = $categoryFactory; } @@ -135,7 +141,7 @@ class NewCategory extends \Magento\Backend\Block\Widget\Form\Generic */ public function getAfterElementHtml() { - $widgetOptions = $this->_coreData->jsonEncode(array( + $widgetOptions = $this->_jsonEncoder->encode(array( 'suggestOptions' => array( 'source' => $this->getUrl('catalog/category/suggestCategories'), 'valueField' => '#new_category_parent', diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Ajax/Serializer.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Ajax/Serializer.php index 9e62dda5b00..f8afd94bcce 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Ajax/Serializer.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Ajax/Serializer.php @@ -25,7 +25,7 @@ */ namespace Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Ajax; -class Serializer extends \Magento\View\Block\Template +class Serializer extends \Magento\View\Element\Template { public function _construct() { diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php index e705bb1ceb3..569314d9513 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Price.php @@ -48,25 +48,23 @@ class Price extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_priceFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\ProductAlert\Model\PriceFactory $priceFactory - * @param \Magento\Catalog\Helper\Data $catalogData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\ProductAlert\Model\PriceFactory $priceFactory + * @param \Magento\Catalog\Helper\Data $catalogData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\ProductAlert\Model\PriceFactory $priceFactory, - \Magento\Catalog\Helper\Data $catalogData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\ProductAlert\Model\PriceFactory $priceFactory, + \Magento\Catalog\Helper\Data $catalogData, + array $data = array() + ) { $this->_priceFactory = $priceFactory; $this->_catalogData = $catalogData; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php index 7460e9d1fbb..4e74526cffe 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Alerts/Stock.php @@ -48,25 +48,23 @@ class Stock extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_stockFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\ProductAlert\Model\StockFactory $stockFactory - * @param \Magento\Catalog\Helper\Data $catalogData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\ProductAlert\Model\StockFactory $stockFactory + * @param \Magento\Catalog\Helper\Data $catalogData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\ProductAlert\Model\StockFactory $stockFactory, - \Magento\Catalog\Helper\Data $catalogData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\ProductAlert\Model\StockFactory $stockFactory, + \Magento\Catalog\Helper\Data $catalogData, + array $data = array() + ) { $this->_stockFactory = $stockFactory; $this->_catalogData = $catalogData; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php index f2960deaa20..49a94bb131c 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes.php @@ -47,27 +47,25 @@ class Attributes extends \Magento\Catalog\Block\Adminhtml\Form */ protected $_wysiwygConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\Catalog\Helper\Data $catalogData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param \Magento\Catalog\Helper\Data $catalogData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Catalog\Helper\Data $catalogData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + \Magento\Catalog\Helper\Data $catalogData, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; $this->_catalogData = $catalogData; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php index 9fa51ea9b55..a35f350be4b 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Attributes/Search.php @@ -52,26 +52,24 @@ class Search extends \Magento\Backend\Block\Widget */ protected $_helperPool; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Resource\HelperPool $helperPool - * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Resource\HelperPool $helperPool + * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Resource\HelperPool $helperPool, - \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Resource\HelperPool $helperPool, + \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $collectionFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_helperPool = $helperPool; $this->_collectionFactory = $collectionFactory; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php index f5220902e9b..88a7ddf792a 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Crosssell.php @@ -72,32 +72,30 @@ class Crosssell extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_visibility; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\Product\Type $type - * @param \Magento\Catalog\Model\Product\Status $status - * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\Product\Type $type + * @param \Magento\Catalog\Model\Product\Status $status + * @param \Magento\Catalog\Model\Product\Visibility $visibility + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Catalog\Model\Product\LinkFactory $linkFactory, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\Product\Type $type, - \Magento\Catalog\Model\Product\Status $status, - \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\Product\LinkFactory $linkFactory, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\Product\Type $type, + \Magento\Catalog\Model\Product\Status $status, + \Magento\Catalog\Model\Product\Visibility $visibility, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_linkFactory = $linkFactory; $this->_setsFactory = $setsFactory; $this->_productFactory = $productFactory; @@ -105,7 +103,7 @@ class Crosssell extends \Magento\Adminhtml\Block\Widget\Grid $this->_status = $status; $this->_visibility = $visibility; $this->_coreRegistry = $coreRegistry; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php index 613b4b31b2d..b3e920e85c1 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Inventory.php @@ -43,8 +43,6 @@ class Inventory extends \Magento\Adminhtml\Block\Widget protected $_catalogData = null; /** - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Helper\Data $coreData * Core registry * * @var \Magento\Core\Model\Registry @@ -61,29 +59,27 @@ class Inventory extends \Magento\Adminhtml\Block\Widget */ protected $_backorders; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\CatalogInventory\Model\Source\Backorders $backorders - * @param \Magento\CatalogInventory\Model\Source\Stock $stock - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\CatalogInventory\Model\Source\Backorders $backorders + * @param \Magento\CatalogInventory\Model\Source\Stock $stock + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\CatalogInventory\Model\Source\Backorders $backorders, - \Magento\CatalogInventory\Model\Source\Stock $stock, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\CatalogInventory\Model\Source\Backorders $backorders, + \Magento\CatalogInventory\Model\Source\Stock $stock, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_stock = $stock; $this->_backorders = $backorders; $this->_catalogData = $catalogData; $this->_coreRegistry = $coreRegistry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getBackordersOption() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php index a5cdc6b1e0e..3a121f5a9ce 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Option.php @@ -68,7 +68,6 @@ class Option extends \Magento\Adminhtml\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Backend\Model\Config\Source\Yesno $configYesNo * @param \Magento\Catalog\Model\Config\Source\Product\Options\Type $optionType * @param \Magento\Catalog\Model\Product $product @@ -78,7 +77,6 @@ class Option extends \Magento\Adminhtml\Block\Widget */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Backend\Model\Config\Source\Yesno $configYesNo, \Magento\Catalog\Model\Config\Source\Product\Options\Type $optionType, \Magento\Catalog\Model\Product $product, @@ -91,7 +89,7 @@ class Option extends \Magento\Adminhtml\Block\Widget $this->_product = $product; $this->_productOptionConfig = $productOptionConfig; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -190,7 +188,7 @@ class Option extends \Magento\Adminhtml\Block\Widget public function getTypeSelectHtml() { - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setData(array( 'id' => $this->getFieldId() . '_${id}_type', 'class' => 'select select-product-option-type required-option-select', @@ -203,7 +201,7 @@ class Option extends \Magento\Adminhtml\Block\Widget public function getRequireSelectHtml() { - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setData(array( 'id' => $this->getFieldId() . '_${id}_is_require', 'class' => 'select' diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/AbstractType.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/AbstractType.php index 2b8f3ffacfa..7088ded311e 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/AbstractType.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Options/Type/AbstractType.php @@ -45,25 +45,23 @@ class AbstractType extends \Magento\Adminhtml\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config\Source\Product\Options\Price $optionPrice * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Config\Source\Product\Options\Price $optionPrice, array $data = array() ) { $this->_optionPrice = $optionPrice; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() { $this->setChild('option_price_type', $this->getLayout() - ->addBlock('Magento\View\Block\Html\Select', + ->addBlock('Magento\View\Element\Html\Select', $this->getNameInLayout() . '.option_price_type', $this->getNameInLayout()) ->setData(array( diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php index a834234f542..a2df4e71d90 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Group/AbstractGroup.php @@ -82,29 +82,27 @@ abstract class AbstractGroup */ protected $_groupFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Customer\Model\GroupFactory $groupFactory - * @param \Magento\Directory\Helper\Data $directoryHelper - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Customer\Model\GroupFactory $groupFactory + * @param \Magento\Directory\Helper\Data $directoryHelper + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Customer\Model\GroupFactory $groupFactory, - \Magento\Directory\Helper\Data $directoryHelper, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Customer\Model\GroupFactory $groupFactory, + \Magento\Directory\Helper\Data $directoryHelper, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_groupFactory = $groupFactory; $this->_directoryHelper = $directoryHelper; $this->_catalogData = $catalogData; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php index 8d6a526a33e..d9ef5805932 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Price/Recurring.php @@ -39,20 +39,18 @@ class Recurring */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php index 118da106ba3..9954522f20b 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Related.php @@ -72,32 +72,30 @@ class Related extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_visibility; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\Product\Type $type - * @param \Magento\Catalog\Model\Product\Status $status - * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\Product\Type $type + * @param \Magento\Catalog\Model\Product\Status $status + * @param \Magento\Catalog\Model\Product\Visibility $visibility + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Catalog\Model\Product\LinkFactory $linkFactory, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\Product\Type $type, - \Magento\Catalog\Model\Product\Status $status, - \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\Product\LinkFactory $linkFactory, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\Product\Type $type, + \Magento\Catalog\Model\Product\Status $status, + \Magento\Catalog\Model\Product\Visibility $visibility, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_linkFactory = $linkFactory; $this->_setsFactory = $setsFactory; $this->_productFactory = $productFactory; @@ -105,7 +103,7 @@ class Related extends \Magento\Adminhtml\Block\Widget\Grid $this->_status = $status; $this->_visibility = $visibility; $this->_coreRegistry = $coreRegistry; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config.php index 90bb3fd6c7e..22d6816d061 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config.php @@ -58,9 +58,14 @@ class Config */ protected $_configurableType; + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Model\Product\Type\Configurable $configurableType * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Model\Registry $coreRegistry @@ -68,7 +73,7 @@ class Config */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Model\Product\Type\Configurable $configurableType, \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Model\Registry $coreRegistry, @@ -77,7 +82,7 @@ class Config $this->_configurableType = $configurableType; $this->_coreRegistry = $coreRegistry; $this->_catalogData = $catalogData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -283,7 +288,7 @@ class Config foreach ($products as $product) { $data[$product->getId()] = $this->getConfigurableSettings($product); } - return $this->_coreData->jsonEncode($data); + return $this->_jsonEncoder->encode($data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php index d5a2e2e2da6..e24433fa4d4 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Grid/Renderer/Checkbox.php @@ -37,25 +37,23 @@ namespace Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Super\Config\Grid\Ren class Checkbox extends \Magento\Adminhtml\Block\Widget\Grid\Column\Renderer\Checkbox { /** - * Core data - * - * @var \Magento\Core\Helper\Data + * @var \Magento\Json\EncoderInterface */ - protected $_coreData = null; + protected $_jsonEncoder; - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Converter $converter - * @param \Magento\Core\Helper\Data $coreData - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Converter $converter + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Converter $converter, - \Magento\Core\Helper\Data $coreData, - array $data = array() - ) { - $this->_coreData = $coreData; + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Backend\Block\Widget\Grid\Column\Renderer\Options\Converter $converter, + \Magento\Json\EncoderInterface $jsonEncoder, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; parent::__construct($context, $converter, $data); } @@ -92,6 +90,6 @@ class Checkbox extends \Magento\Adminhtml\Block\Widget\Grid\Column\Renderer\Chec $result[] = $item; } - return $this->_coreData->jsonEncode($result); + return $this->_jsonEncoder->encode($result); } -}// Class \Magento\Catalog\Block\Adminhtml\Product\Edit\Tab\Super\Config\Grid\Renderer\Checkbox END +} diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php index f8bc14458e7..03a62df24cd 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Matrix.php @@ -37,7 +37,6 @@ class Matrix extends \Magento\Backend\Block\Template { /** - * @param \Magento\Core\Helper\Data $coreData * Core registry * * @var \Magento\Core\Model\Registry @@ -59,29 +58,27 @@ class Matrix */ protected $_config; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\Product\Type\Configurable $configurableType - * @param \Magento\Catalog\Model\Config $config - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\Product\Type\Configurable $configurableType + * @param \Magento\Catalog\Model\Config $config + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\Product\Type\Configurable $configurableType, - \Magento\Catalog\Model\Config $config, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\Product\Type\Configurable $configurableType, + \Magento\Catalog\Model\Config $config, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_configurableType = $configurableType; $this->_productFactory = $productFactory; $this->_config = $config; $this->_coreRegistry = $coreRegistry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php index 54c0fa632e8..0c7104d2a93 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/Simple.php @@ -48,28 +48,26 @@ class Simple */ protected $_productFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Catalog\Model\ProductFactory $productFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $wysiwygConfig, $catalogData, $data); + parent::__construct($context, $registry, $formFactory, $wysiwygConfig, $catalogData, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php index 977eb645793..6b2d70030df 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Settings.php @@ -40,24 +40,22 @@ class Settings extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_configurableType; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Catalog\Model\Product\Type\Configurable $configurableType - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Catalog\Model\Product\Type\Configurable $configurableType + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Catalog\Model\Product\Type\Configurable $configurableType, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Catalog\Model\Product\Type\Configurable $configurableType, + array $data = array() + ) { $this->_configurableType = $configurableType; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php index 1b983bc8448..bef3f2227e0 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Upsell.php @@ -72,32 +72,30 @@ class Upsell extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_visibility; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\Product\Type $type - * @param \Magento\Catalog\Model\Product\Status $status - * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\Product\LinkFactory $linkFactory + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\Product\Type $type + * @param \Magento\Catalog\Model\Product\Status $status + * @param \Magento\Catalog\Model\Product\Visibility $visibility + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Catalog\Model\Product\LinkFactory $linkFactory, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\Product\Type $type, - \Magento\Catalog\Model\Product\Status $status, - \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\Product\LinkFactory $linkFactory, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\Product\Type $type, + \Magento\Catalog\Model\Product\Status $status, + \Magento\Catalog\Model\Product\Visibility $visibility, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_linkFactory = $linkFactory; $this->_setsFactory = $setsFactory; $this->_productFactory = $productFactory; @@ -105,7 +103,7 @@ class Upsell extends \Magento\Adminhtml\Block\Widget\Grid $this->_status = $status; $this->_visibility = $visibility; $this->_coreRegistry = $coreRegistry; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php index 0091dc7b01d..0ca800bac66 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Websites.php @@ -46,26 +46,24 @@ class Websites extends \Magento\Backend\Block\Store\Switcher */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Website\Factory $websiteFactory - * @param \Magento\Core\Model\Store\Group\Factory $storeGroupFactory - * @param \Magento\Core\Model\StoreFactory $storeFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Website\Factory $websiteFactory + * @param \Magento\Core\Model\Store\Group\Factory $storeGroupFactory + * @param \Magento\Core\Model\StoreFactory $storeFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Website\Factory $websiteFactory, - \Magento\Core\Model\Store\Group\Factory $storeGroupFactory, - \Magento\Core\Model\StoreFactory $storeFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Website\Factory $websiteFactory, + \Magento\Core\Model\Store\Group\Factory $storeGroupFactory, + \Magento\Core\Model\StoreFactory $storeFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; - parent::__construct($context, $coreData, $websiteFactory, $storeGroupFactory, $storeFactory, $data); + parent::__construct($context, $websiteFactory, $storeGroupFactory, $storeFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php index 915f01943f0..d24762f941f 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Edit/Tabs.php @@ -66,31 +66,39 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory - * @param \Magento\Catalog\Helper\Catalog $helperCatalog - * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @var \Magento\Module\Manager + */ + protected $_moduleManager; + + /** + * @param \Magento\Module\Manager $moduleManager + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory + * @param \Magento\Catalog\Helper\Catalog $helperCatalog + * @param \Magento\Catalog\Helper\Data $catalogData + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory, - \Magento\Catalog\Helper\Catalog $helperCatalog, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\Module\Manager $moduleManager, + \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $collectionFactory, + \Magento\Catalog\Helper\Catalog $helperCatalog, + \Magento\Catalog\Helper\Data $catalogData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + $this->_moduleManager = $moduleManager; $this->_collectionFactory = $collectionFactory; $this->_helperCatalog = $helperCatalog; $this->_catalogData = $catalogData; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $authSession, $data); + parent::__construct($context, $jsonEncoder, $authSession, $data); } protected function _construct() @@ -170,7 +178,7 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs unset($advancedGroups['advanced-pricing']); } - if ($this->_coreData->isModuleEnabled('Magento_CatalogInventory')) { + if ($this->_moduleManager->isEnabled('Magento_CatalogInventory')) { $this->addTab('advanced-inventory', array( 'label' => __('Advanced Inventory'), 'content' => $this->_translateHtml($this->getLayout() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php index e18930377ac..969ed0161cd 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Frontend/Product/Watermark.php @@ -57,22 +57,22 @@ class Watermark */ protected $_imageTypes; - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Catalog\Model\Config\Source\Watermark\Position $watermarkPosition - * @param \Magento\Backend\Block\System\Config\Form\Field $formField - * @param \Magento\Data\Form\Element\Factory $elementFactory - * @param array $data - * @param array $imageTypes + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Catalog\Model\Config\Source\Watermark\Position $watermarkPosition + * @param \Magento\Backend\Block\System\Config\Form\Field $formField + * @param \Magento\Data\Form\Element\Factory $elementFactory + * @param array $imageTypes + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Catalog\Model\Config\Source\Watermark\Position $watermarkPosition, - \Magento\Backend\Block\System\Config\Form\Field $formField, - \Magento\Data\Form\Element\Factory $elementFactory, - array $data = array(), - array $imageTypes = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Catalog\Model\Config\Source\Watermark\Position $watermarkPosition, + \Magento\Backend\Block\System\Config\Form\Field $formField, + \Magento\Data\Form\Element\Factory $elementFactory, + array $imageTypes = array(), + array $data = array() + ) { $this->_watermarkPosition = $watermarkPosition; $this->_formField = $formField; $this->_elementFactory = $elementFactory; diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php index 9b1a54e2c4a..c53988ec880 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Grid.php @@ -72,32 +72,30 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_websiteFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Core\Model\WebsiteFactory $websiteFactory - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\Product\Type $type - * @param \Magento\Catalog\Model\Product\Status $status - * @param \Magento\Catalog\Model\Product\Visibility $visibility - * @param \Magento\Catalog\Helper\Data $catalogData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Core\Model\WebsiteFactory $websiteFactory + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\Product\Type $type + * @param \Magento\Catalog\Model\Product\Status $status + * @param \Magento\Catalog\Model\Product\Visibility $visibility + * @param \Magento\Catalog\Helper\Data $catalogData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Core\Model\WebsiteFactory $websiteFactory, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\Product\Type $type, - \Magento\Catalog\Model\Product\Status $status, - \Magento\Catalog\Model\Product\Visibility $visibility, - \Magento\Catalog\Helper\Data $catalogData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Core\Model\WebsiteFactory $websiteFactory, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\Product\Type $type, + \Magento\Catalog\Model\Product\Status $status, + \Magento\Catalog\Model\Product\Visibility $visibility, + \Magento\Catalog\Helper\Data $catalogData, + array $data = array() + ) { $this->_websiteFactory = $websiteFactory; $this->_setsFactory = $setsFactory; $this->_productFactory = $productFactory; @@ -105,7 +103,7 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended $this->_status = $status; $this->_visibility = $visibility; $this->_catalogData = $catalogData; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php index aa83f6051fe..c25f519a3d1 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Category.php @@ -53,29 +53,34 @@ class Category extends \Magento\Data\Form\Element\Multiselect */ protected $_coreData; + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + /** * @param \Magento\Catalog\Model\Resource\Category\CollectionFactory $collectionFactory + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Escaper $escaper * @param \Magento\Data\Form\Element\Factory $factoryElement * @param \Magento\Data\Form\Element\CollectionFactory $factoryCollection * @param \Magento\Backend\Helper\Data $backendData * @param \Magento\View\LayoutInterface $layout - * @param \Magento\Core\Helper\Data $coreData * @param array $attributes */ public function __construct( \Magento\Catalog\Model\Resource\Category\CollectionFactory $collectionFactory, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Escaper $escaper, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, \Magento\Backend\Helper\Data $backendData, \Magento\View\LayoutInterface $layout, - \Magento\Core\Helper\Data $coreData, array $attributes = array() ) { + $this->_jsonEncoder = $jsonEncoder; $this->_collectionFactory = $collectionFactory; $this->_backendData = $backendData; - $this->_coreData = $coreData; parent::__construct($escaper, $factoryElement, $factoryCollection, $attributes); $this->_layout = $layout; } @@ -123,7 +128,7 @@ class Category extends \Magento\Data\Form\Element\Multiselect { $htmlId = $this->getHtmlId(); $suggestPlaceholder = __('start typing to search category'); - $selectorOptions = $this->_coreData->jsonEncode($this->_getSelectorOptions()); + $selectorOptions = $this->_jsonEncoder->encode($this->_getSelectorOptions()); $newCategoryCaption = __('New Category'); $button = $this->_layout diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php index 22a576cc5ab..989c9d5aa38 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/Gallery/Content.php @@ -45,20 +45,26 @@ class Content extends \Magento\Backend\Block\Widget */ protected $_mediaConfig; + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Model\Product\Media\Config $mediaConfig * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Model\Product\Media\Config $mediaConfig, array $data = array() ) { + $this->_jsonEncoder = $jsonEncoder; $this->_mediaConfig = $mediaConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() @@ -127,7 +133,7 @@ class Content extends \Magento\Backend\Block\Widget foreach ($value['images'] as &$image) { $image['url'] = $this->_mediaConfig->getMediaUrl($image['file']); } - return $this->_coreData->jsonEncode($value['images']); + return $this->_jsonEncoder->encode($value['images']); } } return '[]'; @@ -142,7 +148,7 @@ class Content extends \Magento\Backend\Block\Widget $attribute->getAttributeCode() ); } - return $this->_coreData->jsonEncode($values); + return $this->_jsonEncoder->encode($values); } /** @@ -189,7 +195,7 @@ class Content extends \Magento\Backend\Block\Widget public function getImageTypesJson() { - return $this->_coreData->jsonEncode($this->getImageTypes()); + return $this->_jsonEncoder->encode($this->getImageTypes()); } } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php index 477426fa370..82a1a14e801 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Options/Ajax.php @@ -54,20 +54,28 @@ class Ajax extends \Magento\Backend\Block\AbstractBlock */ protected $_productFactory; - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Helper\Data $coreData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_coreRegistry = $registry; $this->_coreData = $coreData; $this->_productFactory = $productFactory; @@ -105,6 +113,6 @@ class Ajax extends \Magento\Backend\Block\AbstractBlock $output[] = $resultObject->getData(); } - return $this->_coreData->jsonEncode($output); + return $this->_jsonEncoder->encode($output); } } diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser.php b/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser.php index 79cdc85bc81..f8e437c4969 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Product/Widget/Chooser.php @@ -57,31 +57,29 @@ class Chooser extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_categoryFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $collectionFactory - * @param \Magento\Catalog\Model\Resource\Category $resourceCategory - * @param \Magento\Catalog\Model\Resource\Product $resourceProduct - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $collectionFactory + * @param \Magento\Catalog\Model\Resource\Category $resourceCategory + * @param \Magento\Catalog\Model\Resource\Product $resourceProduct + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Catalog\Model\CategoryFactory $categoryFactory, - \Magento\Catalog\Model\Resource\Product\CollectionFactory $collectionFactory, - \Magento\Catalog\Model\Resource\Category $resourceCategory, - \Magento\Catalog\Model\Resource\Product $resourceProduct, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, + \Magento\Catalog\Model\Resource\Product\CollectionFactory $collectionFactory, + \Magento\Catalog\Model\Resource\Category $resourceCategory, + \Magento\Catalog\Model\Resource\Product $resourceProduct, + array $data = array() + ) { $this->_categoryFactory = $categoryFactory; $this->_collectionFactory = $collectionFactory; $this->_resourceCategory = $resourceCategory; $this->_resourceProduct = $resourceProduct; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php index d5e8538e586..4e22a3db0b6 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit.php @@ -39,20 +39,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php index e1eb0d9aac5..67e85f553d8 100644 --- a/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php +++ b/app/code/Magento/Catalog/Block/Adminhtml/Search/Edit/Form.php @@ -41,24 +41,22 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\System\Store $systemStore - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\System\Store $systemStore, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\System\Store $systemStore, + array $data = array() + ) { $this->_systemStore = $systemStore; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Breadcrumbs.php b/app/code/Magento/Catalog/Block/Breadcrumbs.php index f2a9fb0b0d3..a18bb9245c3 100644 --- a/app/code/Magento/Catalog/Block/Breadcrumbs.php +++ b/app/code/Magento/Catalog/Block/Breadcrumbs.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block; -class Breadcrumbs extends \Magento\View\Block\Template +class Breadcrumbs extends \Magento\View\Element\Template { /** * Catalog data @@ -43,19 +43,17 @@ class Breadcrumbs extends \Magento\View\Block\Template protected $_catalogData = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, array $data = array() ) { $this->_catalogData = $catalogData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Category/View.php b/app/code/Magento/Catalog/Block/Category/View.php index e7434c4d782..2c6d33afdba 100644 --- a/app/code/Magento/Catalog/Block/Category/View.php +++ b/app/code/Magento/Catalog/Block/Category/View.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Category; -class View extends \Magento\View\Block\Template +class View extends \Magento\View\Element\Template { /** * Core registry @@ -50,22 +50,20 @@ class View extends \Magento\View\Block\Template protected $_catalogLayer; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_catalogLayer = $catalogLayer; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() @@ -95,7 +93,7 @@ class View extends \Magento\View\Block\Template ) { $headBlock->addChild( 'magento-page-head-category-canonical-link', - 'Magento\Page\Block\Html\Head\Link', + 'Magento\Theme\Block\Html\Head\Link', array( 'url' => $category->getUrl(), 'properties' => array('attributes' => array('rel' => 'canonical')) diff --git a/app/code/Magento/Catalog/Block/Category/Widget/Link.php b/app/code/Magento/Catalog/Block/Category/Widget/Link.php index a89e445717e..730e9d93152 100644 --- a/app/code/Magento/Catalog/Block/Category/Widget/Link.php +++ b/app/code/Magento/Catalog/Block/Category/Widget/Link.php @@ -38,20 +38,18 @@ class Link extends \Magento\Catalog\Block\Widget\Link { /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite * @param \Magento\Catalog\Model\Resource\Category $resourceCategory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite, \Magento\Catalog\Model\Resource\Category $resourceCategory, array $data = array() ) { - parent::__construct($context, $coreData, $urlRewrite, $data); + parent::__construct($context, $urlRewrite, $data); $this->_entityResource = $resourceCategory; } } diff --git a/app/code/Magento/Catalog/Block/Layer/Filter/AbstractFilter.php b/app/code/Magento/Catalog/Block/Layer/Filter/AbstractFilter.php index 69f5eda44bf..a79b57044bf 100644 --- a/app/code/Magento/Catalog/Block/Layer/Filter/AbstractFilter.php +++ b/app/code/Magento/Catalog/Block/Layer/Filter/AbstractFilter.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Layer\Filter; -abstract class AbstractFilter extends \Magento\View\Block\Template +abstract class AbstractFilter extends \Magento\View\Element\Template { /** * Catalog Layer Filter Attribute model @@ -77,22 +77,20 @@ abstract class AbstractFilter extends \Magento\View\Block\Template protected $_layerFilterFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Layer\Filter\Factory $layerFilterFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Layer\Filter\Factory $layerFilterFactory, array $data = array() ) { $this->_catalogData = $catalogData; $this->_layerFilterFactory = $layerFilterFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Layer/State.php b/app/code/Magento/Catalog/Block/Layer/State.php index 095bb937851..f0cf86e16c7 100644 --- a/app/code/Magento/Catalog/Block/Layer/State.php +++ b/app/code/Magento/Catalog/Block/Layer/State.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Layer; -class State extends \Magento\View\Block\Template +class State extends \Magento\View\Element\Template { protected $_template = 'layer/state.phtml'; @@ -45,19 +45,17 @@ class State extends \Magento\View\Block\Template protected $_catalogLayer; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Layer $catalogLayer * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Layer $catalogLayer, array $data = array() ) { $this->_catalogLayer = $catalogLayer; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Layer/View.php b/app/code/Magento/Catalog/Block/Layer/View.php index 6be814a2a5d..4cce0ae64da 100644 --- a/app/code/Magento/Catalog/Block/Layer/View.php +++ b/app/code/Magento/Catalog/Block/Layer/View.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Layer; -class View extends \Magento\View\Block\Template +class View extends \Magento\View\Element\Template { /** * State block name @@ -78,19 +78,17 @@ class View extends \Magento\View\Block\Template protected $_catalogLayer; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Layer $catalogLayer * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Layer $catalogLayer, array $data = array() ) { $this->_catalogLayer = $catalogLayer; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Navigation.php b/app/code/Magento/Catalog/Block/Navigation.php index 498610ecbee..3ad996bd0bb 100644 --- a/app/code/Magento/Catalog/Block/Navigation.php +++ b/app/code/Magento/Catalog/Block/Navigation.php @@ -31,7 +31,7 @@ namespace Magento\Catalog\Block; * * @SuppressWarnings(PHPMD.LongVariable) */ -class Navigation extends \Magento\View\Block\Template +class Navigation extends \Magento\View\Element\Template { protected $_categoryInstance = null; @@ -90,8 +90,7 @@ class Navigation extends \Magento\View\Block\Template protected $_productCollectionFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory * @param \Magento\Catalog\Model\Layer $catalogLayer @@ -102,8 +101,7 @@ class Navigation extends \Magento\View\Block\Template * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Model\Layer $catalogLayer, @@ -120,7 +118,7 @@ class Navigation extends \Magento\View\Block\Template $this->_catalogCategory = $catalogCategory; $this->_registry = $registry; $this->_categoryInstance = $categoryFactory->create(); - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Catalog/Block/Product.php b/app/code/Magento/Catalog/Block/Product.php index e104a80f49d..dfc2a45f006 100644 --- a/app/code/Magento/Catalog/Block/Product.php +++ b/app/code/Magento/Catalog/Block/Product.php @@ -26,7 +26,7 @@ namespace Magento\Catalog\Block; -class Product extends \Magento\View\Block\Template +class Product extends \Magento\View\Element\Template { protected $_finalPrice = array(); @@ -38,19 +38,17 @@ class Product extends \Magento\View\Block\Template protected $_productFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\ProductFactory $productFactory, array $data = array() ) { $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getProduct() diff --git a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php index 502efcdf9d0..3c8a24302c2 100644 --- a/app/code/Magento/Catalog/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Catalog/Block/Product/AbstractProduct.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product; -abstract class AbstractProduct extends \Magento\View\Block\Template +abstract class AbstractProduct extends \Magento\View\Element\Template { protected $_priceBlock = array(); @@ -115,8 +115,7 @@ abstract class AbstractProduct extends \Magento\View\Block\Template protected $mathRandom; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -125,8 +124,7 @@ abstract class AbstractProduct extends \Magento\View\Block\Template * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -139,7 +137,7 @@ abstract class AbstractProduct extends \Magento\View\Block\Template $this->_taxData = $taxData; $this->_catalogData = $catalogData; $this->mathRandom = $mathRandom; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -255,7 +253,7 @@ abstract class AbstractProduct extends \Magento\View\Block\Template * Prepares and returns block to render some product type * * @param string $productType - * @return \Magento\View\Block\Template + * @return \Magento\View\Element\Template */ public function _preparePriceRenderer($productType) { @@ -599,7 +597,7 @@ abstract class AbstractProduct extends \Magento\View\Block\Template */ public function getPageLayout() { - return $this->helper('Magento\Page\Helper\Layout')->getCurrentPageLayout(); + return $this->helper('Magento\Theme\Helper\Layout')->getCurrentPageLayout(); } /** diff --git a/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php b/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php index 4fb668446a6..d4f59eca800 100644 --- a/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php +++ b/app/code/Magento/Catalog/Block/Product/Compare/AbstractCompare.php @@ -44,8 +44,7 @@ abstract class AbstractCompare extends \Magento\Catalog\Block\Product\AbstractPr protected $_catalogProductCompare = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -55,8 +54,7 @@ abstract class AbstractCompare extends \Magento\Catalog\Block\Product\AbstractPr * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -66,7 +64,7 @@ abstract class AbstractCompare extends \Magento\Catalog\Block\Product\AbstractPr array $data = array() ) { $this->_catalogProductCompare = $catalogProductCompare; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php b/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php index 41aa1b04033..bc85b4255a0 100644 --- a/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php +++ b/app/code/Magento/Catalog/Block/Product/Compare/ListCompare.php @@ -100,7 +100,12 @@ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare protected $_itemCollectionFactory; /** - * @param \Magento\View\Block\Template\Context $context + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry @@ -115,27 +120,27 @@ class ListCompare extends \Magento\Catalog\Block\Product\Compare\AbstractCompare * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, \Magento\Catalog\Helper\Product\Compare $catalogProductCompare, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\Log\Model\Visitor $logVisitor, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { + $this->_coreData = $coreData; $this->_itemCollectionFactory = $itemCollectionFactory; $this->_catalogProductVisibility = $catalogProductVisibility; $this->_logVisitor = $logVisitor; $this->_customerSession = $customerSession; parent::__construct( $context, - $coreData, $catalogConfig, $registry, $taxData, diff --git a/app/code/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php b/app/code/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php index db7c4a8f099..0edaab64e07 100644 --- a/app/code/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php +++ b/app/code/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSet.php @@ -55,8 +55,7 @@ class ColumnSet protected $_productType; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Backend\Model\Widget\Grid\Row\UrlGeneratorFactory $generatorFactory * @param \Magento\Backend\Model\Widget\Grid\SubTotals $subtotals * @param \Magento\Backend\Model\Widget\Grid\Totals $totals @@ -65,8 +64,7 @@ class ColumnSet * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Backend\Model\Widget\Grid\Row\UrlGeneratorFactory $generatorFactory, \Magento\Backend\Model\Widget\Grid\SubTotals $subtotals, \Magento\Backend\Model\Widget\Grid\Totals $totals, @@ -74,7 +72,7 @@ class ColumnSet \Magento\Core\Model\Registry $registryManager, array $data = array() ) { - parent::__construct($context, $coreData, $generatorFactory, $subtotals, $totals, $data); + parent::__construct($context, $generatorFactory, $subtotals, $totals, $data); $this->_registryManager = $registryManager; $this->_productType = $productType; diff --git a/app/code/Magento/Catalog/Block/Product/Configurable/AttributeSelector.php b/app/code/Magento/Catalog/Block/Product/Configurable/AttributeSelector.php index e39b31cc2ac..2a99639725e 100644 --- a/app/code/Magento/Catalog/Block/Product/Configurable/AttributeSelector.php +++ b/app/code/Magento/Catalog/Block/Product/Configurable/AttributeSelector.php @@ -47,23 +47,21 @@ class AttributeSelector extends \Magento\Backend\Block\Template */ protected $_resourceHelper; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeColFactory - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeColFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeColFactory, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeColFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, + array $data = array() + ) { $this->_attributeColFactory = $attributeColFactory; $this->_resourceHelper = $resourceHelper; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/Gallery.php b/app/code/Magento/Catalog/Block/Product/Gallery.php index 9fe9ff3dfdb..f3f8942bf68 100644 --- a/app/code/Magento/Catalog/Block/Product/Gallery.php +++ b/app/code/Magento/Catalog/Block/Product/Gallery.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Product; -class Gallery extends \Magento\View\Block\Template +class Gallery extends \Magento\View\Element\Template { /** * Core registry @@ -43,19 +43,17 @@ class Gallery extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Catalog/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php b/app/code/Magento/Catalog/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php index 8a540fbfbb5..da62b101a38 100644 --- a/app/code/Magento/Catalog/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php +++ b/app/code/Magento/Catalog/Block/Product/Grouped/AssociatedProducts/ListAssociatedProducts.php @@ -42,19 +42,17 @@ class ListAssociatedProducts extends \Magento\Backend\Block\Template */ protected $_registry; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + parent::__construct($context, $data); $this->_registry = $registry; } diff --git a/app/code/Magento/Catalog/Block/Product/Image.php b/app/code/Magento/Catalog/Block/Product/Image.php index 7489db03a24..0b54d84c7bd 100644 --- a/app/code/Magento/Catalog/Block/Product/Image.php +++ b/app/code/Magento/Catalog/Block/Product/Image.php @@ -46,7 +46,7 @@ namespace Magento\Catalog\Block\Product; * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Image extends \Magento\View\Block\Template +class Image extends \Magento\View\Element\Template { /** * Template image only @@ -68,19 +68,17 @@ class Image extends \Magento\View\Block\Template protected $_productImageView; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Product\Image\View $productImageView * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Product\Image\View $productImageView, array $data = array() ) { $this->_productImageView = $productImageView; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/ListProduct.php b/app/code/Magento/Catalog/Block/Product/ListProduct.php index ab704a3459a..9768e0bfb93 100644 --- a/app/code/Magento/Catalog/Block/Product/ListProduct.php +++ b/app/code/Magento/Catalog/Block/Product/ListProduct.php @@ -65,8 +65,7 @@ class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct protected $_categoryFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -77,8 +76,7 @@ class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -90,7 +88,7 @@ class ListProduct extends \Magento\Catalog\Block\Product\AbstractProduct ) { $this->_categoryFactory = $categoryFactory; $this->_catalogLayer = $catalogLayer; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/NewProduct.php b/app/code/Magento/Catalog/Block/Product/NewProduct.php index 34e581214ba..fc59f8cd370 100644 --- a/app/code/Magento/Catalog/Block/Product/NewProduct.php +++ b/app/code/Magento/Catalog/Block/Product/NewProduct.php @@ -67,8 +67,7 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct protected $_productCollectionFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -80,8 +79,7 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -95,7 +93,7 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct $this->_productCollectionFactory = $productCollectionFactory; $this->_catalogProductVisibility = $catalogProductVisibility; $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** @@ -181,7 +179,7 @@ class NewProduct extends \Magento\Catalog\Block\Product\AbstractProduct /** * Prepare collection with new products * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Catalog/Block/Product/Price.php b/app/code/Magento/Catalog/Block/Product/Price.php index 4bd748c9f2a..563ade07089 100644 --- a/app/code/Magento/Catalog/Block/Product/Price.php +++ b/app/code/Magento/Catalog/Block/Product/Price.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Product; -class Price extends \Magento\View\Block\Template +class Price extends \Magento\View\Element\Template { protected $_priceDisplayType = null; protected $_idSuffix = ''; @@ -70,8 +70,13 @@ class Price extends \Magento\View\Block\Template protected $mathRandom; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Registry $registry @@ -80,8 +85,8 @@ class Price extends \Magento\View\Block\Template * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Helper\Data $catalogData, \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Registry $registry, @@ -89,12 +94,13 @@ class Price extends \Magento\View\Block\Template \Magento\Math\Random $mathRandom, array $data = array() ) { + $this->_jsonEncoder = $jsonEncoder; $this->_coreRegistry = $registry; $this->_catalogData = $catalogData; $this->_taxData = $taxData; $this->string = $string; $this->mathRandom = $mathRandom; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -224,7 +230,7 @@ class Price extends \Magento\View\Block\Template public function getRealPriceJs($product) { $html = $this->hasRealPriceHtml() ? $this->getRealPriceHtml() : $product->getRealPriceHtml(); - return $this->_coreData->jsonEncode($html); + return $this->_jsonEncoder->encode($html); } /** diff --git a/app/code/Magento/Catalog/Block/Product/Price/Template.php b/app/code/Magento/Catalog/Block/Product/Price/Template.php index 5e349ea57fb..0dc276c8855 100644 --- a/app/code/Magento/Catalog/Block/Product/Price/Template.php +++ b/app/code/Magento/Catalog/Block/Product/Price/Template.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\Price; -class Template extends \Magento\View\Block\AbstractBlock +class Template extends \Magento\View\Element\AbstractBlock { /** * Product Price block types cache diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php b/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php index 5467c63158c..13d6c1e5d20 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Promotion.php @@ -42,8 +42,7 @@ class Promotion extends \Magento\Catalog\Block\Product\ListProduct protected $_layerFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -56,8 +55,7 @@ class Promotion extends \Magento\Catalog\Block\Product\ListProduct * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -73,7 +71,6 @@ class Promotion extends \Magento\Catalog\Block\Product\ListProduct $this->_productCollectionFactory = $productCollectionFactory; parent::__construct( $context, - $coreData, $catalogConfig, $registry, $taxData, diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Random.php b/app/code/Magento/Catalog/Block/Product/ProductList/Random.php index d14df1a7d4b..91a17a6c020 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Random.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Random.php @@ -48,8 +48,7 @@ class Random extends \Magento\Catalog\Block\Product\ListProduct protected $_layerFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -62,8 +61,7 @@ class Random extends \Magento\Catalog\Block\Product\ListProduct * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -79,7 +77,6 @@ class Random extends \Magento\Catalog\Block\Product\ListProduct $this->_productCollectionFactory = $productCollectionFactory; parent::__construct( $context, - $coreData, $catalogConfig, $registry, $taxData, diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php index cbbbefec796..4681f1e428c 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Related.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Related.php @@ -64,8 +64,7 @@ class Related extends \Magento\Catalog\Block\Product\AbstractProduct protected $_checkoutCart; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -77,8 +76,7 @@ class Related extends \Magento\Catalog\Block\Product\AbstractProduct * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -92,7 +90,7 @@ class Related extends \Magento\Catalog\Block\Product\AbstractProduct $this->_checkoutCart = $checkoutCart; $this->_catalogProductVisibility = $catalogProductVisibility; $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } protected function _prepareData() diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php index fc4d9afec88..38b349e7827 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Toolbar.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\ProductList; -class Toolbar extends \Magento\View\Block\Template +class Toolbar extends \Magento\View\Element\Template { /** * Products collection @@ -158,22 +158,20 @@ class Toolbar extends \Magento\View\Block\Template protected $_catalogSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Session $catalogSession * @param \Magento\Catalog\Model\Config $catalogConfig * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Session $catalogSession, \Magento\Catalog\Model\Config $catalogConfig, array $data = array() ) { $this->_catalogSession = $catalogSession; $this->_catalogConfig = $catalogConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -821,7 +819,7 @@ class Toolbar extends \Magento\View\Block\Template if ($pagerBlock instanceof \Magento\Object) { - /* @var $pagerBlock \Magento\Page\Block\Html\Pager */ + /* @var $pagerBlock \Magento\Theme\Block\Html\Pager */ $pagerBlock->setAvailableLimit($this->getAvailableLimit()); $pagerBlock->setUseContainer(false) diff --git a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php index 8e53a409ae0..4dfa461a47c 100644 --- a/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php +++ b/app/code/Magento/Catalog/Block/Product/ProductList/Upsell.php @@ -70,8 +70,7 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct protected $_checkoutCart; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -84,8 +83,7 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -100,7 +98,7 @@ class Upsell extends \Magento\Catalog\Block\Product\AbstractProduct $this->_checkoutCart = $checkoutCart; $this->_catalogProductVisibility = $catalogProductVisibility; $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } protected function _prepareData() diff --git a/app/code/Magento/Catalog/Block/Product/Send.php b/app/code/Magento/Catalog/Block/Product/Send.php index 35d31e0bcef..4f4c43e406f 100644 --- a/app/code/Magento/Catalog/Block/Product/Send.php +++ b/app/code/Magento/Catalog/Block/Product/Send.php @@ -44,8 +44,7 @@ class Send extends \Magento\Catalog\Block\Product\AbstractProduct protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -55,8 +54,7 @@ class Send extends \Magento\Catalog\Block\Product\AbstractProduct * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -66,7 +64,7 @@ class Send extends \Magento\Catalog\Block\Product\AbstractProduct array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/TemplateSelector.php b/app/code/Magento/Catalog/Block/Product/TemplateSelector.php index 758c6c51e9e..23c4733a23f 100644 --- a/app/code/Magento/Catalog/Block/Product/TemplateSelector.php +++ b/app/code/Magento/Catalog/Block/Product/TemplateSelector.php @@ -31,7 +31,7 @@ namespace Magento\Catalog\Block\Product; * * @SuppressWarnings(PHPMD.LongVariable) */ -class TemplateSelector extends \Magento\View\Block\Template +class TemplateSelector extends \Magento\View\Element\Template { /** * Core registry @@ -55,16 +55,14 @@ class TemplateSelector extends \Magento\View\Block\Template protected $_resourceHelper; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setColFactory * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setColFactory, \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\Resource\Helper $resourceHelper, @@ -73,7 +71,7 @@ class TemplateSelector extends \Magento\View\Block\Template $this->_setColFactory = $setColFactory; $this->_coreRegistry = $registry; $this->_resourceHelper = $resourceHelper; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/View.php b/app/code/Magento/Catalog/Block/Product/View.php index 91c0c05399b..f22be4c5d39 100644 --- a/app/code/Magento/Catalog/Block/Product/View.php +++ b/app/code/Magento/Catalog/Block/Product/View.php @@ -60,8 +60,19 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct protected $_productFactory; /** - * @param \Magento\View\Block\Template\Context $context + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -73,22 +84,25 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, + \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Tax\Model\Calculation $taxCalculation, \Magento\Stdlib\String $string, array $data = array() ) { + $this->_coreData = $coreData; + $this->_jsonEncoder = $jsonEncoder; $this->_productFactory = $productFactory; $this->_taxCalculation = $taxCalculation; $this->string = $string; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** @@ -126,7 +140,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct $params = array('_ignore_category'=>true); $headBlock->addChild( 'magento-page-head-product-canonical-link', - 'Magento\Page\Block\Html\Head\Link', + 'Magento\Theme\Block\Html\Head\Link', array( 'url' => $product->getUrlModel()->getUrl($product, $params), 'properties' => array('attributes' => array('rel' => 'canonical')) @@ -201,7 +215,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct { $config = array(); if (!$this->hasOptions()) { - return $this->_coreData->jsonEncode($config); + return $this->_jsonEncoder->encode($config); } $_request = $this->_taxCalculation->getRateRequest(false, false, false); @@ -256,7 +270,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct } } - return $this->_coreData->jsonEncode($config); + return $this->_jsonEncoder->encode($config); } /** diff --git a/app/code/Magento/Catalog/Block/Product/View/AbstractView.php b/app/code/Magento/Catalog/Block/Product/View/AbstractView.php index 7488844c9e0..820cc588046 100644 --- a/app/code/Magento/Catalog/Block/Product/View/AbstractView.php +++ b/app/code/Magento/Catalog/Block/Product/View/AbstractView.php @@ -41,8 +41,7 @@ abstract class AbstractView extends \Magento\Catalog\Block\Product\AbstractProdu protected $arrayUtils; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -52,8 +51,7 @@ abstract class AbstractView extends \Magento\Catalog\Block\Product\AbstractProdu * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -63,7 +61,7 @@ abstract class AbstractView extends \Magento\Catalog\Block\Product\AbstractProdu array $data = array() ) { $this->arrayUtils = $arrayUtils; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } diff --git a/app/code/Magento/Catalog/Block/Product/View/Additional.php b/app/code/Magento/Catalog/Block/Product/View/Additional.php index a9d07f23c1f..afc5a8f88b1 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Additional.php +++ b/app/code/Magento/Catalog/Block/Product/View/Additional.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Additional extends \Magento\View\Block\Template +class Additional extends \Magento\View\Element\Template { protected $_list; diff --git a/app/code/Magento/Catalog/Block/Product/View/Attributes.php b/app/code/Magento/Catalog/Block/Product/View/Attributes.php index 6576cae55ba..1f3464019c5 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Attributes.php +++ b/app/code/Magento/Catalog/Block/Product/View/Attributes.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Attributes extends \Magento\View\Block\Template +class Attributes extends \Magento\View\Element\Template { protected $_product = null; @@ -46,19 +46,17 @@ class Attributes extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } function getProduct() diff --git a/app/code/Magento/Catalog/Block/Product/View/Description.php b/app/code/Magento/Catalog/Block/Product/View/Description.php index 6e7c0fdae58..328f91af0ab 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Description.php +++ b/app/code/Magento/Catalog/Block/Product/View/Description.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Description extends \Magento\View\Block\Template +class Description extends \Magento\View\Element\Template { protected $_product = null; @@ -46,19 +46,17 @@ class Description extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getProduct() diff --git a/app/code/Magento/Catalog/Block/Product/View/Options.php b/app/code/Magento/Catalog/Block/Product/View/Options.php index b9f791510f4..11e19af6c09 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Options extends \Magento\View\Block\Template +class Options extends \Magento\View\Element\Template { protected $_product; @@ -67,8 +67,19 @@ class Options extends \Magento\View\Block\Template protected $_catalogProduct; /** - * @param \Magento\View\Block\Template\Context $context + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Model\Product $catalogProduct * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Model\Product\Option $option @@ -77,8 +88,9 @@ class Options extends \Magento\View\Block\Template * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Model\Product $catalogProduct, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Model\Product\Option $option, @@ -86,12 +98,14 @@ class Options extends \Magento\View\Block\Template \Magento\Stdlib\ArrayUtils $arrayUtils, array $data = array() ) { + $this->_coreData = $coreData; + $this->_jsonEncoder = $jsonEncoder; $this->_catalogProduct = $catalogProduct; $this->_registry = $registry; $this->_option = $option; $this->_taxData = $taxData; $this->arrayUtils = $arrayUtils; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -191,7 +205,7 @@ class Options extends \Magento\View\Block\Template $config[$option->getId()] = $priceValue; } - return $this->_coreData->jsonEncode($config); + return $this->_jsonEncoder->encode($config); } /** diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php index 50693fb4055..a6ac246acf9 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/AbstractOptions.php @@ -34,7 +34,7 @@ */ namespace Magento\Catalog\Block\Product\View\Options; -abstract class AbstractOptions extends \Magento\View\Block\Template +abstract class AbstractOptions extends \Magento\View\Element\Template { /** * Product object @@ -58,19 +58,17 @@ abstract class AbstractOptions extends \Magento\View\Block\Template protected $_taxData = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Tax\Helper\Data $taxData * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Tax\Helper\Data $taxData, array $data = array() ) { $this->_taxData = $taxData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php index 6867d3546ed..3fa0a3ce257 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Date.php @@ -49,21 +49,19 @@ class Date extends \Magento\Catalog\Block\Product\View\Options\AbstractOptions protected $_catalogProductOptionTypeDate; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Model\Product\Option\Type\Date $catalogProductOptionTypeDate * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Model\Product\Option\Type\Date $catalogProductOptionTypeDate, array $data = array() ) { $this->_catalogProductOptionTypeDate = $catalogProductOptionTypeDate; - parent::__construct($context, $coreData, $taxData, $data); + parent::__construct($context, $taxData, $data); } protected function _prepareLayout() @@ -112,7 +110,7 @@ class Date extends \Magento\Catalog\Block\Product\View\Options\AbstractOptions $yearEnd = $this->_catalogProductOptionTypeDate->getYearEnd(); $calendar = $this->getLayout() - ->createBlock('Magento\View\Block\Html\Date') + ->createBlock('Magento\View\Element\Html\Date') ->setId('options_'.$this->getOption()->getId().'_date') ->setName('options['.$this->getOption()->getId().'][date]') ->setClass('product-custom-option datetime-picker input-text') @@ -203,7 +201,7 @@ class Date extends \Magento\Catalog\Block\Product\View\Options\AbstractOptions * HTML select element * * @param string $name Id/name of html select element - * @return \Magento\View\Block\Html\Select + * @return \Magento\View\Element\Html\Select */ protected function _getHtmlSelect($name, $value = null) { @@ -213,7 +211,7 @@ class Date extends \Magento\Catalog\Block\Product\View\Options\AbstractOptions // $require = $this->getOption()->getIsRequire() ? ' required-entry' : ''; $require = ''; - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setId('options_' . $this->getOption()->getId() . '_' . $name) ->setClass('product-custom-option datetime-picker' . $require) ->setExtraParams() diff --git a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php index 2f6b0a0cae5..e578727a43e 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php +++ b/app/code/Magento/Catalog/Block/Product/View/Options/Type/Select.php @@ -54,7 +54,7 @@ class Select || $_option->getType() == \Magento\Catalog\Model\Product\Option::OPTION_TYPE_MULTIPLE) { $require = ($_option->getIsRequire()) ? ' required' : ''; $extraParams = ''; - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setData(array( 'id' => 'select_'.$_option->getId(), 'class' => $require.' product-custom-option' diff --git a/app/code/Magento/Catalog/Block/Product/View/Price.php b/app/code/Magento/Catalog/Block/Product/View/Price.php index c7ee886d324..8252069f8c1 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Price.php +++ b/app/code/Magento/Catalog/Block/Product/View/Price.php @@ -29,7 +29,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Price extends \Magento\View\Block\Template +class Price extends \Magento\View\Element\Template { /** * Core registry @@ -39,19 +39,17 @@ class Price extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getPrice() diff --git a/app/code/Magento/Catalog/Block/Product/View/Tabs.php b/app/code/Magento/Catalog/Block/Product/View/Tabs.php index c4384e1a691..e414e7f1d76 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Tabs.php +++ b/app/code/Magento/Catalog/Block/Product/View/Tabs.php @@ -29,7 +29,7 @@ */ namespace Magento\Catalog\Block\Product\View; -class Tabs extends \Magento\View\Block\Template +class Tabs extends \Magento\View\Element\Template { /** * Configured tabs diff --git a/app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php b/app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php index 592f722cd2a..dca71d03499 100644 --- a/app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php +++ b/app/code/Magento/Catalog/Block/Product/View/Type/Configurable.php @@ -65,8 +65,13 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView protected $_taxCalculation; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -78,22 +83,23 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, \Magento\Stdlib\ArrayUtils $arrayUtils, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Tax\Model\Calculation $taxCalculation, \Magento\Catalog\Helper\Product $catalogProduct, array $data = array() ) { $this->_taxCalculation = $taxCalculation; $this->_catalogProduct = $catalogProduct; + $this->_jsonEncoder = $jsonEncoder; parent::__construct( - $context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $arrayUtils, $data + $context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $arrayUtils, $data ); } @@ -218,10 +224,10 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView $productAttribute = $attribute->getProductAttribute(); $attributeId = $productAttribute->getId(); $info = array( - 'id' => $productAttribute->getId(), - 'code' => $productAttribute->getAttributeCode(), - 'label' => $attribute->getLabel(), - 'options' => array() + 'id' => $productAttribute->getId(), + 'code' => $productAttribute->getAttributeCode(), + 'label' => $attribute->getLabel(), + 'options' => array() ); $optionPrices = array(); @@ -266,7 +272,7 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView } } if($this->_validateAttributeInfo($info)) { - $attributes[$attributeId] = $info; + $attributes[$attributeId] = $info; } // Add attribute default value (if set) @@ -316,7 +322,7 @@ class Configurable extends \Magento\Catalog\Block\Product\View\AbstractView $config = array_merge($config, $this->_getAdditionalConfig()); - return $this->_coreData->jsonEncode($config); + return $this->_jsonEncoder->encode($config); } /** diff --git a/app/code/Magento/Catalog/Block/Product/Widget/Html/Pager.php b/app/code/Magento/Catalog/Block/Product/Widget/Html/Pager.php index daff46f31c8..0c38f9d6831 100644 --- a/app/code/Magento/Catalog/Block/Product/Widget/Html/Pager.php +++ b/app/code/Magento/Catalog/Block/Product/Widget/Html/Pager.php @@ -33,7 +33,7 @@ */ namespace Magento\Catalog\Block\Product\Widget\Html; -class Pager extends \Magento\Page\Block\Html\Pager +class Pager extends \Magento\Theme\Block\Html\Pager { /** * Collection size diff --git a/app/code/Magento/Catalog/Block/Product/Widget/Link.php b/app/code/Magento/Catalog/Block/Product/Widget/Link.php index c5033970afa..6607f3406c3 100644 --- a/app/code/Magento/Catalog/Block/Product/Widget/Link.php +++ b/app/code/Magento/Catalog/Block/Product/Widget/Link.php @@ -38,20 +38,18 @@ class Link extends \Magento\Catalog\Block\Widget\Link { /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite * @param \Magento\Catalog\Model\Resource\Product $catalogProduct * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite, \Magento\Catalog\Model\Resource\Product $catalogProduct, array $data = array() ) { - parent::__construct($context, $coreData, $urlRewrite, $data); + parent::__construct($context, $urlRewrite, $data); $this->_entityResource = $catalogProduct; } } diff --git a/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php b/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php index af3a3c62c0b..2c287bef6aa 100644 --- a/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php +++ b/app/code/Magento/Catalog/Block/Product/Widget/NewWidget.php @@ -201,7 +201,7 @@ class NewWidget extends \Magento\Catalog\Block\Product\NewProduct ->setTotalLimit($this->getProductsCount()) ->setCollection($this->getProductCollection()); } - if ($this->_pager instanceof \Magento\View\Block\AbstractBlock) { + if ($this->_pager instanceof \Magento\View\Element\AbstractBlock) { return $this->_pager->toHtml(); } } diff --git a/app/code/Magento/Catalog/Block/Widget/Link.php b/app/code/Magento/Catalog/Block/Widget/Link.php index 6479a6f52c7..115e414e348 100644 --- a/app/code/Magento/Catalog/Block/Widget/Link.php +++ b/app/code/Magento/Catalog/Block/Widget/Link.php @@ -35,7 +35,7 @@ namespace Magento\Catalog\Block\Widget; class Link - extends \Magento\View\Block\Html\Link + extends \Magento\View\Element\Html\Link implements \Magento\Widget\Block\BlockInterface { /** @@ -66,19 +66,17 @@ class Link protected $_urlRewrite; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Resource\Url\Rewrite $urlRewrite, array $data = array() ) { $this->_urlRewrite = $urlRewrite; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -118,15 +116,15 @@ class Link } /** - * Prepare anchor text using passed text as parameter. + * Prepare label using passed text as parameter. * If anchor text was not specified get entity name from DB. * * @return string */ - public function getAnchorText() + public function getLabel() { if (!$this->_anchorText && $this->_entityResource) { - if (!$this->getData('anchor_text')) { + if (!$this->getData('label')) { $idPath = explode('/', $this->_getData('id_path')); if (isset($idPath[1])) { $id = $idPath[1]; @@ -136,7 +134,7 @@ class Link } } } else { - $this->_anchorText = $this->getData('anchor_text'); + $this->_anchorText = $this->getData('label'); } } diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Category.php b/app/code/Magento/Catalog/Controller/Adminhtml/Category.php index 4b71aba1147..75052a3faa5 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Category.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Category.php @@ -363,8 +363,8 @@ class Category extends \Magento\Backend\App\Action if ($this->getRequest()->getPost('return_session_messages_only')) { $category->load($category->getId()); // to obtain truncated category name - /** @var $block \Magento\View\Block\Messages */ - $block = $this->_objectManager->get('Magento\View\Block\Messages'); + /** @var $block \Magento\View\Element\Messages */ + $block = $this->_objectManager->get('Magento\View\Element\Messages'); $block->setMessages($this->_getSession()->getMessages(true)); $body = $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode(array( 'messages' => $block->getGroupedHtml(), diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php index a84b6d9afc7..65ca47f0ef2 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set.php @@ -172,8 +172,8 @@ class Set extends \Magento\Backend\App\Action if ($isNewSet) { if ($this->getRequest()->getPost('return_session_messages_only')) { - /** @var $block \Magento\View\Block\Messages */ - $block = $this->_objectManager->get('Magento\View\Block\Messages'); + /** @var $block \Magento\View\Element\Messages */ + $block = $this->_objectManager->get('Magento\View\Element\Messages'); $block->setMessages($this->_getSession()->getMessages(true)); $body = $this->_objectManager->get('Magento\Core\Helper\Data')->jsonEncode(array( 'messages' => $block->getGroupedHtml(), diff --git a/app/code/Magento/Catalog/Controller/Category.php b/app/code/Magento/Catalog/Controller/Category.php index cac91bfe806..81ce0199561 100644 --- a/app/code/Magento/Catalog/Controller/Category.php +++ b/app/code/Magento/Catalog/Controller/Category.php @@ -174,7 +174,7 @@ class Category extends \Magento\App\Action\Action $this->_view->generateLayoutBlocks(); // apply custom layout (page) template once the blocks are generated if ($settings->getPageLayout()) { - $this->_objectManager->get('Magento\Page\Helper\Layout')->applyTemplate($settings->getPageLayout()); + $this->_objectManager->get('Magento\Theme\Helper\Layout')->applyTemplate($settings->getPageLayout()); } $root = $this->_view->getLayout()->getBlock('root'); diff --git a/app/code/Magento/Catalog/Helper/Catalog.php b/app/code/Magento/Catalog/Helper/Catalog.php index 0ccce4bf22d..396e5597928 100644 --- a/app/code/Magento/Catalog/Helper/Catalog.php +++ b/app/code/Magento/Catalog/Helper/Catalog.php @@ -67,13 +67,13 @@ class Catalog extends \Magento\App\Helper\AbstractHelper protected $_coreStoreConfig; /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Store\Config $coreStoreConfig */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\App\Helper\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Store\Config $coreStoreConfig ) { $this->_coreStoreConfig = $coreStoreConfig; diff --git a/app/code/Magento/Catalog/Helper/Category.php b/app/code/Magento/Catalog/Helper/Category.php index d416c2459e2..5b9f98caf4d 100644 --- a/app/code/Magento/Catalog/Helper/Category.php +++ b/app/code/Magento/Catalog/Helper/Category.php @@ -80,18 +80,16 @@ class Category extends \Magento\App\Helper\AbstractHelper protected $_dataCollectionFactory; /** - * Construct - * + * @param \Magento\App\Helper\Context $context * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Data\CollectionFactory $dataCollectionFactory */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Data\CollectionFactory $dataCollectionFactory ) { diff --git a/app/code/Magento/Catalog/Helper/Category/Flat.php b/app/code/Magento/Catalog/Helper/Category/Flat.php index e9bf4762829..fcee41e987b 100644 --- a/app/code/Magento/Catalog/Helper/Category/Flat.php +++ b/app/code/Magento/Catalog/Helper/Category/Flat.php @@ -74,8 +74,6 @@ class Flat extends \Magento\Catalog\Helper\Flat\AbstractFlat protected $_catalogCategoryFlat; /** - * Construct - * * @param \Magento\App\Helper\Context $context * @param \Magento\Index\Model\ProcessFactory $processFactory * @param \Magento\Catalog\Model\Resource\Category\Flat $catalogCategoryFlat diff --git a/app/code/Magento/Catalog/Helper/Data.php b/app/code/Magento/Catalog/Helper/Data.php index 50238607c49..68ee6885eb3 100644 --- a/app/code/Magento/Catalog/Helper/Data.php +++ b/app/code/Magento/Catalog/Helper/Data.php @@ -154,8 +154,7 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_escaper; /** - * Construct - * + * @param \Magento\App\Helper\Context $context * @param \Magento\Catalog\Model\Resource\Eav\AttributeFactory $eavAttributeFactory * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory @@ -164,14 +163,14 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param \Magento\Stdlib\String $string * @param \Magento\Catalog\Helper\Category $catalogCategory * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory * @param \Magento\Escaper $escaper - * @param $templateFilterModel + * @param string $templateFilterModel */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Catalog\Model\Resource\Eav\AttributeFactory $eavAttributeFactory, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\ProductFactory $productFactory, @@ -180,7 +179,6 @@ class Data extends \Magento\App\Helper\AbstractHelper \Magento\Stdlib\String $string, \Magento\Catalog\Helper\Category $catalogCategory, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\App\Helper\Context $context, \Magento\Core\Model\Registry $coreRegistry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Catalog\Model\Template\Filter\Factory $templateFilterFactory, diff --git a/app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php b/app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php index 336128512cc..6bd9b326c7e 100644 --- a/app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php +++ b/app/code/Magento/Catalog/Helper/Flat/AbstractFlat.php @@ -78,8 +78,6 @@ abstract class AbstractFlat extends \Magento\App\Helper\AbstractHelper protected $_isAvailable; /** - * Construct - * * @param \Magento\App\Helper\Context $context * @param \Magento\Index\Model\ProcessFactory $processFactory * @param bool $isAvailable diff --git a/app/code/Magento/Catalog/Helper/Image.php b/app/code/Magento/Catalog/Helper/Image.php index 2e2813525e4..b67c004a615 100644 --- a/app/code/Magento/Catalog/Helper/Image.php +++ b/app/code/Magento/Catalog/Helper/Image.php @@ -130,16 +130,14 @@ class Image extends \Magento\App\Helper\AbstractHelper protected $_productImageFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\Product\ImageFactory $productImageFactory * @param \Magento\App\Helper\Context $context + * @param \Magento\Catalog\Model\Product\ImageFactory $productImageFactory * @param \Magento\View\Url $viewUrl * @param \Magento\Core\Model\Store\Config $coreStoreConfig */ public function __construct( - \Magento\Catalog\Model\Product\ImageFactory $productImageFactory, \Magento\App\Helper\Context $context, + \Magento\Catalog\Model\Product\ImageFactory $productImageFactory, \Magento\View\Url $viewUrl, \Magento\Core\Model\Store\Config $coreStoreConfig ) { diff --git a/app/code/Magento/Catalog/Helper/Output.php b/app/code/Magento/Catalog/Helper/Output.php index dd1d38c31c8..eb1b609634b 100644 --- a/app/code/Magento/Catalog/Helper/Output.php +++ b/app/code/Magento/Catalog/Helper/Output.php @@ -62,17 +62,15 @@ class Output extends \Magento\App\Helper\AbstractHelper protected $_escaper; /** - * Construct - * + * @param \Magento\App\Helper\Context $context * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\App\Helper\Context $context * @param \Magento\Escaper $escaper */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Eav\Model\Config $eavConfig, \Magento\Catalog\Helper\Data $catalogData, - \Magento\App\Helper\Context $context, \Magento\Escaper $escaper ) { $this->_eavConfig = $eavConfig; diff --git a/app/code/Magento/Catalog/Helper/Product.php b/app/code/Magento/Catalog/Helper/Product.php index ebbd9c12937..501b68c2f18 100644 --- a/app/code/Magento/Catalog/Helper/Product.php +++ b/app/code/Magento/Catalog/Helper/Product.php @@ -120,26 +120,24 @@ class Product extends \Magento\Core\Helper\Url protected $_categoryFactory; /** + * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Session $catalogSession - * @param \Magento\App\Helper\Context $context * @param \Magento\View\Url $viewUrl * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Catalog\Model\Attribute\Config $attributeConfig * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Config $coreConfig - * @param $typeSwitcherLabel - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) + * @param string $typeSwitcherLabel */ public function __construct( + \Magento\App\Helper\Context $context, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Session $catalogSession, - \Magento\App\Helper\Context $context, \Magento\View\Url $viewUrl, \Magento\Core\Model\Registry $coreRegistry, \Magento\Catalog\Model\Attribute\Config $attributeConfig, diff --git a/app/code/Magento/Catalog/Helper/Product/Compare.php b/app/code/Magento/Catalog/Helper/Product/Compare.php index 701e437e155..e73f82973e7 100644 --- a/app/code/Magento/Catalog/Helper/Product/Compare.php +++ b/app/code/Magento/Catalog/Helper/Product/Compare.php @@ -97,24 +97,22 @@ class Compare extends \Magento\Core\Helper\Url protected $_itemCollectionFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility * @param \Magento\Log\Model\Visitor $logVisitor * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\Session $catalogSession - * @param \Magento\App\Helper\Context $context */ public function __construct( - \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, + \Magento\App\Helper\Context $context, \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Catalog\Model\Resource\Product\Compare\Item\CollectionFactory $itemCollectionFactory, \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility, \Magento\Log\Model\Visitor $logVisitor, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Session $catalogSession, - \Magento\App\Helper\Context $context + \Magento\Catalog\Model\Session $catalogSession ) { $this->_itemCollectionFactory = $itemCollectionFactory; $this->_catalogProductVisibility = $catalogProductVisibility; diff --git a/app/code/Magento/Catalog/Helper/Product/Composite.php b/app/code/Magento/Catalog/Helper/Product/Composite.php index bbafd2addca..43d5f44622a 100644 --- a/app/code/Magento/Catalog/Helper/Product/Composite.php +++ b/app/code/Magento/Catalog/Helper/Product/Composite.php @@ -70,20 +70,20 @@ class Composite extends \Magento\App\Helper\AbstractHelper protected $_view; /** + * @param \Magento\App\Helper\Context $context * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\App\ViewInterface $view */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\App\Helper\Context $context, \Magento\Core\Model\Registry $coreRegistry, \Magento\App\ViewInterface $view ) { diff --git a/app/code/Magento/Catalog/Helper/Product/Configuration.php b/app/code/Magento/Catalog/Helper/Product/Configuration.php index 3a413ce38f5..709196385b2 100644 --- a/app/code/Magento/Catalog/Helper/Product/Configuration.php +++ b/app/code/Magento/Catalog/Helper/Product/Configuration.php @@ -62,16 +62,16 @@ class Configuration extends \Magento\App\Helper\AbstractHelper protected $string; /** + * @param \Magento\App\Helper\Context $context * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Filter\FilterManager $filter - * @param \Magento\App\Helper\Context $context * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $config * @param \Magento\Stdlib\String $string */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Filter\FilterManager $filter, - \Magento\App\Helper\Context $context, \Magento\Catalog\Model\ProductTypes\ConfigInterface $config, \Magento\Stdlib\String $string ) { diff --git a/app/code/Magento/Catalog/Helper/Product/Flat.php b/app/code/Magento/Catalog/Helper/Product/Flat.php index 8b0b89fd28d..3de0b4575b9 100644 --- a/app/code/Magento/Catalog/Helper/Product/Flat.php +++ b/app/code/Magento/Catalog/Helper/Product/Flat.php @@ -93,8 +93,6 @@ class Flat extends \Magento\Catalog\Helper\Flat\AbstractFlat protected $_coreStoreConfig; /** - * Construct - * * @param \Magento\App\Helper\Context $context * @param \Magento\Index\Model\ProcessFactory $processFactory * @param \Magento\Core\Model\Store\Config $coreStoreConfig diff --git a/app/code/Magento/Catalog/Helper/Product/Url.php b/app/code/Magento/Catalog/Helper/Product/Url.php index ff31c375d0a..7fe2e80c929 100644 --- a/app/code/Magento/Catalog/Helper/Product/Url.php +++ b/app/code/Magento/Catalog/Helper/Product/Url.php @@ -98,16 +98,14 @@ class Url extends \Magento\Core\Helper\Url ); /** - * Check additional instruction for convertation table in configuration - * * @param \Magento\App\Helper\Context $context - * @param \Magento\Core\Model\Config $config * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Core\Model\Config $config */ public function __construct( \Magento\App\Helper\Context $context, - \Magento\Core\Model\Config $config, - \Magento\Core\Model\StoreManagerInterface $storeManager + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\Model\Config $config ) { parent::__construct($context, $storeManager); $convertConfig = $config->getValue('url/convert', 'default'); diff --git a/app/code/Magento/Catalog/Helper/Product/View.php b/app/code/Magento/Catalog/Helper/Product/View.php index 65b796af3e2..76a2a24f779 100644 --- a/app/code/Magento/Catalog/Helper/Product/View.php +++ b/app/code/Magento/Catalog/Helper/Product/View.php @@ -63,7 +63,7 @@ class View extends \Magento\App\Helper\AbstractHelper /** * Catalog product * - * @var \Magento\Page\Helper\Layout + * @var \Magento\Theme\Helper\Layout */ protected $_pageLayout = null; @@ -87,21 +87,21 @@ class View extends \Magento\App\Helper\AbstractHelper protected $_view; /** + * @param \Magento\App\Helper\Context $context * @param \Magento\Catalog\Model\Session $catalogSession * @param \Magento\Catalog\Model\Design $catalogDesign * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\Page\Helper\Layout $pageLayout - * @param \Magento\App\Helper\Context $context + * @param \Magento\Theme\Helper\Layout $pageLayout * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\App\ViewInterface $view * @param array $messageModels */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Catalog\Model\Session $catalogSession, \Magento\Catalog\Model\Design $catalogDesign, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Page\Helper\Layout $pageLayout, - \Magento\App\Helper\Context $context, + \Magento\Theme\Helper\Layout $pageLayout, \Magento\Core\Model\Registry $coreRegistry, \Magento\App\ViewInterface $view, array $messageModels = array() diff --git a/app/code/Magento/Catalog/Model/AbstractModel.php b/app/code/Magento/Catalog/Model/AbstractModel.php index 83ad9af6702..4627868c9d7 100644 --- a/app/code/Magento/Catalog/Model/AbstractModel.php +++ b/app/code/Magento/Catalog/Model/AbstractModel.php @@ -82,19 +82,17 @@ abstract class AbstractModel extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Category.php b/app/code/Magento/Catalog/Model/Category.php index e32cf4c07ef..5d925955813 100644 --- a/app/code/Magento/Catalog/Model/Category.php +++ b/app/code/Magento/Catalog/Model/Category.php @@ -175,8 +175,9 @@ class Category extends \Magento\Catalog\Model\AbstractModel protected $_categoryTreeFactory; /** - * Construct - * + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Resource\Category\Tree $categoryTreeResource * @param \Magento\Catalog\Model\Resource\Category\TreeFactory $categoryTreeFactory * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory @@ -184,21 +185,19 @@ class Category extends \Magento\Catalog\Model\AbstractModel * @param \Magento\Core\Model\Resource\Store\CollectionFactory $storeCollectionFactory * @param \Magento\UrlInterface $url * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Index\Model\Indexer $indexIndexer * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Helper\Category\Flat $catalogCategoryFlat - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Filter\FilterManager $filter * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Resource\Category\Tree $categoryTreeResource, \Magento\Catalog\Model\Resource\Category\TreeFactory $categoryTreeFactory, \Magento\Catalog\Model\CategoryFactory $categoryFactory, @@ -206,13 +205,10 @@ class Category extends \Magento\Catalog\Model\AbstractModel \Magento\Core\Model\Resource\Store\CollectionFactory $storeCollectionFactory, \Magento\UrlInterface $url, \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollectionFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Index\Model\Indexer $indexIndexer, \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Helper\Category\Flat $catalogCategoryFlat, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\Filter\FilterManager $filter, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, @@ -229,7 +225,7 @@ class Category extends \Magento\Catalog\Model\AbstractModel $this->filter = $filter; $this->_catalogCategoryFlat = $catalogCategoryFlat; $this->_treeModel = $categoryTreeResource; - parent::__construct($storeManager, $context, $registry, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $storeManager, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Catalog/Model/Category/Attribute/Source/Layout.php b/app/code/Magento/Catalog/Model/Category/Attribute/Source/Layout.php index 49a19813c0c..9c7dd4a1a95 100644 --- a/app/code/Magento/Catalog/Model/Category/Attribute/Source/Layout.php +++ b/app/code/Magento/Catalog/Model/Category/Attribute/Source/Layout.php @@ -38,17 +38,17 @@ class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource /** * Page source layout * - * @var \Magento\Page\Model\Source\Layout + * @var \Magento\Theme\Model\Layout\Source\Layout */ protected $_pageSourceLayout; /** * Construct * - * @param \Magento\Page\Model\Source\Layout $pageSourceLayout + * @param \Magento\Theme\Model\Layout\Source\Layout $pageSourceLayout */ public function __construct( - \Magento\Page\Model\Source\Layout $pageSourceLayout + \Magento\Theme\Model\Layout\Source\Layout $pageSourceLayout ) { $this->_pageSourceLayout = $pageSourceLayout; } diff --git a/app/code/Magento/Catalog/Model/Category/Indexer/Flat.php b/app/code/Magento/Catalog/Model/Category/Indexer/Flat.php index 3bbf862334b..f126ea6af48 100644 --- a/app/code/Magento/Catalog/Model/Category/Indexer/Flat.php +++ b/app/code/Magento/Catalog/Model/Category/Indexer/Flat.php @@ -79,21 +79,19 @@ class Flat extends \Magento\Index\Model\Indexer\AbstractIndexer protected $_resourceCategoryFlat; /** - * Construct - * - * @param \Magento\Catalog\Model\Resource\Category\Flat $resourceCategoryFlat - * @param \Magento\Catalog\Helper\Category\Flat $catalogCategoryFlat * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Catalog\Model\Resource\Category\Flat $resourceCategoryFlat + * @param \Magento\Catalog\Helper\Category\Flat $catalogCategoryFlat * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Catalog\Model\Resource\Category\Flat $resourceCategoryFlat, - \Magento\Catalog\Helper\Category\Flat $catalogCategoryFlat, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Catalog\Model\Resource\Category\Flat $resourceCategoryFlat, + \Magento\Catalog\Helper\Category\Flat $catalogCategoryFlat, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Config/Backend/Category.php b/app/code/Magento/Catalog/Model/Config/Backend/Category.php index b8e4d570b9c..5b1b68c5b6f 100644 --- a/app/code/Magento/Catalog/Model/Config/Backend/Category.php +++ b/app/code/Magento/Catalog/Model/Config/Backend/Category.php @@ -43,23 +43,21 @@ class Category extends \Magento\Core\Model\Config\Value protected $_catalogCategory; /** - * Construct - * - * @param \Magento\Catalog\Model\Category $catalogCategory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\Catalog\Model\Category $catalogCategory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Catalog\Model\Category $catalogCategory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\Catalog\Model\Category $catalogCategory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php b/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php index 0c1572225bf..b4640a724df 100644 --- a/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php +++ b/app/code/Magento/Catalog/Model/Config/CatalogClone/Media/Image.php @@ -48,25 +48,23 @@ class Image extends \Magento\Core\Model\Config\Value protected $_attributeCollectionFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory - * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory + * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory, - \Magento\Eav\Model\Config $eavConfig, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory, + \Magento\Eav\Model\Config $eavConfig, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Design.php b/app/code/Magento/Catalog/Model/Design.php index 698db0fe2e9..6d065580320 100644 --- a/app/code/Magento/Catalog/Model/Design.php +++ b/app/code/Magento/Catalog/Model/Design.php @@ -54,21 +54,19 @@ class Design extends \Magento\Core\Model\AbstractModel protected $_locale; /** - * Construct - * - * @param \Magento\Core\Model\LocaleInterface $locale - * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\LocaleInterface $locale + * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\LocaleInterface $locale, - \Magento\View\DesignInterface $design, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\LocaleInterface $locale, + \Magento\View\DesignInterface $design, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Indexer/Url.php b/app/code/Magento/Catalog/Model/Indexer/Url.php index 2ec5723ab00..ac5639bc802 100644 --- a/app/code/Magento/Catalog/Model/Indexer/Url.php +++ b/app/code/Magento/Catalog/Model/Indexer/Url.php @@ -87,21 +87,19 @@ class Url extends \Magento\Index\Model\Indexer\AbstractIndexer protected $_catalogResourceUrl; /** - * Construct - * - * @param \Magento\Catalog\Model\Resource\Url $catalogResourceUrl - * @param \Magento\Catalog\Model\Url $catalogUrl * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Catalog\Model\Resource\Url $catalogResourceUrl + * @param \Magento\Catalog\Model\Url $catalogUrl * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Catalog\Model\Resource\Url $catalogResourceUrl, - \Magento\Catalog\Model\Url $catalogUrl, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Catalog\Model\Resource\Url $catalogResourceUrl, + \Magento\Catalog\Model\Url $catalogUrl, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Category.php b/app/code/Magento/Catalog/Model/Layer/Filter/Category.php index c900032becb..5dea59516c8 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Category.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Category.php @@ -121,7 +121,7 @@ class Category extends \Magento\Catalog\Model\Layer\Filter\AbstractFilter * Apply category filter to layer * * @param \Zend_Controller_Request_Abstract $request - * @param \Magento\View\Block\AbstractBlock $filterBlock + * @param \Magento\View\Element\AbstractBlock $filterBlock * @return \Magento\Catalog\Model\Layer\Filter\Category */ public function apply(\Zend_Controller_Request_Abstract $request, $filterBlock) diff --git a/app/code/Magento/Catalog/Model/Layer/Filter/Item.php b/app/code/Magento/Catalog/Model/Layer/Filter/Item.php index 4de4a29ef3a..138e1d1df9c 100644 --- a/app/code/Magento/Catalog/Model/Layer/Filter/Item.php +++ b/app/code/Magento/Catalog/Model/Layer/Filter/Item.php @@ -45,7 +45,7 @@ class Item extends \Magento\Object /** * Html pager block * - * @var \Magento\Page\Block\Html\Pager + * @var \Magento\Theme\Block\Html\Pager */ protected $_htmlPagerBlock; @@ -53,12 +53,12 @@ class Item extends \Magento\Object * Construct * * @param \Magento\UrlInterface $url - * @param \Magento\Page\Block\Html\Pager $htmlPagerBlock + * @param \Magento\Theme\Block\Html\Pager $htmlPagerBlock * @param array $data */ public function __construct( \Magento\UrlInterface $url, - \Magento\Page\Block\Html\Pager $htmlPagerBlock, + \Magento\Theme\Block\Html\Pager $htmlPagerBlock, array $data = array() ) { $this->_url = $url; diff --git a/app/code/Magento/Catalog/Model/Product.php b/app/code/Magento/Catalog/Model/Product.php index 3627f6cb056..5fbcd68df72 100644 --- a/app/code/Magento/Catalog/Model/Product.php +++ b/app/code/Magento/Catalog/Model/Product.php @@ -206,42 +206,37 @@ class Product extends \Magento\Catalog\Model\AbstractModel protected $_itemOptionFactory; /** - * @var \Magento\App\State - */ - protected $_appState; - - /** - * Construct - * - * @param \Magento\Catalog\Model\Product\Url $url - * @param \Magento\Catalog\Model\Product\Link $productLink + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Catalog\Model\Product\Configuration\Item\OptionFactory $itemOptionFactory + * @param Product\Url $url + * @param Product\Link $productLink + * @param Product\Configuration\Item\OptionFactory $itemOptionFactory * @param \Magento\CatalogInventory\Model\Stock\ItemFactory $stockItemFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory - * @param \Magento\Catalog\Model\Product\Option $catalogProductOption - * @param \Magento\Catalog\Model\Product\Visibility $catalogProductVisibility - * @param \Magento\Catalog\Model\Product\Status $catalogProductStatus - * @param \Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig + * @param ProductFactory $productFactory + * @param CategoryFactory $categoryFactory + * @param Product\Option $catalogProductOption + * @param Product\Visibility $catalogProductVisibility + * @param Product\Status $catalogProductStatus + * @param Product\Media\Config $catalogProductMediaConfig * @param \Magento\Index\Model\Indexer $indexIndexer - * @param \Magento\Catalog\Model\Product\Type $catalogProductType + * @param Product\Type $catalogProductType * @param \Magento\Catalog\Helper\Image $catalogImage * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Catalog\Model\Resource\Product $resource - * @param \Magento\Catalog\Model\Resource\Product\Collection $resourceCollection + * @param Resource\Product $resource + * @param Resource\Product\Collection $resourceCollection * @param \Magento\Data\CollectionFactory $collectionFactory * @param array $data - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\Url $url, \Magento\Catalog\Model\Product\Link $productLink, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\Configuration\Item\OptionFactory $itemOptionFactory, \Magento\CatalogInventory\Model\Stock\ItemFactory $stockItemFactory, \Magento\Catalog\Model\ProductFactory $productFactory, @@ -255,8 +250,6 @@ class Product extends \Magento\Catalog\Model\AbstractModel \Magento\Catalog\Helper\Image $catalogImage, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\Resource\Product $resource, \Magento\Catalog\Model\Resource\Product\Collection $resourceCollection, \Magento\Data\CollectionFactory $collectionFactory, @@ -278,8 +271,7 @@ class Product extends \Magento\Catalog\Model\AbstractModel $this->_collectionFactory = $collectionFactory; $this->_urlModel = $url; $this->_linkInstance = $productLink; - $this->_appState = $context->getAppState(); - parent::__construct($storeManager, $context, $registry, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $storeManager, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Catalog/Model/Product/Action.php b/app/code/Magento/Catalog/Model/Product/Action.php index b8422eb2678..2fdbe3a1b61 100644 --- a/app/code/Magento/Catalog/Model/Product/Action.php +++ b/app/code/Magento/Catalog/Model/Product/Action.php @@ -51,21 +51,19 @@ class Action extends \Magento\Core\Model\AbstractModel protected $_productWebsiteFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\Product\WebsiteFactory $productWebsiteFactory - * @param \Magento\Index\Model\Indexer $indexIndexer * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Catalog\Model\Product\WebsiteFactory $productWebsiteFactory + * @param \Magento\Index\Model\Indexer $indexIndexer * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Catalog\Model\Product\WebsiteFactory $productWebsiteFactory, - \Magento\Index\Model\Indexer $indexIndexer, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Catalog\Model\Product\WebsiteFactory $productWebsiteFactory, + \Magento\Index\Model\Indexer $indexIndexer, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Group.php b/app/code/Magento/Catalog/Model/Product/Attribute/Group.php index 81b21dad496..2218b378c13 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Group.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Group.php @@ -38,19 +38,17 @@ class Group extends \Magento\Eav\Model\Entity\Attribute\Group protected $_attributeCollectionFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php index ddd91b58f03..69b3dd4b79b 100644 --- a/app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php +++ b/app/code/Magento/Catalog/Model/Product/Attribute/Source/Layout.php @@ -38,17 +38,17 @@ class Layout extends \Magento\Eav\Model\Entity\Attribute\Source\AbstractSource /** * Page source layout * - * @var \Magento\Page\Model\Source\Layout + * @var \Magento\Theme\Model\Layout\Source\Layout */ protected $_pageSourceLayout; /** * Construct * - * @param \Magento\Page\Model\Source\Layout $pageSourceLayout + * @param \Magento\Theme\Model\Layout\Source\Layout $pageSourceLayout */ public function __construct( - \Magento\Page\Model\Source\Layout $pageSourceLayout + \Magento\Theme\Model\Layout\Source\Layout $pageSourceLayout ) { $this->_pageSourceLayout = $pageSourceLayout; } diff --git a/app/code/Magento/Catalog/Model/Product/Compare/Item.php b/app/code/Magento/Catalog/Model/Product/Compare/Item.php index af4d7174c9a..45a15443d4a 100644 --- a/app/code/Magento/Catalog/Model/Product/Compare/Item.php +++ b/app/code/Magento/Catalog/Model/Product/Compare/Item.php @@ -90,25 +90,23 @@ class Item extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * Construct - * + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Log\Model\Visitor $logVisitor * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Helper\Product\Compare $catalogProductCompare - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Log\Model\Visitor $logVisitor, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Helper\Product\Compare $catalogProductCompare, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Product/Flat/Indexer.php b/app/code/Magento/Catalog/Model/Product/Flat/Indexer.php index 81c4a9fd986..95fed24ff6c 100644 --- a/app/code/Magento/Catalog/Model/Product/Flat/Indexer.php +++ b/app/code/Magento/Catalog/Model/Product/Flat/Indexer.php @@ -80,21 +80,19 @@ class Indexer extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Index\Model\Indexer $index * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Index\Model\Indexer $index * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Index\Model\Indexer $index, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Index\Model\Indexer $index, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Product/Image.php b/app/code/Magento/Catalog/Model/Product/Image.php index 046644f74ac..672b074bf35 100644 --- a/app/code/Magento/Catalog/Model/Product/Image.php +++ b/app/code/Magento/Catalog/Model/Product/Image.php @@ -114,14 +114,12 @@ class Image extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * Construct - * + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\Dir $dir * @param \Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Filesystem $filesystem * @param \Magento\Image\Factory $imageFactory * @param \Magento\View\Url $viewUrl @@ -130,16 +128,14 @@ class Image extends \Magento\Core\Model\AbstractModel * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\Dir $dir, \Magento\Catalog\Model\Product\Media\Config $catalogProductMediaConfig, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\Filesystem $filesystem, \Magento\Image\Factory $imageFactory, \Magento\View\Url $viewUrl, diff --git a/app/code/Magento/Catalog/Model/Product/Indexer/Eav.php b/app/code/Magento/Catalog/Model/Product/Indexer/Eav.php index b6f3cd3e0a1..131599f2788 100644 --- a/app/code/Magento/Catalog/Model/Product/Indexer/Eav.php +++ b/app/code/Magento/Catalog/Model/Product/Indexer/Eav.php @@ -68,19 +68,17 @@ class Eav extends \Magento\Index\Model\Indexer\AbstractIndexer protected $_eavConfig; /** - * Construct - * - * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Eav\Model\Config $eavConfig, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Eav\Model\Config $eavConfig, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Product/Indexer/Flat.php b/app/code/Magento/Catalog/Model/Product/Indexer/Flat.php index 2f1227f86d1..1e2e5bde249 100644 --- a/app/code/Magento/Catalog/Model/Product/Indexer/Flat.php +++ b/app/code/Magento/Catalog/Model/Product/Indexer/Flat.php @@ -95,25 +95,23 @@ class Flat extends \Magento\Index\Model\Indexer\AbstractIndexer protected $_flatIndexerFactory; /** - * Construct - * + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\Product\Flat\IndexerFactory $flatIndexerFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Product\Flat\Indexer $catalogProductFlatIndexer * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\Product\Flat\IndexerFactory $flatIndexerFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\Flat\Indexer $catalogProductFlatIndexer, \Magento\Catalog\Helper\Product\Flat $catalogProductFlat, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Product/Link.php b/app/code/Magento/Catalog/Model/Product/Link.php index 70675696da7..9d6293223e6 100644 --- a/app/code/Magento/Catalog/Model/Product/Link.php +++ b/app/code/Magento/Catalog/Model/Product/Link.php @@ -67,21 +67,19 @@ class Link extends \Magento\Core\Model\AbstractModel protected $_linkCollectionFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\Resource\Product\Link\CollectionFactory $linkCollectionFactory - * @param \Magento\Catalog\Model\Resource\Product\Link\Product\CollectionFactory $productCollectionFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Catalog\Model\Resource\Product\Link\CollectionFactory $linkCollectionFactory + * @param \Magento\Catalog\Model\Resource\Product\Link\Product\CollectionFactory $productCollectionFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Catalog\Model\Resource\Product\Link\CollectionFactory $linkCollectionFactory, - \Magento\Catalog\Model\Resource\Product\Link\Product\CollectionFactory $productCollectionFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Catalog\Model\Resource\Product\Link\CollectionFactory $linkCollectionFactory, + \Magento\Catalog\Model\Resource\Product\Link\Product\CollectionFactory $productCollectionFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Product/Option.php b/app/code/Magento/Catalog/Model/Product/Option.php index ff27e811b57..ac0e79e87f1 100644 --- a/app/code/Magento/Catalog/Model/Product/Option.php +++ b/app/code/Magento/Catalog/Model/Product/Option.php @@ -97,11 +97,9 @@ class Option extends \Magento\Core\Model\AbstractModel protected $string; /** - * Construct - * - * @param \Magento\Catalog\Model\Product\Option\Value $productOptionValue * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Catalog\Model\Product\Option\Value $productOptionValue * @param \Magento\Catalog\Model\Product\Option\Type\Factory $optionFactory * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -109,9 +107,9 @@ class Option extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Catalog\Model\Product\Option\Value $productOptionValue, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Catalog\Model\Product\Option\Value $productOptionValue, \Magento\Catalog\Model\Product\Option\Type\Factory $optionFactory, \Magento\Stdlib\String $string, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Catalog/Model/Product/Option/Value.php b/app/code/Magento/Catalog/Model/Product/Option/Value.php index 1d707190d47..aff7144664a 100644 --- a/app/code/Magento/Catalog/Model/Product/Option/Value.php +++ b/app/code/Magento/Catalog/Model/Product/Option/Value.php @@ -56,19 +56,17 @@ class Value extends \Magento\Core\Model\AbstractModel protected $_valueCollectionFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $valueCollectionFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $valueCollectionFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $valueCollectionFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $valueCollectionFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Product/Status.php b/app/code/Magento/Catalog/Model/Product/Status.php index 0ff9a0683d7..57f78235169 100644 --- a/app/code/Magento/Catalog/Model/Product/Status.php +++ b/app/code/Magento/Catalog/Model/Product/Status.php @@ -69,21 +69,19 @@ class Status extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Catalog\Model\Product\Action $catalogProductAction * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Catalog\Model\Product\Action $catalogProductAction * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Product\Action $catalogProductAction, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Catalog\Model\Product\Action $catalogProductAction, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Attribute/Collection.php b/app/code/Magento/Catalog/Model/Resource/Category/Attribute/Collection.php index 8e371e22e53..ab653a6d3d6 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Attribute/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Attribute/Collection.php @@ -45,25 +45,25 @@ class Collection protected $_eavEntityFactory; /** - * Construct - * - * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Eav\Model\EntityFactory $eavEntityFactory, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Eav\Model\EntityFactory $eavEntityFactory, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_eavEntityFactory = $eavEntityFactory; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Flat/Collection.php b/app/code/Magento/Catalog/Model/Resource/Category/Flat/Collection.php index 149ab71dd9e..fefd96e11c3 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Flat/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Flat/Collection.php @@ -65,25 +65,25 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_storeManager; /** - * Construct - * - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_storeManager = $storeManager; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Category/Indexer/Product.php b/app/code/Magento/Catalog/Model/Resource/Category/Indexer/Product.php index f150c0b8853..54a7572a873 100644 --- a/app/code/Magento/Catalog/Model/Resource/Category/Indexer/Product.php +++ b/app/code/Magento/Catalog/Model/Resource/Category/Indexer/Product.php @@ -86,15 +86,11 @@ class Product extends \Magento\Index\Model\Resource\AbstractResource protected $_eavConfig; /** - * Class constructor - * - * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource + * @param \Magento\Eav\Model\Config $eavConfig */ - public function __construct( - \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource - ) { + public function __construct(\Magento\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig) + { $this->_eavConfig = $eavConfig; parent::__construct($resource); } diff --git a/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php b/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php index dd44a43cf62..20b2e7dbd54 100644 --- a/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php +++ b/app/code/Magento/Catalog/Model/Resource/Collection/AbstractCollection.php @@ -52,34 +52,46 @@ class AbstractCollection extends \Magento\Eav\Model\Entity\Collection\AbstractCo protected $_storeManager; /** - * Construct - * - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager + \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null ) { $this->_storeManager = $storeManager; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, - $eavEntityFactory, $resourceHelper, $universalFactory); + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $connection + ); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Config.php b/app/code/Magento/Catalog/Model/Resource/Config.php index 15957d4c4f4..376c1a0689c 100644 --- a/app/code/Magento/Catalog/Model/Resource/Config.php +++ b/app/code/Magento/Catalog/Model/Resource/Config.php @@ -65,16 +65,14 @@ class Config extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * Class constructor - * + * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource */ public function __construct( + \Magento\App\Resource $resource, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource + \Magento\Eav\Model\Config $eavConfig ) { $this->_storeManager = $storeManager; $this->_eavConfig = $eavConfig; diff --git a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php index b67c27a54df..a09854c0e38 100644 --- a/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php +++ b/app/code/Magento/Catalog/Model/Resource/Layer/Filter/Price.php @@ -49,17 +49,11 @@ class Price extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_eventManager = null; /** - * Class constructor - * - * - * - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\App\Resource $resource + * @param \Magento\Event\ManagerInterface $eventManager */ - public function __construct( - \Magento\Event\ManagerInterface $eventManager, - \Magento\App\Resource $resource - ) { + public function __construct(\Magento\App\Resource $resource, \Magento\Event\ManagerInterface $eventManager) + { $this->_eventManager = $eventManager; parent::__construct($resource); } diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Collection.php index 99867d52719..a889748eb6e 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Attribute/Collection.php @@ -45,25 +45,25 @@ class Collection protected $_eavEntityFactory; /** - * Construct - * - * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Eav\Model\EntityFactory $eavEntityFactory, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Eav\Model\EntityFactory $eavEntityFactory, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_eavEntityFactory = $eavEntityFactory; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Collection.php index 1947eb04a8a..3cd9ce1b61c 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Collection.php @@ -263,15 +263,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl protected $dateTime; /** - * Construct - * - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData @@ -281,19 +280,20 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime - * + * @param mixed $connection + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, @@ -303,8 +303,8 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, - \Magento\Stdlib\DateTime $dateTime + \Magento\Stdlib\DateTime $dateTime, + $connection = null ) { $this->_catalogData = $catalogData; $this->_catalogProductFlat = $catalogProductFlat; @@ -315,8 +315,19 @@ class Collection extends \Magento\Catalog\Model\Resource\Collection\AbstractColl $this->_customerSession = $customerSession; $this->_resourceHelper = $resourceHelper; $this->dateTime = $dateTime; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, - $eavEntityFactory, $resourceHelper, $universalFactory, $storeManager); + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $storeManager, + $connection + ); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProduct.php b/app/code/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProduct.php index f6d3abd98be..f822e123f76 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProduct.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProduct.php @@ -57,13 +57,14 @@ class AssociatedProduct protected $_configurationHelper; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData @@ -73,21 +74,23 @@ class AssociatedProduct * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Registry $registryManager * @param \Magento\Catalog\Model\Product\Type\Configurable $productType * @param \Magento\Catalog\Helper\Product\Configuration $configurationHelper + * @param mixed $connection + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, @@ -97,18 +100,35 @@ class AssociatedProduct \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\Registry $registryManager, \Magento\Catalog\Model\Product\Type\Configurable $productType, - \Magento\Catalog\Helper\Product\Configuration $configurationHelper + \Magento\Catalog\Helper\Product\Configuration $configurationHelper, + $connection = null ) { $this->_registryManager = $registryManager; $this->_productType = $productType; $this->_configurationHelper = $configurationHelper; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, - $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, $coreStoreConfig, - $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $storeManager, + $catalogData, + $catalogProductFlat, + $coreStoreConfig, + $productOptionFactory, + $catalogUrl, + $locale, + $customerSession, + $dateTime, + $connection ); } diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php index 0d5287f8809..d49581a5fc7 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Compare/Item/Collection.php @@ -73,13 +73,14 @@ class Collection protected $_catalogProductCompareItem; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData @@ -89,21 +90,22 @@ class Collection * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Catalog\Model\Resource\Product\Compare\Item $catalogProductCompareItem * @param \Magento\Catalog\Helper\Product\Compare $catalogProductCompare - * + * @param mixed $connection + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, @@ -113,16 +115,33 @@ class Collection \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime, \Magento\Catalog\Model\Resource\Product\Compare\Item $catalogProductCompareItem, - \Magento\Catalog\Helper\Product\Compare $catalogProductCompare + \Magento\Catalog\Helper\Product\Compare $catalogProductCompare, + $connection = null ) { $this->_catalogProductCompareItem = $catalogProductCompareItem; $this->_catalogProductCompare = $catalogProductCompare; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, - $resource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, - $coreStoreConfig, $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $storeManager, + $catalogData, + $catalogProductFlat, + $coreStoreConfig, + $productOptionFactory, + $catalogUrl, + $locale, + $customerSession, + $dateTime, + $connection ); } diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php index 297bd6e8cea..d1a18d3af65 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Flat.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Flat.php @@ -58,16 +58,14 @@ class Flat extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * Class constructor - * + * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\App\Resource $resource */ public function __construct( + \Magento\App\Resource $resource, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Config $catalogConfig, - \Magento\App\Resource $resource + \Magento\Catalog\Model\Config $catalogConfig ) { $this->_storeManager = $storeManager; $this->_catalogConfig = $catalogConfig; diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Flat/Indexer.php b/app/code/Magento/Catalog/Model/Resource/Product/Flat/Indexer.php index ae3630b2f9a..4cb3ceb20fb 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Flat/Indexer.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Flat/Indexer.php @@ -173,10 +173,10 @@ class Indexer extends \Magento\Index\Model\Resource\AbstractResource protected $_resourceHelper; /** + * @param \Magento\App\Resource $resource * @param \Magento\Catalog\Model\Resource\ConfigFactory $configFactory * @param \Magento\Catalog\Model\Resource\Eav\AttributeFactory $eavAttributeFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Resource $resource * @param \Magento\Logger $logger * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Helper\Data $coreData @@ -185,16 +185,14 @@ class Indexer extends \Magento\Index\Model\Resource\AbstractResource * @param \Magento\Catalog\Helper\Product\Flat $catalogProductFlat * @param \Magento\Catalog\Model\Product\Type $productType * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper - * @param $maxIndexCount + * @param string $maxIndexCount * @param array $flatAttributeGroups - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( + \Magento\App\Resource $resource, \Magento\Catalog\Model\Resource\ConfigFactory $configFactory, \Magento\Catalog\Model\Resource\Eav\AttributeFactory $eavAttributeFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\App\Resource $resource, \Magento\Logger $logger, \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Helper\Data $coreData, diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav.php index 6ef01c26066..40e30a4ba61 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Eav.php @@ -58,18 +58,16 @@ class Eav extends \Magento\Catalog\Model\Resource\Product\Indexer\AbstractIndexe protected $_eavDecimalFactory; /** - * Class constructor - * + * @param \Magento\App\Resource $resource + * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Catalog\Model\Resource\Product\Indexer\Eav\DecimalFactory $eavDecimalFactory * @param \Magento\Catalog\Model\Resource\Product\Indexer\Eav\SourceFactory $eavSourceFactory - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\Resource $resource */ public function __construct( - \Magento\Catalog\Model\Resource\Product\Indexer\Eav\DecimalFactory $eavDecimalFactory, - \Magento\Catalog\Model\Resource\Product\Indexer\Eav\SourceFactory $eavSourceFactory, + \Magento\App\Resource $resource, \Magento\Eav\Model\Config $eavConfig, - \Magento\App\Resource $resource + \Magento\Catalog\Model\Resource\Product\Indexer\Eav\DecimalFactory $eavDecimalFactory, + \Magento\Catalog\Model\Resource\Product\Indexer\Eav\SourceFactory $eavSourceFactory ) { $this->_eavDecimalFactory = $eavDecimalFactory; $this->_eavSourceFactory = $eavSourceFactory; diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price.php b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price.php index 25fda479b95..cd2e89af7d2 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Indexer/Price.php @@ -98,23 +98,21 @@ class Price extends \Magento\Index\Model\Resource\AbstractResource protected $dateTime; /** - * Class constructor - * + * @param \Magento\App\Resource $resource * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Catalog\Model\Product\Type $catalogProductType - * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\Config $config * @param \Magento\Catalog\Model\Resource\Product\Indexer\Price\Factory $indexerPriceFactory * @param \Magento\Stdlib\DateTime $dateTime */ public function __construct( + \Magento\App\Resource $resource, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\LocaleInterface $locale, \Magento\Catalog\Model\Product\Type $catalogProductType, - \Magento\App\Resource $resource, \Magento\Core\Model\Config $config, \Magento\Catalog\Model\Resource\Product\Indexer\Price\Factory $indexerPriceFactory, \Magento\Stdlib\DateTime $dateTime diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Link.php b/app/code/Magento/Catalog/Model/Resource/Product/Link.php index 2ac004f3b56..11bb4fbb014 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Link.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Link.php @@ -51,14 +51,12 @@ class Link extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_catalogProductRelation; /** - * Class constructor - * - * @param \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation * @param \Magento\App\Resource $resource + * @param \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation */ public function __construct( - \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation, - \Magento\App\Resource $resource + \Magento\App\Resource $resource, + \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation ) { $this->_catalogProductRelation = $catalogProductRelation; parent::__construct($resource); diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Option/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Option/Collection.php index b4db96dc203..263f48358bf 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Option/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Option/Collection.php @@ -48,28 +48,28 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_optionValueCollectionFactory; /** - * Construct - * - * @param \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $optionValueCollectionFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $optionValueCollectionFactory + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $optionValueCollectionFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Catalog\Model\Resource\Product\Option\Value\CollectionFactory $optionValueCollectionFactory, + \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_optionValueCollectionFactory = $optionValueCollectionFactory; $this->_storeManager = $storeManager; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Status.php b/app/code/Magento/Catalog/Model/Resource/Product/Status.php index 638fe331729..3e19fbce823 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Status.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Status.php @@ -65,18 +65,16 @@ class Status extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_productResource; /** - * Class constructor - * + * @param \Magento\App\Resource $resource * @param \Magento\Catalog\Model\Resource\Product $productResource * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Product $catalogProduct - * @param \Magento\App\Resource $resource */ public function __construct( + \Magento\App\Resource $resource, \Magento\Catalog\Model\Resource\Product $productResource, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Model\Product $catalogProduct, - \Magento\App\Resource $resource + \Magento\Catalog\Model\Product $catalogProduct ) { $this->_productResource = $productResource; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable.php b/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable.php index 889bc5c6f49..65760904c12 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable.php @@ -44,14 +44,12 @@ class Configurable extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_catalogProductRelation; /** - * Class constructor - * - * @param \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation * @param \Magento\App\Resource $resource + * @param \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation */ public function __construct( - \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation, - \Magento\App\Resource $resource + \Magento\App\Resource $resource, + \Magento\Catalog\Model\Resource\Product\Relation $catalogProductRelation ) { $this->_catalogProductRelation = $catalogProductRelation; parent::__construct($resource); diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php b/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php index 43be06b240b..4ad46deb5a0 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable/Attribute.php @@ -65,16 +65,14 @@ class Attribute extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * Construct - * + * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\App\Resource $resource */ public function __construct( + \Magento\App\Resource $resource, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Catalog\Helper\Data $catalogData, - \Magento\App\Resource $resource + \Magento\Catalog\Helper\Data $catalogData ) { $this->_storeManager = $storeManager; $this->_catalogData = $catalogData; diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php b/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php index 023381887b8..de75fbea38a 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Type/Configurable/Attribute/Collection.php @@ -77,31 +77,31 @@ class Collection protected $_storeManager; /** - * Construct - * + * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Logger $logger + * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Model\Product\Type\Configurable $catalogProductTypeConfigurable - * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Logger $logger * @param \Magento\Catalog\Helper\Data $catalogData - * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Catalog\Model\Resource\Product\Type\Configurable\Attribute $resource + * @param mixed $connection */ public function __construct( + \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Logger $logger, + \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\Type\Configurable $catalogProductTypeConfigurable, - \Magento\Event\ManagerInterface $eventManager, - \Magento\Logger $logger, \Magento\Catalog\Helper\Data $catalogData, - \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Catalog\Model\Resource\Product\Type\Configurable\Attribute $resource + \Magento\Catalog\Model\Resource\Product\Type\Configurable\Attribute $resource, + $connection = null ) { $this->_storeManager = $storeManager; $this->_productTypeConfigurable = $catalogProductTypeConfigurable; $this->_catalogData = $catalogData; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php b/app/code/Magento/Catalog/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php index 86cf51586bc..4183876a826 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Type/Grouped/AssociatedProductsCollection.php @@ -51,15 +51,14 @@ class AssociatedProductsCollection protected $_config; /** - * Construct - * - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData @@ -69,21 +68,22 @@ class AssociatedProductsCollection * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Catalog\Model\ProductTypes\ConfigInterface $config - * + * @param mixed $connection + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, @@ -93,16 +93,33 @@ class AssociatedProductsCollection \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\Registry $coreRegistry, - \Magento\Catalog\Model\ProductTypes\ConfigInterface $config + \Magento\Catalog\Model\ProductTypes\ConfigInterface $config, + $connection = null ) { $this->_coreRegistry = $coreRegistry; $this->_config = $config; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, - $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, $coreStoreConfig, - $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $storeManager, + $catalogData, + $catalogProductFlat, + $coreStoreConfig, + $productOptionFactory, + $catalogUrl, + $locale, + $customerSession, + $dateTime, + $connection ); } diff --git a/app/code/Magento/Catalog/Model/Resource/Product/Website.php b/app/code/Magento/Catalog/Model/Resource/Product/Website.php index 2cc60096ae4..9fb2bcf91d4 100644 --- a/app/code/Magento/Catalog/Model/Resource/Product/Website.php +++ b/app/code/Magento/Catalog/Model/Resource/Product/Website.php @@ -51,16 +51,14 @@ class Website extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_productResource; /** - * Class constructor - * + * @param \Magento\App\Resource $resource * @param \Magento\Catalog\Model\Resource\Product $productResource * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Resource $resource */ public function __construct( + \Magento\App\Resource $resource, \Magento\Catalog\Model\Resource\Product $productResource, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\App\Resource $resource + \Magento\Core\Model\StoreManagerInterface $storeManager ) { $this->_productResource = $productResource; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Catalog/Model/Resource/Setup.php b/app/code/Magento/Catalog/Model/Resource/Setup.php index de6dee60c64..43e30960ea6 100755 --- a/app/code/Magento/Catalog/Model/Resource/Setup.php +++ b/app/code/Magento/Catalog/Model/Resource/Setup.php @@ -58,12 +58,10 @@ class Setup extends \Magento\Eav\Model\Entity\Setup protected $_eavAttributeResourceFactory; /** - * Construct - * * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param string $resourceName * @param \Magento\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory - * @param string $resourceName * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Index\Model\IndexerFactory $indexerFactory * @param \Magento\Catalog\Model\Resource\Eav\AttributeFactory $eavAttributeResourceFactory @@ -72,9 +70,9 @@ class Setup extends \Magento\Eav\Model\Entity\Setup */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, \Magento\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory, - $resourceName, \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Index\Model\IndexerFactory $indexerFactory, \Magento\Catalog\Model\Resource\Eav\AttributeFactory $eavAttributeResourceFactory, @@ -84,7 +82,7 @@ class Setup extends \Magento\Eav\Model\Entity\Setup $this->_categoryFactory = $categoryFactory; $this->_indexerFactory = $indexerFactory; $this->_eavAttributeResourceFactory = $eavAttributeResourceFactory; - parent::__construct($context, $cache, $attrGrCollFactory, $resourceName, $moduleName, $connectionName); + parent::__construct($context, $resourceName, $cache, $attrGrCollFactory, $moduleName, $connectionName); } /** diff --git a/app/code/Magento/Catalog/Model/Resource/Url.php b/app/code/Magento/Catalog/Model/Resource/Url.php index 7f423a01a2b..aefba1d77a2 100644 --- a/app/code/Magento/Catalog/Model/Resource/Url.php +++ b/app/code/Magento/Catalog/Model/Resource/Url.php @@ -114,20 +114,20 @@ class Url extends \Magento\Core\Model\Resource\Db\AbstractDb } /** + * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Catalog\Model\Product $catalogProduct * @param \Magento\Catalog\Model\Category $catalogCategory * @param \Magento\Logger $logger - * @param \Magento\App\Resource $resource */ public function __construct( + \Magento\App\Resource $resource, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Catalog\Model\Product $catalogProduct, \Magento\Catalog\Model\Category $catalogCategory, - \Magento\Logger $logger, - \Magento\App\Resource $resource + \Magento\Logger $logger ) { $this->_storeManager = $storeManager; $this->_eavConfig = $eavConfig; diff --git a/app/code/Magento/Catalog/Model/Session.php b/app/code/Magento/Catalog/Model/Session.php index 6206132d7ab..b550dd7961c 100644 --- a/app/code/Magento/Catalog/Model/Session.php +++ b/app/code/Magento/Catalog/Model/Session.php @@ -37,16 +37,20 @@ class Session extends \Magento\Core\Model\Session\AbstractSession { /** * @param \Magento\Core\Model\Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param array $data * @param null $sessionName */ public function __construct( \Magento\Core\Model\Session\Context $context, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, array $data = array(), $sessionName = null ) { - parent::__construct($context, $data); - $this->init('catalog', $sessionName); + parent::__construct($context, $sidResolver, $sessionConfig, $data); + $this->start('catalog', $sessionName); } public function getDisplayMode() diff --git a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php index 5ac15b549c2..3ca9ab962ca 100644 --- a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php +++ b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Category/Flat.php @@ -39,23 +39,21 @@ class Flat extends \Magento\Core\Model\Config\Value protected $_indexerFactory; /** - * Construct - * - * @param \Magento\Index\Model\IndexerFactory $indexerFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\Index\Model\IndexerFactory $indexerFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Index\Model\IndexerFactory $indexerFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\Index\Model\IndexerFactory $indexerFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php index ce40ff299b3..987b7f55b63 100644 --- a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php +++ b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Product/Flat.php @@ -39,23 +39,21 @@ class Flat extends \Magento\Core\Model\Config\Value protected $_indexIndexer; /** - * Construct - * - * @param \Magento\Index\Model\Indexer $indexIndexer * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\Index\Model\Indexer $indexIndexer * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Index\Model\Indexer $indexIndexer, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\Index\Model\Indexer $indexIndexer, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php index 73227bc59ac..e79182a8492 100644 --- a/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php +++ b/app/code/Magento/Catalog/Model/System/Config/Backend/Catalog/Url/Rewrite/Suffix.php @@ -39,21 +39,21 @@ class Suffix extends \Magento\Core\Model\Config\Value protected $_coreUrlRewrite = null; /** - * @param \Magento\Core\Helper\Url\Rewrite $coreUrlRewrite * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\Core\Helper\Url\Rewrite $coreUrlRewrite * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Helper\Url\Rewrite $coreUrlRewrite, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\Core\Helper\Url\Rewrite $coreUrlRewrite, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Catalog/etc/module.xml b/app/code/Magento/Catalog/etc/module.xml index 9d7b484d949..03dcc5b2b7c 100755 --- a/app/code/Magento/Catalog/etc/module.xml +++ b/app/code/Magento/Catalog/etc/module.xml @@ -37,7 +37,7 @@ <module name="Magento_Index"/> <module name="Magento_Customer"/> <module name="Magento_Core"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> <module name="Magento_Checkout"/> <module name="Magento_Log"/> <module name="Magento_Backend"/> diff --git a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml index 8d201979096..3800d9b3ac4 100644 --- a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-js-template.phtml @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -/* @var $this \Magento\View\Block\Template */ +/* @var $this \Magento\View\Element\Template */ ?> <script data-template-for="configurable-attribute" type="text/x-jquery-tmpl"> <div class="entry-edit" data-role="configurable-attribute" data-attribute="${JSON.stringify(attribute)}"> diff --git a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-template.phtml b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-template.phtml index d1c5bfdaeda..122f47d3a5e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-template.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/catalog/product/edit/super/attribute-template.phtml @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -/* @var $this \Magento\View\Block\Template */ +/* @var $this \Magento\View\Element\Template */ $havePriceVariation = array_reduce( $attribute['values'], diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml index e62be5fd5b3..cf448e64476 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/CATALOG_PRODUCT_COMPOSITE_CONFIGURE.xml @@ -31,7 +31,7 @@ <block class="Magento\Catalog\Block\Product\View\Options\Type\File" as="file" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/file.phtml"/> <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/select.phtml"/> <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="Magento_Catalog::catalog/product/composite/fieldset/options/type/date.phtml"/> - <block class="Magento\View\Block\Template" name="product.composite.fieldset.options.js" as="options_js" template="Magento_Catalog::catalog/product/composite/fieldset/options/js.phtml"/> + <block class="Magento\View\Element\Template" name="product.composite.fieldset.options.js" as="options_js" template="Magento_Catalog::catalog/product/composite/fieldset/options/js.phtml"/> </block> <block class="Magento\Catalog\Block\Adminhtml\Product\Composite\Fieldset\Qty" name="product.composite.fieldset.qty" template="catalog/product/composite/fieldset/qty.phtml"/> </block> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml index 24494575ce1..9af617f0d47 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_category_edit.xml @@ -26,32 +26,32 @@ <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="editor"/> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/css/jquery.fileupload-ui.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.iframe-transport.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/load-image.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/canvas-to-blob.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload-fp.js</argument> </arguments> @@ -64,6 +64,6 @@ <block class="Magento\Catalog\Block\Adminhtml\Category\Edit" name="category.edit" template="catalog/category/edit.phtml"/> </referenceContainer> <referenceContainer name="js"> - <block class="Magento\View\Block\Template" template="Magento_Catalog::catalog/wysiwyg/js.phtml" name="catalog.wysiwyg.js"/> + <block class="Magento\View\Element\Template" template="Magento_Catalog::catalog/wysiwyg/js.phtml" name="catalog.wysiwyg.js"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grouped.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grouped.xml index 9ded2b17395..f603f0a4831 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grouped.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_grouped.xml @@ -27,10 +27,10 @@ <update handle="catalog_product_grouped_grid_popup"/> <referenceBlock name="product_tabs"> <block class="Magento\Catalog\Block\Product\Grouped\AssociatedProducts" name="catalog.product.edit.grouped.container" template="Magento_Catalog::product/grouped/container.phtml"> - <block class="Magento\View\Block\Template" name="catalog.product.edit.tab.super.container" template="Magento_Catalog::product/grouped/grouped.phtml"> + <block class="Magento\View\Element\Template" name="catalog.product.edit.tab.super.container" template="Magento_Catalog::product/grouped/grouped.phtml"> <block class="Magento\Catalog\Block\Product\Grouped\AssociatedProducts\ListAssociatedProducts" name="catalog.product.edit.tab.super.list" as="list" template="Magento_Catalog::product/grouped/list.phtml"> </block> - <block class="Magento\View\Block\Template" name="catalog.product.edit.tab.super.grid.popup.container" as="catalog.product.group.grid.popup.container"/> + <block class="Magento\View\Element\Template" name="catalog.product.edit.tab.super.grid.popup.container" as="catalog.product.group.grid.popup.container"/> </block> </block> <action method="addTab"> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml index e73c7363a46..9f695a8b110 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_new.xml @@ -26,87 +26,87 @@ <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="editor"/> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/css/jquery.fileupload-ui.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.iframe-transport.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/load-image.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/canvas-to-blob.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload-fp.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-proxy-event-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-proxy-event-js"> <arguments> <argument name="file" xsi:type="string">mage/proxy-event.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-adminhtml-catalog-category-selector-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-adminhtml-catalog-category-selector-css"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::catalog/category-selector.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jstree-jquery-hotkeys-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jstree-jquery-hotkeys-js"> <arguments> <argument name="file" xsi:type="string">jquery/jstree/jquery.hotkeys.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jstree-jquery-jstree-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jstree-jquery-jstree-js"> <arguments> <argument name="file" xsi:type="string">jquery/jstree/jquery.jstree.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-catalog-type-switcher-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-catalog-type-switcher-js"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::catalog/type-switcher.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-catalog-product-variation-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-catalog-product-variation-js"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::catalog/product-variation.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-catalog-base-image-uploader-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-catalog-base-image-uploader-js"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::catalog/base-image-uploader.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-catalog-js-product-gallery-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-catalog-js-product-gallery-js"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::js/product-gallery.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-catalog-product-product-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-catalog-product-product-css"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::product/product.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-catalog-js-custom-options-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-catalog-js-custom-options-js"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::js/custom-options.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-catalog-js-new-category-dialog-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-catalog-js-new-category-dialog-js"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::js/new-category-dialog.js</argument> </arguments> @@ -119,14 +119,14 @@ </block> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\AttributeSet" name="attribute-set-info" template="Magento_Catalog::catalog/product/edit/attribute_set.phtml"/> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\NewCategory" name="new-category" template="Magento_Catalog::catalog/product/edit/category/new/form.phtml"/> - <block class="Magento\View\Block\Template" name="affected-attribute-set-form" template="Magento_Catalog::product/configurable/affected-attribute-set-selector/form.phtml"/> + <block class="Magento\View\Element\Template" name="affected-attribute-set-form" template="Magento_Catalog::product/configurable/affected-attribute-set-selector/form.phtml"/> </referenceContainer> <referenceContainer name="left"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Tabs" name="product_tabs"/> </referenceContainer> <referenceContainer name="js"> <block class="Magento\Catalog\Block\Adminhtml\Product\Edit\Js" name="catalog_product_js" template="catalog/product/js.phtml"/> - <block class="Magento\View\Block\Template" template="Magento_Catalog::catalog/wysiwyg/js.phtml"/> + <block class="Magento\View\Element\Template" template="Magento_Catalog::catalog/wysiwyg/js.phtml"/> <block class="Magento\Catalog\Block\Product\Configurable\AttributeSelector" template="Magento_Catalog::product/configurable/attribute-selector/js.phtml"/> <block class="Magento\Catalog\Block\Product\Configurable\AttributeSelector" template="Magento_Catalog::product/configurable/affected-attribute-set-selector/js.phtml"/> </referenceContainer> diff --git a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_review_new.xml b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_review_new.xml index 6efff826f02..fd08c5e7221 100644 --- a/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_review_new.xml +++ b/app/code/Magento/Catalog/view/adminhtml/layout/catalog_product_review_new.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-catalog-js-rating-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-catalog-js-rating-js"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::js/rating.js</argument> </arguments> diff --git a/app/code/Magento/Catalog/view/adminhtml/product/configurable/affected-attribute-set-selector/form.phtml b/app/code/Magento/Catalog/view/adminhtml/product/configurable/affected-attribute-set-selector/form.phtml index 7d4961b562b..6514076090e 100644 --- a/app/code/Magento/Catalog/view/adminhtml/product/configurable/affected-attribute-set-selector/form.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/product/configurable/affected-attribute-set-selector/form.phtml @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -/* @var $this \Magento\View\Block\Template */ +/* @var $this \Magento\View\Element\Template */ ?> <div id="<?php echo $this->getNameInLayout() ?>" style="display:none" data-role="dialog" data-id="affected-attribute-set-selector"> <form action=""> diff --git a/app/code/Magento/Catalog/view/adminhtml/product/grouped/grouped.phtml b/app/code/Magento/Catalog/view/adminhtml/product/grouped/grouped.phtml index 5942d7449db..4bb1ab68f8b 100644 --- a/app/code/Magento/Catalog/view/adminhtml/product/grouped/grouped.phtml +++ b/app/code/Magento/Catalog/view/adminhtml/product/grouped/grouped.phtml @@ -24,9 +24,9 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -/** @var $this \Magento\View\Block\Template */ +/** @var $this \Magento\View\Element\Template */ -/** @var $this \Magento\View\Block\Template */ +/** @var $this \Magento\View\Element\Template */ $_gridPopupBlock = $this->getChildBlock('catalog.product.group.grid.popup.container')->getChildBlock('grid'); $_gridPopupBlock->setRowClickCallback('function(){}'); /** @var $_helper \Magento\Core\Helper\Data */ diff --git a/app/code/Magento/Catalog/view/frontend/category/widget/link/link_block.phtml b/app/code/Magento/Catalog/view/frontend/category/widget/link/link_block.phtml index 1f250d2453e..eee7b32d4c7 100644 --- a/app/code/Magento/Catalog/view/frontend/category/widget/link/link_block.phtml +++ b/app/code/Magento/Catalog/view/frontend/category/widget/link/link_block.phtml @@ -22,4 +22,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<div class="widget category link"><a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getAnchorText()) ?></span></a></div> +<div class="widget category link"><a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getLabel()) ?></span></a></div> diff --git a/app/code/Magento/Catalog/view/frontend/category/widget/link/link_inline.phtml b/app/code/Magento/Catalog/view/frontend/category/widget/link/link_inline.phtml index cec450787e0..5c879fd0c96 100644 --- a/app/code/Magento/Catalog/view/frontend/category/widget/link/link_inline.phtml +++ b/app/code/Magento/Catalog/view/frontend/category/widget/link/link_inline.phtml @@ -22,4 +22,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<span class="widget category link"><a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getAnchorText()) ?></span></a></span> +<span class="widget category link"><a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getLabel()) ?></span></a></span> diff --git a/app/code/Magento/Catalog/view/frontend/layout/MAP_popup.xml b/app/code/Magento/Catalog/view/frontend/layout/MAP_popup.xml index 3fc59ceed7a..71ec2335e53 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/MAP_popup.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/MAP_popup.xml @@ -25,6 +25,6 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> - <block class="Magento\View\Block\Template" template="Magento_Catalog::msrp/popup.phtml" name="product.tooltip"/> + <block class="Magento\View\Element\Template" template="Magento_Catalog::msrp/popup.phtml" name="product.tooltip"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml index 57788350edb..907b3619080 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_category_view.xml @@ -29,7 +29,7 @@ <block class="Magento\Catalog\Block\Category\View" name="category.products" template="category/view.phtml"> <block class="Magento\Catalog\Block\Product\ListProduct" name="product_list" template="product/list.phtml"> <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="product/list/toolbar.phtml"> - <block class="Magento\Page\Block\Html\Pager" name="product_list_toolbar_pager"/> + <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/> <!-- The following code shows how to set your own pager increments --> <!-- <action method="setDefaultListPerPage"> diff --git a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml index 59a46c1af00..5c133f983c1 100644 --- a/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/Catalog/view/frontend/layout/catalog_product_view.xml @@ -37,12 +37,12 @@ </arguments> </referenceBlock> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-zoom-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-zoom-js"> <arguments> <argument name="file" xsi:type="string">mage/zoom.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="mage-gallery-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mage-gallery-css"> <arguments> <argument name="file" xsi:type="string">mage/gallery.css</argument> </arguments> @@ -53,7 +53,7 @@ <container name="product.info.form.content" label="invisible" as="product_info_form_content"> <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart" as="addtocart" template="product/view/addtocart.phtml"/> </container> - <block class="Magento\View\Block\Template" name="product.info.form.options" as="options_container"> + <block class="Magento\View\Element\Template" name="product.info.form.options" as="options_container"> <block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper" as="product_options_wrapper" template="product/view/options/wrapper.phtml"> <block class="Magento\Catalog\Block\Product\View\Options" name="product.info.options" as="product_options" template="product/view/options.phtml"> <block class="Magento\Catalog\Block\Product\View\Options\Type\DefaultType" as="default" template="product/view/options/type/default.phtml"/> @@ -62,7 +62,7 @@ <block class="Magento\Catalog\Block\Product\View\Options\Type\Select" as="select" template="product/view/options/type/select.phtml"/> <block class="Magento\Catalog\Block\Product\View\Options\Type\Date" as="date" template="product/view/options/type/date.phtml"/> </block> - <block class="Magento\View\Block\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Page::js/calendar.phtml"/> + <block class="Magento\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/> </block> <block class="Magento\Catalog\Block\Product\View" name="product.info.options.wrapper.bottom" as="product_options_wrapper_bottom" template="product/view/options/wrapper/bottom.phtml"> <block class="Magento\Catalog\Block\Product\View" name="product.info.addtocart.additional" as="product.info.addtocart" template="product/view/addtocart.phtml"/> diff --git a/app/code/Magento/Catalog/view/frontend/product/widget/link/link_block.phtml b/app/code/Magento/Catalog/view/frontend/product/widget/link/link_block.phtml index d7e235f05b8..c1454702567 100644 --- a/app/code/Magento/Catalog/view/frontend/product/widget/link/link_block.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/widget/link/link_block.phtml @@ -23,5 +23,5 @@ */ ?> <div class="widget product link"> - <a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getAnchorText()) ?></span></a> + <a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getLabel()) ?></span></a> </div> diff --git a/app/code/Magento/Catalog/view/frontend/product/widget/link/link_inline.phtml b/app/code/Magento/Catalog/view/frontend/product/widget/link/link_inline.phtml index 7a8dd8e1124..08123b7d10b 100644 --- a/app/code/Magento/Catalog/view/frontend/product/widget/link/link_inline.phtml +++ b/app/code/Magento/Catalog/view/frontend/product/widget/link/link_inline.phtml @@ -23,5 +23,5 @@ */ ?> <span class="widget product link"> - <a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getAnchorText()) ?></span></a> + <a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getLabel()) ?></span></a> </span> diff --git a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php index e7adb5187b5..da2d217c0d9 100644 --- a/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php +++ b/app/code/Magento/CatalogInventory/Block/Adminhtml/Form/Field/Customergroup.php @@ -28,7 +28,7 @@ */ namespace Magento\CatalogInventory\Block\Adminhtml\Form\Field; -class Customergroup extends \Magento\View\Block\Html\Select +class Customergroup extends \Magento\View\Element\Html\Select { /** * Customer groups cache @@ -54,12 +54,12 @@ class Customergroup extends \Magento\View\Block\Html\Select /** * Construct * - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\Customer\Model\Resource\Group\CollectionFactory $groupCollectionFactory * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\Customer\Model\Resource\Group\CollectionFactory $groupCollectionFactory, array $data = array() ) { diff --git a/app/code/Magento/CatalogInventory/Block/Qtyincrements.php b/app/code/Magento/CatalogInventory/Block/Qtyincrements.php index 398d9d663f8..1cfd79ed04b 100644 --- a/app/code/Magento/CatalogInventory/Block/Qtyincrements.php +++ b/app/code/Magento/CatalogInventory/Block/Qtyincrements.php @@ -34,7 +34,7 @@ */ namespace Magento\CatalogInventory\Block; -class Qtyincrements extends \Magento\View\Block\Template +class Qtyincrements extends \Magento\View\Element\Template { /** * Qty Increments cache @@ -51,19 +51,17 @@ class Qtyincrements extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php b/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php index 17f6471e7b4..eed50e59ee6 100644 --- a/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php +++ b/app/code/Magento/CatalogInventory/Block/Stockqty/AbstractStockqty.php @@ -34,7 +34,7 @@ */ namespace Magento\CatalogInventory\Block\Stockqty; -abstract class AbstractStockqty extends \Magento\View\Block\Template +abstract class AbstractStockqty extends \Magento\View\Element\Template { const XML_PATH_STOCK_THRESHOLD_QTY = 'cataloginventory/options/stock_threshold_qty'; @@ -46,19 +46,17 @@ abstract class AbstractStockqty extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php b/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php index ff62f4ffb26..0b09314227a 100644 --- a/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php +++ b/app/code/Magento/CatalogInventory/Model/Config/Backend/Managestock.php @@ -43,21 +43,21 @@ class Managestock protected $_stockStatus; /** - * @param \Magento\CatalogInventory\Model\Stock\Status $stockStatus * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\CatalogInventory\Model\Stock\Status $stockStatus * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\CatalogInventory\Model\Stock\Status $stockStatus, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\CatalogInventory\Model\Stock\Status $stockStatus, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php b/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php index 9dfc1b043d9..fc6fc9ee8b3 100644 --- a/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Indexer/Stock.php @@ -99,18 +99,18 @@ class Stock extends \Magento\Index\Model\Indexer\AbstractIndexer protected $_indexer; /** - * @param \Magento\Index\Model\Indexer $indexer * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Index\Model\Indexer $indexer * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Index\Model\Indexer $indexer, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Index\Model\Indexer $indexer, \Magento\CatalogInventory\Helper\Data $catalogInventoryData, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/Collection.php b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/Collection.php index a98821e53c6..72e12e913f3 100644 --- a/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/Collection.php +++ b/app/code/Magento/CatalogInventory/Model/Resource/Stock/Item/Collection.php @@ -35,23 +35,25 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_storeManager; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_storeManager = $storeManager; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/CatalogInventory/Model/Stock.php b/app/code/Magento/CatalogInventory/Model/Stock.php index 8a8eb65a16c..76c88bf29e2 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock.php +++ b/app/code/Magento/CatalogInventory/Model/Stock.php @@ -72,9 +72,9 @@ class Stock extends \Magento\Core\Model\AbstractModel protected $_collectionFactory; /** - * @param \Magento\CatalogInventory\Model\Resource\Stock\Item\CollectionFactory $collectionFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\CatalogInventory\Model\Resource\Stock\Item\CollectionFactory $collectionFactory * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\CatalogInventory\Model\Stock\ItemFactory $stockItemFactory @@ -83,9 +83,9 @@ class Stock extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\CatalogInventory\Model\Resource\Stock\Item\CollectionFactory $collectionFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\CatalogInventory\Model\Resource\Stock\Item\CollectionFactory $collectionFactory, \Magento\CatalogInventory\Helper\Data $catalogInventoryData, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\CatalogInventory\Model\Stock\ItemFactory $stockItemFactory, diff --git a/app/code/Magento/CatalogInventory/Model/Stock/Item.php b/app/code/Magento/CatalogInventory/Model/Stock/Item.php index 145e04d6ed7..c8a0414e3d0 100644 --- a/app/code/Magento/CatalogInventory/Model/Stock/Item.php +++ b/app/code/Magento/CatalogInventory/Model/Stock/Item.php @@ -191,13 +191,11 @@ class Item extends \Magento\Core\Model\AbstractModel protected $mathDivision; /** - * Construct - * + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Index\Model\Indexer $indexer * @param \Magento\CatalogInventory\Model\Stock\Status $stockStatus - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData * @param \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty * @param \Magento\Core\Model\Store\Config $coreStoreConfig @@ -209,11 +207,11 @@ class Item extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Customer\Model\Session $customerSession, \Magento\Index\Model\Indexer $indexer, \Magento\CatalogInventory\Model\Stock\Status $stockStatus, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\CatalogInventory\Helper\Data $catalogInventoryData, \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty, \Magento\Core\Model\Store\Config $coreStoreConfig, diff --git a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php index f03cbf87ef5..4b1307eb7ad 100644 --- a/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php +++ b/app/code/Magento/CatalogInventory/Model/System/Config/Backend/Minsaleqty.php @@ -40,21 +40,21 @@ class Minsaleqty extends \Magento\Core\Model\Config\Value protected $_catalogInventoryMinsaleqty = null; /** - * @param \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\CatalogInventory\Helper\Minsaleqty $catalogInventoryMinsaleqty, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php index c326a78bf83..dcc2db0676d 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit.php @@ -39,20 +39,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php index 1057fd89fba..2fff1858914 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Conditions.php @@ -40,27 +40,25 @@ class Conditions */ protected $_conditions; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Rule\Block\Conditions $conditions - * @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Rule\Block\Conditions $conditions + * @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Rule\Block\Conditions $conditions, - \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Rule\Block\Conditions $conditions, + \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset, + array $data = array() + ) { $this->_rendererFieldset = $rendererFieldset; $this->_conditions = $conditions; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php index 80da91b7898..67e4bc4ff20 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Catalog/Edit/Tab/Main.php @@ -49,7 +49,6 @@ class Main /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Customer\Model\Resource\Group\CollectionFactory $customerGroup @@ -58,7 +57,6 @@ class Main */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Customer\Model\Resource\Group\CollectionFactory $customerGroup, @@ -67,7 +65,7 @@ class Main ) { $this->_systemStore = $systemStore; $this->_customerGroup = $customerGroup; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser.php index b902561416d..98aedc05629 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser.php @@ -36,22 +36,20 @@ class Chooser extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_salesRule; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\SalesRule\Model\RuleFactory $salesRule - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\SalesRule\Model\RuleFactory $salesRule + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\SalesRule\Model\RuleFactory $salesRule, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\SalesRule\Model\RuleFactory $salesRule, + array $data = array() + ) { $this->_salesRule = $salesRule; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php index aa54e2e677c..c9113b11007 100644 --- a/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php +++ b/app/code/Magento/CatalogRule/Block/Adminhtml/Promo/Widget/Chooser/Sku.php @@ -55,31 +55,29 @@ class Sku extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_catalogProduct; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Catalog\Model\ProductFactory $catalogProduct - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavAttSetCollection - * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $cpCollection - * @param \Magento\Catalog\Model\Product\Type $catalogType - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\ProductFactory $catalogProduct + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavAttSetCollection + * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $cpCollection + * @param \Magento\Catalog\Model\Product\Type $catalogType + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Catalog\Model\ProductFactory $catalogProduct, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavAttSetCollection, - \Magento\Catalog\Model\Resource\Product\CollectionFactory $cpCollection, - \Magento\Catalog\Model\Product\Type $catalogType, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\ProductFactory $catalogProduct, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavAttSetCollection, + \Magento\Catalog\Model\Resource\Product\CollectionFactory $cpCollection, + \Magento\Catalog\Model\Product\Type $catalogType, + array $data = array() + ) { $this->_catalogType = $catalogType; $this->_cpCollection = $cpCollection; $this->_eavAttSetCollection = $eavAttSetCollection; $this->_catalogProduct = $catalogProduct; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/CatalogRule/Model/Rule.php b/app/code/Magento/CatalogRule/Model/Rule.php index e944cf25824..e51b2b2d9b9 100644 --- a/app/code/Magento/CatalogRule/Model/Rule.php +++ b/app/code/Magento/CatalogRule/Model/Rule.php @@ -166,10 +166,14 @@ class Rule extends \Magento\Rule\Model\AbstractModel protected $dateTime; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param Rule\Condition\CombineFactory $combineFactory - * @param Rule\Action\CollectionFactory $actionCollFactory + * @param \Magento\CatalogRule\Model\Rule\Condition\CombineFactory $combineFactory + * @param \Magento\CatalogRule\Model\Rule\Action\CollectionFactory $actionCollFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Core\Model\Resource\Iterator $resourceIterator * @param \Magento\Index\Model\Indexer $indexer @@ -177,18 +181,16 @@ class Rule extends \Magento\Rule\Model\AbstractModel * @param \Magento\CatalogRule\Helper\Data $catalogRuleData * @param \Magento\App\Cache\TypeListInterface $cacheTypesList * @param \Magento\Stdlib\DateTime $dateTime - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $relatedCacheTypes * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\LocaleInterface $locale, \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\CatalogRule\Model\Rule\Condition\CombineFactory $combineFactory, @@ -200,10 +202,6 @@ class Rule extends \Magento\Rule\Model\AbstractModel \Magento\CatalogRule\Helper\Data $catalogRuleData, \Magento\App\Cache\TypeListInterface $cacheTypesList, \Magento\Stdlib\DateTime $dateTime, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\LocaleInterface $locale, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $relatedCacheTypes = array(), @@ -221,7 +219,7 @@ class Rule extends \Magento\Rule\Model\AbstractModel $this->_cacheTypesList = $cacheTypesList; $this->_relatedCacheTypes = $relatedCacheTypes; $this->dateTime = $dateTime; - parent::__construct($formFactory, $context, $registry, $locale, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $formFactory, $locale, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/CatalogSearch/Block/Advanced/Form.php b/app/code/Magento/CatalogSearch/Block/Advanced/Form.php index 6b92f27f4fe..c6e8d7be694 100644 --- a/app/code/Magento/CatalogSearch/Block/Advanced/Form.php +++ b/app/code/Magento/CatalogSearch/Block/Advanced/Form.php @@ -33,7 +33,7 @@ */ namespace Magento\CatalogSearch\Block\Advanced; -class Form extends \Magento\View\Block\Template +class Form extends \Magento\View\Element\Template { /** * Currency factory @@ -50,22 +50,20 @@ class Form extends \Magento\View\Block\Template protected $_catalogSearchAdvanced; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\CatalogSearch\Model\Advanced $catalogSearchAdvanced * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\CatalogSearch\Model\Advanced $catalogSearchAdvanced, \Magento\Directory\Model\CurrencyFactory $currencyFactory, array $data = array() ) { $this->_catalogSearchAdvanced = $catalogSearchAdvanced; $this->_currencyFactory = $currencyFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function _prepareLayout() @@ -286,7 +284,7 @@ class Form extends \Magento\View\Block\Template { $block = $this->getData('_select_block'); if (is_null($block)) { - $block = $this->getLayout()->createBlock('Magento\View\Block\Html\Select'); + $block = $this->getLayout()->createBlock('Magento\View\Element\Html\Select'); $this->setData('_select_block', $block); } return $block; @@ -296,7 +294,7 @@ class Form extends \Magento\View\Block\Template { $block = $this->getData('_date_block'); if (is_null($block)) { - $block = $this->getLayout()->createBlock('Magento\View\Block\Html\Date'); + $block = $this->getLayout()->createBlock('Magento\View\Element\Html\Date'); $this->setData('_date_block', $block); } return $block; diff --git a/app/code/Magento/CatalogSearch/Block/Advanced/Result.php b/app/code/Magento/CatalogSearch/Block/Advanced/Result.php index 2115c0642a8..d0f01b2221a 100644 --- a/app/code/Magento/CatalogSearch/Block/Advanced/Result.php +++ b/app/code/Magento/CatalogSearch/Block/Advanced/Result.php @@ -33,7 +33,7 @@ */ namespace Magento\CatalogSearch\Block\Advanced; -class Result extends \Magento\View\Block\Template +class Result extends \Magento\View\Element\Template { /** * Url factory @@ -57,16 +57,14 @@ class Result extends \Magento\View\Block\Template protected $_catalogSearchAdvanced; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\CatalogSearch\Model\Advanced $catalogSearchAdvanced * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\Core\Model\UrlFactory $urlFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\CatalogSearch\Model\Advanced $catalogSearchAdvanced, \Magento\Catalog\Model\Layer $catalogLayer, \Magento\Core\Model\UrlFactory $urlFactory, @@ -75,7 +73,7 @@ class Result extends \Magento\View\Block\Template $this->_catalogSearchAdvanced = $catalogSearchAdvanced; $this->_catalogLayer = $catalogLayer; $this->_urlFactory = $urlFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/CatalogSearch/Block/Autocomplete.php b/app/code/Magento/CatalogSearch/Block/Autocomplete.php index 966fb71c735..2f282e0cf30 100644 --- a/app/code/Magento/CatalogSearch/Block/Autocomplete.php +++ b/app/code/Magento/CatalogSearch/Block/Autocomplete.php @@ -29,7 +29,7 @@ */ namespace Magento\CatalogSearch\Block; -class Autocomplete extends \Magento\View\Block\AbstractBlock +class Autocomplete extends \Magento\View\Element\AbstractBlock { protected $_suggestData = null; diff --git a/app/code/Magento/CatalogSearch/Block/Layer.php b/app/code/Magento/CatalogSearch/Block/Layer.php index b0d90f5de38..4be2228a3a4 100644 --- a/app/code/Magento/CatalogSearch/Block/Layer.php +++ b/app/code/Magento/CatalogSearch/Block/Layer.php @@ -59,8 +59,7 @@ class Layer extends \Magento\Catalog\Block\Layer\View protected $_catalogSearchLayer; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\CatalogSearch\Model\Layer $catalogLayer * @param \Magento\CatalogSearch\Model\Resource\EngineProvider $engineProvider * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData @@ -69,8 +68,7 @@ class Layer extends \Magento\Catalog\Block\Layer\View * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\CatalogSearch\Model\Layer $catalogLayer, \Magento\CatalogSearch\Model\Resource\EngineProvider $engineProvider, \Magento\CatalogSearch\Helper\Data $catalogSearchData, @@ -82,7 +80,7 @@ class Layer extends \Magento\Catalog\Block\Layer\View $this->_coreRegistry = $registry; $this->_catalogSearchData = $catalogSearchData; $this->_catalogSearchLayer = $catalogSearchLayer; - parent::__construct($context, $coreData, $catalogLayer, $data); + parent::__construct($context, $catalogLayer, $data); } /** diff --git a/app/code/Magento/CatalogSearch/Block/Result.php b/app/code/Magento/CatalogSearch/Block/Result.php index f1d047b6ef9..7454929c560 100644 --- a/app/code/Magento/CatalogSearch/Block/Result.php +++ b/app/code/Magento/CatalogSearch/Block/Result.php @@ -34,7 +34,7 @@ */ namespace Magento\CatalogSearch\Block; -class Result extends \Magento\View\Block\Template +class Result extends \Magento\View\Element\Template { /** * Catalog Product collection @@ -58,22 +58,20 @@ class Result extends \Magento\View\Block\Template protected $_catalogLayer; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Layer $catalogLayer * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Layer $catalogLayer, \Magento\CatalogSearch\Helper\Data $catalogSearchData, array $data = array() ) { $this->_catalogLayer = $catalogLayer; $this->_catalogSearchData = $catalogSearchData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/CatalogSearch/Block/Term.php b/app/code/Magento/CatalogSearch/Block/Term.php index 30031df9e58..56d7b53a596 100644 --- a/app/code/Magento/CatalogSearch/Block/Term.php +++ b/app/code/Magento/CatalogSearch/Block/Term.php @@ -33,7 +33,7 @@ */ namespace Magento\CatalogSearch\Block; -class Term extends \Magento\View\Block\Template +class Term extends \Magento\View\Element\Template { protected $_terms; protected $_minPopularity; @@ -54,22 +54,20 @@ class Term extends \Magento\View\Block\Template protected $_queryCollectionFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queryCollectionFactory * @param \Magento\Core\Model\UrlFactory $urlFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\CatalogSearch\Model\Resource\Query\CollectionFactory $queryCollectionFactory, \Magento\Core\Model\UrlFactory $urlFactory, array $data = array() ) { $this->_queryCollectionFactory = $queryCollectionFactory; $this->_urlFactory = $urlFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php b/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php index 53fbae7e7b8..ed681d473bf 100644 --- a/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php +++ b/app/code/Magento/CatalogSearch/Model/Config/Backend/Search/Type.php @@ -44,23 +44,21 @@ class Type extends \Magento\Core\Model\Config\Value protected $_catalogSearchFulltext; /** - * Construct - * * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\CatalogSearch\Model\Fulltext $catalogSearchFulltext * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection - * @param \Magento\CatalogSearch\Model\Fulltext $catalogSearchFulltext * @param array $data */ public function __construct( - \Magento\CatalogSearch\Model\Fulltext $catalogSearchFulltext, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\CatalogSearch\Model\Fulltext $catalogSearchFulltext, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/CatalogSearch/Model/Fulltext.php b/app/code/Magento/CatalogSearch/Model/Fulltext.php index 75d67d04c13..8623599aa2b 100644 --- a/app/code/Magento/CatalogSearch/Model/Fulltext.php +++ b/app/code/Magento/CatalogSearch/Model/Fulltext.php @@ -64,18 +64,18 @@ class Fulltext extends \Magento\Core\Model\AbstractModel protected $_coreStoreConfig; /** - * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\CatalogSearch\Helper\Data $catalogSearchData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\CatalogSearch\Helper\Data $catalogSearchData, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php index 87af424704b..d9c274a66fc 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Advanced/Collection.php @@ -44,13 +44,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection protected $_date; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData @@ -60,20 +61,21 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Date $date - * + * @param mixed $connection + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, @@ -83,15 +85,31 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime, - \Magento\Core\Model\Date $date + \Magento\Core\Model\Date $date, + $connection = null ) { $this->_date = $date; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, - $resource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, $coreStoreConfig, $productOptionFactory, $catalogUrl, $locale, - $customerSession, $resourceHelper, $dateTime + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $storeManager, + $catalogData, + $catalogProductFlat, + $coreStoreConfig, + $productOptionFactory, + $catalogUrl, + $locale, + $customerSession, + $dateTime, + $connection ); } diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php index 988b07c29ae..2e1f0ae8af7 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Fulltext/Collection.php @@ -51,13 +51,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection protected $_catalogSearchFulltext; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData @@ -67,21 +68,22 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\CatalogSearch\Helper\Data $catalogSearchData * @param \Magento\CatalogSearch\Model\Fulltext $catalogSearchFulltext - * + * @param mixed $connection + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, @@ -91,17 +93,33 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime, \Magento\CatalogSearch\Helper\Data $catalogSearchData, - \Magento\CatalogSearch\Model\Fulltext $catalogSearchFulltext + \Magento\CatalogSearch\Model\Fulltext $catalogSearchFulltext, + $connection = null ) { $this->_catalogSearchFulltext = $catalogSearchFulltext; $this->_catalogSearchData = $catalogSearchData; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, - $resource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, $coreStoreConfig, $productOptionFactory, $catalogUrl, $locale, - $customerSession, $resourceHelper, $dateTime + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $storeManager, + $catalogData, + $catalogProductFlat, + $coreStoreConfig, + $productOptionFactory, + $catalogUrl, + $locale, + $customerSession, + $dateTime, + $connection ); } diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Query/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Query/Collection.php index db70925f759..a3424d920b1 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Query/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Query/Collection.php @@ -58,28 +58,28 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_resourceHelper; /** - * Construct - * - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\CatalogSearch\Model\Resource\Helper $resourceHelper + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\CatalogSearch\Model\Resource\Helper $resourceHelper, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_storeManager = $storeManager; $this->_resourceHelper = $resourceHelper; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php b/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php index 0da7d62a20e..b2d4053bbb6 100644 --- a/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php +++ b/app/code/Magento/CatalogSearch/Model/Resource/Search/Collection.php @@ -58,13 +58,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection protected $_attributeCollectionFactory; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData @@ -74,18 +75,21 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory + * @param mixed $connection + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, @@ -95,16 +99,31 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime, \Magento\Catalog\Model\Resource\Product\Attribute\CollectionFactory $attributeCollectionFactory, - \Magento\App\Resource $resource + $connection = null ) { $this->_attributeCollectionFactory = $attributeCollectionFactory; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, - $resource, $eavEntityFactory, $universalFactory, $storeManager, $catalogData, - $catalogProductFlat, $coreStoreConfig, $productOptionFactory, $catalogUrl, $locale, - $customerSession, $resourceHelper, $dateTime + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $storeManager, + $catalogData, + $catalogProductFlat, + $coreStoreConfig, + $productOptionFactory, + $catalogUrl, + $locale, + $customerSession, + $dateTime, + $connection ); } diff --git a/app/code/Magento/CatalogSearch/etc/module.xml b/app/code/Magento/CatalogSearch/etc/module.xml index d1e2bd7c0ee..d03b82e3a52 100755 --- a/app/code/Magento/CatalogSearch/etc/module.xml +++ b/app/code/Magento/CatalogSearch/etc/module.xml @@ -37,7 +37,7 @@ <module name="Magento_Index"/> <module name="Magento_Eav"/> <module name="Magento_Backend"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/CatalogSearch/view/frontend/form.mini.phtml b/app/code/Magento/CatalogSearch/view/frontend/form.mini.phtml index 3510ed3f34e..44cbdb7ebd2 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/form.mini.phtml +++ b/app/code/Magento/CatalogSearch/view/frontend/form.mini.phtml @@ -23,7 +23,7 @@ */ ?> <?php -/** @var $this \Magento\View\Block\Template */ +/** @var $this \Magento\View\Element\Template */ /** @var $helper \Magento\CatalogSearch\Helper\Data */ $helper = $this->helper('Magento\CatalogSearch\Helper\Data'); ?> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml index 5c6ebc268d9..7e04b240dac 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_index.xml @@ -33,6 +33,6 @@ <update handle="page_calendar"/> <referenceContainer name="content"> <block class="Magento\CatalogSearch\Block\Advanced\Form" name="catalogsearch_advanced_form" template="advanced/form.phtml"/> - <block class="Magento\View\Block\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Page::js/calendar.phtml"/> + <block class="Magento\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml index f9f661d884d..d60b9a1ef6a 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_advanced_result.xml @@ -34,7 +34,7 @@ <block class="Magento\CatalogSearch\Block\Advanced\Result" name="catalogsearch_advanced_result" template="advanced/result.phtml"> <block class="Magento\Catalog\Block\Product\ListProduct" name="search_result_list" template="product/list.phtml"> <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="product/list/toolbar.phtml"> - <block class="Magento\Page\Block\Html\Pager" name="product_list_toolbar_pager"/> + <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/> </block> <action method="setToolbarBlockName"> <argument name="name" xsi:type="string">product_list_toolbar</argument> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml index 81182cf4c0e..3570d341e7a 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/catalogsearch_result_index.xml @@ -38,7 +38,7 @@ <argument name="positioned" xsi:type="string">positions:list-secondary</argument> </arguments> <block class="Magento\Catalog\Block\Product\ProductList\Toolbar" name="product_list_toolbar" template="product/list/toolbar.phtml"> - <block class="Magento\Page\Block\Html\Pager" name="product_list_toolbar_pager"/> + <block class="Magento\Theme\Block\Html\Pager" name="product_list_toolbar_pager"/> </block> <action method="setToolbarBlockName"> <argument name="name" xsi:type="string">product_list_toolbar</argument> diff --git a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml index 8454bb6d813..6845a1111a9 100644 --- a/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml +++ b/app/code/Magento/CatalogSearch/view/frontend/layout/default.xml @@ -25,16 +25,16 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="header"> - <block class="Magento\View\Block\Template" name="top.search" as="topSearch" template="Magento_CatalogSearch::form.mini.phtml"/> + <block class="Magento\View\Element\Template" name="top.search" as="topSearch" template="Magento_CatalogSearch::form.mini.phtml"/> </referenceBlock> <referenceBlock name="footer_links"> - <block class="Magento\Page\Block\Link\Current" ifconfig="catalog/seo/search_terms" name="catalog-search-term-popular-link"> + <block class="Magento\View\Element\Html\Link\Current" ifconfig="catalog/seo/search_terms" name="catalog-search-term-popular-link"> <arguments> <argument name="label" xsi:type="string">Search Terms</argument> <argument name="path" xsi:type="string">catalogsearch/term/popular</argument> </arguments> </block> - <block class="Magento\Page\Block\Link\Current" ifconfig="catalog/seo/search_terms" name="catalog-search-advanced-link"> + <block class="Magento\View\Element\Html\Link\Current" ifconfig="catalog/seo/search_terms" name="catalog-search-advanced-link"> <arguments> <argument name="label" xsi:type="string">Advanced Search</argument> <argument name="path" xsi:type="string">catalogsearch/advanced</argument> diff --git a/app/code/Magento/Centinel/Block/Authentication.php b/app/code/Magento/Centinel/Block/Authentication.php index 075de9e727d..754eb86fe70 100644 --- a/app/code/Magento/Centinel/Block/Authentication.php +++ b/app/code/Magento/Centinel/Block/Authentication.php @@ -29,7 +29,7 @@ */ namespace Magento\Centinel\Block; -class Authentication extends \Magento\View\Block\Template +class Authentication extends \Magento\View\Element\Template { /** * Checkout session @@ -54,19 +54,17 @@ class Authentication extends \Magento\View\Block\Template protected $_authenticationStartMode = false; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Centinel/Block/Authentication/Complete.php b/app/code/Magento/Centinel/Block/Authentication/Complete.php index f3bb56bbe3a..ad617d1b284 100644 --- a/app/code/Magento/Centinel/Block/Authentication/Complete.php +++ b/app/code/Magento/Centinel/Block/Authentication/Complete.php @@ -30,7 +30,7 @@ */ namespace Magento\Centinel\Block\Authentication; -class Complete extends \Magento\View\Block\Template +class Complete extends \Magento\View\Element\Template { /** * Core registry @@ -40,19 +40,17 @@ class Complete extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Centinel/Block/Authentication/Start.php b/app/code/Magento/Centinel/Block/Authentication/Start.php index 7c0b164ca8a..34ec3875c00 100644 --- a/app/code/Magento/Centinel/Block/Authentication/Start.php +++ b/app/code/Magento/Centinel/Block/Authentication/Start.php @@ -30,7 +30,7 @@ */ namespace Magento\Centinel\Block\Authentication; -class Start extends \Magento\View\Block\Template +class Start extends \Magento\View\Element\Template { /** * Core registry @@ -40,19 +40,17 @@ class Start extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Centinel/Block/Logo.php b/app/code/Magento/Centinel/Block/Logo.php index 311c649eb79..0ff411674b8 100644 --- a/app/code/Magento/Centinel/Block/Logo.php +++ b/app/code/Magento/Centinel/Block/Logo.php @@ -29,7 +29,7 @@ */ namespace Magento\Centinel\Block; -class Logo extends \Magento\View\Block\Template +class Logo extends \Magento\View\Element\Template { protected $_template = 'logo.phtml'; diff --git a/app/code/Magento/Centinel/Model/Service.php b/app/code/Magento/Centinel/Model/Service.php index d21950e74fd..68c2943c139 100644 --- a/app/code/Magento/Centinel/Model/Service.php +++ b/app/code/Magento/Centinel/Model/Service.php @@ -89,13 +89,6 @@ class Service extends \Magento\Object */ protected $_centinelSession; - /** - * Session - * - * @var \Magento\Core\Model\Session - */ - protected $_session; - /** * State factory * @@ -115,13 +108,18 @@ class Service extends \Magento\Object */ protected $_urlPrefix; + /** + * @var \Magento\Data\Form\FormKey + */ + protected $formKey; + /** * @param \Magento\Centinel\Model\Config $config * @param \Magento\Centinel\Model\Api $api * @param \Magento\UrlInterface $url * @param \Magento\Core\Model\Session\AbstractSession $centinelSession - * @param \Magento\Core\Model\Session $session * @param \Magento\Centinel\Model\StateFactory $stateFactory + * @param \Magento\Data\Form\FormKey $formKey * @param string $urlPrefix * @param array $data */ @@ -130,8 +128,8 @@ class Service extends \Magento\Object \Magento\Centinel\Model\Api $api, \Magento\UrlInterface $url, \Magento\Core\Model\Session\AbstractSession $centinelSession, - \Magento\Core\Model\Session $session, \Magento\Centinel\Model\StateFactory $stateFactory, + \Magento\Data\Form\FormKey $formKey, $urlPrefix = 'centinel/index/', array $data = array() ) { @@ -139,8 +137,8 @@ class Service extends \Magento\Object $this->_api = $api; $this->_url = $url; $this->_centinelSession = $centinelSession; - $this->_session = $session; $this->_stateFactory = $stateFactory; + $this->formKey = $formKey; $this->_urlPrefix = $urlPrefix; parent::__construct($data); } @@ -184,7 +182,7 @@ class Service extends \Magento\Object $params = array( '_secure' => true, '_current' => $current, - 'form_key' => $this->_session->getFormKey(), + 'form_key' => $this->formKey->getFormKey(), 'isIframe' => true ); return $this->_url->getUrl($this->_urlPrefix . $suffix, $params); diff --git a/app/code/Magento/Centinel/etc/module.xml b/app/code/Magento/Centinel/etc/module.xml index d7211898798..288315b0118 100755 --- a/app/code/Magento/Centinel/etc/module.xml +++ b/app/code/Magento/Centinel/etc/module.xml @@ -33,7 +33,7 @@ <module name="Magento_Checkout"/> <module name="Magento_Core"/> <module name="Magento_Backend"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_index.xml index b293f7a8d09..edcefd192fe 100644 --- a/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Centinel/view/adminhtml/layout/sales_order_create_index.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-centinel-order-create-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-centinel-order-create-js"> <arguments> <argument name="file" xsi:type="string">Magento_Centinel::order_create.js</argument> </arguments> diff --git a/app/code/Magento/Centinel/view/frontend/layout/checkout_multishipping_overview.xml b/app/code/Magento/Centinel/view/frontend/layout/checkout_multishipping_overview.xml index 442a5035343..7a594610782 100644 --- a/app/code/Magento/Centinel/view/frontend/layout/checkout_multishipping_overview.xml +++ b/app/code/Magento/Centinel/view/frontend/layout/checkout_multishipping_overview.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-centinel-centinel-authenticate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-centinel-centinel-authenticate-js"> <arguments> <argument name="file" xsi:type="string">Magento_Centinel::centinel-authenticate.js</argument> </arguments> diff --git a/app/code/Magento/Centinel/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Centinel/view/frontend/layout/checkout_onepage_index.xml index e628bff7868..17ffc549873 100644 --- a/app/code/Magento/Centinel/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Centinel/view/frontend/layout/checkout_onepage_index.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-centinel-centinel-authenticate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-centinel-centinel-authenticate-js"> <arguments> <argument name="file" xsi:type="string">Magento_Centinel::centinel-authenticate.js</argument> </arguments> diff --git a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php index 607d7dfb1eb..b58d5854f3c 100644 --- a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php +++ b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit.php @@ -35,20 +35,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php index c5d49f12aa2..8eacc56285a 100644 --- a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php +++ b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Edit/Form.php @@ -33,24 +33,22 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\System\Store $systemStore - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\System\Store $systemStore, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\System\Store $systemStore, + array $data = array() + ) { $this->_systemStore = $systemStore; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php index fcd958b73ea..e28f317418f 100644 --- a/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php +++ b/app/code/Magento/Checkout/Block/Adminhtml/Agreement/Grid.php @@ -32,22 +32,20 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Checkout/Block/Agreements.php b/app/code/Magento/Checkout/Block/Agreements.php index 4060adf6b2e..54add2231b7 100644 --- a/app/code/Magento/Checkout/Block/Agreements.php +++ b/app/code/Magento/Checkout/Block/Agreements.php @@ -25,7 +25,7 @@ */ namespace Magento\Checkout\Block; -class Agreements extends \Magento\View\Block\Template +class Agreements extends \Magento\View\Element\Template { /** * @var \Magento\Checkout\Model\Resource\Agreement\CollectionFactory @@ -33,19 +33,17 @@ class Agreements extends \Magento\View\Block\Template protected $_agreementCollFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $agreementCollFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Resource\Agreement\CollectionFactory $agreementCollFactory, array $data = array() ) { $this->_agreementCollFactory = $agreementCollFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Cart.php b/app/code/Magento/Checkout/Block/Cart.php index 92a7e85da44..78a918cefeb 100644 --- a/app/code/Magento/Checkout/Block/Cart.php +++ b/app/code/Magento/Checkout/Block/Cart.php @@ -41,8 +41,7 @@ class Cart extends \Magento\Checkout\Block\Cart\AbstractCart protected $_catalogUrlBuilder; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession @@ -50,8 +49,7 @@ class Cart extends \Magento\Checkout\Block\Cart\AbstractCart * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, @@ -59,7 +57,7 @@ class Cart extends \Magento\Checkout\Block\Cart\AbstractCart array $data = array() ) { $this->_catalogUrlBuilder = $catalogUrlBuilder; - parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $data); + parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Cart/AbstractCart.php b/app/code/Magento/Checkout/Block/Cart/AbstractCart.php index bf11f7db07e..da8229fa0cc 100644 --- a/app/code/Magento/Checkout/Block/Cart/AbstractCart.php +++ b/app/code/Magento/Checkout/Block/Cart/AbstractCart.php @@ -33,7 +33,7 @@ */ namespace Magento\Checkout\Block\Cart; -class AbstractCart extends \Magento\View\Block\Template +class AbstractCart extends \Magento\View\Element\Template { /** * Block alias fallback @@ -63,16 +63,14 @@ class AbstractCart extends \Magento\View\Block\Template protected $_checkoutSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, @@ -81,7 +79,7 @@ class AbstractCart extends \Magento\View\Block\Template $this->_customerSession = $customerSession; $this->_checkoutSession = $checkoutSession; $this->_catalogData = $catalogData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -104,7 +102,7 @@ class AbstractCart extends \Magento\View\Block\Template * * @param string $type * @throws \RuntimeException - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function getItemRenderer($type) { diff --git a/app/code/Magento/Checkout/Block/Cart/Crosssell.php b/app/code/Magento/Checkout/Block/Cart/Crosssell.php index 1bb998b973b..5dd3441363c 100644 --- a/app/code/Magento/Checkout/Block/Cart/Crosssell.php +++ b/app/code/Magento/Checkout/Block/Cart/Crosssell.php @@ -63,8 +63,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct protected $_productLinkFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -79,8 +78,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -96,7 +94,7 @@ class Crosssell extends \Magento\Catalog\Block\Product\AbstractProduct $this->_productVisibility = $productVisibility; $this->_stock = $stock; $this->_productLinkFactory = $productLinkFactory; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Cart/Item/Configure.php b/app/code/Magento/Checkout/Block/Cart/Item/Configure.php index 6be0c50ea0a..ee93ecac2df 100644 --- a/app/code/Magento/Checkout/Block/Cart/Item/Configure.php +++ b/app/code/Magento/Checkout/Block/Cart/Item/Configure.php @@ -35,7 +35,7 @@ */ namespace Magento\Checkout\Block\Cart\Item; -class Configure extends \Magento\View\Block\Template +class Configure extends \Magento\View\Element\Template { /** diff --git a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php index 2dda9fd8b15..5f566c2feab 100644 --- a/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php +++ b/app/code/Magento/Checkout/Block/Cart/Item/Renderer.php @@ -36,7 +36,7 @@ */ namespace Magento\Checkout\Block\Cart\Item; -class Renderer extends \Magento\View\Block\Template +class Renderer extends \Magento\View\Element\Template { /** @var \Magento\Checkout\Model\Session */ protected $_checkoutSession; @@ -66,22 +66,20 @@ class Renderer extends \Magento\View\Block\Template protected $_productConfig = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Product\Configuration $productConfig * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Product\Configuration $productConfig, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_productConfig = $productConfig; $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -433,7 +431,7 @@ class Renderer extends \Magento\View\Block\Template /** * Return product additional information block * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function getProductAdditionalInformationBlock() { diff --git a/app/code/Magento/Checkout/Block/Cart/Link.php b/app/code/Magento/Checkout/Block/Cart/Link.php index c9fd4c0ce92..def77100868 100644 --- a/app/code/Magento/Checkout/Block/Cart/Link.php +++ b/app/code/Magento/Checkout/Block/Cart/Link.php @@ -27,7 +27,7 @@ */ namespace Magento\Checkout\Block\Cart; -class Link extends \Magento\Page\Block\Link +class Link extends \Magento\View\Element\Html\Link { /** * @var \Magento\Module\Manager @@ -35,18 +35,16 @@ class Link extends \Magento\Page\Block\Link protected $_moduleManager; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Module\Manager $moduleManager * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Module\Manager $moduleManager, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_moduleManager = $moduleManager; } diff --git a/app/code/Magento/Checkout/Block/Cart/Shipping.php b/app/code/Magento/Checkout/Block/Cart/Shipping.php index 9f2de88b2b6..69db0dc5968 100644 --- a/app/code/Magento/Checkout/Block/Cart/Shipping.php +++ b/app/code/Magento/Checkout/Block/Cart/Shipping.php @@ -53,8 +53,7 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart protected $_directoryBlock; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession @@ -62,8 +61,7 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, @@ -71,7 +69,7 @@ class Shipping extends \Magento\Checkout\Block\Cart\AbstractCart array $data = array() ) { $this->_directoryBlock = $directoryBlock; - parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $data); + parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Cart/Sidebar.php b/app/code/Magento/Checkout/Block/Cart/Sidebar.php index c7eb59e7c45..987a42c6271 100644 --- a/app/code/Magento/Checkout/Block/Cart/Sidebar.php +++ b/app/code/Magento/Checkout/Block/Cart/Sidebar.php @@ -61,8 +61,7 @@ class Sidebar extends \Magento\Checkout\Block\Cart\AbstractCart protected $_checkoutCart; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession @@ -73,8 +72,7 @@ class Sidebar extends \Magento\Checkout\Block\Cart\AbstractCart * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, @@ -88,7 +86,7 @@ class Sidebar extends \Magento\Checkout\Block\Cart\AbstractCart $this->_catalogUrl = $catalogUrl; $this->_taxConfig = $taxConfig; $this->_checkoutCart = $checkoutCart; - parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $data); + parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $data); } /** @@ -325,7 +323,7 @@ class Sidebar extends \Magento\Checkout\Block\Cart\AbstractCart { $result = array(); foreach ($this->getLayout()->getChildBlocks($this->getNameInLayout()) as $block) { - /** @var $block \Magento\View\Block\Template */ + /** @var $block \Magento\View\Element\Template */ $result[] = implode('|', array( // skip $this->getNameInLayout() and '.' substr($block->getNameInLayout(), strlen($this->getNameInLayout()) + 1), diff --git a/app/code/Magento/Checkout/Block/Cart/Totals.php b/app/code/Magento/Checkout/Block/Cart/Totals.php index 6a18cfecf96..b9fb6b7caba 100644 --- a/app/code/Magento/Checkout/Block/Cart/Totals.php +++ b/app/code/Magento/Checkout/Block/Cart/Totals.php @@ -38,8 +38,7 @@ class Totals extends \Magento\Checkout\Block\Cart\AbstractCart protected $_salesConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession @@ -47,8 +46,7 @@ class Totals extends \Magento\Checkout\Block\Cart\AbstractCart * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, @@ -56,7 +54,7 @@ class Totals extends \Magento\Checkout\Block\Cart\AbstractCart array $data = array() ) { $this->_salesConfig = $salesConfig; - parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $data); + parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $data); } diff --git a/app/code/Magento/Checkout/Block/Link.php b/app/code/Magento/Checkout/Block/Link.php index e830d7d8156..514e179730e 100644 --- a/app/code/Magento/Checkout/Block/Link.php +++ b/app/code/Magento/Checkout/Block/Link.php @@ -27,7 +27,7 @@ */ namespace Magento\Checkout\Block; -class Link extends \Magento\Page\Block\Link +class Link extends \Magento\View\Element\Html\Link { /** * @var \Magento\Module\Manager @@ -35,18 +35,16 @@ class Link extends \Magento\Page\Block\Link protected $_moduleManager; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Module\Manager $moduleManager * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Module\Manager $moduleManager, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_moduleManager = $moduleManager; } diff --git a/app/code/Magento/Checkout/Block/Multishipping/AbstractMultishipping.php b/app/code/Magento/Checkout/Block/Multishipping/AbstractMultishipping.php index e7c36860c30..1bcb3e1d60c 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/AbstractMultishipping.php +++ b/app/code/Magento/Checkout/Block/Multishipping/AbstractMultishipping.php @@ -33,7 +33,7 @@ */ namespace Magento\Checkout\Block\Multishipping; -class AbstractMultishipping extends \Magento\View\Block\Template +class AbstractMultishipping extends \Magento\View\Element\Template { /** * @var \Magento\Checkout\Model\Type\Multishipping @@ -41,19 +41,17 @@ class AbstractMultishipping extends \Magento\View\Block\Template protected $_multishipping; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping $multishipping, array $data = array() ) { $this->_multishipping = $multishipping; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Addresses.php b/app/code/Magento/Checkout/Block/Multishipping/Addresses.php index ca5d94b8452..ce1c9a03bd1 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Addresses.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Addresses.php @@ -46,22 +46,20 @@ class Addresses extends \Magento\Sales\Block\Items\AbstractItems protected $_multishipping; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Filter\Object\GridFactory $filterGridFactory * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Filter\Object\GridFactory $filterGridFactory, \Magento\Checkout\Model\Type\Multishipping $multishipping, array $data = array() ) { $this->_filterGridFactory = $filterGridFactory; $this->_multishipping = $multishipping; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -107,7 +105,7 @@ class Addresses extends \Magento\Sales\Block\Items\AbstractItems */ public function getAddressesHtmlSelect($item, $index) { - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName('ship['.$index.']['.$item->getQuoteItemId().'][address]') ->setId('ship_'.$index.'_'.$item->getQuoteItemId().'_address') ->setValue($item->getCustomerAddressId()) diff --git a/app/code/Magento/Checkout/Block/Multishipping/Billing.php b/app/code/Magento/Checkout/Block/Multishipping/Billing.php index 7acc2286444..b20101e87c1 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Billing.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Billing.php @@ -46,22 +46,20 @@ class Billing extends \Magento\Payment\Block\Form\Container protected $_checkoutSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping $multishipping, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_multishipping = $multishipping; $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Billing/Items.php b/app/code/Magento/Checkout/Block/Multishipping/Billing/Items.php index 374dc895e4e..fdeb34ba5cf 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Billing/Items.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Billing/Items.php @@ -46,22 +46,20 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems protected $_checkoutSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping $multishipping, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_multishipping = $multishipping; $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Link.php b/app/code/Magento/Checkout/Block/Multishipping/Link.php index c46940f9017..8c62262926b 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Link.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Link.php @@ -29,7 +29,7 @@ */ namespace Magento\Checkout\Block\Multishipping; -class Link extends \Magento\View\Block\Template +class Link extends \Magento\View\Element\Template { /** * Checkout data @@ -44,22 +44,20 @@ class Link extends \Magento\View\Block\Template protected $_checkoutSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Helper\Data $checkoutData * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Helper\Data $checkoutData, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutData = $checkoutData; $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Overview.php b/app/code/Magento/Checkout/Block/Multishipping/Overview.php index 240ba98ec05..c802ed645d5 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Overview.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Overview.php @@ -46,19 +46,17 @@ class Overview extends \Magento\Sales\Block\Items\AbstractItems protected $_multishipping; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping $multishipping, array $data = array() ) { $this->_multishipping = $multishipping; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -362,7 +360,7 @@ class Overview extends \Magento\Sales\Block\Items\AbstractItems * Retrieve renderer block for row-level item output * * @param string $type - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _getRowItemRenderer($type) { diff --git a/app/code/Magento/Checkout/Block/Multishipping/Payment/Info.php b/app/code/Magento/Checkout/Block/Multishipping/Payment/Info.php index ecd73a13d10..5d674d15095 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Payment/Info.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Payment/Info.php @@ -41,21 +41,19 @@ class Info extends \Magento\Payment\Block\Info\AbstractContainer protected $_multishipping; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Payment\Helper\Data $paymentData, \Magento\Checkout\Model\Type\Multishipping $multishipping, array $data = array() ) { $this->_multishipping = $multishipping; - parent::__construct($context, $coreData, $paymentData, $data); + parent::__construct($context, $paymentData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Shipping.php b/app/code/Magento/Checkout/Block/Multishipping/Shipping.php index 3c729003c05..0296a7268da 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Shipping.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Shipping.php @@ -41,22 +41,20 @@ class Shipping extends \Magento\Sales\Block\Items\AbstractItems protected $_filterGridFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Filter\Object\GridFactory $filterGridFactory * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Filter\Object\GridFactory $filterGridFactory, \Magento\Checkout\Model\Type\Multishipping $multishipping, array $data = array() ) { $this->_filterGridFactory = $filterGridFactory; $this->_multishipping = $multishipping; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/State.php b/app/code/Magento/Checkout/Block/Multishipping/State.php index c6eae8c6bd3..a0d1fb65352 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/State.php +++ b/app/code/Magento/Checkout/Block/Multishipping/State.php @@ -33,7 +33,7 @@ */ namespace Magento\Checkout\Block\Multishipping; -class State extends \Magento\View\Block\Template +class State extends \Magento\View\Element\Template { /** * @var \Magento\Checkout\Model\Type\Multishipping\State @@ -41,19 +41,17 @@ class State extends \Magento\View\Block\Template protected $_multishippingState; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping\State $multishippingState * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping\State $multishippingState, array $data = array() ) { $this->_multishippingState = $multishippingState; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Multishipping/Success.php b/app/code/Magento/Checkout/Block/Multishipping/Success.php index 245f1fa0b67..45f0fc14617 100644 --- a/app/code/Magento/Checkout/Block/Multishipping/Success.php +++ b/app/code/Magento/Checkout/Block/Multishipping/Success.php @@ -36,18 +36,16 @@ namespace Magento\Checkout\Block\Multishipping; class Success extends \Magento\Checkout\Block\Multishipping\AbstractMultishipping { /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Type\Multishipping $multishipping * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Type\Multishipping $multishipping, array $data = array() ) { - parent::__construct($context, $coreData, $multishipping, $data); + parent::__construct($context, $multishipping, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php index b8bc7e5e727..c6867dcdf28 100644 --- a/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php +++ b/app/code/Magento/Checkout/Block/Onepage/AbstractOnepage.php @@ -31,7 +31,7 @@ */ namespace Magento\Checkout\Block\Onepage; -abstract class AbstractOnepage extends \Magento\View\Block\Template +abstract class AbstractOnepage extends \Magento\View\Element\Template { /** * @var \Magento\App\Cache\Type\Config @@ -60,7 +60,12 @@ abstract class AbstractOnepage extends \Magento\View\Block\Template protected $_countryCollFactory; /** - * @param \Magento\View\Block\Template\Context $context + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession @@ -70,7 +75,7 @@ abstract class AbstractOnepage extends \Magento\View\Block\Template * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, @@ -79,12 +84,13 @@ abstract class AbstractOnepage extends \Magento\View\Block\Template \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory, array $data = array() ) { + $this->_coreData = $coreData; $this->_configCacheType = $configCacheType; $this->_customerSession = $customerSession; $this->_checkoutSession = $resourceSession; $this->_countryCollFactory = $countryCollFactory; $this->_regionCollFactory = $regionCollFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -185,7 +191,7 @@ abstract class AbstractOnepage extends \Magento\View\Block\Template } } - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName($type.'_address_id') ->setId($type.'-address-select') ->setClass('address-select') @@ -207,7 +213,7 @@ abstract class AbstractOnepage extends \Magento\View\Block\Template if (is_null($countryId)) { $countryId = $this->_coreData->getDefaultCountry(); } - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName($type.'[country_id]') ->setId($type.':country_id') ->setTitle(__('Country')) @@ -220,7 +226,7 @@ abstract class AbstractOnepage extends \Magento\View\Block\Template public function getRegionHtmlSelect($type) { - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName($type.'[region]') ->setId($type.':region') ->setTitle(__('State/Province')) diff --git a/app/code/Magento/Checkout/Block/Onepage/Billing.php b/app/code/Magento/Checkout/Block/Onepage/Billing.php index 416c6de0ffb..3684166f7cf 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Billing.php +++ b/app/code/Magento/Checkout/Block/Onepage/Billing.php @@ -56,7 +56,7 @@ class Billing extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_addressFactory; /** - * @param \Magento\View\Block\Template\Context $context + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession @@ -67,7 +67,7 @@ class Billing extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Checkout/Block/Onepage/Failure.php b/app/code/Magento/Checkout/Block/Onepage/Failure.php index eb2d74dd9f0..355d16fe167 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Failure.php +++ b/app/code/Magento/Checkout/Block/Onepage/Failure.php @@ -27,7 +27,7 @@ namespace Magento\Checkout\Block\Onepage; -class Failure extends \Magento\View\Block\Template +class Failure extends \Magento\View\Element\Template { /** * @var \Magento\Checkout\Model\Session @@ -35,19 +35,17 @@ class Failure extends \Magento\View\Block\Template protected $_checkoutSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getRealOrderId() diff --git a/app/code/Magento/Checkout/Block/Onepage/Link.php b/app/code/Magento/Checkout/Block/Onepage/Link.php index ae1c190e060..8dc1f7aed72 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Link.php +++ b/app/code/Magento/Checkout/Block/Onepage/Link.php @@ -33,7 +33,7 @@ */ namespace Magento\Checkout\Block\Onepage; -class Link extends \Magento\View\Block\Template +class Link extends \Magento\View\Element\Template { /** * @var \Magento\Checkout\Model\Session @@ -41,19 +41,17 @@ class Link extends \Magento\View\Block\Template protected $_checkoutSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Login.php b/app/code/Magento/Checkout/Block/Onepage/Login.php index 082db96ccc1..014b453f18c 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Login.php +++ b/app/code/Magento/Checkout/Block/Onepage/Login.php @@ -44,7 +44,7 @@ class Login extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_checkoutData = null; /** - * @param \Magento\View\Block\Template\Context $context + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession @@ -55,7 +55,7 @@ class Login extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php b/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php index 1f38720086d..91838f7eb9e 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php +++ b/app/code/Magento/Checkout/Block/Onepage/Payment/Info.php @@ -41,21 +41,19 @@ class Info extends \Magento\Payment\Block\Info\AbstractContainer protected $_checkoutSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Payment\Helper\Data $paymentData, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $paymentData, $data); + parent::__construct($context, $paymentData, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php b/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php index 4615084fab1..d3fe6ff7250 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php +++ b/app/code/Magento/Checkout/Block/Onepage/Payment/Methods.php @@ -42,19 +42,17 @@ class Methods extends \Magento\Payment\Block\Form\Container protected $_checkoutSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Review/Info.php b/app/code/Magento/Checkout/Block/Onepage/Review/Info.php index 935cc6b89df..87e7647826a 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Review/Info.php +++ b/app/code/Magento/Checkout/Block/Onepage/Review/Info.php @@ -37,19 +37,17 @@ class Info extends \Magento\Sales\Block\Items\AbstractItems protected $_checkoutSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping.php b/app/code/Magento/Checkout/Block/Onepage/Shipping.php index 01a26f74767..54a052c0d74 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping.php @@ -44,7 +44,7 @@ class Shipping extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_addressFactory; /** - * @param \Magento\View\Block\Template\Context $context + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession @@ -55,7 +55,7 @@ class Shipping extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php index 42d925dd3da..2fe8503d457 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php +++ b/app/code/Magento/Checkout/Block/Onepage/Shipping/Method/Available.php @@ -47,7 +47,7 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage protected $_taxData = null; /** - * @param \Magento\View\Block\Template\Context $context + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Customer\Model\Session $customerSession @@ -58,7 +58,7 @@ class Available extends \Magento\Checkout\Block\Onepage\AbstractOnepage * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\App\Cache\Type\Config $configCacheType, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Checkout/Block/Onepage/Success.php b/app/code/Magento/Checkout/Block/Onepage/Success.php index a5e27ecd562..97a598a3a08 100644 --- a/app/code/Magento/Checkout/Block/Onepage/Success.php +++ b/app/code/Magento/Checkout/Block/Onepage/Success.php @@ -33,7 +33,7 @@ */ namespace Magento\Checkout\Block\Onepage; -class Success extends \Magento\View\Block\Template +class Success extends \Magento\View\Element\Template { /** * @var \Magento\Checkout\Model\Session @@ -66,8 +66,7 @@ class Success extends \Magento\View\Block\Template protected $_orderConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\OrderFactory $orderFactory @@ -77,8 +76,7 @@ class Success extends \Magento\View\Block\Template * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\OrderFactory $orderFactory, @@ -93,7 +91,7 @@ class Success extends \Magento\View\Block\Template $this->_agreementFactory = $agreementFactory; $this->_profileCollFactory = $profileCollFactory; $this->_orderConfig = $orderConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Block/Success.php b/app/code/Magento/Checkout/Block/Success.php index efead2fd444..65d62c9c680 100644 --- a/app/code/Magento/Checkout/Block/Success.php +++ b/app/code/Magento/Checkout/Block/Success.php @@ -26,7 +26,7 @@ namespace Magento\Checkout\Block; -class Success extends \Magento\View\Block\Template +class Success extends \Magento\View\Element\Template { /** * @var \Magento\Sales\Model\OrderFactory @@ -34,19 +34,17 @@ class Success extends \Magento\View\Block\Template protected $_orderFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Sales\Model\OrderFactory $orderFactory, array $data = array() ) { $this->_orderFactory = $orderFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Checkout/Controller/Multishipping.php b/app/code/Magento/Checkout/Controller/Multishipping.php index e85468dec2e..cc24334a6ee 100644 --- a/app/code/Magento/Checkout/Controller/Multishipping.php +++ b/app/code/Magento/Checkout/Controller/Multishipping.php @@ -518,7 +518,7 @@ class Multishipping extends \Magento\Checkout\Controller\Action $this->_getState()->setCompleteStep( \Magento\Checkout\Model\Type\Multishipping\State::STEP_OVERVIEW ); - $this->_getCheckout()->getCheckoutSession()->clear(); + $this->_getCheckout()->getCheckoutSession()->clearQuote(); $this->_getCheckout()->getCheckoutSession()->setDisplaySuccess(true); $this->_redirect('*/*/success'); } catch (\Magento\Payment\Model\Info\Exception $e) { @@ -530,7 +530,7 @@ class Multishipping extends \Magento\Checkout\Controller\Action } catch (\Magento\Checkout\Exception $e) { $this->_objectManager->get('Magento\Checkout\Helper\Data') ->sendPaymentFailedEmail($this->_getCheckout()->getQuote(), $e->getMessage(), 'multi-shipping'); - $this->_getCheckout()->getCheckoutSession()->clear(); + $this->_getCheckout()->getCheckoutSession()->clearQuote(); $this->_getCheckoutSession()->addError($e->getMessage()); $this->_redirect('*/cart'); } catch (\Magento\Core\Exception $e) { diff --git a/app/code/Magento/Checkout/Controller/Onepage.php b/app/code/Magento/Checkout/Controller/Onepage.php index f74a3a11743..cda03409c4f 100644 --- a/app/code/Magento/Checkout/Controller/Onepage.php +++ b/app/code/Magento/Checkout/Controller/Onepage.php @@ -280,7 +280,7 @@ class Onepage extends \Magento\Checkout\Controller\Action return; } - $session->clear(); + $session->clearQuote(); $this->_view->loadLayout(); $this->_view->getLayout()->initMessages('Magento\Checkout\Model\Session'); $this->_eventManager->dispatch( diff --git a/app/code/Magento/Checkout/Model/Observer.php b/app/code/Magento/Checkout/Model/Observer.php index 91dcfecbeba..f01ad4cd352 100644 --- a/app/code/Magento/Checkout/Model/Observer.php +++ b/app/code/Magento/Checkout/Model/Observer.php @@ -50,7 +50,7 @@ class Observer public function unsetAll() { - $this->_checkoutSession->unsetAll(); + $this->_checkoutSession->clearQuote()->clearStorage(); } public function loadCustomerQuote() diff --git a/app/code/Magento/Checkout/Model/Resource/Agreement.php b/app/code/Magento/Checkout/Model/Resource/Agreement.php index e7d001da610..e42fb34ca8f 100644 --- a/app/code/Magento/Checkout/Model/Resource/Agreement.php +++ b/app/code/Magento/Checkout/Model/Resource/Agreement.php @@ -42,13 +42,11 @@ class Agreement extends \Magento\Core\Model\Resource\Db\AbstractDb protected $filterManager; /** - * @param \Magento\Filter\FilterManager $filterManager * @param \Magento\App\Resource $resource + * @param \Magento\Filter\FilterManager $filterManager */ - public function __construct( - \Magento\Filter\FilterManager $filterManager, - \Magento\App\Resource $resource - ) { + public function __construct(\Magento\App\Resource $resource, \Magento\Filter\FilterManager $filterManager) + { $this->filterManager = $filterManager; parent::__construct($resource); } diff --git a/app/code/Magento/Checkout/Model/Resource/Setup.php b/app/code/Magento/Checkout/Model/Resource/Setup.php index 1af9e5dd1f1..84265014e26 100644 --- a/app/code/Magento/Checkout/Model/Resource/Setup.php +++ b/app/code/Magento/Checkout/Model/Resource/Setup.php @@ -43,24 +43,24 @@ class Setup extends \Magento\Eav\Model\Entity\Setup /** * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param string $resourceName * @param \Magento\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory * @param \Magento\Customer\Helper\Address $customerAddress - * @param string $resourceName * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, \Magento\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory, \Magento\Customer\Helper\Address $customerAddress, - $resourceName, $moduleName = 'Magento_Checkout', $connectionName = '' ) { $this->_customerAddress = $customerAddress; - parent::__construct($context, $cache, $attrGrCollFactory, $resourceName, $moduleName, $connectionName); + parent::__construct($context, $resourceName, $cache, $attrGrCollFactory, $moduleName, $connectionName); } /** diff --git a/app/code/Magento/Checkout/Model/Session.php b/app/code/Magento/Checkout/Model/Session.php index b67a58eaed3..c6ae9a38b3b 100644 --- a/app/code/Magento/Checkout/Model/Session.php +++ b/app/code/Magento/Checkout/Model/Session.php @@ -81,6 +81,8 @@ class Session extends \Magento\Core\Model\Session\AbstractSession /** * @param \Magento\Core\Model\Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\QuoteFactory $quoteFactory @@ -90,6 +92,8 @@ class Session extends \Magento\Core\Model\Session\AbstractSession */ public function __construct( \Magento\Core\Model\Session\Context $context, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\QuoteFactory $quoteFactory, @@ -101,17 +105,8 @@ class Session extends \Magento\Core\Model\Session\AbstractSession $this->_customerSession = $customerSession; $this->_quoteFactory = $quoteFactory; $this->_remoteAddress = $remoteAddress; - parent::__construct($context, $data); - $this->init('checkout', $sessionName); - } - - /** - * Unset all data associated with object - */ - public function unsetAll() - { - parent::unsetAll(); - $this->_quote = null; + parent::__construct($context, $sidResolver, $sessionConfig, $data); + $this->start('checkout', $sessionName); } /** @@ -402,12 +397,31 @@ class Session extends \Magento\Core\Model\Session\AbstractSession return $this->addItemAdditionalMessage('quote_item' . $itemId, $message); } - public function clear() + /** + * Destroy/end a session + * Unset all data associated with object + * + * @return $this + */ + public function clearQuote() { - $this->_eventManager->dispatch('checkout_quote_destroy', array('quote'=>$this->getQuote())); + $this->_eventManager->dispatch('checkout_quote_destroy', array('quote' => $this->getQuote())); $this->_quote = null; $this->setQuoteId(null); $this->setLastSuccessQuoteId(null); + return $this; + } + + /** + * Unset all session data and quote + * + * @return $this + */ + public function clearStorage() + { + parent::clearStorage(); + $this->_quote = null; + return $this; } /** diff --git a/app/code/Magento/Checkout/etc/module.xml b/app/code/Magento/Checkout/etc/module.xml index fb08b4987f3..a4feec089ea 100755 --- a/app/code/Magento/Checkout/etc/module.xml +++ b/app/code/Magento/Checkout/etc/module.xml @@ -36,7 +36,6 @@ <module name="Magento_Customer"/> <module name="Magento_Catalog"/> <module name="Magento_Payment"/> - <module name="Magento_Page"/> <module name="Magento_Tax"/> <module name="Magento_Directory"/> <module name="Magento_Eav"/> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml index e13f318ffbe..b899db32ef3 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_cart_index.xml @@ -55,5 +55,5 @@ </container> </block> </referenceContainer> - <!-- <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> --> + <!-- <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> --> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_addresses.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_addresses.xml index dacf3e65ab9..a96393e24dc 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_addresses.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_addresses.xml @@ -37,5 +37,5 @@ <block class="Magento\Checkout\Block\Cart\Item\Renderer\Configurable" as="configurable" template="multishipping/item/default.phtml"/> </block> </referenceContainer> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_overview.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_overview.xml index 00fa8577451..a8743ef4b25 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_overview.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_overview.xml @@ -48,5 +48,5 @@ <container name="checkout.multishipping.overview.items.after" as="items_after" label="Overview Items After"/> </block> </referenceContainer> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_shipping.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_shipping.xml index d5362947403..fbeeb1891d9 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_shipping.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_multishipping_shipping.xml @@ -42,5 +42,5 @@ </block> </block> </referenceContainer> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml index 85128b7b94f..79ceb873ba9 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_index.xml @@ -51,8 +51,8 @@ <argument name="template" xsi:type="string">Magento_Payment::form/purchaseorder.phtml</argument> </action> </block> - <block class="Magento\View\Block\Template" name="checkout.onepage.payment.additional" as="additional"/> - <block class="Magento\View\Block\Template" name="checkout.onepage.payment.methods_additional" as="methods_additional"/> + <block class="Magento\View\Element\Template" name="checkout.onepage.payment.additional" as="additional"/> + <block class="Magento\View\Element\Template" name="checkout.onepage.payment.methods_additional" as="methods_additional"/> </block> <block class="Magento\Checkout\Block\Onepage\Review" name="checkout.onepage.review" as="review" template="onepage/review.phtml"/> </block> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml index c5252ab7027..aeb5de37273 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_paymentmethod.xml @@ -29,7 +29,7 @@ <argument name="method" xsi:type="string">purchaseorder</argument> <argument name="template" xsi:type="string">Magento_Payment::form/purchaseorder.phtml</argument> </action> - <block class="Magento\View\Block\Template" name="checkout.onepage.payment.methods.scripts" as="scripts"/> - <block class="Magento\View\Block\Template" name="checkout.onepage.payment.methods.additional" as="additional"/> + <block class="Magento\View\Element\Template" name="checkout.onepage.payment.methods.scripts" as="scripts"/> + <block class="Magento\View\Element\Template" name="checkout.onepage.payment.methods.additional" as="additional"/> </block> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml index ae8fae2ac76..b68a13d14df 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/checkout_onepage_review.xml @@ -32,7 +32,7 @@ <container name="checkout.onepage.review.info.items.before" as="items_before" label="Items Before"/> <container name="checkout.onepage.review.info.items.after" as="items_after" label="Items After"/> <block class="Magento\Checkout\Block\Agreements" name="checkout.onepage.agreements" as="agreements" template="agreements.phtml"/> - <block class="Magento\View\Block\Template" name="checkout.onepage.review.button" as="button" template="Magento_Checkout::onepage/review/button.phtml"/> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="checkout.onepage.review.button" as="button" template="Magento_Checkout::onepage/review/button.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </block> </layout> diff --git a/app/code/Magento/Checkout/view/frontend/layout/default.xml b/app/code/Magento/Checkout/view/frontend/layout/default.xml index 1088c62a076..856c7840ea2 100644 --- a/app/code/Magento/Checkout/view/frontend/layout/default.xml +++ b/app/code/Magento/Checkout/view/frontend/layout/default.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head.components"> - <block class="Magento\Page\Block\Js\Components" name="checkout_page_head_components" template="Magento_Checkout::js/components.phtml"/> + <block class="Magento\View\Element\Js\Components" name="checkout_page_head_components" template="Magento_Checkout::js/components.phtml"/> </referenceBlock> <referenceContainer name="header"> <block class="Magento\Checkout\Block\Cart\Sidebar" name="minicart" as="minicart" after="logo" template="cart/minicart.phtml"> diff --git a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit.php b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit.php index 41f0483f9ba..8d47dc6f1fb 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit.php @@ -42,20 +42,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php index b06331783db..d946aa452c8 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Block/Edit/Form.php @@ -46,27 +46,25 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\Core\Model\System\Store $systemStore - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param \Magento\Core\Model\System\Store $systemStore + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Core\Model\System\Store $systemStore, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + \Magento\Core\Model\System\Store $systemStore, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; $this->_systemStore = $systemStore; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Cms/Block/Adminhtml/Block/Widget/Chooser.php b/app/code/Magento/Cms/Block/Adminhtml/Block/Widget/Chooser.php index 0d5fa34087a..8a6635aabba 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Block/Widget/Chooser.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Block/Widget/Chooser.php @@ -45,25 +45,23 @@ class Chooser extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Cms\Model\BlockFactory $blockFactory - * @param \Magento\Cms\Model\Resource\Block\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Cms\Model\BlockFactory $blockFactory + * @param \Magento\Cms\Model\Resource\Block\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Cms\Model\BlockFactory $blockFactory, - \Magento\Cms\Model\Resource\Block\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Cms\Model\BlockFactory $blockFactory, + \Magento\Cms\Model\Resource\Block\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_blockFactory = $blockFactory; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit.php index c11b33cb587..88bb13e2711 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit.php @@ -42,20 +42,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -137,7 +135,7 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container /** * Prepare layout * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Content.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Content.php index d683d1d95bd..b5bf1229ccb 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Content.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Content.php @@ -38,24 +38,22 @@ class Content */ protected $_wysiwygConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php index dd4584c6a55..fd7e6462f1f 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Design.php @@ -38,31 +38,29 @@ class Design protected $_labelFactory; /** - * @var \Magento\Page\Model\Source\Layout + * @var \Magento\Theme\Model\Layout\Source\Layout */ protected $_pageLayout; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Page\Model\Source\Layout $pageLayout - * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Theme\Model\Layout\Source\Layout $pageLayout + * @param \Magento\Core\Model\Theme\LabelFactory $labelFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Page\Model\Source\Layout $pageLayout, - \Magento\Core\Model\Theme\LabelFactory $labelFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Theme\Model\Layout\Source\Layout $pageLayout, + \Magento\Core\Model\Theme\LabelFactory $labelFactory, + array $data = array() + ) { $this->_labelFactory = $labelFactory; $this->_pageLayout = $pageLayout; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Main.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Main.php index 563446df85f..62303e26362 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Main.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Edit/Tab/Main.php @@ -38,24 +38,22 @@ class Main */ protected $_systemStore; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\System\Store $systemStore - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\System\Store $systemStore, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\System\Store $systemStore, + array $data = array() + ) { $this->_systemStore = $systemStore; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php index 31c7bbe42d5..41c021bf3ad 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Grid.php @@ -46,32 +46,30 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid protected $_cmsPage; /** - * @var \Magento\Page\Model\Source\Layout + * @var \Magento\Theme\Model\Layout\Source\Layout */ protected $_pageLayout; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Page\Model\Source\Layout $pageLayout - * @param \Magento\Cms\Model\Page $cmsPage - * @param \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Theme\Model\Layout\Source\Layout $pageLayout + * @param \Magento\Cms\Model\Page $cmsPage + * @param \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Page\Model\Source\Layout $pageLayout, - \Magento\Cms\Model\Page $cmsPage, - \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Theme\Model\Layout\Source\Layout $pageLayout, + \Magento\Cms\Model\Page $cmsPage, + \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; $this->_cmsPage = $cmsPage; $this->_pageLayout = $pageLayout; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Cms/Block/Adminhtml/Page/Widget/Chooser.php b/app/code/Magento/Cms/Block/Adminhtml/Page/Widget/Chooser.php index 49f2bca50bc..74c75c4ad20 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Page/Widget/Chooser.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Page/Widget/Chooser.php @@ -36,7 +36,7 @@ namespace Magento\Cms\Block\Adminhtml\Page\Widget; class Chooser extends \Magento\Adminhtml\Block\Widget\Grid { /** - * @var \Magento\Page\Model\Source\Layout + * @var \Magento\Theme\Model\Layout\Source\Layout */ protected $_pageLayout; @@ -55,31 +55,29 @@ class Chooser extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Page\Model\Source\Layout $pageLayout - * @param \Magento\Cms\Model\Page $cmsPage - * @param \Magento\Cms\Model\PageFactory $pageFactory - * @param \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Theme\Model\Layout\Source\Layout $pageLayout + * @param \Magento\Cms\Model\Page $cmsPage + * @param \Magento\Cms\Model\PageFactory $pageFactory + * @param \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Page\Model\Source\Layout $pageLayout, - \Magento\Cms\Model\Page $cmsPage, - \Magento\Cms\Model\PageFactory $pageFactory, - \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Theme\Model\Layout\Source\Layout $pageLayout, + \Magento\Cms\Model\Page $cmsPage, + \Magento\Cms\Model\PageFactory $pageFactory, + \Magento\Cms\Model\Resource\Page\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_pageLayout = $pageLayout; $this->_cmsPage = $cmsPage; $this->_pageFactory = $pageFactory; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php index 99c4d820ee5..312cc732030 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content.php @@ -33,8 +33,29 @@ */ namespace Magento\Cms\Block\Adminhtml\Wysiwyg\Images; +use Magento\View\Element\Template; + class Content extends \Magento\Adminhtml\Block\Widget\Container { + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; + parent::__construct($context, $data); + } + /** * Block construction */ @@ -101,7 +122,7 @@ class Content extends \Magento\Adminhtml\Block\Widget\Container 'showBreadcrumbs' => true )); - return $this->_coreData->jsonEncode($setupObject); + return $this->_jsonEncoder->encode($setupObject); } /** diff --git a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Files.php b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Files.php index 0e7ec3871ce..dbf823ff0dc 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Files.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Files.php @@ -52,23 +52,21 @@ class Files extends \Magento\Backend\Block\Template */ protected $_imageHelper; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Cms\Model\Wysiwyg\Images\Storage $imageStorage - * @param \Magento\Cms\Helper\Wysiwyg\Images $imageHelper - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Cms\Model\Wysiwyg\Images\Storage $imageStorage + * @param \Magento\Cms\Helper\Wysiwyg\Images $imageHelper + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Cms\Model\Wysiwyg\Images\Storage $imageStorage, - \Magento\Cms\Helper\Wysiwyg\Images $imageHelper, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Cms\Model\Wysiwyg\Images\Storage $imageStorage, + \Magento\Cms\Helper\Wysiwyg\Images $imageHelper, + array $data = array() + ) { $this->_imageHelper = $imageHelper; $this->_imageStorage = $imageStorage; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Uploader.php b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Uploader.php index 9cde9c297cc..2b14b1673ae 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Uploader.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Content/Uploader.php @@ -40,22 +40,20 @@ class Uploader extends \Magento\Backend\Block\Media\Uploader */ protected $_imagesStorage; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\File\Size $fileSize - * @param \Magento\Cms\Model\Wysiwyg\Images\Storage $imagesStorage - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\File\Size $fileSize + * @param \Magento\Cms\Model\Wysiwyg\Images\Storage $imagesStorage + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\File\Size $fileSize, - \Magento\Cms\Model\Wysiwyg\Images\Storage $imagesStorage, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\File\Size $fileSize, + \Magento\Cms\Model\Wysiwyg\Images\Storage $imagesStorage, + array $data = array() + ) { $this->_imagesStorage = $imagesStorage; - parent::__construct($context, $coreData, $fileSize, $data); + parent::__construct($context, $fileSize, $data); } protected function _construct() diff --git a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php index f3b98b928f9..cbe9639379c 100644 --- a/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php +++ b/app/code/Magento/Cms/Block/Adminhtml/Wysiwyg/Images/Tree.php @@ -49,23 +49,21 @@ class Tree extends \Magento\Backend\Block\Template */ protected $_cmsWysiwygImages = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Cms\Helper\Wysiwyg\Images $cmsWysiwygImages, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_cmsWysiwygImages = $cmsWysiwygImages; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Cms/Block/Block.php b/app/code/Magento/Cms/Block/Block.php index 8f1ba323ae8..f1d4c4256aa 100644 --- a/app/code/Magento/Cms/Block/Block.php +++ b/app/code/Magento/Cms/Block/Block.php @@ -34,7 +34,9 @@ */ namespace Magento\Cms\Block; -class Block extends \Magento\View\Block\AbstractBlock +use Magento\View\Element\AbstractBlock; + +class Block extends \Magento\View\Element\AbstractBlock { /** * @var \Magento\Cms\Model\Template\FilterProvider @@ -58,14 +60,14 @@ class Block extends \Magento\View\Block\AbstractBlock /** * Construct * - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\Cms\Model\Template\FilterProvider $filterProvider * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Cms\Model\BlockFactory $blockFactory * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\Cms\Model\Template\FilterProvider $filterProvider, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Cms\Model\BlockFactory $blockFactory, diff --git a/app/code/Magento/Cms/Block/Page.php b/app/code/Magento/Cms/Block/Page.php index b3132f9d63b..d61aa6ce0bc 100644 --- a/app/code/Magento/Cms/Block/Page.php +++ b/app/code/Magento/Cms/Block/Page.php @@ -34,7 +34,9 @@ */ namespace Magento\Cms\Block; -class Page extends \Magento\View\Block\AbstractBlock +use Magento\View\Element\AbstractBlock; + +class Page extends \Magento\View\Element\AbstractBlock { /** * @var \Magento\Cms\Model\Template\FilterProvider @@ -63,7 +65,7 @@ class Page extends \Magento\View\Block\AbstractBlock /** * Construct * - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\Cms\Model\Page $page * @param \Magento\Cms\Model\Template\FilterProvider $filterProvider * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -71,7 +73,7 @@ class Page extends \Magento\View\Block\AbstractBlock * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\Cms\Model\Page $page, \Magento\Cms\Model\Template\FilterProvider $filterProvider, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Cms/Block/Widget/Block.php b/app/code/Magento/Cms/Block/Widget/Block.php index 3339bb9976c..b2fe249384b 100644 --- a/app/code/Magento/Cms/Block/Widget/Block.php +++ b/app/code/Magento/Cms/Block/Widget/Block.php @@ -34,7 +34,7 @@ */ namespace Magento\Cms\Block\Widget; -class Block extends \Magento\View\Block\Template implements \Magento\Widget\Block\BlockInterface +class Block extends \Magento\View\Element\Template implements \Magento\Widget\Block\BlockInterface { /** * @var \Magento\Cms\Model\Template\FilterProvider @@ -56,20 +56,18 @@ class Block extends \Magento\View\Block\Template implements \Magento\Widget\Bloc protected $_blockFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Cms\Model\Template\FilterProvider $filterProvider * @param \Magento\Cms\Model\BlockFactory $blockFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Cms\Model\Template\FilterProvider $filterProvider, \Magento\Cms\Model\BlockFactory $blockFactory, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_filterProvider = $filterProvider; $this->_blockFactory = $blockFactory; } diff --git a/app/code/Magento/Cms/Block/Widget/Page/Link.php b/app/code/Magento/Cms/Block/Widget/Page/Link.php index b2adfca4b5f..aba64d26216 100644 --- a/app/code/Magento/Cms/Block/Widget/Page/Link.php +++ b/app/code/Magento/Cms/Block/Widget/Page/Link.php @@ -35,7 +35,7 @@ namespace Magento\Cms\Block\Widget\Page; class Link - extends \Magento\View\Block\Html\Link + extends \Magento\View\Element\Html\Link implements \Magento\Widget\Block\BlockInterface { /** @@ -72,20 +72,18 @@ class Link protected $_cmsPage; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Cms\Model\Resource\Page $resourcePage * @param \Magento\Cms\Helper\Page $cmsPage * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Cms\Model\Resource\Page $resourcePage, \Magento\Cms\Helper\Page $cmsPage, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_resourcePage = $resourcePage; $this->_cmsPage = $cmsPage; } @@ -135,13 +133,13 @@ class Link } /** - * Prepare anchor text using passed text as parameter. + * Prepare label using passed text as parameter. * If anchor text was not specified use title instead and * if title will be blank string, page identifier will be used. * * @return string */ - public function getAnchorText() + public function getLable() { if ($this->getData('anchor_text')) { $this->_anchorText = $this->getData('anchor_text'); diff --git a/app/code/Magento/Cms/Helper/Page.php b/app/code/Magento/Cms/Helper/Page.php index 18a94685167..c8967f89ebb 100644 --- a/app/code/Magento/Cms/Helper/Page.php +++ b/app/code/Magento/Cms/Helper/Page.php @@ -43,7 +43,7 @@ class Page extends \Magento\App\Helper\AbstractHelper /** * Catalog product * - * @var \Magento\Page\Helper\Layout + * @var \Magento\Theme\Helper\Layout */ protected $_pageLayout; @@ -99,7 +99,7 @@ class Page extends \Magento\App\Helper\AbstractHelper * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Session\Pool $sessionFactory * @param \Magento\Cms\Model\Page $page - * @param \Magento\Page\Helper\Layout $pageLayout + * @param \Magento\Theme\Helper\Layout $pageLayout * @param \Magento\View\DesignInterface $design * @param \Magento\Cms\Model\PageFactory $pageFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -111,7 +111,7 @@ class Page extends \Magento\App\Helper\AbstractHelper \Magento\App\Helper\Context $context, \Magento\Core\Model\Session\Pool $sessionFactory, \Magento\Cms\Model\Page $page, - \Magento\Page\Helper\Layout $pageLayout, + \Magento\Theme\Helper\Layout $pageLayout, \Magento\View\DesignInterface $design, \Magento\Cms\Model\PageFactory $pageFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Cms/Model/Resource/Page/Collection.php b/app/code/Magento/Cms/Model/Resource/Page/Collection.php index 497c0fe1701..dfc2f3d79ce 100644 --- a/app/code/Magento/Cms/Model/Resource/Page/Collection.php +++ b/app/code/Magento/Cms/Model/Resource/Page/Collection.php @@ -52,24 +52,24 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_storeManager; /** - * Construct - * - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_storeManager = $storeManager; } diff --git a/app/code/Magento/Cms/Model/Resource/Setup.php b/app/code/Magento/Cms/Model/Resource/Setup.php index f99a4be5a10..046e4a44e8e 100644 --- a/app/code/Magento/Cms/Model/Resource/Setup.php +++ b/app/code/Magento/Cms/Model/Resource/Setup.php @@ -45,9 +45,9 @@ class Setup extends \Magento\Core\Model\Resource\Setup\Generic public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, \Magento\Cms\Model\BlockFactory $blockFactory, \Magento\Cms\Model\PageFactory $pageFactory, - $resourceName, $moduleName = 'Magento_Cms', $connectionName = '' ) { diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php index 4297b91e4c0..6bec71b42b9 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage.php @@ -470,7 +470,7 @@ class Storage extends \Magento\Object $this->resizeFile($targetPath . DS . $uploader->getUploadedFileName(), true); $result['cookie'] = array( - 'name' => session_name(), + 'name' => $this->getSession()->getName(), 'value' => $this->getSession()->getSessionId(), 'lifetime' => $this->getSession()->getCookieLifetime(), 'path' => $this->getSession()->getCookiePath(), diff --git a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php index f3a47d1ae1a..7aafdae4b7c 100644 --- a/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php +++ b/app/code/Magento/Cms/Model/Wysiwyg/Images/Storage/Collection.php @@ -41,15 +41,11 @@ class Collection extends \Magento\Data\Collection\Filesystem protected $_filesystem; /** - * Constructor - * - * @param \Magento\Filesystem $filesystem * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Filesystem $filesystem */ - public function __construct( - \Magento\Filesystem $filesystem, - \Magento\Core\Model\EntityFactory $entityFactory - ) { + public function __construct(\Magento\Core\Model\EntityFactory $entityFactory, \Magento\Filesystem $filesystem) + { $this->_filesystem = $filesystem; parent::__construct($entityFactory); } diff --git a/app/code/Magento/Cms/etc/module.xml b/app/code/Magento/Cms/etc/module.xml index fa20b90a7c2..88ded907c2f 100644 --- a/app/code/Magento/Cms/etc/module.xml +++ b/app/code/Magento/Cms/etc/module.xml @@ -27,11 +27,11 @@ <module name="Magento_Cms" version="2.0.0.0" active="true"> <sequence> <module name="Magento_Core"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </sequence> <depends> <module name="Magento_Core"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> <module name="Magento_Widget"/> <module name="Magento_Backend"/> <module name="Magento_Catalog"/> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml index 96f6417ba01..d0e2471e5ea 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_block_edit.xml @@ -26,32 +26,32 @@ <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="editor"/> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/css/jquery.fileupload-ui.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.iframe-transport.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/load-image.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/canvas-to-blob.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload-fp.js</argument> </arguments> diff --git a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml index c694e9b8564..461211b6bbf 100644 --- a/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml +++ b/app/code/Magento/Cms/view/adminhtml/layout/cms_page_edit.xml @@ -25,37 +25,37 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/css/jquery.fileupload-ui.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.iframe-transport.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/load-image.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/canvas-to-blob.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload-fp.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-cms-js-tiny-mce-form-submit-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-cms-js-tiny-mce-form-submit-js"> <arguments> <argument name="file" xsi:type="string">Magento_Cms::js/tiny_mce_form_submit.js</argument> </arguments> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml index 0c622876982..43d1e828c91 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultindex.xml @@ -30,6 +30,6 @@ </action> </referenceBlock> <referenceContainer name="content"> - <block class="Magento\View\Block\Template" name="default_home_page" template="Magento_Cms::default/home.phtml"/> + <block class="Magento\View\Element\Template" name="default_home_page" template="Magento_Cms::default/home.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml index ea923101aa1..af890b76dfc 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_index_defaultnoroute.xml @@ -30,6 +30,6 @@ </action> </referenceBlock> <referenceContainer name="content"> - <block class="Magento\View\Block\Template" name="default_no_route" template="Magento_Cms::default/no-route.phtml"/> + <block class="Magento\View\Element\Template" name="default_no_route" template="Magento_Cms::default/no-route.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml b/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml index 6876cd1901f..2a2d811456a 100644 --- a/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml +++ b/app/code/Magento/Cms/view/frontend/layout/cms_page_view.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> - <block class="Magento\View\Block\Template" name="page_content_heading" template="Magento_Cms::content_heading.phtml"/> + <block class="Magento\View\Element\Template" name="page_content_heading" template="Magento_Cms::content_heading.phtml"/> <container name="cms.wrapper" label="CMS Content Wrapper" htmlTag="div" htmlClass="std"> <block class="Magento\Cms\Block\Page" name="cms_page"/> </container> diff --git a/app/code/Magento/Cms/view/frontend/widget/link/link_block.phtml b/app/code/Magento/Cms/view/frontend/widget/link/link_block.phtml index 66b6fddb63b..f4bcb3ad7ce 100644 --- a/app/code/Magento/Cms/view/frontend/widget/link/link_block.phtml +++ b/app/code/Magento/Cms/view/frontend/widget/link/link_block.phtml @@ -24,4 +24,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<span class="widget widget-cms-link"><a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getAnchorText()) ?></span></a></span> +<span class="widget widget-cms-link"><a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getLabel()) ?></span></a></span> diff --git a/app/code/Magento/Cms/view/frontend/widget/link/link_inline.phtml b/app/code/Magento/Cms/view/frontend/widget/link/link_inline.phtml index 7afdf1b9a93..681e15f3d75 100644 --- a/app/code/Magento/Cms/view/frontend/widget/link/link_inline.phtml +++ b/app/code/Magento/Cms/view/frontend/widget/link/link_inline.phtml @@ -24,4 +24,4 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<span class="widget widget-cms-link-inline"><a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getAnchorText()) ?></span></a></span> +<span class="widget widget-cms-link-inline"><a <?php echo $this->getLinkAttributes() ?>><span><?php echo $this->escapeHtml($this->getLabel()) ?></span></a></span> diff --git a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/AbstractTab.php b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/AbstractTab.php index f5899bb18f1..c67a3db5cf0 100644 --- a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/AbstractTab.php +++ b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/AbstractTab.php @@ -52,23 +52,21 @@ abstract class AbstractTab */ protected $_addFileDepButtonHtml; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Connect\Model\Session $session - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Connect\Model\Session $session + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Connect\Model\Session $session, - array $data = array() - ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Connect\Model\Session $session, + array $data = array() + ) { + parent::__construct($context, $registry, $formFactory, $data); $this->setData($session->getCustomExtensionPackageFormData()); } diff --git a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php index 86873d474c1..9f0426dcf0f 100644 --- a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php +++ b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Authors.php @@ -33,9 +33,36 @@ */ namespace Magento\Connect\Block\Adminhtml\Extension\Custom\Edit\Tab; +use Magento\Backend\Block\Widget\Form\Generic; + class Authors extends \Magento\Connect\Block\Adminhtml\Extension\Custom\Edit\Tab\AbstractTab { + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Connect\Model\Session $session + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Connect\Model\Session $session, + \Magento\Json\EncoderInterface $jsonEncoder, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; + parent::__construct($context, $registry, $formFactory, $session, $data); + } + /** * Get Tab Label * @@ -89,7 +116,7 @@ class Authors } } foreach ($temp as $key => $value) { - $authors[$key] = $this->_coreData->jsonEncode($value); + $authors[$key] = $this->_jsonEncoder->encode($value); } } return $authors; diff --git a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php index 70b67a67f91..3d340e18303 100644 --- a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php +++ b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Contents.php @@ -43,26 +43,24 @@ class Contents */ protected $_extensionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Connect\Model\Session $session - * @param \Magento\Connect\Model\ExtensionFactory $extensionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Connect\Model\Session $session + * @param \Magento\Connect\Model\ExtensionFactory $extensionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Connect\Model\Session $session, - \Magento\Connect\Model\ExtensionFactory $extensionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Connect\Model\Session $session, + \Magento\Connect\Model\ExtensionFactory $extensionFactory, + array $data = array() + ) { $this->_extensionFactory = $extensionFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $session, $data); + parent::__construct($context, $registry, $formFactory, $session, $data); } /** diff --git a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php index f97d91d72c8..5fc9e8e49c2 100644 --- a/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php +++ b/app/code/Magento/Connect/Block/Adminhtml/Extension/Custom/Edit/Tab/Grid.php @@ -42,22 +42,20 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Connect\Model\Extension\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Connect\Model\Extension\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Connect\Model\Extension\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Connect\Model\Extension\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Connect/Model/Extension/Collection.php b/app/code/Magento/Connect/Model/Extension/Collection.php index 86486fe09ac..86ff827a742 100644 --- a/app/code/Magento/Connect/Model/Extension/Collection.php +++ b/app/code/Magento/Connect/Model/Extension/Collection.php @@ -52,12 +52,10 @@ class Collection extends \Magento\Data\Collection\Filesystem protected $_baseDir = ''; /** - * Set base dir - * - * @param \Magento\App\Dir $dirs * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\App\Dir $dirs */ - public function __construct(\Magento\App\Dir $dirs, \Magento\Core\Model\EntityFactory $entityFactory) + public function __construct(\Magento\Core\Model\EntityFactory $entityFactory, \Magento\App\Dir $dirs) { parent::__construct($entityFactory); $this->_baseDir = $dirs->getDir('var') . DS . 'connect'; diff --git a/app/code/Magento/Connect/Model/Session.php b/app/code/Magento/Connect/Model/Session.php index 738c9f5593e..ea9b6530139 100644 --- a/app/code/Magento/Connect/Model/Session.php +++ b/app/code/Magento/Connect/Model/Session.php @@ -45,17 +45,21 @@ class Session extends \Magento\Core\Model\Session\AbstractSession /** * @param \Magento\Core\Model\Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Connect\Helper\Data $connectData * @param array $data */ public function __construct( \Magento\Core\Model\Session\Context $context, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Connect\Helper\Data $connectData, array $data = array() ) { $this->_connectData = $connectData; - parent::__construct($context, $data); - $this->init('adminhtml'); + parent::__construct($context, $sidResolver, $sessionConfig, $data); + $this->start('adminhtml'); } /** diff --git a/app/code/Magento/Contacts/etc/frontend/di.xml b/app/code/Magento/Contacts/etc/frontend/di.xml index ef2c7b61054..e7863c1c135 100644 --- a/app/code/Magento/Contacts/etc/frontend/di.xml +++ b/app/code/Magento/Contacts/etc/frontend/di.xml @@ -27,7 +27,7 @@ <type name="Magento\Core\Model\Url\SecurityInfo"> <param name="secureUrlList"> <value> - <customer>/contacts/</customer> + <contacts>/contacts/</contacts> </value> </param> </type> diff --git a/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml b/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml index 5c9374a609d..6f4471a3afa 100644 --- a/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml +++ b/app/code/Magento/Contacts/view/frontend/layout/contacts_index_index.xml @@ -38,7 +38,7 @@ </action> </referenceBlock> <referenceContainer name="content"> - <block class="Magento\View\Block\Template" name="contactForm" template="Magento_Contacts::form.phtml"> + <block class="Magento\View\Element\Template" name="contactForm" template="Magento_Contacts::form.phtml"> <container name="form.additional.info" label="Form Additional Info"/> </block> </referenceContainer> diff --git a/app/code/Magento/Contacts/view/frontend/layout/default.xml b/app/code/Magento/Contacts/view/frontend/layout/default.xml index e0ef5232e6c..dfcd7d3954b 100644 --- a/app/code/Magento/Contacts/view/frontend/layout/default.xml +++ b/app/code/Magento/Contacts/view/frontend/layout/default.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="footer_links"> - <block class="Magento\Page\Block\Link" ifconfig="contacts/contacts/enabled" + <block class="Magento\View\Element\Html\Link\Current" ifconfig="contacts/contacts/enabled" name="contact-us-link"> <arguments> <argument name="label" xsi:type="string">Contact Us</argument> diff --git a/app/code/Magento/Core/App/Action/FormKeyValidator.php b/app/code/Magento/Core/App/Action/FormKeyValidator.php index b9735512382..f4a2af6244c 100644 --- a/app/code/Magento/Core/App/Action/FormKeyValidator.php +++ b/app/code/Magento/Core/App/Action/FormKeyValidator.php @@ -27,16 +27,16 @@ namespace Magento\Core\App\Action; class FormKeyValidator { /** - * @var \Magento\Core\Model\Session + * @var \Magento\Data\Form\FormKey */ - protected $_session; + protected $_formKey; /** - * @param \Magento\Core\Model\Session $session + * @param \Magento\Data\Form\FormKey $formKey */ - public function __construct(\Magento\Core\Model\Session $session) + public function __construct(\Magento\Data\Form\FormKey $formKey) { - $this->_session = $session; + $this->_formKey = $formKey; } /** @@ -48,9 +48,9 @@ class FormKeyValidator public function validate(\Magento\App\RequestInterface $request) { $formKey = $request->getParam('form_key', null); - if (!$formKey || $formKey != $this->_session->getFormKey()) { + if (!$formKey || $formKey !== $this->_formKey->getFormKey()) { return false; } return true; } -} \ No newline at end of file +} diff --git a/app/code/Magento/Core/App/Action/Plugin/Session.php b/app/code/Magento/Core/App/Action/Plugin/Session.php index 3705d66a85e..70c7a250899 100644 --- a/app/code/Magento/Core/App/Action/Plugin/Session.php +++ b/app/code/Magento/Core/App/Action/Plugin/Session.php @@ -32,7 +32,12 @@ class Session protected $_session; /** - * @var \Magento\Core\Model\Cookie + * @var \Magento\Session\SidResolverInterface + */ + protected $_sidResolver; + + /** + * @var \Magento\Stdlib\Cookie */ protected $_cookie; @@ -62,24 +67,27 @@ class Session protected $_storeConfig; /** + * @param \Magento\App\ActionFlag $flag * @param \Magento\Core\Model\Session $session - * @param \Magento\Core\Model\Cookie $cookie + * @param \Magento\Stdlib\Cookie $cookie * @param \Magento\Core\Model\Url $url - * @param \Magento\App\ActionFlag $flag * @param \Magento\Core\Model\Store\Config $storeConfig + * @param \Magento\Session\SidResolverInterface $sidResolver * @param string $sessionNamespace * @param array $cookieCheckActions */ public function __construct( \Magento\App\ActionFlag $flag, \Magento\Core\Model\Session $session, - \Magento\Core\Model\Cookie $cookie, + \Magento\Stdlib\Cookie $cookie, \Magento\Core\Model\Url $url, \Magento\Core\Model\Store\Config $storeConfig, + \Magento\Session\SidResolverInterface $sidResolver, $sessionNamespace = '', array $cookieCheckActions = array() ) { $this->_session = $session; + $this->_sidResolver = $sidResolver; $this->_cookie = $cookie; $this->_cookieCheckActions = $cookieCheckActions; $this->_url = $url; @@ -100,23 +108,20 @@ class Session && !$request->getParam('nocookie', false); $cookies = $this->_cookie->get(); - /** @var $session \Magento\Core\Model\Session */ - $session = $this->_session->start(); if (empty($cookies)) { - if ($session->getCookieShouldBeReceived()) { - $session->unsCookieShouldBeReceived(); - $session->setSkipSessionIdFlag(true); + if ($this->_session->getCookieShouldBeReceived()) { + $this->_session->unsCookieShouldBeReceived(); if ($this->_storeConfig->getConfig('web/browser_capabilities/cookies')) { $this->_forward($request); return null; } } elseif ($checkCookie) { - if (isset($_GET[$session->getSessionIdQueryParam()]) + if ($request->getQuery($this->_sidResolver->getSessionIdQueryParam($this->_session), false) && $this->_url->getUseSession() && $this->_sessionNamespace != \Magento\Backend\App\AbstractAction::SESSION_NAMESPACE ) { - $session->setCookieShouldBeReceived(true); + $this->_session->setCookieShouldBeReceived(true); } else { $this->_forward($request); return null; diff --git a/app/code/Magento/Core/App/Response/Redirect.php b/app/code/Magento/Core/App/Response/Redirect.php index b1631c6fa3d..ef8f1e54e1c 100644 --- a/app/code/Magento/Core/App/Response/Redirect.php +++ b/app/code/Magento/Core/App/Response/Redirect.php @@ -47,6 +47,11 @@ class Redirect implements \Magento\App\Response\RedirectInterface */ protected $_session; + /** + * @var \Magento\Session\SidResolverInterface + */ + protected $_sidResolver; + /** * @var bool */ @@ -62,6 +67,7 @@ class Redirect implements \Magento\App\Response\RedirectInterface * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Encryption\UrlCoder $urlCoder * @param \Magento\Core\Model\Session\AbstractSession $session + * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Core\Model\Url $urlBuilder * @param bool $canUseSessionIdInParam */ @@ -70,6 +76,7 @@ class Redirect implements \Magento\App\Response\RedirectInterface \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Encryption\UrlCoder $urlCoder, \Magento\Core\Model\Session\AbstractSession $session, + \Magento\Session\SidResolverInterface $sidResolver, \Magento\Core\Model\Url $urlBuilder, $canUseSessionIdInParam = true ) { @@ -78,6 +85,7 @@ class Redirect implements \Magento\App\Response\RedirectInterface $this->_storeManager = $storeManager; $this->_urlCoder = $urlCoder; $this->_session = $session; + $this->_sidResolver = $sidResolver; $this->_urlBuilder = $urlBuilder; } @@ -183,7 +191,7 @@ class Redirect implements \Magento\App\Response\RedirectInterface && $this->_canUseSessionIdInParam ) { $arguments += array('_query' => array( - $this->_session->getSessionIdQueryParam() => $this->_session->getSessionId() + $this->_sidResolver->getSessionIdQueryParam($this->_session) => $this->_session->getSessionId() )); } $response->setRedirect($this->_urlBuilder->getUrl($path, $arguments)); diff --git a/app/code/Magento/Core/App/Router/Base.php b/app/code/Magento/Core/App/Router/Base.php index c95985b0e21..5b87daa0ced 100644 --- a/app/code/Magento/Core/App/Router/Base.php +++ b/app/code/Magento/Core/App/Router/Base.php @@ -184,7 +184,7 @@ class Base extends \Magento\App\Router\AbstractRouter // get module name if ($request->getModuleName()) { $moduleFrontName = $request->getModuleName(); - } else if (!empty($param)) { + } elseif (!empty($param)) { $moduleFrontName = $param; } else { $moduleFrontName = $this->_defaultPath->getPart('module'); @@ -207,7 +207,7 @@ class Base extends \Magento\App\Router\AbstractRouter { if ($request->getControllerName()) { $controller = $request->getControllerName(); - } else if (!empty($param)) { + } elseif (!empty($param)) { $controller = $param; } else { $controller = $this->_defaultPath->getPart('controller'); @@ -230,7 +230,7 @@ class Base extends \Magento\App\Router\AbstractRouter { if ($request->getActionName()) { $action = $request->getActionName(); - } else if (empty($param)) { + } elseif (empty($param)) { $action = $this->_defaultPath->getPart('action'); } else { $action = $param; @@ -333,6 +333,7 @@ class Base extends \Magento\App\Router\AbstractRouter /** * Get router default request path + * * @return string */ protected function _getDefaultPath() @@ -428,9 +429,9 @@ class Base extends \Magento\App\Router\AbstractRouter */ protected function _shouldBeSecure($path) { - return substr($this->_storeConfig->getConfig('web/unsecure/base_url'), 0, 5) === 'https' - || $this->_storeConfig->getConfigFlag('web/secure/use_in_frontend') - && substr($this->_storeConfig->getConfig('web/secure/base_url'), 0, 5) == 'https' + return parse_url($this->_storeConfig->getConfig('web/unsecure/base_url'), PHP_URL_SCHEME) === 'https' + || $this->_storeConfig->getConfigFlag(\Magento\Core\Model\Store::XML_PATH_SECURE_IN_FRONTEND) + && parse_url($this->_storeConfig->getConfig('web/secure/base_url'), PHP_URL_SCHEME) == 'https' && $this->_urlSecurityInfo->isSecure($path); } } diff --git a/app/code/Magento/Core/Block/Formkey.php b/app/code/Magento/Core/Block/Formkey.php index 6e8e8464241..6822c31dab2 100644 --- a/app/code/Magento/Core/Block/Formkey.php +++ b/app/code/Magento/Core/Block/Formkey.php @@ -29,8 +29,27 @@ */ namespace Magento\Core\Block; -class Formkey extends \Magento\View\Block\Template +class Formkey extends \Magento\View\Element\Template { + /** + * @var \Magento\Data\Form\FormKey + */ + protected $formKey; + + /** + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\Data\Form\FormKey $formKey + * @param array $data + */ + public function __construct( + \Magento\View\Element\Template\Context $context, + \Magento\Data\Form\FormKey $formKey, + array $data = array() + ) { + $this->formKey = $formKey; + parent::__construct($context, $data); + } + /** * Get form key * @@ -38,6 +57,6 @@ class Formkey extends \Magento\View\Block\Template */ public function getFormKey() { - return $this->_session->getFormKey(); + return $this->formKey->getFormKey(); } } diff --git a/app/code/Magento/Core/Block/Store/Switcher.php b/app/code/Magento/Core/Block/Store/Switcher.php index c93b913c5c0..e9e815ef31e 100644 --- a/app/code/Magento/Core/Block/Store/Switcher.php +++ b/app/code/Magento/Core/Block/Store/Switcher.php @@ -33,7 +33,7 @@ */ namespace Magento\Core\Block\Store; -class Switcher extends \Magento\View\Block\Template +class Switcher extends \Magento\View\Element\Template { protected $_groups = array(); protected $_stores = array(); @@ -54,22 +54,20 @@ class Switcher extends \Magento\View\Block\Template protected $_storeGroupFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Store\GroupFactory $storeGroupFactory * @param \Magento\Core\Model\StoreFactory $storeFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Store\GroupFactory $storeGroupFactory, \Magento\Core\Model\StoreFactory $storeFactory, array $data = array() ) { $this->_storeGroupFactory = $storeGroupFactory; $this->_storeFactory = $storeFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Page/Block/Switcher.php b/app/code/Magento/Core/Block/Switcher.php similarity index 97% rename from app/code/Magento/Page/Block/Switcher.php rename to app/code/Magento/Core/Block/Switcher.php index 2e638715576..1639b941070 100644 --- a/app/code/Magento/Page/Block/Switcher.php +++ b/app/code/Magento/Core/Block/Switcher.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -31,9 +29,9 @@ * @package Magento_Core * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Page\Block; +namespace Magento\Core\Block; -class Switcher extends \Magento\View\Block\Template +class Switcher extends \Magento\View\Element\Template { protected $_storeInUrl; diff --git a/app/code/Magento/Core/Helper/Cookie.php b/app/code/Magento/Core/Helper/Cookie.php index a90844b660e..f69b6a5f3c0 100644 --- a/app/code/Magento/Core/Helper/Cookie.php +++ b/app/code/Magento/Core/Helper/Cookie.php @@ -24,15 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Core\Helper; + /** * Core Cookie helper - * - * @category Magento - * @package Magento_Core - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Core\Helper; - class Cookie extends \Magento\App\Helper\AbstractHelper { /** @@ -55,11 +51,6 @@ class Cookie extends \Magento\App\Helper\AbstractHelper */ protected $_currentStore; - /** - * @var \Magento\Core\Model\Cookie - */ - protected $_cookieModel; - /** * @var \Magento\Core\Model\Website */ @@ -68,7 +59,6 @@ class Cookie extends \Magento\App\Helper\AbstractHelper /** * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\Cookie $cookie * @param array $data * * @throws \InvalidArgumentException @@ -76,26 +66,18 @@ class Cookie extends \Magento\App\Helper\AbstractHelper public function __construct( \Magento\App\Helper\Context $context, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Cookie $cookie, array $data = array() ) { parent::__construct($context); $this->_currentStore = isset($data['current_store']) ? $data['current_store'] : $storeManager->getStore(); - if (!($this->_currentStore instanceof \Magento\Core\Model\Store)) { + if (!$this->_currentStore instanceof \Magento\Core\Model\Store) { throw new \InvalidArgumentException('Required store object is invalid'); } - $this->_cookieModel = isset($data['cookie_model']) - ? $data['cookie_model'] : $cookie; - - if (false == ($this->_cookieModel instanceof \Magento\Core\Model\Cookie)) { - throw new \InvalidArgumentException('Required cookie object is invalid'); - } - $this->_website = isset($data['website']) ? $data['website'] : $storeManager->getWebsite(); - if (false == ($this->_website instanceof \Magento\Core\Model\Website)) { + if (!$this->_website instanceof \Magento\Core\Model\Website) { throw new \InvalidArgumentException('Required website object is invalid'); } } @@ -109,8 +91,8 @@ class Cookie extends \Magento\App\Helper\AbstractHelper public function isUserNotAllowSaveCookie() { $acceptedSaveCookiesWebsites = $this->_getAcceptedSaveCookiesWebsites(); - return $this->_currentStore->getConfig(self::XML_PATH_COOKIE_RESTRICTION) && - empty($acceptedSaveCookiesWebsites[$this->_website->getId()]); + return $this->_currentStore->getConfig(self::XML_PATH_COOKIE_RESTRICTION) + && empty($acceptedSaveCookiesWebsites[$this->_website->getId()]); } /** @@ -132,7 +114,7 @@ class Cookie extends \Magento\App\Helper\AbstractHelper */ protected function _getAcceptedSaveCookiesWebsites() { - $serializedList = $this->_cookieModel->get(self::IS_USER_ALLOWED_SAVE_COOKIE); + $serializedList = $this->_request->getCookie(self::IS_USER_ALLOWED_SAVE_COOKIE, false); $unSerializedList = json_decode($serializedList, true); return is_array($unSerializedList) ? $unSerializedList : array(); } @@ -144,6 +126,6 @@ class Cookie extends \Magento\App\Helper\AbstractHelper */ public function getCookieRestrictionLifetime() { - return (int)$this->_currentStore->getConfig(self::XML_PATH_COOKIE_RESTRICTION_LIFETIME); + return (int) $this->_currentStore->getConfig(self::XML_PATH_COOKIE_RESTRICTION_LIFETIME); } } diff --git a/app/code/Magento/Core/Helper/File/Storage.php b/app/code/Magento/Core/Helper/File/Storage.php index d82ae7ad8d2..0c457537075 100644 --- a/app/code/Magento/Core/Helper/File/Storage.php +++ b/app/code/Magento/Core/Helper/File/Storage.php @@ -76,15 +76,15 @@ class Storage extends \Magento\App\Helper\AbstractHelper protected $config; /** - * @param Storage\Database $coreFileStorageDb * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Model\File\Storage $storage * @param \Magento\Core\Model\File\Storage\File $filesystemStorage * @param \Magento\Core\Model\ConfigInterface $config */ public function __construct( - \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\App\Helper\Context $context, + \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Model\File\Storage $storage, \Magento\Core\Model\File\Storage\File $filesystemStorage, \Magento\Core\Model\ConfigInterface $config diff --git a/app/code/Magento/Core/Helper/Js.php b/app/code/Magento/Core/Helper/Js.php index 4823d32a1c6..0c7af2a7ba6 100644 --- a/app/code/Magento/Core/Helper/Js.php +++ b/app/code/Magento/Core/Helper/Js.php @@ -51,13 +51,13 @@ class Js extends \Magento\App\Helper\AbstractHelper protected $_coreData = null; /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\View\Url $viewUrl */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\App\Helper\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\View\Url $viewUrl ) { $this->_coreData = $coreData; @@ -196,6 +196,8 @@ class Js extends \Magento\App\Helper\AbstractHelper $this->_addTranslation('Please enter a valid year (1900-%d).', __('Please enter a valid year (1900-%d).')); $this->_addTranslation('Please enter a valid full date', __('Please enter a valid full date')); //various files + $this->_addTranslation('Allow', __('Allow')); + $this->_addTranslation('Activate', __('Activate')); $this->_addTranslation('Cancel', __('Cancel')); $this->_addTranslation('Save', __('Save')); $this->_addTranslation('File extension not known or unsupported type.', __('File extension not known or unsupported type.')); diff --git a/app/code/Magento/Core/Helper/Theme.php b/app/code/Magento/Core/Helper/Theme.php index e139baf16bd..f3d3306ba44 100644 --- a/app/code/Magento/Core/Helper/Theme.php +++ b/app/code/Magento/Core/Helper/Theme.php @@ -98,14 +98,14 @@ class Theme extends \Magento\App\Helper\AbstractHelper /** * XPath selector to get CSS files from layout added for HEAD block directly */ - $xpathSelectorBlocks = '//block[@class="Magento\Page\Block\Html\Head"]' - . '/block[@class="Magento\Page\Block\Html\Head\Css"]/arguments/argument[@name="file"]'; + $xpathSelectorBlocks = '//block[@class="Magento\Theme\Block\Html\Head"]' + . '/block[@class="Magento\Theme\Block\Html\Head\Css"]/arguments/argument[@name="file"]'; /** * XPath selector to get CSS files from layout added for HEAD block using reference */ $xpathSelectorRefs = '//referenceBlock[@name="head"]' - . '/block[@class="Magento\Page\Block\Html\Head\Css"]/arguments/argument[@name="file"]'; + . '/block[@class="Magento\Theme\Block\Html\Head\Css"]/arguments/argument[@name="file"]'; $elements = array_merge( $layoutElement->xpath($xpathSelectorBlocks) ?: array(), diff --git a/app/code/Magento/Core/Model/App.php b/app/code/Magento/Core/Model/App.php index 2249f819179..bb96568d463 100644 --- a/app/code/Magento/Core/Model/App.php +++ b/app/code/Magento/Core/Model/App.php @@ -53,7 +53,7 @@ class App implements \Magento\Core\Model\AppInterface /** * Magento version */ - const VERSION = '2.0.0.0-dev54'; + const VERSION = '2.0.0.0-dev55'; /** @@ -233,11 +233,11 @@ class App implements \Magento\Core\Model\AppInterface /** * Retrieve cookie object * - * @return \Magento\Core\Model\Cookie + * @return \Magento\Stdlib\Cookie */ public function getCookie() { - return $this->_objectManager->get('Magento\Core\Model\Cookie'); + return $this->_objectManager->get('Magento\Stdlib\Cookie'); } /** @@ -801,7 +801,7 @@ class App implements \Magento\Core\Model\AppInterface 'revision' => '0', 'patch' => '0', 'stability' => 'dev', - 'number' => '54', + 'number' => '55', ); } } diff --git a/app/code/Magento/Core/Model/AppInterface.php b/app/code/Magento/Core/Model/AppInterface.php index f786cdadd97..d7c9b2552c5 100644 --- a/app/code/Magento/Core/Model/AppInterface.php +++ b/app/code/Magento/Core/Model/AppInterface.php @@ -59,7 +59,7 @@ interface AppInterface extends \Magento\Core\Model\StoreManagerInterface /** * Retrieve cookie object * - * @return \Magento\Core\Model\Cookie + * @return \Magento\Stdlib\Cookie */ public function getCookie(); diff --git a/app/code/Magento/Core/Model/Asset/Config.php b/app/code/Magento/Core/Model/Asset/Config.php new file mode 100644 index 00000000000..aebbd4ca9cd --- /dev/null +++ b/app/code/Magento/Core/Model/Asset/Config.php @@ -0,0 +1,108 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Core\Model\Asset; + +/** + * View asset configuration interface + */ +class Config implements \Magento\View\Asset\ConfigInterface +{ + /** + * XML path for CSS files merge configuration + */ + const XML_PATH_MERGE_CSS_FILES = 'dev/css/merge_css_files'; + + /** + * XML path for JavaScript files merge configuration + */ + const XML_PATH_MERGE_JS_FILES = 'dev/js/merge_files'; + + /** + * XML path for asset minification configuration + */ + const XML_PATH_MINIFICATION_ENABLED = 'dev/%s/minify_files'; + + /** + * XML path for asset minification adapter configuration + */ + const XML_PATH_MINIFICATION_ADAPTER = 'dev/%s/minify_adapter'; + + /** + * @var \Magento\Core\Model\Config + */ + protected $storeConfig; + + /** + * @param \Magento\Core\Model\Store\ConfigInterface $storeConfig + */ + public function __construct(\Magento\Core\Model\Store\ConfigInterface $storeConfig) + { + $this->storeConfig = $storeConfig; + } + + /** + * Check whether merging of CSS files is on + * + * @return bool + */ + public function isMergeCssFiles() + { + return (bool)$this->storeConfig->getConfigFlag(self::XML_PATH_MERGE_CSS_FILES); + } + + /** + * Check whether merging of JavScript files is on + * + * @return bool + */ + public function isMergeJsFiles() + { + return (bool)$this->storeConfig->getConfigFlag(self::XML_PATH_MERGE_JS_FILES); + } + + /** + * Check whether asset minification is on for specified content type + * + * @param string $contentType + * @return bool + */ + public function isAssetMinification($contentType) + { + return (bool)$this->storeConfig->getConfigFlag(sprintf(self::XML_PATH_MINIFICATION_ENABLED, $contentType)); + } + + /** + * Get asset minification adapter for specified content type + * + * @param string $contentType + * @return string + */ + public function getAssetMinificationAdapter($contentType) + { + return (string)$this->storeConfig->getConfig(sprintf(self::XML_PATH_MINIFICATION_ADAPTER, $contentType)); + } +} diff --git a/app/code/Magento/Core/Model/Asset/Plugin/CleanMergedJsCss.php b/app/code/Magento/Core/Model/Asset/Plugin/CleanMergedJsCss.php new file mode 100644 index 00000000000..aef7bd92e3b --- /dev/null +++ b/app/code/Magento/Core/Model/Asset/Plugin/CleanMergedJsCss.php @@ -0,0 +1,65 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Core\Model\Asset\Plugin; + +class CleanMergedJsCss +{ + /** + * @var \Magento\Core\Helper\File\Storage\Database + */ + protected $database; + + /** + * @var \Magento\App\Dir + */ + protected $dirs; + + /** + * @param \Magento\Core\Helper\File\Storage\Database $database + * @param \Magento\App\Dir $dirs + */ + public function __construct( + \Magento\Core\Helper\File\Storage\Database $database, + \Magento\App\Dir $dirs + ) { + $this->database = $database; + $this->dirs = $dirs; + } + + /** + * Clean files in database on cleaning merged assets + * + * @param array $arguments + * @param \Magento\Code\Plugin\InvocationChain $invocationChain + */ + public function aroundCleanMergedJsCss(array $arguments, \Magento\Code\Plugin\InvocationChain $invocationChain) + { + $invocationChain->proceed($arguments); + + $mergedDir = $this->dirs->getDir(\Magento\App\Dir::PUB_VIEW_CACHE) + . '/' . \Magento\View\Asset\Merged::PUBLIC_MERGE_DIR; + $this->database->deleteFolder($mergedDir); + } +} diff --git a/app/code/Magento/Core/Model/Cookie.php b/app/code/Magento/Core/Model/Cookie.php deleted file mode 100644 index ed1271fbaba..00000000000 --- a/app/code/Magento/Core/Model/Cookie.php +++ /dev/null @@ -1,349 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Core - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - - -/** - * Core cookie model - * - * @category Magento - * @package Magento_Core - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Core\Model; - -class Cookie -{ - const XML_PATH_COOKIE_DOMAIN = 'web/cookie/cookie_domain'; - const XML_PATH_COOKIE_PATH = 'web/cookie/cookie_path'; - const XML_PATH_COOKIE_LIFETIME = 'web/cookie/cookie_lifetime'; - const XML_PATH_COOKIE_HTTPONLY = 'web/cookie/cookie_httponly'; - - protected $_lifetime; - - /** - * Store object - * - * @var \Magento\Core\Model\Store - */ - protected $_store; - - /** - * @var \Magento\Core\Model\StoreManagerInterface - */ - protected $_storeManager; - - /** - * @var \Magento\App\RequestInterface - */ - protected $_httpRequest; - - /** - * @var \Magento\App\ResponseInterface - */ - protected $_httpResponse; - - /** - * Core store config - * - * @var \Magento\Core\Model\Store\Config - */ - protected $_coreStoreConfig; - - /** - * @param \Magento\App\RequestInterface $request - * @param \Magento\App\ResponseInterface $response - * @param Store\Config $coreStoreConfig - * @param StoreManager $storeManager - */ - public function __construct( - \Magento\App\RequestInterface $request, - \Magento\App\ResponseInterface $response, - \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\StoreManagerInterface $storeManager - ) { - $this->_httpRequest = $request; - $this->_httpResponse = $response; - $this->_coreStoreConfig = $coreStoreConfig; - $this->_storeManager = $storeManager; - } - - /** - * Set Store object - * - * @param mixed $store - * @return \Magento\Core\Model\Cookie - */ - public function setStore($store) - { - $this->_store = $this->_storeManager->getStore($store); - return $this; - } - - /** - * Retrieve Store object - * - * @return \Magento\Core\Model\Store - */ - public function getStore() - { - if (is_null($this->_store)) { - $this->_store = $this->_storeManager->getStore(); - } - return $this->_store; - } - - /** - * Retrieve Request object - * - * @return \Magento\App\RequestInterface - */ - protected function _getRequest() - { - return $this->_httpRequest; - } - - /** - * Retrieve Response object - * - * @return \Magento\App\ResponseInterface - */ - protected function _getResponse() - { - return $this->_httpResponse; - } - - /** - * Retrieve Domain for cookie - * - * @return string - */ - public function getDomain() - { - $domain = $this->getConfigDomain(); - if (empty($domain)) { - $domain = $this->_getRequest()->getHttpHost(); - } - return $domain; - } - - /** - * Retrieve Config Domain for cookie - * - * @return string - */ - public function getConfigDomain() - { - return (string)$this->_coreStoreConfig->getConfig(self::XML_PATH_COOKIE_DOMAIN, $this->getStore()); - } - - /** - * Retrieve Path for cookie - * - * @return string - */ - public function getPath() - { - $path = $this->_coreStoreConfig->getConfig(self::XML_PATH_COOKIE_PATH, $this->getStore()); - if (empty($path)) { - $path = $this->_getRequest()->getBasePath(); - } - return $path; - } - - /** - * Retrieve cookie lifetime - * - * @return int - */ - public function getLifetime() - { - if (!is_null($this->_lifetime)) { - $lifetime = $this->_lifetime; - } else { - $lifetime = $this->_coreStoreConfig->getConfig(self::XML_PATH_COOKIE_LIFETIME, $this->getStore()); - } - if (!is_numeric($lifetime)) { - $lifetime = 3600; - } - return $lifetime; - } - - /** - * Set cookie lifetime - * - * @param int $lifetime - * @return \Magento\Core\Model\Cookie - */ - public function setLifetime($lifetime) - { - $this->_lifetime = (int)$lifetime; - return $this; - } - - /** - * Retrieve use HTTP only flag - * - * @return bool - */ - public function getHttponly() - { - $httponly = $this->_coreStoreConfig->getConfig(self::XML_PATH_COOKIE_HTTPONLY, $this->getStore()); - if (is_null($httponly)) { - return null; - } - return (bool)$httponly; - } - - /** - * Is https secure request - * - * @return bool - */ - public function isSecure() - { - return false; - } - - /** - * Set cookie - * - * @param string $name The cookie name - * @param string $value The cookie value - * @param int $period Lifetime period - * @param string $path - * @param string $domain - * @param int|bool $secure - * @param bool $httponly - * @return \Magento\Core\Model\Cookie - */ - public function set($name, $value, $period = null, $path = null, $domain = null, $secure = null, $httponly = null) - { - /** - * Check headers sent - */ - if (!$this->_getResponse()->canSendHeaders(false)) { - return $this; - } - - if ($period === true) { - $period = 3600 * 24 * 365; - } elseif (is_null($period)) { - $period = $this->getLifetime(); - } - - if ($period == 0) { - $expire = 0; - } - else { - $expire = time() + $period; - } - if (is_null($path)) { - $path = $this->getPath(); - } - if (is_null($domain)) { - $domain = $this->getDomain(); - } - if (is_null($secure)) { - $secure = $this->isSecure(); - } - if (is_null($httponly)) { - $httponly = $this->getHttponly(); - } - - setcookie($name, $value, $expire, $path, $domain, $secure, $httponly); - - return $this; - } - - /** - * Postpone cookie expiration time if cookie value defined - * - * @param string $name The cookie name - * @param int $period Lifetime period - * @param string $path - * @param string $domain - * @param int|bool $secure - * @return \Magento\Core\Model\Cookie - */ - public function renew($name, $period = null, $path = null, $domain = null, $secure = null, $httponly = null) - { - if (($period === null) && !$this->getLifetime()) { - return $this; - } - $value = $this->_getRequest()->getCookie($name, false); - if ($value !== false) { - $this->set($name, $value, $period, $path, $domain, $secure, $httponly); - } - return $this; - } - - /** - * Retrieve cookie or false if not exists - * - * @param string $name The cookie name - * @return mixed - */ - public function get($name = null) - { - return $this->_getRequest()->getCookie($name, false); - } - - /** - * Delete cookie - * - * @param string $name - * @param string $path - * @param string $domain - * @param int|bool $secure - * @param int|bool $httponly - * @return \Magento\Core\Model\Cookie - */ - public function delete($name, $path = null, $domain = null, $secure = null, $httponly = null) - { - /** - * Check headers sent - */ - if (!$this->_getResponse()->canSendHeaders(false)) { - return $this; - } - - if (is_null($path)) { - $path = $this->getPath(); - } - if (is_null($domain)) { - $domain = $this->getDomain(); - } - if (is_null($secure)) { - $secure = $this->isSecure(); - } - if (is_null($httponly)) { - $httponly = $this->getHttponly(); - } - - setcookie($name, null, null, $path, $domain, $secure, $httponly); - return $this; - } -} diff --git a/app/code/Magento/Core/Model/Design/Backend/Exceptions.php b/app/code/Magento/Core/Model/Design/Backend/Exceptions.php index 992e8176e17..ca2b5808400 100644 --- a/app/code/Magento/Core/Model/Design/Backend/Exceptions.php +++ b/app/code/Magento/Core/Model/Design/Backend/Exceptions.php @@ -36,21 +36,21 @@ class Exceptions extends \Magento\Backend\Model\Config\Backend\Serialized\ArrayS protected $_design = null; /** - * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\View\DesignInterface $design, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\View\DesignInterface $design, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Core/Model/Design/Backend/Theme.php b/app/code/Magento/Core/Model/Design/Backend/Theme.php index 9882c87a439..f54fc16ca5a 100644 --- a/app/code/Magento/Core/Model/Design/Backend/Theme.php +++ b/app/code/Magento/Core/Model/Design/Backend/Theme.php @@ -36,21 +36,21 @@ class Theme extends \Magento\Core\Model\Config\Value protected $_design = null; /** - * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\View\DesignInterface $design, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\View\DesignInterface $design, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Core/Model/File/Storage.php b/app/code/Magento/Core/Model/File/Storage.php index a7ce7e97cb0..3b076dcaa2a 100644 --- a/app/code/Magento/Core/Model/File/Storage.php +++ b/app/code/Magento/Core/Model/File/Storage.php @@ -97,9 +97,9 @@ class Storage extends \Magento\Core\Model\AbstractModel protected $_dir; /** - * @param \Magento\Core\Helper\File\Storage $coreFileStorage * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Helper\File\Storage $coreFileStorage * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Config $coreConfig * @param \Magento\Core\Model\File\Storage\Flag $fileFlag @@ -111,9 +111,9 @@ class Storage extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Helper\File\Storage $coreFileStorage, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Helper\File\Storage $coreFileStorage, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Config $coreConfig, \Magento\Core\Model\File\Storage\Flag $fileFlag, diff --git a/app/code/Magento/Core/Model/File/Storage/Database.php b/app/code/Magento/Core/Model/File/Storage/Database.php index 15a50465b38..096d8fcf881 100644 --- a/app/code/Magento/Core/Model/File/Storage/Database.php +++ b/app/code/Magento/Core/Model/File/Storage/Database.php @@ -63,27 +63,25 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas protected $_mediaHelper; /** - * Class constructor - * - * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb - * @param \Magento\Core\Helper\File\Media $mediaHelper * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Model\Date $dateModel * @param \Magento\Core\Model\App $app + * @param \Magento\Core\Helper\File\Media $mediaHelper * @param \Magento\Core\Model\Resource\File\Storage\Database $resource - * @param Directory\DatabaseFactory $directoryFactory + * @param \Magento\Core\Model\File\Storage\Directory\DatabaseFactory $directoryFactory * @param \Magento\Data\Collection\Db $resourceCollection * @param string|null $connectionName * @param array $data */ public function __construct( - \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, - \Magento\Core\Helper\File\Media $mediaHelper, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Model\Date $dateModel, \Magento\Core\Model\App $app, + \Magento\Core\Helper\File\Media $mediaHelper, \Magento\Core\Model\Resource\File\Storage\Database $resource, \Magento\Core\Model\File\Storage\Directory\DatabaseFactory $directoryFactory, \Magento\Data\Collection\Db $resourceCollection = null, @@ -93,9 +91,9 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas $this->_directoryFactory = $directoryFactory; $this->_mediaHelper = $mediaHelper; parent::__construct( - $coreFileStorageDb, $context, $registry, + $coreFileStorageDb, $dateModel, $app, $resource, diff --git a/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php b/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php index bf6e7dc21f9..cbe28f3b31d 100644 --- a/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php +++ b/app/code/Magento/Core/Model/File/Storage/Database/AbstractDatabase.php @@ -58,11 +58,9 @@ abstract class AbstractDatabase extends \Magento\Core\Model\AbstractModel protected $_app; /** - * Class constructor - * - * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Model\Date $dateModel * @param \Magento\Core\Model\App $app * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -71,9 +69,9 @@ abstract class AbstractDatabase extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Model\Date $dateModel, \Magento\Core\Model\App $app, \Magento\Core\Model\Resource\AbstractResource $resource = null, @@ -81,7 +79,7 @@ abstract class AbstractDatabase extends \Magento\Core\Model\AbstractModel $connectionName = null, array $data = array() ) { - parent::__construct($context, $registry, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->_app = $app; $this->_coreFileStorageDb = $coreFileStorageDb; $this->_date = $dateModel; diff --git a/app/code/Magento/Core/Model/File/Storage/Directory/Database.php b/app/code/Magento/Core/Model/File/Storage/Directory/Database.php index 8da9f986e50..7cdc54dc674 100644 --- a/app/code/Magento/Core/Model/File/Storage/Directory/Database.php +++ b/app/code/Magento/Core/Model/File/Storage/Directory/Database.php @@ -51,11 +51,9 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas protected $_directoryFactory; /** - * Class constructor - * - * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb * @param \Magento\Core\Model\Date $dateModel * @param \Magento\Core\Model\App $app * @param \Magento\Core\Model\File\Storage\Directory\DatabaseFactory $directoryFactory @@ -65,9 +63,9 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas * @param array $data */ public function __construct( - \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, \Magento\Core\Model\Date $dateModel, \Magento\Core\Model\App $app, \Magento\Core\Model\File\Storage\Directory\DatabaseFactory $directoryFactory, @@ -78,9 +76,9 @@ class Database extends \Magento\Core\Model\File\Storage\Database\AbstractDatabas ) { $this->_directoryFactory = $directoryFactory; parent::__construct( - $coreFileStorageDb, $context, $registry, + $coreFileStorageDb, $dateModel, $app, $resource, diff --git a/app/code/Magento/Core/Model/Layout.php b/app/code/Magento/Core/Model/Layout.php index 9afb7c7a3b3..5f06c0c3db6 100644 --- a/app/code/Magento/Core/Model/Layout.php +++ b/app/code/Magento/Core/Model/Layout.php @@ -34,6 +34,7 @@ namespace Magento\Core\Model; use Magento\View\Element\BlockFactory; +use Magento\View\Layout\Element; /** * @SuppressWarnings(PHPMD.ExcessiveClassComplexity) @@ -45,29 +46,6 @@ use Magento\View\Element\BlockFactory; */ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutInterface { - /**#@+ - * Supported layout directives - */ - const TYPE_BLOCK = 'block'; - const TYPE_CONTAINER = 'container'; - const TYPE_ACTION = 'action'; - const TYPE_ARGUMENTS = 'arguments'; - const TYPE_ARGUMENT = 'argument'; - const TYPE_REFERENCE_BLOCK = 'referenceBlock'; - const TYPE_REFERENCE_CONTAINER = 'referenceContainer'; - const TYPE_REMOVE = 'remove'; - const TYPE_MOVE = 'move'; - /**#@-*/ - - /**#@+ - * Names of container options in layout - */ - const CONTAINER_OPT_HTML_TAG = 'htmlTag'; - const CONTAINER_OPT_HTML_CLASS = 'htmlClass'; - const CONTAINER_OPT_HTML_ID = 'htmlId'; - const CONTAINER_OPT_LABEL = 'label'; - /**#@-*/ - /** * Scheduled structure array index for name */ @@ -432,10 +410,10 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn if (isset($node['output'])) { $this->addOutputElement($elementName); } - if ($type == self::TYPE_BLOCK) { + if ($type == Element::TYPE_BLOCK) { $this->_generateBlock($elementName); } else { - $this->_generateContainer($elementName, (string)$node[self::CONTAINER_OPT_LABEL], $attributes); + $this->_generateContainer($elementName, (string)$node[Element::CONTAINER_OPT_LABEL], $attributes); $this->_scheduledStructure->unsetElement($elementName); } } @@ -494,35 +472,35 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn foreach ($parent as $node) { /** @var $node \Magento\View\Layout\Element */ switch ($node->getName()) { - case self::TYPE_CONTAINER: + case Element::TYPE_CONTAINER: $this->_scheduleStructure($node, $parent); $this->_mergeContainerAttributes($node); $this->_readStructure($node); break; - case self::TYPE_BLOCK: + case Element::TYPE_BLOCK: $this->_initServiceCalls($node); $this->_scheduleStructure($node, $parent); $this->_readStructure($node); break; - case self::TYPE_REFERENCE_CONTAINER: + case Element::TYPE_REFERENCE_CONTAINER: $this->_mergeContainerAttributes($node); $this->_readStructure($node); break; - case self::TYPE_REFERENCE_BLOCK: + case Element::TYPE_REFERENCE_BLOCK: $this->_readStructure($node); break; - case self::TYPE_ACTION: + case Element::TYPE_ACTION: $referenceName = $parent->getAttribute('name'); $element = $this->_scheduledStructure->getStructureElement($referenceName, array()); $element['actions'][] = array($node, $parent); $this->_scheduledStructure->setStructureElement($referenceName, $element); break; - case self::TYPE_ARGUMENTS: + case Element::TYPE_ARGUMENTS: $referenceName = $parent->getAttribute('name'); $element = $this->_scheduledStructure->getStructureElement($referenceName, array()); $args = $this->_parseArguments($node); @@ -531,11 +509,11 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn $this->_scheduledStructure->setStructureElement($referenceName, $element); break; - case self::TYPE_MOVE: + case Element::TYPE_MOVE: $this->_scheduleMove($node); break; - case self::TYPE_REMOVE: + case Element::TYPE_REMOVE: $this->_scheduledStructure->setElementToRemoveList((string)$node->getAttribute('name')); break; @@ -590,10 +568,10 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn } } else { $element['attributes'] = array( - self::CONTAINER_OPT_HTML_TAG => (string)$node[self::CONTAINER_OPT_HTML_TAG], - self::CONTAINER_OPT_HTML_ID => (string)$node[self::CONTAINER_OPT_HTML_ID], - self::CONTAINER_OPT_HTML_CLASS => (string)$node[self::CONTAINER_OPT_HTML_CLASS], - self::CONTAINER_OPT_LABEL => (string)$node[self::CONTAINER_OPT_LABEL], + Element::CONTAINER_OPT_HTML_TAG => (string)$node[Element::CONTAINER_OPT_HTML_TAG], + Element::CONTAINER_OPT_HTML_ID => (string)$node[Element::CONTAINER_OPT_HTML_ID], + Element::CONTAINER_OPT_HTML_CLASS => (string)$node[Element::CONTAINER_OPT_HTML_CLASS], + Element::CONTAINER_OPT_LABEL => (string)$node[Element::CONTAINER_OPT_LABEL], ); } $this->_scheduledStructure->setStructureElement($containerName, $element); @@ -876,13 +854,13 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn * Creates block object based on xml node data and add it to the layout * * @param string $elementName - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock * @throws \Magento\Exception */ protected function _generateBlock($elementName) { list($type, $node, $actions, $args) = $this->_scheduledStructure->getElement($elementName); - if ($type !== self::TYPE_BLOCK) { + if ($type !== Element::TYPE_BLOCK) { throw new \Magento\Exception("Unexpected element type specified for generating block: {$type}."); } @@ -909,7 +887,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn if (!empty($node['template'])) { $templateFileName = (string)$node['template']; - if ($block instanceof \Magento\View\Block\Template) { + if ($block instanceof \Magento\View\Element\Template) { $block->assign($dictionary); } $block->setTemplate($templateFileName); @@ -941,21 +919,21 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn */ protected function _generateContainer($name, $label = '', array $options) { - $this->_structure->setAttribute($name, self::CONTAINER_OPT_LABEL, $label); - unset($options[self::CONTAINER_OPT_LABEL]); + $this->_structure->setAttribute($name, Element::CONTAINER_OPT_LABEL, $label); + unset($options[Element::CONTAINER_OPT_LABEL]); unset($options['type']); $allowedTags = array( 'dd', 'div', 'dl', 'fieldset', 'header', 'footer', 'hgroup', 'ol', 'p', 'section','table', 'tfoot', 'ul' ); - if (!empty($options[self::CONTAINER_OPT_HTML_TAG]) - && !in_array($options[self::CONTAINER_OPT_HTML_TAG], $allowedTags) + if (!empty($options[Element::CONTAINER_OPT_HTML_TAG]) + && !in_array($options[Element::CONTAINER_OPT_HTML_TAG], $allowedTags) ) { throw new \Magento\Exception( __('Html tag "%1" is forbidden for usage in containers. Consider to use one of the allowed: %2.', - $options[self::CONTAINER_OPT_HTML_TAG], implode(', ', $allowedTags))); + $options[Element::CONTAINER_OPT_HTML_TAG], implode(', ', $allowedTags))); } - if (empty($options[self::CONTAINER_OPT_HTML_TAG]) - && (!empty($options[self::CONTAINER_OPT_HTML_ID]) || !empty($options[self::CONTAINER_OPT_HTML_CLASS])) + if (empty($options[Element::CONTAINER_OPT_HTML_TAG]) + && (!empty($options[Element::CONTAINER_OPT_HTML_ID]) || !empty($options[Element::CONTAINER_OPT_HTML_CLASS])) ) { throw new \Magento\Exception('HTML ID or class will not have effect, if HTML tag is not specified.'); } @@ -1001,7 +979,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn * * @param string $parentName * @param string $alias - * @return bool|\Magento\View\Block\AbstractBlock + * @return bool|\Magento\View\Element\AbstractBlock */ public function getChildBlock($parentName, $alias) { @@ -1192,21 +1170,21 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn foreach ($children as $child) { $html .= $this->renderElement($child); } - if ($html == '' || !$this->_structure->getAttribute($name, self::CONTAINER_OPT_HTML_TAG)) { + if ($html == '' || !$this->_structure->getAttribute($name, Element::CONTAINER_OPT_HTML_TAG)) { return $html; } - $htmlId = $this->_structure->getAttribute($name, self::CONTAINER_OPT_HTML_ID); + $htmlId = $this->_structure->getAttribute($name, Element::CONTAINER_OPT_HTML_ID); if ($htmlId) { $htmlId = ' id="' . $htmlId . '"'; } - $htmlClass = $this->_structure->getAttribute($name, self::CONTAINER_OPT_HTML_CLASS); + $htmlClass = $this->_structure->getAttribute($name, Element::CONTAINER_OPT_HTML_CLASS); if ($htmlClass) { $htmlClass = ' class="'. $htmlClass . '"'; } - $htmlTag = $this->_structure->getAttribute($name, self::CONTAINER_OPT_HTML_TAG); + $htmlTag = $this->_structure->getAttribute($name, Element::CONTAINER_OPT_HTML_TAG); $html = sprintf('<%1$s%2$s%3$s>%4$s</%1$s>', $htmlTag, $htmlId, $htmlClass, $html); @@ -1269,7 +1247,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn public function isBlock($name) { if ($this->_structure->hasElement($name)) { - return self::TYPE_BLOCK === $this->_structure->getAttribute($name, 'type'); + return Element::TYPE_BLOCK === $this->_structure->getAttribute($name, 'type'); } return false; } @@ -1283,7 +1261,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn public function isContainer($name) { if ($this->_structure->hasElement($name)) { - return self::TYPE_CONTAINER === $this->_structure->getAttribute($name, 'type'); + return Element::TYPE_CONTAINER === $this->_structure->getAttribute($name, 'type'); } return false; } @@ -1304,7 +1282,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn * Save block in blocks registry * * @param string $name - * @param \Magento\View\Block\AbstractBlock $block + * @param \Magento\View\Element\AbstractBlock $block * @return \Magento\Core\Model\Layout */ public function setBlock($name, $block) @@ -1336,11 +1314,11 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn * @param string $type * @param string $name * @param array $attributes - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function createBlock($type, $name = '', array $attributes = array()) { - $name = $this->_createStructuralElement($name, self::TYPE_BLOCK, $type); + $name = $this->_createStructuralElement($name, Element::TYPE_BLOCK, $type); $block = $this->_createBlock($type, $name, $attributes); return $block; } @@ -1348,10 +1326,10 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn /** * Create block and add to layout * - * @param string|\Magento\View\Block\AbstractBlock $block + * @param string|\Magento\View\Element\AbstractBlock $block * @param string $name * @param array $attributes - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _createBlock($block, $name, array $attributes = array()) { @@ -1370,20 +1348,20 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn /** * Add a block to registry, create new object if needed * - * @param string|\Magento\View\Block\AbstractBlock $block + * @param string|\Magento\View\Element\AbstractBlock $block * @param string $name * @param string $parent * @param string $alias - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function addBlock($block, $name = '', $parent = '', $alias = '') { - if (empty($name) && $block instanceof \Magento\View\Block\AbstractBlock) { + if (empty($name) && $block instanceof \Magento\View\Element\AbstractBlock) { $name = $block->getNameInLayout(); } $name = $this->_createStructuralElement( $name, - self::TYPE_BLOCK, + Element::TYPE_BLOCK, $name ?: (is_object($block) ? get_class($block) : $block) ); if ($parent) { @@ -1403,7 +1381,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn */ public function addContainer($name, $label, array $options = array(), $parent = '', $alias = '') { - $name = $this->_createStructuralElement($name, self::TYPE_CONTAINER, $alias); + $name = $this->_createStructuralElement($name, Element::TYPE_CONTAINER, $alias); $this->_generateContainer($name, $label, $options); if ($parent) { $this->_structure->setAsChild($name, $parent, $alias); @@ -1433,10 +1411,10 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn /** * Create block object instance based on block type * - * @param string|\Magento\View\Block\AbstractBlock $block + * @param string|\Magento\View\Element\AbstractBlock $block * @param array $attributes * @throws \Magento\Core\Exception - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _getBlockInstance($block, array $attributes = array()) { @@ -1445,7 +1423,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn $block = $this->_blockFactory->createBlock($block, $attributes); } } - if (!$block instanceof \Magento\View\Block\AbstractBlock) { + if (!$block instanceof \Magento\View\Element\AbstractBlock) { throw new \Magento\Core\Exception(__('Invalid block type: %1', $block)); } return $block; @@ -1466,7 +1444,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn * Get block object by name * * @param string $name - * @return \Magento\View\Block\AbstractBlock|bool + * @return \Magento\View\Element\AbstractBlock|bool */ public function getBlock($name) { @@ -1546,7 +1524,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn /** * Retrieve messages block * - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ public function getMessagesBlock() { @@ -1554,7 +1532,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn if ($block) { return $block; } - return $this->createBlock('Magento\View\Block\Messages', 'messages'); + return $this->createBlock('Magento\View\Element\Messages', 'messages'); } /** @@ -1573,7 +1551,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn $helper = $this->_blockFactory->createBlock($type); if ($helper) { - if ($helper instanceof \Magento\View\Block\AbstractBlock) { + if ($helper instanceof \Magento\View\Element\AbstractBlock) { $helper->setLayout($this); } $this->_helpers[$type] = $helper; @@ -1653,7 +1631,7 @@ class Layout extends \Magento\Simplexml\Config implements \Magento\View\LayoutIn if (!empty($options['dataServiceName'])) { $dictionary = $this->_dataServiceGraph->get($options['dataServiceName']); } - /** @var $block \Magento\View\Block\Template */ + /** @var $block \Magento\View\Element\Template */ $block = $this->createBlock($options['type'], '') ->setData($data) ->assign($dictionary) diff --git a/app/code/Magento/Core/Model/Layout/PageType/Config.php b/app/code/Magento/Core/Model/Layout/PageType/Config.php index 46a662136ff..8f12c1ffe85 100644 --- a/app/code/Magento/Core/Model/Layout/PageType/Config.php +++ b/app/code/Magento/Core/Model/Layout/PageType/Config.php @@ -20,8 +20,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ diff --git a/app/code/Magento/Core/Model/Observer.php b/app/code/Magento/Core/Model/Observer.php index e7e23ab3da2..c196d1d923d 100644 --- a/app/code/Magento/Core/Model/Observer.php +++ b/app/code/Magento/Core/Model/Observer.php @@ -44,7 +44,7 @@ class Observer private $_currentTheme; /** - * @var \Magento\Core\Model\Page\Asset\Collection + * @var \Magento\View\Asset\GroupedCollection */ private $_pageAssets; @@ -54,7 +54,7 @@ class Observer protected $_config; /** - * @var \Magento\Core\Model\Page\Asset\PublicFileFactory + * @var \Magento\View\Asset\PublicFileFactory */ protected $_assetFileFactory; @@ -71,24 +71,24 @@ class Observer /** * @param \Magento\App\Cache\Frontend\Pool $cacheFrontendPool * @param \Magento\View\DesignInterface $design - * @param \Magento\Core\Model\Page $page + * @param \Magento\View\Asset\GroupedCollection $assets * @param \Magento\Core\Model\ConfigInterface $config - * @param \Magento\Core\Model\Page\Asset\PublicFileFactory $assetFileFactory + * @param \Magento\View\Asset\PublicFileFactory $assetFileFactory * @param \Magento\Core\Model\Theme\Registration $registration * @param \Magento\Logger $logger */ public function __construct( \Magento\App\Cache\Frontend\Pool $cacheFrontendPool, \Magento\View\DesignInterface $design, - \Magento\Core\Model\Page $page, + \Magento\View\Asset\GroupedCollection $assets, \Magento\Core\Model\ConfigInterface $config, - \Magento\Core\Model\Page\Asset\PublicFileFactory $assetFileFactory, + \Magento\View\Asset\PublicFileFactory $assetFileFactory, \Magento\Core\Model\Theme\Registration $registration, \Magento\Logger $logger ) { $this->_cacheFrontendPool = $cacheFrontendPool; $this->_currentTheme = $design->getDesignTheme(); - $this->_pageAssets = $page->getAssets(); + $this->_pageAssets = $assets; $this->_config = $config; $this->_assetFileFactory = $assetFileFactory; $this->_registration = $registration; diff --git a/app/code/Magento/Core/Model/Resource/Config/Value/Collection/Scoped.php b/app/code/Magento/Core/Model/Resource/Config/Value/Collection/Scoped.php index f42c681b907..bc0b374ca76 100644 --- a/app/code/Magento/Core/Model/Resource/Config/Value/Collection/Scoped.php +++ b/app/code/Magento/Core/Model/Resource/Config/Value/Collection/Scoped.php @@ -42,26 +42,28 @@ class Scoped extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollecti protected $_scopeId; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Resource\Config\Data $resource - * @param $scope - * @param null $scopeId + * @param string $scope + * @param mixed $connection + * @param mixed $scopeId */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Resource\Config\Data $resource, $scope, + $connection = null, $scopeId = null ) { $this->_scope = $scope; $this->_scopeId = $scopeId; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Core/Model/Resource/Db/Collection/AbstractCollection.php b/app/code/Magento/Core/Model/Resource/Db/Collection/AbstractCollection.php index 5e672bc3e26..c8e8b1edaf6 100644 --- a/app/code/Magento/Core/Model/Resource/Db/Collection/AbstractCollection.php +++ b/app/code/Magento/Core/Model/Resource/Db/Collection/AbstractCollection.php @@ -121,21 +121,23 @@ abstract class AbstractCollection extends \Magento\Data\Collection\Db protected $_eventManager = null; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_eventManager = $eventManager; - parent::__construct($logger, $fetchStrategy, $entityFactory); + parent::__construct($entityFactory, $logger, $fetchStrategy, $connection); $this->_construct(); $this->_resource = $resource; $this->setConnection($this->getResource()->getReadConnection()); diff --git a/app/code/Magento/Core/Model/Resource/Design.php b/app/code/Magento/Core/Model/Resource/Design.php index 420ad076a6d..581786ac34e 100644 --- a/app/code/Magento/Core/Model/Resource/Design.php +++ b/app/code/Magento/Core/Model/Resource/Design.php @@ -42,13 +42,11 @@ class Design extends \Magento\Core\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\App\Resource $resource + * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct( - \Magento\Stdlib\DateTime $dateTime, - \Magento\App\Resource $resource - ) { + public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) + { $this->dateTime = $dateTime; parent::__construct($resource); } diff --git a/app/code/Magento/Core/Model/Resource/Design/Collection.php b/app/code/Magento/Core/Model/Resource/Design/Collection.php index 5532e71c107..60266f6a66f 100644 --- a/app/code/Magento/Core/Model/Resource/Design/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Design/Collection.php @@ -37,23 +37,25 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $dateTime; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Stdlib\DateTime $dateTime + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Stdlib\DateTime $dateTime, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->dateTime = $dateTime; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Core/Model/Resource/Layout/Link/Collection.php b/app/code/Magento/Core/Model/Resource/Layout/Link/Collection.php index e4768e3007c..444cd685af2 100644 --- a/app/code/Magento/Core/Model/Resource/Layout/Link/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Layout/Link/Collection.php @@ -37,23 +37,25 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $dateTime; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Stdlib\DateTime $dateTime + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Stdlib\DateTime $dateTime, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->dateTime = $dateTime; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Core/Model/Resource/Layout/Update/Collection.php b/app/code/Magento/Core/Model/Resource/Layout/Update/Collection.php index 849986844c8..b434f0388ea 100644 --- a/app/code/Magento/Core/Model/Resource/Layout/Update/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Layout/Update/Collection.php @@ -51,23 +51,25 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $dateTime; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Stdlib\DateTime $dateTime + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Stdlib\DateTime $dateTime, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->dateTime = $dateTime; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Core/Model/Resource/Setup/Migration.php b/app/code/Magento/Core/Model/Resource/Setup/Migration.php index 480d4dec4f3..2e2d6b85431 100644 --- a/app/code/Magento/Core/Model/Resource/Setup/Migration.php +++ b/app/code/Magento/Core/Model/Resource/Setup/Migration.php @@ -155,21 +155,21 @@ class Migration extends \Magento\Core\Model\Resource\Setup protected $_dir; /** - * @param Context $context + * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param string $resourceName * @param \Magento\Filesystem $filesystem * @param \Magento\Core\Helper\Data $helper * @param \Magento\App\Dir $dir - * @param $resourceName - * @param $confPathToMapFile + * @param string $confPathToMapFile * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, \Magento\Filesystem $filesystem, \Magento\Core\Helper\Data $helper, \Magento\App\Dir $dir, - $resourceName, $confPathToMapFile, $moduleName = 'Magento_Core', $connectionName = '' diff --git a/app/code/Magento/Core/Model/Resource/Url/Rewrite/Collection.php b/app/code/Magento/Core/Model/Resource/Url/Rewrite/Collection.php index 09ab3179220..a0330359ab5 100644 --- a/app/code/Magento/Core/Model/Resource/Url/Rewrite/Collection.php +++ b/app/code/Magento/Core/Model/Resource/Url/Rewrite/Collection.php @@ -44,22 +44,24 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_storeManager; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_storeManager = $storeManager; } diff --git a/app/code/Magento/Core/Model/Session.php b/app/code/Magento/Core/Model/Session.php index 459f294c5f4..5ad6862ad67 100644 --- a/app/code/Magento/Core/Model/Session.php +++ b/app/code/Magento/Core/Model/Session.php @@ -38,38 +38,20 @@ namespace Magento\Core\Model; class Session extends \Magento\Core\Model\Session\AbstractSession { /** - * @var \Magento\Math\Random - */ - protected $mathRandom; - - /** - * @param \Magento\Core\Model\Session\Context $context - * @param \Magento\Math\Random $mathRandom + * @param Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param array $data - * @param string|null $sessionName - * @internal param \Magento\Core\Helper\Data $coreData + * @param null $sessionName */ public function __construct( \Magento\Core\Model\Session\Context $context, - \Magento\Math\Random $mathRandom, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, array $data = array(), $sessionName = null ) { - $this->mathRandom = $mathRandom; - parent::__construct($context, $data); - $this->init('core', $sessionName); - } - - /** - * Retrieve Session Form Key - * - * @return string A 16 bit unique key for forms - */ - public function getFormKey() - { - if (!$this->getData('_form_key')) { - $this->setData('_form_key', $this->mathRandom->getRandomString(16)); - } - return $this->getData('_form_key'); + parent::__construct($context, $sidResolver, $sessionConfig, $data); + $this->start('core', $sessionName); } } diff --git a/app/code/Magento/Core/Model/Session/AbstractSession.php b/app/code/Magento/Core/Model/Session/AbstractSession.php index 574e7b1f540..a69e21a4808 100644 --- a/app/code/Magento/Core/Model/Session/AbstractSession.php +++ b/app/code/Magento/Core/Model/Session/AbstractSession.php @@ -29,40 +29,35 @@ namespace Magento\Core\Model\Session; class AbstractSession extends \Magento\Object { - const XML_PATH_COOKIE_DOMAIN = 'web/cookie/cookie_domain'; - const XML_PATH_COOKIE_PATH = 'web/cookie/cookie_path'; - - const PARAM_SESSION_SAVE_METHOD = 'session_save'; - const PARAM_SESSION_SAVE_PATH = 'session_save_path'; - const PARAM_SESSION_CACHE_LIMITER = 'session_cache_limiter'; - - const XML_PATH_USE_FRONTEND_SID = 'web/session/use_frontend_sid'; - - const XML_PATH_LOG_EXCEPTION_FILE = 'dev/log/exception_file'; - - const HOST_KEY = '_session_hosts'; - const SESSION_ID_QUERY_PARAM = 'SID'; + /** + * Configuration path to log exception file + */ + const XML_PATH_LOG_EXCEPTION_FILE = 'dev/log/exception_file'; /** - * URL host cache - * - * @var array + * Session key for list of hosts */ - protected static $_urlHostCache = array(); + const HOST_KEY = '_session_hosts'; /** - * Encrypted session id cache + * Default options when a call destroy() * - * @var string + * - send_expire_cookie: whether or not to send a cookie expiring the current session cookie + * - clear_storage: whether or not to empty the storage object of any stored values + * + * @var array */ - protected static $_encryptedSessionId; + protected $defaultDestroyOptions = array( + 'send_expire_cookie' => true, + 'clear_storage' => true, + ); /** - * Skip session id flag + * URL host cache * - * @var bool + * @var array */ - protected $_skipSessionIdFlag = false; + protected static $_urlHostCache = array(); /** * @var \Magento\Logger @@ -74,7 +69,7 @@ class AbstractSession extends \Magento\Object * * @var \Magento\Event\ManagerInterface */ - protected $_eventManager = null; + protected $_eventManager; /** * @var \Magento\Core\Model\Session\Validator @@ -91,13 +86,6 @@ class AbstractSession extends \Magento\Object */ protected $_saveMethod; - /** - * Core cookie - * - * @var \Magento\Core\Model\Cookie - */ - protected $_cookie; - /** * Core message * @@ -128,77 +116,48 @@ class AbstractSession extends \Magento\Object protected $_storeManager; /** - * @var \Magento\App\Dir + * @var \Magento\Session\SidResolverInterface */ - protected $_dir; + protected $_sidResolver; /** - * @var \Magento\Core\Model\Url + * @var \Magento\Session\Config\ConfigInterface */ - protected $_url; - - /** - * @var string - */ - protected $_savePath; - - /** - * @var string - */ - protected $_cacheLimiter; - - /** - * @var array - */ - protected $_sidNameMap; + protected $_sessionConfig; /** * @param \Magento\Core\Model\Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param array $data */ public function __construct( \Magento\Core\Model\Session\Context $context, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, array $data = array() ) { $this->_validator = $context->getValidator(); $this->_eventManager = $context->getEventManager(); $this->_logger = $context->getLogger(); $this->_coreStoreConfig = $context->getStoreConfig(); - $this->_savePath = $this->_savePath ?: $context->getSavePath(); $this->_saveMethod = $this->_saveMethod ?: $context->getSaveMethod(); - $this->_cacheLimiter = $this->_cacheLimiter ?: $context->getCacheLimiter(); - $this->_sidNameMap = $context->getSidMap(); $this->messagesFactory = $context->getMessagesFactory(); $this->messageFactory = $context->getMessageFactory(); - $this->_cookie = $context->getCookie(); $this->_request = $context->getRequest(); $this->_appState = $context->getAppState(); $this->_storeManager = $context->getStoreManager(); - $this->_dir = $context->getDir(); - $this->_url = $context->getUrl(); + $this->_sidResolver = $sidResolver; + $this->_sessionConfig = $sessionConfig; parent::__construct($data); } /** - * This method needs to support sessions with APC enabled - */ - public function __destruct() - { - session_write_close(); - } - - /** - * Configure session handler and start session - * - * @param string $sessionName - * @return \Magento\Core\Model\Session\AbstractSession + * Init session handler */ - public function start($sessionName = null) + protected function _initSessionHandler() { - if (isset($_SESSION) && !$this->getSkipEmptySessionCheck()) { - return $this; - } - + \Magento\Profiler::start('session_start'); switch($this->getSessionSaveMethod()) { case 'db': ini_set('session.save_handler', 'user'); @@ -209,101 +168,73 @@ class AbstractSession extends \Magento\Object break; case 'memcache': ini_set('session.save_handler', 'memcache'); - session_save_path($this->getSessionSavePath()); break; case 'memcached': ini_set('session.save_handler', 'memcached'); - session_save_path($this->getSessionSavePath()); break; case 'eaccelerator': ini_set('session.save_handler', 'eaccelerator'); break; default: session_module_name($this->getSessionSaveMethod()); - if (is_writable($this->getSessionSavePath())) { - session_save_path($this->getSessionSavePath()); - } break; } - $cookie = $this->getCookie(); - - // session cookie params - $cookieParams = array( - 'lifetime' => 0, // 0 is browser session lifetime - 'path' => $cookie->getPath(), - 'domain' => $cookie->getConfigDomain(), - 'secure' => $cookie->isSecure(), - 'httponly' => $cookie->getHttponly() - ); - - if (!$cookieParams['httponly']) { - unset($cookieParams['httponly']); - if (!$cookieParams['secure']) { - unset($cookieParams['secure']); - if (!$cookieParams['domain']) { - unset($cookieParams['domain']); - } - } - } - - if (isset($cookieParams['domain'])) { - $cookieParams['domain'] = $cookie->getDomain(); - } - - call_user_func_array('session_set_cookie_params', $cookieParams); - - if (!empty($sessionName)) { - $this->setSessionName($sessionName); - } // potential custom logic for session id (ex. switching between hosts) - $this->setSessionId(); - - \Magento\Profiler::start('session_start'); + $this->setSessionId($this->_sidResolver->getSid($this)); - if ($this->_cacheLimiter) { - session_cache_limiter($this->_cacheLimiter); - } session_start(); + register_shutdown_function(array($this, 'writeClose')); \Magento\Profiler::stop('session_start'); - - return $this; } /** - * Retrieve cookie object - * - * @return \Magento\Core\Model\Cookie + * This method needs to support sessions with APC enabled */ - public function getCookie() + public function writeClose() { - return $this->_cookie; + session_write_close(); } /** - * Init session with namespace + * Configure session handler and start session * * @param string $namespace * @param string $sessionName * @return \Magento\Core\Model\Session\AbstractSession */ - public function init($namespace, $sessionName = null) + public function start($namespace = 'default', $sessionName = null) { - if (!isset($_SESSION)) { - $this->start($sessionName); + if (!$this->isSessionExists()) { + if (!empty($sessionName)) { + $this->setSessionName($sessionName); + } + $this->_initSessionHandler(); + $this->_validator->validate($this); + $this->_addHost(); } + if (!isset($_SESSION[$namespace])) { $_SESSION[$namespace] = array(); } - $this->_data = &$_SESSION[$namespace]; - - $this->_validator->validate($this); - $this->_addHost(); return $this; } + /** + * Does a session exist + * + * @return bool + */ + public function isSessionExists() + { + if (session_status() === PHP_SESSION_NONE && !headers_sent()) { + return false; + } + return true; + } + /** * Additional get data with clear mode * @@ -335,7 +266,7 @@ class AbstractSession extends \Magento\Object * * @return string */ - public function getSessionName() + public function getName() { return session_name(); } @@ -353,24 +284,41 @@ class AbstractSession extends \Magento\Object } /** - * Unset all data + * Destroy/end a session * - * @return \Magento\Core\Model\Session\AbstractSession + * @param array $options */ - public function unsetAll() + public function destroy(array $options = null) { - $this->unsetData(); - return $this; + if (null === $options) { + $options = $this->defaultDestroyOptions; + } else { + $options = array_merge($this->defaultDestroyOptions, $options); + } + + if ($options['clear_storage']) { + $this->clearStorage(); + } + + if (session_status() !== PHP_SESSION_ACTIVE) { + return; + } + + session_destroy(); + if ($options['send_expire_cookie']) { + $this->expireSessionCookie(); + } } /** - * Alias for unsetAll + * Unset all session data * - * @return \Magento\Core\Model\Session\AbstractSession + * @return $this */ - public function clear() + public function clearStorage() { - return $this->unsetAll(); + $this->unsetData(); + return $this; } /** @@ -380,7 +328,7 @@ class AbstractSession extends \Magento\Object */ public function getCookieDomain() { - return $this->getCookie()->getDomain(); + return $this->_sessionConfig->getCookieDomain(); } /** @@ -390,7 +338,7 @@ class AbstractSession extends \Magento\Object */ public function getCookiePath() { - return $this->getCookie()->getPath(); + return $this->_sessionConfig->getCookiePath(); } /** @@ -400,7 +348,7 @@ class AbstractSession extends \Magento\Object */ public function getCookieLifetime() { - return $this->getCookie()->getLifetime(); + return $this->_sessionConfig->getCookieLifetime(); } /** @@ -542,7 +490,7 @@ class AbstractSession extends \Magento\Object foreach ($items as $item) { if ($item instanceof \Magento\Message\AbstractMessage) { $text = $item->getText(); - } else if (is_string($item)) { + } elseif (is_string($item)) { $text = $item; } else { continue; // Some unknown object, do not put it in already existing messages @@ -553,7 +501,7 @@ class AbstractSession extends \Magento\Object foreach ($messages as $message) { if ($message instanceof \Magento\Message\AbstractMessage) { $text = $message->getText(); - } else if (is_string($message)) { + } elseif (is_string($message)) { $text = $message; } else { $text = null; // Some unknown object, add it anyway @@ -575,74 +523,18 @@ class AbstractSession extends \Magento\Object /** * Specify session identifier * - * @param string|null $id + * @param string|null $sessionId * @return \Magento\Core\Model\Session\AbstractSession */ - public function setSessionId($id = null) + public function setSessionId($sessionId) { - if (null === $id && $this->_isSidUsedFromQueryParam()) { - $_queryParam = $this->getSessionIdQueryParam(); - if (isset($_GET[$_queryParam]) && $this->_url->isOwnOriginUrl()) { - $id = $_GET[$_queryParam]; - } - } $this->_addHost(); - if (!is_null($id) && preg_match('#^[0-9a-zA-Z,-]+$#', $id)) { - session_id($id); - } - return $this; - } - - /** - * Get encrypted session identifier. - * No reason use crypt key for session id encryption, we can use session identifier as is. - * - * @return string - */ - public function getEncryptedSessionId() - { - if (!self::$_encryptedSessionId) { - self::$_encryptedSessionId = $this->getSessionId(); - } - return self::$_encryptedSessionId; - } - - /** - * Get session id query param - * - * @return string - */ - public function getSessionIdQueryParam() - { - $sessionName = $this->getSessionName(); - if ($sessionName && isset($this->_sidNameMap[$sessionName])) { - return $this->_sidNameMap[$sessionName]; + if (!is_null($sessionId) && preg_match('#^[0-9a-zA-Z,-]+$#', $sessionId)) { + session_id($sessionId); } - return self::SESSION_ID_QUERY_PARAM; - } - - /** - * Set skip flag if need skip generating of _GET session_id_key param - * - * @param bool $flag - * @return \Magento\Core\Model\Session\AbstractSession - */ - public function setSkipSessionIdFlag($flag) - { - $this->_skipSessionIdFlag = $flag; return $this; } - /** - * Retrieve session id skip flag - * - * @return bool - */ - public function getSkipSessionIdFlag() - { - return $this->_skipSessionIdFlag; - } - /** * If session cookie is not applicable due to host or path mismatch - add session id to query * @@ -651,10 +543,6 @@ class AbstractSession extends \Magento\Object */ public function getSessionIdForHost($urlHost) { - if ($this->getSkipSessionIdFlag() === true) { - return ''; - } - $httpHost = $this->_request->getHttpHost(); if (!$httpHost) { return ''; @@ -670,11 +558,11 @@ class AbstractSession extends \Magento\Object $urlHostArr = explode(':', $urlHost); $urlHost = $urlHostArr[0]; $sessionId = $httpHost !== $urlHost && !$this->isValidForHost($urlHost) - ? $this->getEncryptedSessionId() : ''; + ? $this->getSessionId() : ''; self::$_urlHostCache[$urlHost] = $sessionId; } - return $this->isValidForPath($urlPath) ? self::$_urlHostCache[$urlHost] : $this->getEncryptedSessionId(); + return $this->isValidForPath($urlPath) ? self::$_urlHostCache[$urlHost] : $this->getSessionId(); } /** @@ -746,16 +634,6 @@ class AbstractSession extends \Magento\Object return $this; } - /** - * Whether to take session id from GET - * - * @return bool - */ - protected function _isSidUsedFromQueryParam() - { - return $this->_coreStoreConfig->getConfig(self::XML_PATH_USE_FRONTEND_SID); - } - /** * Retrieve session save method * @@ -770,42 +648,68 @@ class AbstractSession extends \Magento\Object } /** - * Get session save path + * Renew session id and update session cookie * - * @return string + * @param bool $deleteOldSession + * @return \Magento\Core\Model\Session\AbstractSession + * @throws \LogicException */ - public function getSessionSavePath() + public function regenerateId($deleteOldSession = true) { - if ($this->_appState->isInstalled() && $this->_savePath) { - return $this->_savePath; + if ($this->isSessionExists()) { + return $this; } - return $this->_dir->getDir('session'); + session_regenerate_id($deleteOldSession); + + if ($this->_sessionConfig->getUseCookies()) { + $this->clearSubDomainSessionCookie(); + } + return $this; } /** - * Renew session id and update session cookie - * - * @return \Magento\Core\Model\Session\AbstractSession + * Expire the session cookie for sub domains */ - public function renewSession() + protected function clearSubDomainSessionCookie() { - if (headers_sent()) { - $this->_logger->log('Can not regenerate session id because HTTP headers already sent.'); - return $this; - } - session_regenerate_id(true); - - $sessionHosts = $this->_getHosts(); - $currentCookieDomain = $this->getCookie()->getDomain(); - if (is_array($sessionHosts)) { - foreach (array_keys($sessionHosts) as $host) { - // Delete cookies with the same name for parent domains - if (strpos($currentCookieDomain, $host) > 0) { - $this->getCookie()->delete($this->getSessionName(), null, $host); - } + foreach (array_keys($this->_getHosts()) as $host) { + // Delete cookies with the same name for parent domains + if (strpos($this->_sessionConfig->getCookieDomain(), $host) > 0) { + setcookie( + $this->getName(), + '', + 0, + $this->_sessionConfig->getCookiePath(), + $host, + $this->_sessionConfig->getCookieSecure(), + $this->_sessionConfig->getCookieHttpOnly() + ); } } + } - return $this; + /** + * Expire the session cookie + * + * Sends a session cookie with no value, and with an expiry in the past. + * + * @return void + */ + public function expireSessionCookie() + { + if (!$this->_sessionConfig->getUseCookies()) { + return; + } + + setcookie( + $this->getName(), // session name + '', // value + 0, // TTL for cookie + $this->_sessionConfig->getCookiePath(), + $this->_sessionConfig->getCookieDomain(), + $this->_sessionConfig->getCookieSecure(), + $this->_sessionConfig->getCookieHttpOnly() + ); + $this->clearSubDomainSessionCookie(); } } diff --git a/app/code/Magento/Core/Model/Session/Config.php b/app/code/Magento/Core/Model/Session/Config.php new file mode 100644 index 00000000000..f8d493cea25 --- /dev/null +++ b/app/code/Magento/Core/Model/Session/Config.php @@ -0,0 +1,626 @@ +<?php +/** + * Session configuration object + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\Session; + +/** + * Magento session configuration + */ +class Config implements \Magento\Session\Config\ConfigInterface +{ + /** + * Configuration path for session save method + */ + const PARAM_SESSION_SAVE_METHOD = 'session_save'; + + /** + * Configuration path for session save path + */ + const PARAM_SESSION_SAVE_PATH = 'session_save_path'; + + /** + * Configuration path for session cache limiter + */ + const PARAM_SESSION_CACHE_LIMITER = 'session_cache_limiter'; + + /** + * Configuration path for cookie domain + */ + const XML_PATH_COOKIE_DOMAIN = 'web/cookie/cookie_domain'; + + /** + * Configuration path for cookie lifetime + */ + const XML_PATH_COOKIE_LIFETIME = 'web/cookie/cookie_lifetime'; + + /** + * Configuration path for cookie http only param + */ + const XML_PATH_COOKIE_HTTPONLY = 'web/cookie/cookie_httponly'; + + /** + * Configuration path for cookie path + */ + const XML_PATH_COOKIE_PATH = 'web/cookie/cookie_path'; + + /** + * Cookie default lifetime + */ + const COOKIE_LIFETIME_DEFAULT = 3600; + + /** + * All options + * + * @var array + */ + protected $options = array(); + + /** + * @var \Magento\Core\Model\Store\Config + */ + protected $_storeConfig; + + /** + * @var \Magento\Core\Model\StoreManagerInterface + */ + protected $_storeManager; + + /** + * @var \Magento\Stdlib\String + */ + protected $_stringHelper; + + /** + * @var \Magento\App\RequestInterface + */ + protected $_httpRequest; + + /** + * List of boolean options + * + * @var array + */ + protected $booleanOptions = array( + 'session.use_cookies', + 'session.use_only_cookies', + 'session.use_trans_sid', + 'session.cookie_httponly' + ); + + /** + * @var \Magento\App\State + */ + protected $_appState; + + /** + * @var \Magento\App\Dir + */ + protected $_dir; + + /** + * @param \Magento\Core\Model\Store\Config $storeConfig + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Stdlib\String $stringHelper + * @param \Magento\App\RequestInterface $request + * @param \Magento\App\State $appState + * @param \Magento\App\Dir $dir + * @param null|string $savePath + * @param null|string $cacheLimiter + */ + public function __construct( + \Magento\Core\Model\Store\Config $storeConfig, + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Stdlib\String $stringHelper, + \Magento\App\RequestInterface $request, + \Magento\App\State $appState, + \Magento\App\Dir $dir, + $savePath = null, + $cacheLimiter = null + ) { + $this->_storeConfig = $storeConfig; + $this->_storeManager = $storeManager; + $this->_stringHelper = $stringHelper; + $this->_httpRequest = $request; + $this->_appState = $appState; + $this->_dir = $dir; + + if (!$this->_appState->isInstalled() || !$savePath) { + $savePath = $this->_dir->getDir('session'); + } + $this->setSavePath($savePath); + + if ($cacheLimiter) { + $this->setOption('session.cache_limiter', $cacheLimiter); + } + + $lifetime = $this->_storeConfig->getConfig(self::XML_PATH_COOKIE_LIFETIME, $this->_storeManager->getStore()); + $lifetime = is_numeric($lifetime) ? $lifetime : self::COOKIE_LIFETIME_DEFAULT; + $this->setCookieLifetime($lifetime); + + $path = $this->_storeConfig->getConfig(self::XML_PATH_COOKIE_PATH, $this->_storeManager->getStore()); + if (empty($path)) { + $path = $this->_httpRequest->getBasePath(); + } + $this->setCookiePath($path); + + $domain = $this->_storeConfig->getConfig(self::XML_PATH_COOKIE_DOMAIN, $this->_storeManager->getStore()); + $domain = empty($domain) ? $this->_httpRequest->getHttpHost() : $domain; + $this->setCookieDomain((string)$domain); + $this->setCookieSecure($this->_httpRequest->isSecure()); + $this->setCookieHttpOnly( + $this->_storeConfig->getConfig(self::XML_PATH_COOKIE_HTTPONLY, $this->_storeManager->getStore()) + ); + } + + /** + * Set many options at once + * + * @param array $options + * @return $this + * @throws \InvalidArgumentException + */ + public function setOptions($options) + { + if (!is_array($options) && !$options instanceof \Traversable) { + throw new \InvalidArgumentException(sprintf( + 'Parameter provided to %s must be an array or Traversable', + __METHOD__ + )); + } + + foreach ($options as $option => $value) { + $setter = 'set' . $this->_stringHelper->upperCaseWords($option, '_', ''); + if (method_exists($this, $setter)) { + $this->{$setter}($value); + } else { + $this->setOption($option, $value); + } + } + + return $this; + } + + /** + * Get all options set + * + * @return array + */ + public function getOptions() + { + return $this->options; + } + + /** + * Set an individual option + * + * @param string $option + * @param mixed $value + * @return $this + */ + public function setOption($option, $value) + { + $option = $this->getFixedOptionName($option); + if (!array_key_exists($option, $this->options) || $this->options[$option] != $value) { + $this->setStorageOption($option, $value); + $this->options[$option] = $value; + } + + return $this; + } + + /** + * Get an individual option + * + * @param string $option + * @return mixed + */ + public function getOption($option) + { + $option = $this->getFixedOptionName($option); + if ($this->hasOption($option)) { + return $this->options[$option]; + } + + $value = $this->getStorageOption($option); + if (null !== $value) { + $this->options[$option] = $value; + return $value; + } + + return null; + } + + /** + * Check to see if an internal option has been set for the key provided. + * + * @param string $option + * @return bool + */ + public function hasOption($option) + { + $option = $this->getFixedOptionName($option); + return array_key_exists($option, $this->options); + } + + /** + * @return array + */ + public function toArray() + { + return $this->getOptions(); + } + + /** + * Set session.name + * + * @param string $name + * @return $this + * @throws \InvalidArgumentException + */ + public function setName($name) + { + $name = (string) $name; + if (empty($name)) { + throw new \InvalidArgumentException('Invalid session name; cannot be empty'); + } + $this->setOption('session.name', $name); + return $this; + } + + /** + * Get session.name + * + * @return string + */ + public function getName() + { + return (string) $this->getOption('session.name'); + } + + /** + * Set session.save_path + * + * @param string $savePath + * @return $this + * @throws \InvalidArgumentException + */ + public function setSavePath($savePath) + { + if (!is_dir($savePath)) { + throw new \InvalidArgumentException('Invalid save_path provided; not a directory'); + } + if (!is_writable($savePath)) { + throw new \InvalidArgumentException('Invalid save_path provided; not writable'); + } + + $this->setOption('session.save_path', $savePath); + return $this; + } + + /** + * Set session.save_path + * + * @return string + */ + public function getSavePath() + { + return (string) $this->getOption('session.save_path'); + } + + /** + * Set session.cookie_lifetime + * + * @param int $cookieLifetime + * @return $this + * @throws \InvalidArgumentException + */ + public function setCookieLifetime($cookieLifetime) + { + if (!is_numeric($cookieLifetime)) { + throw new \InvalidArgumentException('Invalid cookie_lifetime; must be numeric'); + } + if ($cookieLifetime < 0) { + throw new \InvalidArgumentException( + 'Invalid cookie_lifetime; must be a positive integer or zero' + ); + } + + $cookieLifetime = (int) $cookieLifetime; + $this->setOption('session.cookie_lifetime', $cookieLifetime); + return $this; + } + + /** + * Get session.cookie_lifetime + * + * @return int + */ + public function getCookieLifetime() + { + return (int) $this->getOption('session.cookie_lifetime'); + } + + /** + * Set session.cookie_path + * + * @param string $cookiePath + * @return $this + * @throws \InvalidArgumentException + */ + public function setCookiePath($cookiePath) + { + $cookiePath = (string) $cookiePath; + + $test = parse_url($cookiePath, PHP_URL_PATH); + if ($test != $cookiePath || '/' != $test[0]) { + throw new \InvalidArgumentException('Invalid cookie path'); + } + + $this->setOption('session.cookie_path', $cookiePath); + return $this; + } + + /** + * Get session.cookie_path + * + * @return string + */ + public function getCookiePath() + { + if (!$this->hasOption('session.cookie_path')) { + $path = $this->_storeConfig->getConfig(self::XML_PATH_COOKIE_PATH, $this->_storeManager->getStore()); + if (empty($path)) { + $path = $this->_httpRequest->getBasePath(); + } + $this->setCookiePath($path); + } + return (string) $this->getOption('session.cookie_path'); + } + + /** + * Set session.cookie_domain + * + * @param string $cookieDomain + * @return $this + * @throws \InvalidArgumentException + */ + public function setCookieDomain($cookieDomain) + { + if (!is_string($cookieDomain)) { + throw new \InvalidArgumentException('Invalid cookie domain: must be a string'); + } + + $validator = new \Zend\Validator\Hostname(\Zend\Validator\Hostname::ALLOW_ALL); + + if (!empty($cookieDomain) && !$validator->isValid($cookieDomain)) { + throw new \InvalidArgumentException( + 'Invalid cookie domain: ' . join('; ', $validator->getMessages()) + ); + } + + $this->setOption('session.cookie_domain', $cookieDomain); + return $this; + } + + /** + * Get session.cookie_domain + * + * @return string + */ + public function getCookieDomain() + { + return (string) $this->getOption('session.cookie_domain'); + } + + /** + * Set session.cookie_secure + * + * @param bool $cookieSecure + * @return $this + */ + public function setCookieSecure($cookieSecure) + { + $this->setOption('session.cookie_secure', (bool) $cookieSecure); + return $this; + } + + /** + * Get session.cookie_secure + * + * @return bool + */ + public function getCookieSecure() + { + return (bool) $this->getOption('session.cookie_secure'); + } + + /** + * Set session.cookie_httponly + * + * @param bool $cookieHttpOnly + * @return $this + */ + public function setCookieHttpOnly($cookieHttpOnly) + { + $this->setOption('session.cookie_httponly', (bool) $cookieHttpOnly); + return $this; + } + + /** + * Get session.cookie_httponly + * + * @return bool + */ + public function getCookieHttpOnly() + { + return (bool) $this->getOption('session.cookie_httponly'); + } + + /** + * Set session.use_cookies + * + * @param bool $useCookies + * @return $this + */ + public function setUseCookies($useCookies) + { + $this->setOption('session.use_cookies', (bool) $useCookies); + return $this; + } + + /** + * Get session.use_cookies + * + * @return bool + */ + public function getUseCookies() + { + return (bool) $this->getOption('session.use_cookies'); + } + + /** + * Set remember_me_seconds + * + * @param int $rememberMeSeconds + * @return $this + * @throws \InvalidArgumentException + */ + public function setRememberMeSeconds($rememberMeSeconds) + { + if (!is_numeric($rememberMeSeconds)) { + throw new \InvalidArgumentException('Invalid remember_me_seconds; must be numeric'); + } + + $rememberMeSeconds = (int) $rememberMeSeconds; + if ($rememberMeSeconds < 1) { + throw new \InvalidArgumentException('Invalid remember_me_seconds; must be a positive integer'); + } + + $this->options['remember_me_seconds'] = $rememberMeSeconds; + return $this; + } + + /** + * Get remember_me_seconds + * + * @return int + */ + public function getRememberMeSeconds() + { + return (int) isset($this->options['remember_me_seconds']) ? $this->options['remember_me_seconds'] : 1209600; + } + + /** + * Set storage option in backend configuration store + * + * @param string $option + * @param mixed $value + * @return $this + * @throws \InvalidArgumentException + */ + protected function setStorageOption($option, $value) + { + $result = ini_set($option, $value); + if ($result === false) { + throw new \InvalidArgumentException(sprintf('"%s" is not a valid sessions-related ini setting.', $option)); + } + + return $this; + } + + /** + * Retrieve a storage option from a backend configuration store + * + * @param string $option + * @return mixed + */ + protected function getStorageOption($option) + { + $value = ini_get($option); + if (in_array($option, $this->booleanOptions)) { + $value = (bool) $value; + } + + return $value; + } + + /** + * Fix session option name + * + * @param string $option + * @return string + */ + protected function getFixedOptionName($option) + { + $option = strtolower($option); + + switch ($option) { + case 'remember_me_seconds': + // do nothing; not an INI option + return; + case 'url_rewriter_tags': + $option = 'url_rewriter.tags'; + break; + default: + if (strpos($option, 'session.') !== 0) { + $option = 'session.' . $option; + } + break; + } + + return $option; + } + + /** + * Intercept get*() and set*() methods + * + * Intercepts getters and setters and passes them to getOption() and setOption(), + * respectively. + * + * @param string $method + * @param array $args + * @return mixed + * @throws \BadMethodCallException on non-getter/setter method + */ + public function __call($method, $args) + { + $prefix = substr($method, 0, 3); + $option = substr($method, 3); + $key = strtolower(preg_replace('#(?<=[a-z])([A-Z])#', '_\1', $option)); + + if ($prefix === 'set') { + $value = array_shift($args); + return $this->setOption($key, $value); + } elseif ($prefix === 'get') { + return $this->getOption($key); + } else { + throw new \BadMethodCallException(sprintf( + 'Method "%s" does not exist in %s', + $method, + get_class($this) + )); + } + } +} diff --git a/app/code/Magento/Core/Model/Session/Context.php b/app/code/Magento/Core/Model/Session/Context.php index 46c0e29f3f2..1c19fdc7a7e 100644 --- a/app/code/Magento/Core/Model/Session/Context.php +++ b/app/code/Magento/Core/Model/Session/Context.php @@ -53,31 +53,7 @@ class Context implements \Magento\ObjectManager\ContextInterface protected $_saveMethod; /** - * @var string - */ - protected $_savePath; - - /** - * @var string - */ - protected $_cacheLimiter; - - /** - * Mapping between area and SID param name - * - * @var array - */ - protected $sidMap; - - /** - * Core cookie - * - * @var \Magento\Core\Model\Cookie - */ - protected $_cookie; - - /** - * Core message factory + * Core message * * @var \Magento\Message\Factory */ @@ -105,16 +81,6 @@ class Context implements \Magento\ObjectManager\ContextInterface */ protected $_storeManager; - /** - * @var \Magento\App\Dir - */ - protected $_dir; - - /** - * @var \Magento\Core\Model\Url - */ - protected $_url; - /** * @param \Magento\Core\Model\Session\Validator $validator * @param \Magento\Logger $logger @@ -122,16 +88,10 @@ class Context implements \Magento\ObjectManager\ContextInterface * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Message\CollectionFactory $messagesFactory * @param \Magento\Message\Factory $messageFactory - * @param \Magento\Core\Model\Cookie $cookie * @param \Magento\App\RequestInterface $request * @param \Magento\App\State $appState * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Dir $dir - * @param \Magento\Core\Model\Url $url - * @param $saveMethod - * @param null $savePath - * @param null $cacheLimiter - * @param array $sidMap + * @param string $saveMethod */ public function __construct( \Magento\Core\Model\Session\Validator $validator, @@ -140,33 +100,21 @@ class Context implements \Magento\ObjectManager\ContextInterface \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Message\CollectionFactory $messagesFactory, \Magento\Message\Factory $messageFactory, - \Magento\Core\Model\Cookie $cookie, \Magento\App\RequestInterface $request, \Magento\App\State $appState, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\App\Dir $dir, - \Magento\Core\Model\Url $url, - $saveMethod, - $savePath = null, - $cacheLimiter = null, - $sidMap = array() + $saveMethod = 'files' ) { $this->_validator = $validator; $this->_logger = $logger; $this->_eventManager = $eventManager; $this->_storeConfig = $coreStoreConfig; $this->_saveMethod = $saveMethod; - $this->_savePath = $savePath; - $this->_cacheLimiter = $cacheLimiter; - $this->sidMap = $sidMap; $this->messagesFactory = $messagesFactory; $this->messageFactory = $messageFactory; - $this->_cookie = $cookie; $this->_request = $request; $this->_appState = $appState; $this->_storeManager = $storeManager; - $this->_dir = $dir; - $this->_url = $url; } /** @@ -201,14 +149,6 @@ class Context implements \Magento\ObjectManager\ContextInterface return $this->_validator; } - /** - * @return string - */ - public function getCacheLimiter() - { - return $this->_cacheLimiter; - } - /** * @return string */ @@ -217,22 +157,6 @@ class Context implements \Magento\ObjectManager\ContextInterface return $this->_saveMethod; } - /** - * @return string - */ - public function getSavePath() - { - return $this->_savePath; - } - - /** - * @return array - */ - public function getSidMap() - { - return $this->sidMap; - } - /** * @return \Magento\App\State */ @@ -241,22 +165,6 @@ class Context implements \Magento\ObjectManager\ContextInterface return $this->_appState; } - /** - * @return \Magento\Core\Model\Cookie - */ - public function getCookie() - { - return $this->_cookie; - } - - /** - * @return \Magento\App\Dir - */ - public function getDir() - { - return $this->_dir; - } - /** * @return \Magento\Message\Factory */ @@ -288,12 +196,4 @@ class Context implements \Magento\ObjectManager\ContextInterface { return $this->_storeManager; } - - /** - * @return \Magento\Core\Model\Url - */ - public function getUrl() - { - return $this->_url; - } } diff --git a/app/code/Magento/Core/Model/Session/Generic.php b/app/code/Magento/Core/Model/Session/Generic.php index b9d6ba8b515..f0404480f59 100644 --- a/app/code/Magento/Core/Model/Session/Generic.php +++ b/app/code/Magento/Core/Model/Session/Generic.php @@ -27,17 +27,21 @@ class Generic extends \Magento\Core\Model\Session\AbstractSession { /** * @param \Magento\Core\Model\Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param string $sessionNamespace * @param array $data * @param null $sessionName */ public function __construct( \Magento\Core\Model\Session\Context $context, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, $sessionNamespace, array $data = array(), $sessionName = null ) { - parent::__construct($context, $data); - $this->init($sessionNamespace, $sessionName); + parent::__construct($context, $sidResolver, $sessionConfig, $data); + $this->start($sessionNamespace, $sessionName); } } diff --git a/app/code/Magento/Core/Model/Session/SidResolver.php b/app/code/Magento/Core/Model/Session/SidResolver.php new file mode 100644 index 00000000000..f99b7c1ae2a --- /dev/null +++ b/app/code/Magento/Core/Model/Session/SidResolver.php @@ -0,0 +1,113 @@ +<?php +/** + * SID resolver + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Core\Model\Session; + +class SidResolver implements \Magento\Session\SidResolverInterface +{ + /** + * Config path for flag whether use SID on frontend + */ + const XML_PATH_USE_FRONTEND_SID = 'web/session/use_frontend_sid'; + + /** + * @var \Magento\Core\Model\StoreManagerInterface + */ + protected $storeManager; + + /** + * @var \Magento\Core\Model\Store\ConfigInterface + */ + protected $coreStoreConfig; + + /** + * @var \Magento\UrlInterface + */ + protected $urlBuilder; + + /** + * @var \Magento\App\RequestInterface + */ + protected $request; + + /** + * @var array + */ + protected $sidNameMap; + + /** + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig + * @param \Magento\UrlInterface $urlBuilder + * @param \Magento\App\RequestInterface $request + * @param array $sidNameMap + */ + public function __construct( + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, + \Magento\UrlInterface $urlBuilder, + \Magento\App\RequestInterface $request, + array $sidNameMap = array() + ) { + $this->storeManager = $storeManager; + $this->coreStoreConfig = $coreStoreConfig; + $this->urlBuilder = $urlBuilder; + $this->request = $request; + $this->sidNameMap = $sidNameMap; + } + + /** + * @param AbstractSession $session + * @return string + */ + public function getSid(AbstractSession $session) + { + $sidKey = null; + if ($this->coreStoreConfig->getConfig(self::XML_PATH_USE_FRONTEND_SID) + && $this->request->getQuery($this->getSessionIdQueryParam($session), false) + && $this->urlBuilder->isOwnOriginUrl() + ) { + $sidKey = $this->request->getQuery($this->getSessionIdQueryParam($session)); + } + return $sidKey; + } + + /** + * Get session id query param + * + * @param AbstractSession $session + * @return string + */ + public function getSessionIdQueryParam(AbstractSession $session) + { + $sessionName = $session->getName(); + if ($sessionName && isset($this->sidNameMap[$sessionName])) { + return $this->sidNameMap[$sessionName]; + } + return self::SESSION_ID_QUERY_PARAM; + } +} diff --git a/app/code/Magento/Core/Model/Session/Validator.php b/app/code/Magento/Core/Model/Session/Validator.php index 47f5e35ee94..89a1ee56f21 100644 --- a/app/code/Magento/Core/Model/Session/Validator.php +++ b/app/code/Magento/Core/Model/Session/Validator.php @@ -78,7 +78,7 @@ class Validator $_SESSION[self::VALIDATOR_KEY] = $this->_getSessionEnvironment(); } else { if (!$this->_validate()) { - $session->getCookie()->delete(session_name()); + $session->destroy(array('clear_storage' => false)); // throw core session exception throw new \Magento\Core\Model\Session\Exception(''); } diff --git a/app/code/Magento/Core/Model/Store.php b/app/code/Magento/Core/Model/Store.php index 7689e317703..37e0e982129 100644 --- a/app/code/Magento/Core/Model/Store.php +++ b/app/code/Magento/Core/Model/Store.php @@ -291,9 +291,21 @@ class Store extends \Magento\Core\Model\AbstractModel protected $_config; /** - * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase + * @var \Magento\Session\SidResolverInterface + */ + protected $_sidResolver; + + /** + * Cookie model + * + * @var \Magento\Stdlib\Cookie + */ + protected $_cookie; + + /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Core\Model\Url $url * @param \Magento\App\RequestInterface $request @@ -303,14 +315,16 @@ class Store extends \Magento\Core\Model\AbstractModel * @param \Magento\Core\Model\Config $coreConfig * @param \Magento\Core\Model\Resource\Store $resource * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Stdlib\Cookie $cookie * @param \Magento\Data\Collection\Db $resourceCollection * @param bool $isCustomEntryPoint * @param array $data */ public function __construct( - \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, \Magento\App\Cache\Type\Config $configCacheType, \Magento\Core\Model\Url $url, \Magento\App\RequestInterface $request, @@ -320,6 +334,8 @@ class Store extends \Magento\Core\Model\AbstractModel \Magento\Core\Model\Config $coreConfig, \Magento\Core\Model\Resource\Store $resource, \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Stdlib\Cookie $cookie, \Magento\Data\Collection\Db $resourceCollection = null, $isCustomEntryPoint = false, array $data = array() @@ -333,8 +349,10 @@ class Store extends \Magento\Core\Model\AbstractModel $this->_isCustomEntryPoint = $isCustomEntryPoint; $this->_dir = $dir; $this->_config = $coreConfig; - parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->_storeManager = $storeManager; + $this->_sidResolver = $sidResolver; + $this->_cookie = $cookie; + parent::__construct($context, $registry, $resource, $resourceCollection, $data); } public function __sleep() @@ -360,6 +378,8 @@ class Store extends \Magento\Core\Model\AbstractModel ->get('Magento\Core\Model\Store\Config'); $this->_config = \Magento\App\ObjectManager::getInstance() ->get('Magento\Core\Model\Config'); + $this->_cookie = \Magento\App\ObjectManager::getInstance() + ->get('Magento\Stdlib\Cookie'); } /** @@ -378,8 +398,9 @@ class Store extends \Magento\Core\Model\AbstractModel protected function _getSession() { if (!$this->_session) { - $this->_session = \Magento\App\ObjectManager::getInstance()->create('Magento\Core\Model\Session') - ->init('store_'.$this->getCode()); + $this->_session = \Magento\App\ObjectManager::getInstance() + ->create('Magento\Core\Model\Session') + ->start('store_' . $this->getCode()); } return $this->_session; } @@ -815,11 +836,9 @@ class Store extends \Magento\Core\Model\AbstractModel if (in_array($code, $this->getAvailableCurrencyCodes())) { $this->_getSession()->setCurrencyCode($code); if ($code == $this->getDefaultCurrency()) { - \Magento\App\ObjectManager::getInstance() - ->get('Magento\Core\Model\App')->getCookie()->delete(self::COOKIE_CURRENCY, $code); + $this->_cookie->set(self::COOKIE_CURRENCY, null); } else { - \Magento\App\ObjectManager::getInstance() - ->get('Magento\Core\Model\App')->getCookie()->set(self::COOKIE_CURRENCY, $code); + $this->_cookie->set(self::COOKIE_CURRENCY, $code); } } return $this; @@ -1078,7 +1097,7 @@ class Store extends \Magento\Core\Model\AbstractModel */ public function getCurrentUrl($fromStore = true) { - $sidQueryParam = $this->_getSession()->getSessionIdQueryParam(); + $sidQueryParam = $this->_sidResolver->getSessionIdQueryParam($this->_getSession()); $requestString = $this->getUrlModel()->escape(ltrim( \Magento\App\ObjectManager::getInstance() ->get('Magento\Core\Model\App')->getRequest()->getRequestString(), diff --git a/app/code/Magento/Core/Model/Store/Storage/Db.php b/app/code/Magento/Core/Model/Store/Storage/Db.php index eaff6813981..cec17400b0d 100644 --- a/app/code/Magento/Core/Model/Store/Storage/Db.php +++ b/app/code/Magento/Core/Model/Store/Storage/Db.php @@ -30,7 +30,6 @@ use Magento\Core\Exception; use Magento\App\State; use Magento\Core\Model\AppInterface; use Magento\Core\Model\Config; -use Magento\Core\Model\Cookie; use Magento\Core\Model\Store; use Magento\Core\Model\Store\StorageInterface; use Magento\Core\Model\Store\Group; @@ -164,7 +163,7 @@ class Db implements StorageInterface * @param Website\Factory $websiteFactory * @param Group\Factory $groupFactory * @param Config $config - * @param Cookie $cookie + * @param \Magento\Stdlib\Cookie $cookie * @param State $appState * @param \Magento\Backend\Model\Url $url * @param $isSingleStoreAllowed @@ -177,7 +176,7 @@ class Db implements StorageInterface \Magento\Core\Model\Website\Factory $websiteFactory, \Magento\Core\Model\Store\Group\Factory $groupFactory, \Magento\Core\Model\Config $config, - \Magento\Core\Model\Cookie $cookie, + \Magento\Stdlib\Cookie $cookie, \Magento\App\State $appState, \Magento\Backend\Model\Url $url, $isSingleStoreAllowed, @@ -291,7 +290,7 @@ class Db implements StorageInterface if ($this->_currentStore == $store) { $store = $this->getStore($store); if ($store->getWebsite()->getDefaultStore()->getId() == $store->getId()) { - $this->_cookie->delete(Store::COOKIE_NAME); + $this->_cookie->set(Store::COOKIE_NAME, null); } else { $this->_cookie->set(Store::COOKIE_NAME, $this->_currentStore, true); } diff --git a/app/code/Magento/Core/Model/Store/StorageFactory.php b/app/code/Magento/Core/Model/Store/StorageFactory.php index e2c0285a87c..fc403b332bc 100644 --- a/app/code/Magento/Core/Model/Store/StorageFactory.php +++ b/app/code/Magento/Core/Model/Store/StorageFactory.php @@ -130,7 +130,7 @@ class StorageFactory $instance->initCurrentStore(); if ($className === $this->_installedStoreClassName) { $useSid = $instance->getStore() - ->getConfig(\Magento\Core\Model\Session\AbstractSession::XML_PATH_USE_FRONTEND_SID); + ->getConfig(\Magento\Core\Model\Session\SidResolver::XML_PATH_USE_FRONTEND_SID); $this->_app->setUseSessionInUrl($useSid); $this->_eventManager->dispatch('core_app_init_current_store_after'); diff --git a/app/code/Magento/Core/Model/Template.php b/app/code/Magento/Core/Model/Template.php index b788b4282f9..b087bdd31c3 100644 --- a/app/code/Magento/Core/Model/Template.php +++ b/app/code/Magento/Core/Model/Template.php @@ -102,16 +102,16 @@ abstract class Template extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Context $context + * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param array $data */ public function __construct( - \Magento\View\DesignInterface $design, \Magento\Core\Model\Context $context, + \Magento\View\DesignInterface $design, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Core/Model/Theme/Collection.php b/app/code/Magento/Core/Model/Theme/Collection.php index 1212e36c635..d0b3f1b46b9 100644 --- a/app/code/Magento/Core/Model/Theme/Collection.php +++ b/app/code/Magento/Core/Model/Theme/Collection.php @@ -58,14 +58,14 @@ class Collection extends \Magento\Data\Collection protected $_targetDirs = array(); /** + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Filesystem $filesystem * @param \Magento\App\Dir $dirs - * @param \Magento\Core\Model\EntityFactory $entityFactory */ public function __construct( + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Filesystem $filesystem, - \Magento\App\Dir $dirs, - \Magento\Core\Model\EntityFactory $entityFactory + \Magento\App\Dir $dirs ) { parent::__construct($entityFactory); $this->_filesystem = $filesystem; diff --git a/app/code/Magento/Core/Model/Translate/Inline.php b/app/code/Magento/Core/Model/Translate/Inline.php index c18bd207236..184ce74f845 100644 --- a/app/code/Magento/Core/Model/Translate/Inline.php +++ b/app/code/Magento/Core/Model/Translate/Inline.php @@ -180,8 +180,8 @@ class Inline implements \Magento\Core\Model\Translate\InlineInterface return; } - /** @var $block \Magento\View\Block\Template */ - $block = $this->_layout->createBlock('Magento\View\Block\Template'); + /** @var $block \Magento\View\Element\Template */ + $block = $this->_layout->createBlock('Magento\View\Element\Template'); $block->setAjaxUrl($this->_getAjaxUrl()); diff --git a/app/code/Magento/Core/Model/Url.php b/app/code/Magento/Core/Model/Url.php index 975f9322271..b209e7bd50f 100644 --- a/app/code/Magento/Core/Model/Url.php +++ b/app/code/Magento/Core/Model/Url.php @@ -151,6 +151,11 @@ class Url extends \Magento\Object implements \Magento\UrlInterface */ protected $_session; + /** + * @var \Magento\Session\SidResolverInterface + */ + protected $_sidResolver; + /** * Constructor * @@ -171,6 +176,7 @@ class Url extends \Magento\Object implements \Magento\UrlInterface * @param App $app * @param StoreManager $storeManager * @param Session $session + * @param \Magento\Session\SidResolverInterface $sidResolver * @param null $areaCode * @param array $data */ @@ -182,6 +188,7 @@ class Url extends \Magento\Object implements \Magento\UrlInterface \Magento\Core\Model\App $app, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Session $session, + \Magento\Session\SidResolverInterface $sidResolver, $areaCode = null, array $data = array() ) { @@ -192,6 +199,7 @@ class Url extends \Magento\Object implements \Magento\UrlInterface $this->_app = $app; $this->_storeManager = $storeManager; $this->_session = $session; + $this->_sidResolver = $sidResolver; $this->_areaCode = $areaCode; parent::__construct($data); } @@ -844,12 +852,14 @@ class Url extends \Magento\Object implements \Magento\UrlInterface { $hostArr = explode(':', $this->getRequest()->getServer('HTTP_HOST')); if ($hostArr[0] !== $this->getHost()) { - $session = $this->_session; - if (!$session->isValidForHost($this->getHost())) { + if (!$this->_session->isValidForHost($this->getHost())) { if (!self::$_encryptedSessionId) { - self::$_encryptedSessionId = $session->getEncryptedSessionId(); + self::$_encryptedSessionId = $this->_session->getSessionId(); } - $this->setQueryParam($session->getSessionIdQueryParam(), self::$_encryptedSessionId); + $this->setQueryParam( + $this->_sidResolver->getSessionIdQueryParam($this->_session), + self::$_encryptedSessionId + ); } } return $this; @@ -863,9 +873,9 @@ class Url extends \Magento\Object implements \Magento\UrlInterface public function addSessionParam() { if (!self::$_encryptedSessionId) { - self::$_encryptedSessionId = $this->_session->getEncryptedSessionId(); + self::$_encryptedSessionId = $this->_session->getSessionId(); } - $this->setQueryParam($this->_session->getSessionIdQueryParam(), self::$_encryptedSessionId); + $this->setQueryParam($this->_sidResolver->getSessionIdQueryParam($this->_session), self::$_encryptedSessionId); return $this; } @@ -1120,7 +1130,7 @@ class Url extends \Magento\Object implements \Magento\UrlInterface if ($this->_app->getUseSessionVar() && !$sessionId) { $this->setQueryParam('___SID', $this->isSecure() ? 'S' : 'U'); // Secure/Unsecure } else if ($sessionId) { - $this->setQueryParam($this->_session->getSessionIdQueryParam(), $sessionId); + $this->setQueryParam($this->_sidResolver->getSessionIdQueryParam($this->_session), $sessionId); } return $this; } @@ -1230,8 +1240,8 @@ class Url extends \Magento\Object implements \Magento\UrlInterface { if ($this->useSessionIdForUrl($match[2] == 'S' ? true : false)) { return $match[1] - . $this->_session->getSessionIdQueryParam() - . '=' . $this->_session->getEncryptedSessionId() + . $this->_sidResolver->getSessionIdQueryParam($this->_session) + . '=' . $this->_session->getSessionId() . (isset($match[3]) ? $match[3] : ''); } else { if ($match[1] == '?' && isset($match[3])) { diff --git a/app/code/Magento/Core/Model/Variable.php b/app/code/Magento/Core/Model/Variable.php index 4e798263e45..3c590b3b4b2 100644 --- a/app/code/Magento/Core/Model/Variable.php +++ b/app/code/Magento/Core/Model/Variable.php @@ -53,17 +53,17 @@ class Variable extends \Magento\Core\Model\AbstractModel protected $_escaper = null; /** - * @param \Magento\Escaper $escaper * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Escaper $escaper * @param \Magento\Core\Model\Resource\Variable $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Escaper $escaper, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Escaper $escaper, \Magento\Core\Model\Resource\Variable $resource, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Core/etc/di.xml b/app/code/Magento/Core/etc/di.xml index 1283d811a86..e7c79712c20 100644 --- a/app/code/Magento/Core/etc/di.xml +++ b/app/code/Magento/Core/etc/di.xml @@ -32,7 +32,7 @@ <preference for="Magento\Authorization\RoleLocator" type="Magento\Authorization\RoleLocator\DefaultRoleLocator" /> <preference for="Magento\Core\Model\Session\AbstractSession" type="Magento\Core\Model\Session" /> <preference for="Magento\Core\Model\LocaleInterface" type="Magento\Core\Model\Locale" /> - <preference for="Magento\Core\Model\Page\Asset\MergeStrategyInterface" type="Magento\Core\Model\Page\Asset\MergeStrategy\Direct" /> + <preference for="Magento\View\Asset\MergeStrategyInterface" type="Magento\View\Asset\MergeStrategy\Direct" /> <preference for="Magento\Core\Model\DataService\ConfigInterface" type="Magento\Core\Model\DataService\Config" /> <preference for="Magento\Core\Model\ConfigInterface" type="Magento\Core\Model\Config" /> <preference for="Magento\Core\Model\Config\DataInterface" type="Magento\Core\Model\Config\Data" /> @@ -51,6 +51,7 @@ <preference for="Magento\View\Design\Theme\ThemeProviderInterface" type="Magento\Core\Model\Theme\ThemeProvider" /> <preference for="Magento\View\Design\Theme\FileProviderInterface" type="Magento\Core\Model\Theme\FileProvider" /> <preference for="Magento\View\Design\Theme\Customization\ConfigInterface" type="Magento\Core\Model\Theme\Customization\Config" /> + <preference for="Magento\View\Asset\ConfigInterface" type="Magento\Core\Model\Asset\Config" /> <preference for="Magento\App\ViewInterface" type="Magento\App\View" /> <preference for="Magento\TranslateInterface" type="Magento\Core\Model\Translate" /> <preference for="Magento\App\Response\RedirectInterface" type="Magento\Core\App\Response\Redirect" /> @@ -165,7 +166,7 @@ <instance type="Magento\Core\Model\Resource\Store\Collection\FetchStrategy" /> </param> </type> - <type name="Magento\Core\Model\Page\Asset\Collection" shared="false" /> + <type name="Magento\View\Asset\Collection" shared="false" /> <type name="Magento\Core\Model\Theme\Collection" shared="false" /> <type name="Magento\Core\Model\Observer"> <param name="config"> @@ -362,16 +363,15 @@ </type> <type name="Magento\Core\Model\Session\Context"> <param name="saveMethod"> - <value type="argument">Magento\Core\Model\Session\AbstractSession::PARAM_SESSION_SAVE_METHOD</value> + <value type="argument">Magento\Core\Model\Session\Config::PARAM_SESSION_SAVE_METHOD</value> </param> + </type> + <type name="Magento\Core\Model\Session\Config"> <param name="savePath"> - <value type="argument">Magento\Core\Model\Session\AbstractSession::PARAM_SESSION_SAVE_PATH</value> + <value type="argument">Magento\Core\Model\Session\Config::PARAM_SESSION_SAVE_PATH</value> </param> <param name="cacheLimiter"> - <value type="argument">Magento\Core\Model\Session\AbstractSession::PARAM_SESSION_CACHE_LIMITER</value> - </param> - <param name="url"> - <instance type="Magento\Core\Model\Url\Proxy" /> + <value type="argument">Magento\Core\Model\Session\Config::PARAM_SESSION_CACHE_LIMITER</value> </param> </type> <type name="Magento\Core\Model\StoreManager"> @@ -461,6 +461,7 @@ </param> </type> <type name="Magento\App\FrontController"> + <plugin name="install" type="Magento\Module\FrontController\Plugin\Install" sortOrder="40"/> <plugin name="dispatchExceptionHandler" type="Magento\Core\App\FrontController\Plugin\DispatchExceptionHandler" sortOrder="30"/> <plugin name="clickjacking" type="Magento\App\FrontController\Plugin\Clickjacking" sortOrder="0"/> </type> @@ -475,4 +476,7 @@ <instance type="Magento\Core\Model\Date\Proxy" /> </param> </type> + <type name="Magento\View\Asset\MergeService"> + <plugin name="cleanMergedJsCss" type="Magento\Core\Model\Asset\Plugin\CleanMergedJsCss"/> + </type> </config> diff --git a/app/code/Magento/Core/etc/module.xml b/app/code/Magento/Core/etc/module.xml index fee188b4556..05c7ebe25be 100755 --- a/app/code/Magento/Core/etc/module.xml +++ b/app/code/Magento/Core/etc/module.xml @@ -45,7 +45,6 @@ <module name="Magento_PaypalUk"/> <module name="Magento_ProductAlert"/> <module name="Magento_SalesRule"/> - <module name="Magento_Page"/> <extension name="spl"/> <extension name="dom"/> <extension name="simplexml"/> diff --git a/app/code/Magento/Core/view/adminhtml/prototype/magento.css b/app/code/Magento/Core/view/adminhtml/prototype/magento.css index d9ba2471caf..601e9bbd21e 100644 --- a/app/code/Magento/Core/view/adminhtml/prototype/magento.css +++ b/app/code/Magento/Core/view/adminhtml/prototype/magento.css @@ -292,6 +292,11 @@ float: right; } +.insert-actions button { + float: left; + margin-left: 4px; +} + .insert-title-inner > .title { color: #666; display: inline-block; diff --git a/app/code/Magento/Page/view/frontend/switch/flags.phtml b/app/code/Magento/Core/view/frontend/switch/flags.phtml similarity index 100% rename from app/code/Magento/Page/view/frontend/switch/flags.phtml rename to app/code/Magento/Core/view/frontend/switch/flags.phtml diff --git a/app/code/Magento/Page/view/frontend/switch/languages.phtml b/app/code/Magento/Core/view/frontend/switch/languages.phtml similarity index 96% rename from app/code/Magento/Page/view/frontend/switch/languages.phtml rename to app/code/Magento/Core/view/frontend/switch/languages.phtml index 3b6a76e6cb6..39253e79256 100644 --- a/app/code/Magento/Page/view/frontend/switch/languages.phtml +++ b/app/code/Magento/Core/view/frontend/switch/languages.phtml @@ -26,13 +26,11 @@ <?php /** * Language switcher template - * - * @see \Magento\Page\Block\Switch */ ?> <?php if(count($this->getStores())>1): ?> -<div class="switcher language"> +<div class="switcher language" data-ui-id="language-switcher"> <strong class="label"><span><?php echo __('Language') ?></span></strong> <div class="options"> <strong class="view-<?php echo $this->escapeHtml($this->getCurrentStoreCode()) ?>"> diff --git a/app/code/Magento/Page/view/frontend/switch/stores.phtml b/app/code/Magento/Core/view/frontend/switch/stores.phtml similarity index 100% rename from app/code/Magento/Page/view/frontend/switch/stores.phtml rename to app/code/Magento/Core/view/frontend/switch/stores.phtml diff --git a/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php b/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php index 73bd8c1bccf..0618c9a9482 100644 --- a/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php +++ b/app/code/Magento/Cron/Model/Config/Backend/Product/Alert.php @@ -56,22 +56,22 @@ class Alert extends \Magento\Core\Model\Config\Value protected $_runModelPath = ''; /** - * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param string $runModelPath * @param array $data */ public function __construct( - \Magento\Core\Model\Config\ValueFactory $configValueFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\Core\Model\Config\ValueFactory $configValueFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, $runModelPath = '', diff --git a/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php b/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php index 246c3602428..8925d2c2612 100644 --- a/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php +++ b/app/code/Magento/Cron/Model/Config/Backend/Sitemap.php @@ -56,22 +56,22 @@ class Sitemap extends \Magento\Core\Model\Config\Value protected $_runModelPath = ''; /** - * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\Core\Model\Config\ValueFactory $configValueFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param string $runModelPath * @param array $data */ public function __construct( - \Magento\Core\Model\Config\ValueFactory $configValueFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\Core\Model\Config\ValueFactory $configValueFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, $runModelPath = '', diff --git a/app/code/Magento/Cron/Model/Schedule.php b/app/code/Magento/Cron/Model/Schedule.php index 7537d5099c3..a1b9d179c1b 100644 --- a/app/code/Magento/Cron/Model/Schedule.php +++ b/app/code/Magento/Cron/Model/Schedule.php @@ -64,17 +64,17 @@ class Schedule extends \Magento\Core\Model\AbstractModel protected $_date; /** - * @param \Magento\Core\Model\Date $date * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\Date $date * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\Date $date, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\Date $date, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Matrix.php b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Matrix.php index f6bec982331..a40cb9ceadf 100644 --- a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Matrix.php +++ b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Matrix.php @@ -42,20 +42,18 @@ class Matrix extends \Magento\Backend\Block\Template */ protected $_dirCurrencyFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Directory\Model\CurrencyFactory $dirCurrencyFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Directory\Model\CurrencyFactory $dirCurrencyFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Directory\Model\CurrencyFactory $dirCurrencyFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Directory\Model\CurrencyFactory $dirCurrencyFactory, + array $data = array() + ) { $this->_dirCurrencyFactory = $dirCurrencyFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Services.php b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Services.php index 0b69229b086..4e2f8c5ff7d 100644 --- a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Services.php +++ b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currency/Rate/Services.php @@ -48,30 +48,28 @@ class Services extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Directory\Model\Currency\Import\Source\ServiceFactory $srcCurrencyFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Directory\Model\Currency\Import\Source\ServiceFactory $srcCurrencyFactory, array $data = array() ) { $this->_srcCurrencyFactory = $srcCurrencyFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** * Create import services form select element * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { $this->setChild( 'import_services', - $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setOptions($this->_srcCurrencyFactory->create()->toOptionArray()) ->setId('rate_services') ->setName('rate_services') diff --git a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php index 1b0b197992b..3aeab5c6733 100644 --- a/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php +++ b/app/code/Magento/CurrencySymbol/Block/Adminhtml/System/Currencysymbol.php @@ -40,20 +40,18 @@ class Currencysymbol extends \Magento\Backend\Block\Widget\Form */ protected $_symbolSystemFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolSystemFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolSystemFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolSystemFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\CurrencySymbol\Model\System\CurrencysymbolFactory $symbolSystemFactory, + array $data = array() + ) { $this->_symbolSystemFactory = $symbolSystemFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -76,7 +74,7 @@ class Currencysymbol extends \Magento\Backend\Block\Widget\Form /** * Prepares layout * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { @@ -100,7 +98,7 @@ class Currencysymbol extends \Magento\Backend\Block\Widget\Form */ public function getSaveButtonHtml() { - /** @var $block \Magento\View\Block\AbstractBlock */ + /** @var $block \Magento\View\Element\AbstractBlock */ $block = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Widget\Button'); $block->setData(array( 'label' => __('Save Currency Symbols'), diff --git a/app/code/Magento/Customer/Block/Account/AuthorizationLink.php b/app/code/Magento/Customer/Block/Account/AuthorizationLink.php index 0b86e73af83..f36ee8ecbf6 100644 --- a/app/code/Magento/Customer/Block/Account/AuthorizationLink.php +++ b/app/code/Magento/Customer/Block/Account/AuthorizationLink.php @@ -27,7 +27,7 @@ namespace Magento\Customer\Block\Account; /** * Customer authorization link */ -class AuthorizationLink extends \Magento\Page\Block\Link +class AuthorizationLink extends \Magento\View\Element\Html\Link { /** * Customer session @@ -37,18 +37,16 @@ class AuthorizationLink extends \Magento\Page\Block\Link protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $session * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $session, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_customerSession = $session; } diff --git a/app/code/Magento/Customer/Block/Account/Customer.php b/app/code/Magento/Customer/Block/Account/Customer.php index 2690deb58c5..3876569063c 100644 --- a/app/code/Magento/Customer/Block/Account/Customer.php +++ b/app/code/Magento/Customer/Block/Account/Customer.php @@ -24,7 +24,7 @@ namespace Magento\Customer\Block\Account; -class Customer extends \Magento\View\Block\Template +class Customer extends \Magento\View\Element\Template { /** * Customer session @@ -34,18 +34,16 @@ class Customer extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $session * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $session, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_customerSession = $session; } diff --git a/app/code/Magento/Customer/Block/Account/Dashboard.php b/app/code/Magento/Customer/Block/Account/Dashboard.php index cd2fde10f78..ae4b35d8962 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard.php @@ -33,7 +33,7 @@ */ namespace Magento\Customer\Block\Account; -class Dashboard extends \Magento\View\Block\Template +class Dashboard extends \Magento\View\Element\Template { /** * @var \Magento\Newsletter\Model\Subscriber @@ -51,22 +51,20 @@ class Dashboard extends \Magento\View\Block\Template protected $_subscriberFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, array $data = array() ) { $this->_customerSession = $customerSession; $this->_subscriberFactory = $subscriberFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getCustomer() diff --git a/app/code/Magento/Customer/Block/Account/Dashboard/Address.php b/app/code/Magento/Customer/Block/Account/Dashboard/Address.php index 7e46d6c916d..46ba260f388 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard/Address.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard/Address.php @@ -34,7 +34,7 @@ namespace Magento\Customer\Block\Account\Dashboard; -class Address extends \Magento\View\Block\Template +class Address extends \Magento\View\Element\Template { /** * @var \Magento\Customer\Model\Session @@ -42,19 +42,17 @@ class Address extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getCustomer() diff --git a/app/code/Magento/Customer/Block/Account/Dashboard/Block.php b/app/code/Magento/Customer/Block/Account/Dashboard/Block.php index 5215d420c52..eda0a34ac3e 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard/Block.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard/Block.php @@ -27,7 +27,7 @@ namespace Magento\Customer\Block\Account\Dashboard; -class Block extends \Magento\View\Block\Template +class Block extends \Magento\View\Element\Template { } diff --git a/app/code/Magento/Customer/Block/Account/Dashboard/Hello.php b/app/code/Magento/Customer/Block/Account/Dashboard/Hello.php index 3aa0b3e3475..85881cfa95b 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard/Hello.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard/Hello.php @@ -27,7 +27,7 @@ namespace Magento\Customer\Block\Account\Dashboard; -class Hello extends \Magento\View\Block\Template +class Hello extends \Magento\View\Element\Template { /** * @var \Magento\Customer\Model\Session @@ -35,19 +35,17 @@ class Hello extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getCustomerName() diff --git a/app/code/Magento/Customer/Block/Account/Dashboard/Info.php b/app/code/Magento/Customer/Block/Account/Dashboard/Info.php index 1687e8bb5f6..b914b35f9b2 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard/Info.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard/Info.php @@ -34,7 +34,7 @@ namespace Magento\Customer\Block\Account\Dashboard; -class Info extends \Magento\View\Block\Template +class Info extends \Magento\View\Element\Template { /** * Cached subscription object @@ -54,22 +54,20 @@ class Info extends \Magento\View\Block\Template protected $_subscriberFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, array $data = array() ) { $this->_customerSession = $customerSession; $this->_subscriberFactory = $subscriberFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } diff --git a/app/code/Magento/Customer/Block/Account/Dashboard/Newsletter.php b/app/code/Magento/Customer/Block/Account/Dashboard/Newsletter.php index bab61998c26..eea4c44bae3 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard/Newsletter.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard/Newsletter.php @@ -34,7 +34,7 @@ namespace Magento\Customer\Block\Account\Dashboard; -class Newsletter extends \Magento\View\Block\Template +class Newsletter extends \Magento\View\Element\Template { /** * @var \Magento\Newsletter\Model\Subscriber @@ -52,22 +52,20 @@ class Newsletter extends \Magento\View\Block\Template protected $_subscriberFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, array $data = array() ) { $this->_customerSession = $customerSession; $this->_subscriberFactory = $subscriberFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getSubscriptionObject() diff --git a/app/code/Magento/Customer/Block/Account/Dashboard/Sidebar.php b/app/code/Magento/Customer/Block/Account/Dashboard/Sidebar.php index 4dc447ac5fb..3f1a5fa350d 100644 --- a/app/code/Magento/Customer/Block/Account/Dashboard/Sidebar.php +++ b/app/code/Magento/Customer/Block/Account/Dashboard/Sidebar.php @@ -34,7 +34,7 @@ namespace Magento\Customer\Block\Account\Dashboard; -class Sidebar extends \Magento\View\Block\Template +class Sidebar extends \Magento\View\Element\Template { protected $_cartItemsCount; @@ -73,8 +73,7 @@ class Sidebar extends \Magento\View\Block\Template protected $_itemsCompareFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Sales\Model\QuoteFactory $quoteFactory @@ -83,8 +82,7 @@ class Sidebar extends \Magento\View\Block\Template * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Sales\Model\QuoteFactory $quoteFactory, @@ -97,7 +95,7 @@ class Sidebar extends \Magento\View\Block\Template $this->_quoteFactory = $quoteFactory; $this->_wishListFactory = $wishListFactory; $this->_itemsCompareFactory = $itemsCompareFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } diff --git a/app/code/Magento/Customer/Block/Account/Forgotpassword.php b/app/code/Magento/Customer/Block/Account/Forgotpassword.php index 3806aca5ca1..ff7873c924d 100644 --- a/app/code/Magento/Customer/Block/Account/Forgotpassword.php +++ b/app/code/Magento/Customer/Block/Account/Forgotpassword.php @@ -34,7 +34,7 @@ namespace Magento\Customer\Block\Account; -class Forgotpassword extends \Magento\View\Block\Template +class Forgotpassword extends \Magento\View\Element\Template { } diff --git a/app/code/Magento/Customer/Block/Account/Link.php b/app/code/Magento/Customer/Block/Account/Link.php index e45d47ac74e..3375ac23f6c 100644 --- a/app/code/Magento/Customer/Block/Account/Link.php +++ b/app/code/Magento/Customer/Block/Account/Link.php @@ -24,7 +24,7 @@ namespace Magento\Customer\Block\Account; -class Link extends \Magento\Page\Block\Link +class Link extends \Magento\View\Element\Html\Link { /** * @return string diff --git a/app/code/Magento/Customer/Block/Account/RegisterLink.php b/app/code/Magento/Customer/Block/Account/RegisterLink.php index fc4a6b688c4..17922920e20 100644 --- a/app/code/Magento/Customer/Block/Account/RegisterLink.php +++ b/app/code/Magento/Customer/Block/Account/RegisterLink.php @@ -27,7 +27,7 @@ namespace Magento\Customer\Block\Account; /** * Customer register link */ -class RegisterLink extends \Magento\Page\Block\Link +class RegisterLink extends \Magento\View\Element\Html\Link { /** * Customer session @@ -37,18 +37,16 @@ class RegisterLink extends \Magento\Page\Block\Link protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $session * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $session, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_customerSession = $session; } diff --git a/app/code/Magento/Customer/Block/Account/Resetpassword.php b/app/code/Magento/Customer/Block/Account/Resetpassword.php index 212137a0241..caedaf8bee0 100644 --- a/app/code/Magento/Customer/Block/Account/Resetpassword.php +++ b/app/code/Magento/Customer/Block/Account/Resetpassword.php @@ -34,7 +34,7 @@ namespace Magento\Customer\Block\Account; -class Resetpassword extends \Magento\View\Block\Template +class Resetpassword extends \Magento\View\Element\Template { } diff --git a/app/code/Magento/Customer/Block/Address/Book.php b/app/code/Magento/Customer/Block/Address/Book.php index 7dcc00c2807..3f0f470ce4e 100644 --- a/app/code/Magento/Customer/Block/Address/Book.php +++ b/app/code/Magento/Customer/Block/Address/Book.php @@ -33,7 +33,7 @@ */ namespace Magento\Customer\Block\Address; -class Book extends \Magento\View\Block\Template +class Book extends \Magento\View\Element\Template { /** * @var \Magento\Customer\Model\Session @@ -41,19 +41,17 @@ class Book extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Customer/Block/Address/Edit.php b/app/code/Magento/Customer/Block/Address/Edit.php index dd028ffc6af..92b93b66721 100644 --- a/app/code/Magento/Customer/Block/Address/Edit.php +++ b/app/code/Magento/Customer/Block/Address/Edit.php @@ -51,7 +51,8 @@ class Edit extends \Magento\Directory\Block\Data protected $_addressFactory; /** - * @param \Magento\View\Block\Template\Context $context + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory @@ -62,8 +63,9 @@ class Edit extends \Magento\Directory\Block\Data * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\App\Cache\Type\Config $configCacheType, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory, @@ -75,7 +77,9 @@ class Edit extends \Magento\Directory\Block\Data $this->_config = $config; $this->_customerSession = $customerSession; $this->_addressFactory = $addressFactory; - parent::__construct($context, $coreData, $configCacheType, $regionCollFactory, $countryCollFactory, $data); + parent::__construct( + $context, $coreData, $jsonEncoder, $configCacheType, $regionCollFactory, $countryCollFactory, $data + ); } protected function _prepareLayout() diff --git a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php index 068f0c09d76..17497cb0d89 100644 --- a/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php +++ b/app/code/Magento/Customer/Block/Address/Renderer/DefaultRenderer.php @@ -35,7 +35,7 @@ namespace Magento\Customer\Block\Address\Renderer; class DefaultRenderer - extends \Magento\View\Block\AbstractBlock + extends \Magento\View\Element\AbstractBlock implements \Magento\Customer\Block\Address\Renderer\RendererInterface { /** @@ -58,13 +58,13 @@ class DefaultRenderer protected $_attrDataFactory; /** - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\Customer\Helper\Address $customerAddress * @param \Magento\Eav\Model\AttributeDataFactory $attrDataFactory * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\Customer\Helper\Address $customerAddress, \Magento\Eav\Model\AttributeDataFactory $attrDataFactory, array $data = array() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit.php b/app/code/Magento/Customer/Block/Adminhtml/Edit.php index a386b98f3dc..31e709eedad 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit.php @@ -42,20 +42,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/Group.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/Group.php index d32bcbad187..966bcd80b14 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/Group.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Renderer/Attribute/Group.php @@ -52,23 +52,21 @@ class Group */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Customer\Helper\Address $customerAddress - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Customer\Helper\Address $customerAddress + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Customer\Helper\Address $customerAddress, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Customer\Helper\Address $customerAddress, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_customerAddress = $customerAddress; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php index 8a41f3340bc..55d2a9ed7af 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Account.php @@ -55,27 +55,33 @@ class Account extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Customer\Model\FormFactory $customerFactory - * @param \Magento\Core\Model\System\Store $systemStore - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Customer\Model\FormFactory $customerFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Customer\Model\FormFactory $customerFactory, - \Magento\Core\Model\System\Store $systemStore, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Customer\Model\FormFactory $customerFactory, + \Magento\Core\Model\System\Store $systemStore, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_systemStore = $systemStore; $this->_customerFactory = $customerFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** @@ -288,7 +294,7 @@ class Account extends \Magento\Backend\Block\Widget\Form\Generic $form->getElement('website_id')->setAfterElementHtml( '<script type="text/javascript">' . " - var {$prefix}_websites = " . $this->_coreData->jsonEncode($websites) . "; + var {$prefix}_websites = " . $this->_jsonEncoder->encode($websites) . "; jQuery.validator.addMethod('validate-website-has-store', function(v, elem){ return {$prefix}_websites[elem.value] == true; }, diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php index 92b5ee0d467..4d5619f63b0 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Addresses.php @@ -44,36 +44,50 @@ class Addresses extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_adminhtmlAddresses = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Customer\Model\Renderer\RegionFactory $regionFactory - * @param \Magento\Customer\Model\AddressFactory $addressFactory - * @param \Magento\Customer\Model\FormFactory $customerFactory - * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Customer\Model\Renderer\RegionFactory $regionFactory + * @param \Magento\Customer\Model\AddressFactory $addressFactory + * @param \Magento\Customer\Model\FormFactory $customerFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Customer\Model\Renderer\RegionFactory $regionFactory, - \Magento\Customer\Model\AddressFactory $addressFactory, - \Magento\Customer\Model\FormFactory $customerFactory, - \Magento\Core\Model\System\Store $systemStore, - \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Customer\Model\Renderer\RegionFactory $regionFactory, + \Magento\Customer\Model\AddressFactory $addressFactory, + \Magento\Customer\Model\FormFactory $customerFactory, + \Magento\Core\Model\System\Store $systemStore, + \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses, + array $data = array() + ) { + $this->_coreData = $coreData; + $this->_jsonEncoder = $jsonEncoder; $this->_adminhtmlAddresses = $adminhtmlAddresses; $this->_regionFactory = $regionFactory; $this->_addressFactory = $addressFactory; $this->_customerFactory = $customerFactory; $this->_systemStore = $systemStore; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } public function getRegionsUrl() @@ -275,7 +289,7 @@ class Addresses extends \Magento\Backend\Block\Widget\Form\Generic ); } - return $this->_coreData->jsonEncode($result); + return $this->_jsonEncoder->encode($result); } /** diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Cart.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Cart.php index 590ac64c6e1..0b58d9a45ed 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Cart.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Cart.php @@ -55,28 +55,26 @@ class Cart extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_quoteFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\QuoteFactory $quoteFactory - * @param \Magento\Data\CollectionFactory $dataCollectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\QuoteFactory $quoteFactory + * @param \Magento\Data\CollectionFactory $dataCollectionFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\QuoteFactory $quoteFactory, - \Magento\Data\CollectionFactory $dataCollectionFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\QuoteFactory $quoteFactory, + \Magento\Data\CollectionFactory $dataCollectionFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_dataCollectionFactory = $dataCollectionFactory; $this->_coreRegistry = $coreRegistry; $this->_quoteFactory = $quoteFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Carts.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Carts.php index 239057fd690..5a565755270 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Carts.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Carts.php @@ -39,20 +39,18 @@ class Carts extends \Magento\Backend\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php index 5f2aa802b56..49bfacef392 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter.php @@ -42,24 +42,22 @@ class Newsletter extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_subscriberFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, + array $data = array() + ) { $this->_subscriberFactory = $subscriberFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } public function initForm() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php index ba3cd074bcf..90670db2e31 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Newsletter/Grid.php @@ -47,25 +47,23 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php index d8e6ce16073..404889eccac 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/Orders.php @@ -54,28 +54,26 @@ class Orders extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory - * @param \Magento\Sales\Helper\Reorder $salesReorder - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory + * @param \Magento\Sales\Helper\Reorder $salesReorder + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory, - \Magento\Sales\Helper\Reorder $salesReorder, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory, + \Magento\Sales\Helper\Reorder $salesReorder, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; $this->_salesReorder = $salesReorder; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php index dccfcde274a..8593c87dd8a 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View.php @@ -51,7 +51,6 @@ class View protected $_coreRegistry; /** - * @param \Magento\Core\Helper\Data $coreData * @var \Magento\Log\Model\Visitor */ protected $_modelVisitor; @@ -71,32 +70,30 @@ class View */ protected $dateTime; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Customer\Model\GroupFactory $groupFactory - * @param \Magento\Log\Model\CustomerFactory $logFactory - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Log\Model\Visitor $modelVisitor - * @param \Magento\Stdlib\DateTime $dateTime - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Customer\Model\GroupFactory $groupFactory + * @param \Magento\Log\Model\CustomerFactory $logFactory + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Log\Model\Visitor $modelVisitor + * @param \Magento\Stdlib\DateTime $dateTime + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Customer\Model\GroupFactory $groupFactory, - \Magento\Log\Model\CustomerFactory $logFactory, - \Magento\Core\Model\Registry $registry, - \Magento\Log\Model\Visitor $modelVisitor, - \Magento\Stdlib\DateTime $dateTime, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Customer\Model\GroupFactory $groupFactory, + \Magento\Log\Model\CustomerFactory $logFactory, + \Magento\Core\Model\Registry $registry, + \Magento\Log\Model\Visitor $modelVisitor, + \Magento\Stdlib\DateTime $dateTime, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_modelVisitor = $modelVisitor; $this->_groupFactory = $groupFactory; $this->_logFactory = $logFactory; $this->dateTime = $dateTime; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Accordion.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Accordion.php index 782249d96d7..43157102b4a 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Accordion.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Accordion.php @@ -52,26 +52,24 @@ class Accordion extends \Magento\Adminhtml\Block\Widget\Accordion */ protected $_itemsFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Sales\Model\QuoteFactory $quoteFactory - * @param \Magento\Wishlist\Model\Resource\Item\CollectionFactory $itemsFactory - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Sales\Model\QuoteFactory $quoteFactory + * @param \Magento\Wishlist\Model\Resource\Item\CollectionFactory $itemsFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Sales\Model\QuoteFactory $quoteFactory, - \Magento\Wishlist\Model\Resource\Item\CollectionFactory $itemsFactory, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Sales\Model\QuoteFactory $quoteFactory, + \Magento\Wishlist\Model\Resource\Item\CollectionFactory $itemsFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_quoteFactory = $quoteFactory; $this->_itemsFactory = $itemsFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Cart.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Cart.php index ed0cb7edec6..b793e9e8027 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Cart.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Cart.php @@ -55,28 +55,26 @@ class Cart extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_quoteFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\QuoteFactory $quoteFactory - * @param \Magento\Data\CollectionFactory $dataCollectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\QuoteFactory $quoteFactory + * @param \Magento\Data\CollectionFactory $dataCollectionFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\QuoteFactory $quoteFactory, - \Magento\Data\CollectionFactory $dataCollectionFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\QuoteFactory $quoteFactory, + \Magento\Data\CollectionFactory $dataCollectionFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_dataCollectionFactory = $dataCollectionFactory; $this->_coreRegistry = $coreRegistry; $this->_quoteFactory = $quoteFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Orders.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Orders.php index 6e4c3cbf408..a61367ecd2a 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Orders.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Orders.php @@ -47,25 +47,23 @@ class Orders extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $collectionFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Sales.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Sales.php index 1a50eb89229..b4cf3aa1c4e 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Sales.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Sales.php @@ -54,7 +54,6 @@ class Sales extends \Magento\Backend\Block\Template protected $_currency; /** - * @param \Magento\Core\Helper\Data $coreData * Core registry * * @var \Magento\Core\Model\Registry @@ -71,26 +70,24 @@ class Sales extends \Magento\Backend\Block\Template */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory - * @param \Magento\Sales\Model\Resource\Sale\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory + * @param \Magento\Sales\Model\Resource\Sale\CollectionFactory $collectionFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Directory\Model\CurrencyFactory $currencyFactory, - \Magento\Sales\Model\Resource\Sale\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Directory\Model\CurrencyFactory $currencyFactory, + \Magento\Sales\Model\Resource\Sale\CollectionFactory $collectionFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; $this->_currencyFactory = $currencyFactory; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Wishlist.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Wishlist.php index 9b3ead0c890..4eb80968e07 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Wishlist.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tab/View/Wishlist.php @@ -47,25 +47,23 @@ class Wishlist extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Wishlist\Model\Resource\Item\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Wishlist\Model\Resource\Item\CollectionFactory $collectionFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Wishlist\Model\Resource\Item\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Wishlist\Model\Resource\Item\CollectionFactory $collectionFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tabs.php b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tabs.php index 1cd8b1002fa..4604f67059d 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Edit/Tabs.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Edit/Tabs.php @@ -38,22 +38,22 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $authSession, $data); + parent::__construct($context, $jsonEncoder, $authSession, $data); } protected function _construct() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Grid.php b/app/code/Magento/Customer/Block/Adminhtml/Grid.php index c01330688de..d1df9b86122 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Grid.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Grid.php @@ -50,28 +50,26 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_groupsFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory - * @param \Magento\Customer\Model\Resource\Group\CollectionFactory $groupsFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Core\Model\System\Store $systemStore + * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory + * @param \Magento\Customer\Model\Resource\Group\CollectionFactory $groupsFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Core\Model\System\Store $systemStore, - \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory, - \Magento\Customer\Model\Resource\Group\CollectionFactory $groupsFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Core\Model\System\Store $systemStore, + \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory, + \Magento\Customer\Model\Resource\Group\CollectionFactory $groupsFactory, + array $data = array() + ) { $this->_systemStore = $systemStore; $this->_customersFactory = $customersFactory; $this->_groupsFactory = $groupsFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit.php b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit.php index f817ab726b9..59def1cfbe5 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit.php @@ -38,20 +38,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php index 4d9526b9186..2c7928d3d51 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Group/Edit/Form.php @@ -40,24 +40,22 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_taxCustomer; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Tax\Model\TaxClass\Source\Customer $taxCustomer - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Tax\Model\TaxClass\Source\Customer $taxCustomer + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Tax\Model\TaxClass\Source\Customer $taxCustomer, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Tax\Model\TaxClass\Source\Customer $taxCustomer, + array $data = array() + ) { $this->_taxCustomer = $taxCustomer; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Customer/Block/Adminhtml/Sales/Order/Address/Form/Renderer/Vat.php b/app/code/Magento/Customer/Block/Adminhtml/Sales/Order/Address/Form/Renderer/Vat.php index ebe4612fb86..2c7a6df869d 100644 --- a/app/code/Magento/Customer/Block/Adminhtml/Sales/Order/Address/Form/Renderer/Vat.php +++ b/app/code/Magento/Customer/Block/Adminhtml/Sales/Order/Address/Form/Renderer/Vat.php @@ -33,6 +33,8 @@ */ namespace Magento\Customer\Block\Adminhtml\Sales\Order\Address\Form\Renderer; +use Magento\View\Element\Template; + class Vat extends \Magento\Adminhtml\Block\Widget\Form\Renderer\Fieldset\Element { @@ -45,6 +47,25 @@ class Vat protected $_template = 'sales/order/create/address/form/renderer/vat.phtml'; + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; + parent::__construct($context, $data); + } + /** * Retrieve validate button block * @@ -64,7 +85,7 @@ class Vat $groupMessage = __('The customer is currently assigned to Customer Group %s.') . ' ' . __('Would you like to change the Customer Group for this order?'); - $vatValidateOptions = $this->_coreData->jsonEncode(array( + $vatValidateOptions = $this->_jsonEncoder->encode(array( 'vatElementId' => $vatElementId, 'countryElementId' => $countryElementId, 'groupIdHtmlId' => 'group_id', diff --git a/app/code/Magento/Customer/Block/Form/Login.php b/app/code/Magento/Customer/Block/Form/Login.php index 1664c69413c..3801a2dfda1 100644 --- a/app/code/Magento/Customer/Block/Form/Login.php +++ b/app/code/Magento/Customer/Block/Form/Login.php @@ -33,7 +33,7 @@ */ namespace Magento\Customer\Block\Form; -class Login extends \Magento\View\Block\Template +class Login extends \Magento\View\Element\Template { private $_username = -1; @@ -43,19 +43,17 @@ class Login extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Customer/Block/Form/Register.php b/app/code/Magento/Customer/Block/Form/Register.php index cebbe3b1d6a..2be14928a0b 100644 --- a/app/code/Magento/Customer/Block/Form/Register.php +++ b/app/code/Magento/Customer/Block/Form/Register.php @@ -44,8 +44,15 @@ class Register extends \Magento\Directory\Block\Data protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context + * @var \Magento\Module\Manager + */ + protected $_moduleManager; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Module\Manager $moduleManager * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory @@ -54,18 +61,23 @@ class Register extends \Magento\Directory\Block\Data * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\App\Cache\Type\Config $configCacheType, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory, + \Magento\Module\Manager $moduleManager, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Model\AddressFactory $addressFactory, array $data = array() ) { + $this->_moduleManager = $moduleManager; $this->_customerSession = $customerSession; $this->_addressFactory = $addressFactory; - parent::__construct($context, $coreData, $configCacheType, $regionCollFactory, $countryCollFactory, $data); + parent::__construct( + $context, $coreData, $jsonEncoder, $configCacheType, $regionCollFactory, $countryCollFactory, $data + ); } /** @@ -168,7 +180,7 @@ class Register extends \Magento\Directory\Block\Data */ public function isNewsletterEnabled() { - return $this->_coreData->isModuleOutputEnabled('Magento_Newsletter'); + return $this->_moduleManager->isOutputEnabled('Magento_Newsletter'); } /** diff --git a/app/code/Magento/Customer/Block/Newsletter.php b/app/code/Magento/Customer/Block/Newsletter.php index 83243a3e4a0..71ac451544c 100644 --- a/app/code/Magento/Customer/Block/Newsletter.php +++ b/app/code/Magento/Customer/Block/Newsletter.php @@ -34,7 +34,7 @@ */ namespace Magento\Customer\Block; -class Newsletter extends \Magento\Customer\Block\Account\Dashboard // \Magento\View\Block\Template +class Newsletter extends \Magento\Customer\Block\Account\Dashboard { protected $_template = 'form/newsletter.phtml'; diff --git a/app/code/Magento/Customer/Block/Widget/AbstractWidget.php b/app/code/Magento/Customer/Block/Widget/AbstractWidget.php index 1a2c94bf0c8..cbd4e442848 100644 --- a/app/code/Magento/Customer/Block/Widget/AbstractWidget.php +++ b/app/code/Magento/Customer/Block/Widget/AbstractWidget.php @@ -26,7 +26,7 @@ namespace Magento\Customer\Block\Widget; -class AbstractWidget extends \Magento\View\Block\Template +class AbstractWidget extends \Magento\View\Element\Template { /** * @var \Magento\Eav\Model\Config @@ -34,19 +34,17 @@ class AbstractWidget extends \Magento\View\Block\Template protected $_eavConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Eav\Model\Config $eavConfig * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Eav\Model\Config $eavConfig, array $data = array() ) { $this->_eavConfig = $eavConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getConfig($key) diff --git a/app/code/Magento/Customer/Block/Widget/Gender.php b/app/code/Magento/Customer/Block/Widget/Gender.php index 8ca30eca52e..f3a5dcad08a 100644 --- a/app/code/Magento/Customer/Block/Widget/Gender.php +++ b/app/code/Magento/Customer/Block/Widget/Gender.php @@ -46,16 +46,14 @@ class Gender extends \Magento\Customer\Block\Widget\AbstractWidget protected $_customerResource; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Customer\Model\Resource\Customer $customerResource * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Session $customerSession, \Magento\Customer\Model\Resource\Customer $customerResource, @@ -63,7 +61,7 @@ class Gender extends \Magento\Customer\Block\Widget\AbstractWidget ) { $this->_customerSession = $customerSession; $this->_customerResource = $customerResource; - parent::__construct($context, $coreData, $eavConfig, $data); + parent::__construct($context, $eavConfig, $data); } /** diff --git a/app/code/Magento/Customer/Block/Widget/Taxvat.php b/app/code/Magento/Customer/Block/Widget/Taxvat.php index 16758a524cd..53e9ef3291f 100644 --- a/app/code/Magento/Customer/Block/Widget/Taxvat.php +++ b/app/code/Magento/Customer/Block/Widget/Taxvat.php @@ -34,21 +34,19 @@ class Taxvat extends \Magento\Customer\Block\Widget\AbstractWidget protected $_customerResource; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $eavConfig, $data); + parent::__construct($context, $eavConfig, $data); } public function _construct() diff --git a/app/code/Magento/Customer/Controller/Account.php b/app/code/Magento/Customer/Controller/Account.php index 7ed23a426ed..e99725ec32c 100644 --- a/app/code/Magento/Customer/Controller/Account.php +++ b/app/code/Magento/Customer/Controller/Account.php @@ -312,7 +312,7 @@ class Account extends \Magento\App\Action\Action { $lastCustomerId = $this->_getSession()->getId(); $this->_getSession()->logout() - ->renewSession() + ->regenerateId() ->setBeforeAuthUrl($this->_redirect->getRefererUrl()) ->setLastCustomerId($lastCustomerId); diff --git a/app/code/Magento/Customer/Controller/Adminhtml/Group.php b/app/code/Magento/Customer/Controller/Adminhtml/Group.php index d5d55bda9d8..0e3c0147d66 100644 --- a/app/code/Magento/Customer/Controller/Adminhtml/Group.php +++ b/app/code/Magento/Customer/Controller/Adminhtml/Group.php @@ -136,12 +136,13 @@ class Group extends \Magento\Backend\App\Action } $customerGroup->setTaxClassId($taxClass)->save(); - $this->_objectManager->get('Magento\Adminhtml\Model\Session')->addSuccess(__('The customer group has been saved.')); + $this->_objectManager->get('Magento\Core\Model\Session\AbstractSession') + ->addSuccess(__('The customer group has been saved.')); $this->getResponse()->setRedirect($this->getUrl('customer/group')); return; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Adminhtml\Model\Session')->addError($e->getMessage()); - $this->_objectManager->get('Magento\Adminhtml\Model\Session')->setCustomerGroupData($customerGroup->getData()); + $this->_objectManager->get('Magento\Core\Model\Session\AbstractSession')->addError($e->getMessage()); + $this->_objectManager->get('Magento\Core\Model\Session\AbstractSession')->setCustomerGroupData($customerGroup->getData()); $this->getResponse()->setRedirect($this->getUrl('customer/group/edit', array('id' => $id))); return; } @@ -157,19 +158,22 @@ class Group extends \Magento\Backend\App\Action { $id = $this->getRequest()->getParam('id'); if ($id) { + /** @var \Magento\Customer\Model\Group $customerGroup */ $customerGroup = $this->_objectManager->create('Magento\Customer\Model\Group')->load($id); if (!$customerGroup->getId()) { - $this->_objectManager->get('Magento\Adminhtml\Model\Session')->addError(__('The customer group no longer exists.')); + $this->_objectManager->get('Magento\Core\Model\Session\AbstractSession') + ->addError(__('The customer group no longer exists.')); $this->_redirect('customer/*/'); return; } try { $customerGroup->delete(); - $this->_objectManager->get('Magento\Adminhtml\Model\Session')->addSuccess(__('The customer group has been deleted.')); + $this->_objectManager->get('Magento\Core\Model\Session\AbstractSession') + ->addSuccess(__('The customer group has been deleted.')); $this->getResponse()->setRedirect($this->getUrl('customer/group')); return; } catch (\Exception $e) { - $this->_objectManager->get('Magento\Adminhtml\Model\Session')->addError($e->getMessage()); + $this->_objectManager->get('Magento\Core\Model\Session\AbstractSession')->addError($e->getMessage()); $this->getResponse()->setRedirect($this->getUrl('customer/group/edit', array('id' => $id))); return; } diff --git a/app/code/Magento/Customer/Helper/Data.php b/app/code/Magento/Customer/Helper/Data.php index 96e4c19297a..ec8803720d4 100644 --- a/app/code/Magento/Customer/Helper/Data.php +++ b/app/code/Magento/Customer/Helper/Data.php @@ -157,9 +157,9 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $mathRandom; /** + * @param \Magento\App\Helper\Context $context * @param \Magento\Customer\Helper\Address $customerAddress * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Config $coreConfig * @param \Magento\Customer\Model\Session $customerSession @@ -169,9 +169,9 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param \Magento\Math\Random $mathRandom */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Customer\Helper\Address $customerAddress, \Magento\Core\Helper\Data $coreData, - \Magento\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Config $coreConfig, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Customer/Model/Address.php b/app/code/Magento/Customer/Model/Address.php index e1b99858231..d4eded14c3c 100644 --- a/app/code/Magento/Customer/Model/Address.php +++ b/app/code/Magento/Customer/Model/Address.php @@ -47,9 +47,9 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress protected $_customerFactory; /** - * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Customer\Model\Address\Config $addressConfig * @param \Magento\Directory\Model\RegionFactory $regionFactory @@ -58,13 +58,11 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Directory\Helper\Data $directoryData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Directory\Helper\Data $directoryData, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Address\Config $addressConfig, \Magento\Directory\Model\RegionFactory $regionFactory, @@ -76,8 +74,16 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress ) { $this->_customerFactory = $customerFactory; parent::__construct( - $directoryData, $context, $registry, $eavConfig, $addressConfig, $regionFactory, - $countryFactory, $resource, $resourceCollection, $data + $context, + $registry, + $directoryData, + $eavConfig, + $addressConfig, + $regionFactory, + $countryFactory, + $resource, + $resourceCollection, + $data ); } diff --git a/app/code/Magento/Customer/Model/Address/AbstractAddress.php b/app/code/Magento/Customer/Model/Address/AbstractAddress.php index 1b6f5306de1..19a4ad5257b 100644 --- a/app/code/Magento/Customer/Model/Address/AbstractAddress.php +++ b/app/code/Magento/Customer/Model/Address/AbstractAddress.php @@ -100,9 +100,9 @@ class AbstractAddress extends \Magento\Core\Model\AbstractModel protected $_countryFactory; /** - * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Customer\Model\Address\Config $addressConfig * @param \Magento\Directory\Model\RegionFactory $regionFactory @@ -112,9 +112,9 @@ class AbstractAddress extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Directory\Helper\Data $directoryData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Directory\Helper\Data $directoryData, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Address\Config $addressConfig, \Magento\Directory\Model\RegionFactory $regionFactory, diff --git a/app/code/Magento/Customer/Model/Customer.php b/app/code/Magento/Customer/Model/Customer.php index 28705a39c68..4679d2faf3e 100644 --- a/app/code/Magento/Customer/Model/Customer.php +++ b/app/code/Magento/Customer/Model/Customer.php @@ -33,6 +33,9 @@ namespace Magento\Customer\Model; * @method int getStoreId() getStoreId() * @method string getEmail() getEmail() * @method \Magento\Customer\Model\Resource\Customer _getResource() + * @method mixed getDisableAutoGroupChange() + * @method \Magento\Customer\Model\Customer setDisableAutoGroupChange($value) + * @method \Magento\Customer\Model\Customer setGroupId($value) */ class Customer extends \Magento\Core\Model\AbstractModel { @@ -192,9 +195,9 @@ class Customer extends \Magento\Core\Model\AbstractModel protected $dateTime; /** - * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\Email\Model\Sender $sender * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Eav\Model\Config $config @@ -210,13 +213,13 @@ class Customer extends \Magento\Core\Model\AbstractModel * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Math\Random $mathRandom * @param \Magento\Stdlib\DateTime $dateTime - * @param \Magento\Data\Collection\Db|null $resourceCollection + * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Customer\Helper\Data $customerData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Customer\Helper\Data $customerData, \Magento\Email\Model\Sender $sender, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Eav\Model\Config $config, diff --git a/app/code/Magento/Customer/Model/Renderer/Region.php b/app/code/Magento/Customer/Model/Renderer/Region.php index c3eaf57c2a3..dd8598f0480 100644 --- a/app/code/Magento/Customer/Model/Renderer/Region.php +++ b/app/code/Magento/Customer/Model/Renderer/Region.php @@ -112,7 +112,7 @@ class Region implements \Magento\Data\Form\Element\Renderer\RendererInterface if ($regionCollection && count($regionCollection) > 0) { $elementClass = $element->getClass(); $html.= '<label class="label" for="' . $regionIdHtmlId . '"><span>' . $element->getLabel() . '</span>' - . '<span class="required" style="display:none">*</span></label>'; + . '</label>'; $html.= '<div class="control">'; $html .= '<select id="' . $regionIdHtmlId . '" name="' . $regionIdHtmlName . '" ' @@ -132,9 +132,9 @@ class Region implements \Magento\Data\Form\Element\Renderer\RendererInterface $element->setClass($elementClass); } else { $element->setClass('input-text'); - $html.= '<label class="label" for="' . $regionHtmlId . '"><label for="'.$element->getHtmlId().'">' + $html.= '<label class="label" for="' . $regionHtmlId . '"><span>' . $element->getLabel() - . '</span><span class="required" style="display:none">*</span></label>'; + . '</span></label>'; $element->setRequired(false); $html.= '<div class="control">'; diff --git a/app/code/Magento/Customer/Model/Resource/Customer/Collection.php b/app/code/Magento/Customer/Model/Resource/Customer/Collection.php index c361746935a..824e0d06ffa 100644 --- a/app/code/Magento/Customer/Model/Resource/Customer/Collection.php +++ b/app/code/Magento/Customer/Model/Resource/Customer/Collection.php @@ -52,43 +52,48 @@ class Collection extends \Magento\Eav\Model\Entity\Collection\AbstractCollection protected $_modelName; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Object\Copy\Config $fieldsetConfig + * @param mixed $connection * @param string $modelName + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Object\Copy\Config $fieldsetConfig, + $connection = null, $modelName = self::CUSTOMER_MODEL_NAME ) { $this->_fieldsetConfig = $fieldsetConfig; $this->_modelName = $modelName; parent::__construct( - $eventManager, + $entityFactory, $logger, $fetchStrategy, - $entityFactory, + $eventManager, $eavConfig, $resource, $eavEntityFactory, $resourceHelper, - $universalFactory + $universalFactory, + $connection ); } diff --git a/app/code/Magento/Customer/Model/Resource/Group.php b/app/code/Magento/Customer/Model/Resource/Group.php index 046003dc517..f1fdbc438ea 100644 --- a/app/code/Magento/Customer/Model/Resource/Group.php +++ b/app/code/Magento/Customer/Model/Resource/Group.php @@ -49,15 +49,13 @@ class Group extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_customersFactory; /** - * Class constructor - * - * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\App\Resource $resource + * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory */ public function __construct( - \Magento\Customer\Helper\Data $customerData, \Magento\App\Resource $resource, + \Magento\Customer\Helper\Data $customerData, \Magento\Customer\Model\Resource\Customer\CollectionFactory $customersFactory ) { $this->_customerData = $customerData; diff --git a/app/code/Magento/Customer/Model/Resource/Setup.php b/app/code/Magento/Customer/Model/Resource/Setup.php index dfbbdd4d661..8e3bb42af99 100644 --- a/app/code/Magento/Customer/Model/Resource/Setup.php +++ b/app/code/Magento/Customer/Model/Resource/Setup.php @@ -43,24 +43,24 @@ class Setup extends \Magento\Eav\Model\Entity\Setup /** * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param string $resourceName * @param \Magento\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\App\CacheInterface $resourceName * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, \Magento\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory, \Magento\Eav\Model\Config $eavConfig, - $resourceName, $moduleName = 'Magento_Customer', $connectionName = '' ) { $this->_eavConfig = $eavConfig; - parent::__construct($context, $cache, $attrGrCollFactory, $resourceName, $moduleName, $connectionName); + parent::__construct($context, $resourceName, $cache, $attrGrCollFactory, $moduleName, $connectionName); } /** diff --git a/app/code/Magento/Customer/Model/Session.php b/app/code/Magento/Customer/Model/Session.php index 35c7fc739f4..d10c2400f54 100644 --- a/app/code/Magento/Customer/Model/Session.php +++ b/app/code/Magento/Customer/Model/Session.php @@ -86,42 +86,46 @@ class Session extends \Magento\Core\Model\Session\AbstractSession /** * @param \Magento\Core\Model\Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param \Magento\Customer\Model\Config\Share $configShare * @param \Magento\Core\Helper\Url $coreUrl * @param \Magento\Customer\Helper\Data $customerData - * @param \Magento\Core\Model\Session $session * @param \Magento\Customer\Model\Resource\Customer $customerResource * @param \Magento\Customer\Model\CustomerFactory $customerFactory * @param \Magento\Core\Model\UrlFactory $urlFactory + * @param \Magento\Core\Model\Session $session * @param array $data * @param null $sessionName */ public function __construct( \Magento\Core\Model\Session\Context $context, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, \Magento\Customer\Model\Config\Share $configShare, \Magento\Core\Helper\Url $coreUrl, \Magento\Customer\Helper\Data $customerData, - \Magento\Core\Model\Session $session, \Magento\Customer\Model\Resource\Customer $customerResource, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Core\Model\UrlFactory $urlFactory, + \Magento\Core\Model\Session $session, array $data = array(), $sessionName = null ) { $this->_coreUrl = $coreUrl; $this->_customerData = $customerData; $this->_configShare = $configShare; - $this->_session = $session; $this->_customerResource = $customerResource; $this->_customerFactory = $customerFactory; $this->_urlFactory = $urlFactory; - parent::__construct($context, $data); + $this->_session = $session; + parent::__construct($context, $sidResolver, $sessionConfig, $data); $namespace = 'customer'; if ($configShare->isWebsiteScope()) { $namespace .= '_' . ($this->_storeManager->getWebsite()->getCode()); } - $this->init($namespace, $sessionName); + $this->start($namespace, $sessionName); $this->_eventManager->dispatch('customer_session_init', array('customer_session' => $this)); } @@ -271,7 +275,7 @@ class Session extends \Magento\Core\Model\Session\AbstractSession if ($customer->authenticate($username, $password)) { $this->setCustomerAsLoggedIn($customer); - $this->renewSession(); + $this->regenerateId(); return true; } return false; @@ -331,13 +335,13 @@ class Session extends \Magento\Core\Model\Session\AbstractSession $action->getResponse()->setRedirect($loginUrl); } else { $arguments = $this->_customerData->getLoginUrlParams(); - if ($this->_session->getCookieShouldBeReceived() && $this->_url->getUseSession()) { + if ($this->_session->getCookieShouldBeReceived() && $this->_createUrl()->getUseSession()) { $arguments += array('_query' => array( - $this->_session->getSessionIdQueryParam() => $this->_session->getSessionId() + $this->_sidResolver->getSessionIdQueryParam($this->_session) => $this->_session->getSessionId() )); } $action->getResponse()->setRedirect( - $this->_url->getUrl(\Magento\Customer\Helper\Data::ROUTE_ACCOUNT_LOGIN, $arguments) + $this->_createUrl()->getUrl(\Magento\Customer\Helper\Data::ROUTE_ACCOUNT_LOGIN, $arguments) ); } @@ -353,7 +357,7 @@ class Session extends \Magento\Core\Model\Session\AbstractSession */ protected function _setAuthUrl($key, $url) { - $url = $this->_coreUrl->removeRequestParam($url, $this->_session->getSessionIdQueryParam()); + $url = $this->_coreUrl->removeRequestParam($url, $this->_sidResolver->getSessionIdQueryParam($this)); // Add correct session ID to URL if needed $url = $this->_createUrl()->getRebuiltUrl($url); return $this->setData($key, $url); @@ -368,7 +372,7 @@ class Session extends \Magento\Core\Model\Session\AbstractSession { $this->setId(null); $this->setCustomerGroupId(\Magento\Customer\Model\Group::NOT_LOGGED_IN_ID); - $this->getCookie()->delete($this->getSessionName()); + $this->destroy(array('clear_storage' => false)); return $this; } @@ -397,11 +401,12 @@ class Session extends \Magento\Core\Model\Session\AbstractSession /** * Reset core session hosts after reseting session ID * + * @param bool $deleteOldSession * @return \Magento\Customer\Model\Session */ - public function renewSession() + public function regenerateId($deleteOldSession = true) { - parent::renewSession(); + parent::regenerateId($deleteOldSession); $this->_cleanHosts(); return $this; } diff --git a/app/code/Magento/Customer/etc/module.xml b/app/code/Magento/Customer/etc/module.xml index 1bc2adc94b0..d4b96f9ba23 100755 --- a/app/code/Magento/Customer/etc/module.xml +++ b/app/code/Magento/Customer/etc/module.xml @@ -40,7 +40,7 @@ <module name="Magento_Wishlist"/> <module name="Magento_Index"/> <module name="Magento_Log"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml index 40327482b2c..afe42840e93 100644 --- a/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml +++ b/app/code/Magento/Customer/view/adminhtml/layout/customer_index_edit.xml @@ -29,17 +29,17 @@ </referenceContainer> <referenceBlock name="head"> <block class="Magento\Backend\Block\Template" name="optional_zip_countries" as="optional_zip_countries" template="Magento_Directory::js/optional_zip_countries.phtml"/> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-catalog-product-composite-configure-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-catalog-product-composite-configure-js"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::catalog/product/composite/configure.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="varien-configurable-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="varien-configurable-js"> <arguments> <argument name="file" xsi:type="string">varien/configurable.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-customer-edit-tab-js-addresses.js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-customer-edit-tab-js-addresses.js"> <arguments> <argument name="file" xsi:type="string">Magento_Customer::edit/tab/js/addresses.js</argument> </arguments> diff --git a/app/code/Magento/Customer/view/frontend/account/navigation.phtml b/app/code/Magento/Customer/view/frontend/account/navigation.phtml index cab46eb40b9..fae0de2ceb3 100644 --- a/app/code/Magento/Customer/view/frontend/account/navigation.phtml +++ b/app/code/Magento/Customer/view/frontend/account/navigation.phtml @@ -22,7 +22,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -/** @var $this \Magento\Page\Block\Links */ +/** @var $this \Magento\View\Element\Html\Links */ ?> <?php /** @var $this \Magento\Customer\Block\Account\Navigation */ ?> <div class="block account nav"> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account.xml index ca526741059..6a4ef38b386 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account.xml @@ -28,20 +28,20 @@ <container name="my.account.wrapper" label="My Account Wrapper" htmlTag="div" htmlClass="my-account" after="-"/> </referenceContainer> <referenceContainer name="left"> - <block class="Magento\Page\Block\Links" name="customer_account_navigation" before="-" template="Magento_Customer::account/navigation.phtml"> - <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-account-link"> + <block class="Magento\View\Element\Html\Links" name="customer_account_navigation" before="-" template="Magento_Customer::account/navigation.phtml"> + <block class="Magento\View\Element\Html\Link\Current" name="customer-account-navigation-account-link"> <arguments> <argument name="label" xsi:type="string">Account Dashboard</argument> <argument name="path" xsi:type="string">customer/account</argument> </arguments> </block> - <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-account-edit-link"> + <block class="Magento\View\Element\Html\Link\Current" name="customer-account-navigation-account-edit-link"> <arguments> <argument name="label" xsi:type="string">Account Information</argument> <argument name="path" xsi:type="string">customer/account/edit</argument> </arguments> </block> - <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-address-link"> + <block class="Magento\View\Element\Html\Link\Current" name="customer-account-navigation-address-link"> <arguments> <argument name="label" xsi:type="string">Address Book</argument> <argument name="path" xsi:type="string">customer/address</argument> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml index 34e54f22ebf..3e2adb8c592 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_confirmation.xml @@ -35,6 +35,6 @@ </action> </referenceBlock> <referenceContainer name="content"> - <block class="Magento\View\Block\Template" name="accountConfirmation" template="Magento_Customer::form/confirmation.phtml"/> + <block class="Magento\View\Element\Template" name="accountConfirmation" template="Magento_Customer::form/confirmation.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml index 1d1922a9d7d..e05ec0970b4 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_index.xml @@ -32,7 +32,7 @@ </referenceBlock> <referenceContainer name="content"> <block class="Magento\Customer\Block\Account\Dashboard\Hello" name="customer_account_dashboard_hello" as="hello" template="account/dashboard/hello.phtml"/> - <block class="Magento\View\Block\Template" name="customer_account_dashboard_top" as="top"/> + <block class="Magento\View\Element\Template" name="customer_account_dashboard_top" as="top"/> <block class="Magento\Customer\Block\Account\Dashboard\Info" name="customer_account_dashboard_info" as="info" template="account/dashboard/info.phtml"/> <block class="Magento\Customer\Block\Account\Dashboard\Address" name="customer_account_dashboard_address" as="address" template="account/dashboard/address.phtml"/> </referenceContainer> diff --git a/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml b/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml index 9a17dc8e9c0..247c193ae33 100644 --- a/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml +++ b/app/code/Magento/Customer/view/frontend/layout/customer_account_logoutsuccess.xml @@ -35,6 +35,6 @@ </action> </referenceBlock> <referenceContainer name="content"> - <block class="Magento\View\Block\Template" name="customer_logout" template="Magento_Customer::logout.phtml"/> + <block class="Magento\View\Element\Template" name="customer_logout" template="Magento_Customer::logout.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Renderer/BackgroundUploader.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Renderer/BackgroundUploader.php index 95cedefbb5f..5d37c0d6d9a 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Renderer/BackgroundUploader.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Renderer/BackgroundUploader.php @@ -37,20 +37,18 @@ class BackgroundUploader */ protected $_themeContext; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\DesignEditor\Model\Theme\Context $themeContext - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\DesignEditor\Model\Theme\Context $themeContext + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\DesignEditor\Model\Theme\Context $themeContext, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\DesignEditor\Model\Theme\Context $themeContext, + array $data = array() + ) { $this->_themeContext = $themeContext; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Renderer/LogoUploader.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Renderer/LogoUploader.php index 1ff5b226fbe..5e8654c96fd 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Renderer/LogoUploader.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Form/Renderer/LogoUploader.php @@ -60,23 +60,21 @@ class LogoUploader 'Magento_DesignEditor::editor/form/renderer/logo-uploader.phtml', ); - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\DesignEditor\Model\Theme\Context $themeContext - * @param \Magento\Theme\Model\Config\Customization $customization - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\DesignEditor\Model\Theme\Context $themeContext + * @param \Magento\Theme\Model\Config\Customization $customization + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\DesignEditor\Model\Theme\Context $themeContext, - \Magento\Theme\Model\Config\Customization $customization, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\DesignEditor\Model\Theme\Context $themeContext, + \Magento\Theme\Model\Config\Customization $customization, + array $data = array() + ) { $this->_themeContext = $themeContext; $this->_customization = $customization; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/Edit.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/Edit.php index 765ab97da9f..775929c0604 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/Edit.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Toolbar/Buttons/Edit.php @@ -42,23 +42,21 @@ class Edit */ protected $_changeFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\DesignEditor\Model\Theme\Context $themeContext - * @param \Magento\DesignEditor\Model\Theme\ChangeFactory $changeFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\DesignEditor\Model\Theme\Context $themeContext + * @param \Magento\DesignEditor\Model\Theme\ChangeFactory $changeFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\DesignEditor\Model\Theme\Context $themeContext, - \Magento\DesignEditor\Model\Theme\ChangeFactory $changeFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\DesignEditor\Model\Theme\Context $themeContext, + \Magento\DesignEditor\Model\Theme\ChangeFactory $changeFactory, + array $data = array() + ) { $this->_themeContext = $themeContext; $this->_changeFactory = $changeFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools.php index 5791179d15f..1078bb3598a 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools.php @@ -44,20 +44,18 @@ class Tools extends \Magento\Backend\Block\Template */ protected $_themeContext; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\DesignEditor\Model\Theme\Context $themeContext - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\DesignEditor\Model\Theme\Context $themeContext + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\DesignEditor\Model\Theme\Context $themeContext, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\DesignEditor\Model\Theme\Context $themeContext, + array $data = array() + ) { $this->_themeContext = $themeContext; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Block.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Block.php index e3f51e19f8a..157ec6c41e4 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Block.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Block.php @@ -29,6 +29,6 @@ */ namespace Magento\DesignEditor\Block\Adminhtml\Editor\Tools; -class Block extends \Magento\View\Block\Template +class Block extends \Magento\View\Element\Template { } diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Css.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Css.php index 5c98b0d8f09..77a62390613 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Css.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Css.php @@ -29,7 +29,7 @@ */ namespace Magento\DesignEditor\Block\Adminhtml\Editor\Tools\Code; -class Css extends \Magento\View\Block\Template +class Css extends \Magento\View\Element\Template { /** * Get file groups content diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php index 806e9afcb0d..c8694d00acf 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Custom.php @@ -43,23 +43,21 @@ class Custom extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_themeContext; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\DesignEditor\Model\Theme\Context $themeContext - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\DesignEditor\Model\Theme\Context $themeContext + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\DesignEditor\Model\Theme\Context $themeContext, - array $data = array() - ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\DesignEditor\Model\Theme\Context $themeContext, + array $data = array() + ) { + parent::__construct($context, $registry, $formFactory, $data); $this->_themeContext = $themeContext; } diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php index fe0cbd86a9c..09593dcd3ea 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/ImageSizing.php @@ -48,27 +48,25 @@ class ImageSizing extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_themeContext; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\DesignEditor\Model\Editor\Tools\Controls\Factory $controlFactory - * @param \Magento\DesignEditor\Model\Theme\Context $themeContext - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Eav\Model\Config $eavConfig + * @param \Magento\DesignEditor\Model\Editor\Tools\Controls\Factory $controlFactory + * @param \Magento\DesignEditor\Model\Theme\Context $themeContext + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Eav\Model\Config $eavConfig, - \Magento\DesignEditor\Model\Editor\Tools\Controls\Factory $controlFactory, - \Magento\DesignEditor\Model\Theme\Context $themeContext, - array $data = array() - ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Eav\Model\Config $eavConfig, + \Magento\DesignEditor\Model\Editor\Tools\Controls\Factory $controlFactory, + \Magento\DesignEditor\Model\Theme\Context $themeContext, + array $data = array() + ) { + parent::__construct($context, $registry, $formFactory, $data); $this->_eavConfig = $eavConfig; $this->_controlFactory = $controlFactory; $this->_themeContext = $themeContext; diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php index d179993bc06..041d724c04d 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/Js.php @@ -43,25 +43,23 @@ class Js extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_themeContext; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Theme\Model\Config\Customization $customizationConfig - * @param \Magento\DesignEditor\Model\Theme\Context $themeContext - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Theme\Model\Config\Customization $customizationConfig + * @param \Magento\DesignEditor\Model\Theme\Context $themeContext + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Theme\Model\Config\Customization $customizationConfig, - \Magento\DesignEditor\Model\Theme\Context $themeContext, - array $data = array() - ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Theme\Model\Config\Customization $customizationConfig, + \Magento\DesignEditor\Model\Theme\Context $themeContext, + array $data = array() + ) { + parent::__construct($context, $registry, $formFactory, $data); $this->_customizationConfig = $customizationConfig; $this->_themeContext = $themeContext; } diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/QuickStyles/AbstractTab.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/QuickStyles/AbstractTab.php index 978cba1aa85..c6abafe61e5 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/QuickStyles/AbstractTab.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/QuickStyles/AbstractTab.php @@ -62,21 +62,19 @@ abstract class AbstractTab */ protected $_tab = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\DesignEditor\Model\Editor\Tools\QuickStyles\Form\Builder $formBuilder - * @param \Magento\DesignEditor\Model\Theme\Context $themeContext - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\DesignEditor\Model\Editor\Tools\QuickStyles\Form\Builder $formBuilder + * @param \Magento\DesignEditor\Model\Theme\Context $themeContext + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\DesignEditor\Model\Editor\Tools\QuickStyles\Form\Builder $formBuilder, - \Magento\DesignEditor\Model\Theme\Context $themeContext, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\DesignEditor\Model\Editor\Tools\QuickStyles\Form\Builder $formBuilder, + \Magento\DesignEditor\Model\Theme\Context $themeContext, + array $data = array() + ) { + parent::__construct($context, $data); $this->_formBuilder = $formBuilder; $this->_themeContext = $themeContext; } diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Settings.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Settings.php index 98e200a2536..c83e3360cfd 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Settings.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Settings.php @@ -29,7 +29,7 @@ */ namespace Magento\DesignEditor\Block\Adminhtml\Editor\Tools; -class Settings extends \Magento\View\Block\Template +class Settings extends \Magento\View\Element\Template { } diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Tabs/AbstractTabs.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Tabs/AbstractTabs.php index 4f671b605a7..e1ce0d70f44 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Tabs/AbstractTabs.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Tabs/AbstractTabs.php @@ -31,7 +31,7 @@ */ namespace Magento\DesignEditor\Block\Adminhtml\Editor\Tools\Tabs; -abstract class AbstractTabs extends \Magento\View\Block\Template +abstract class AbstractTabs extends \Magento\View\Element\Template { /** * Alias of tab handle block in layout diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Tabs/Body.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Tabs/Body.php index 40d57cb2388..5d4615053e0 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Tabs/Body.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Tabs/Body.php @@ -36,7 +36,7 @@ */ namespace Magento\DesignEditor\Block\Adminhtml\Editor\Tools\Tabs; -class Body extends \Magento\View\Block\Template +class Body extends \Magento\View\Element\Template { /** * Get tab content diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Button.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Button.php index c21ea4d630c..4f2ceb061eb 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Button.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Button.php @@ -29,7 +29,7 @@ */ namespace Magento\DesignEditor\Block\Adminhtml\Theme; -class Button extends \Magento\View\Block\Template +class Button extends \Magento\View\Element\Template { /** * Define block template diff --git a/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/StoreView.php b/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/StoreView.php index 10f6eddbea8..7a6d7e65543 100644 --- a/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/StoreView.php +++ b/app/code/Magento/DesignEditor/Block/Adminhtml/Theme/Selector/StoreView.php @@ -47,24 +47,22 @@ class StoreView extends \Magento\Backend\Block\Template */ protected $_customizationConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Resource\Website\Collection $websiteCollection - * @param \Magento\Theme\Model\Config\Customization $customizationConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Resource\Website\Collection $websiteCollection + * @param \Magento\Theme\Model\Config\Customization $customizationConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Resource\Website\Collection $websiteCollection, - \Magento\Theme\Model\Config\Customization $customizationConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Resource\Website\Collection $websiteCollection, + \Magento\Theme\Model\Config\Customization $customizationConfig, + array $data = array() + ) { $this->_websiteCollection = $websiteCollection; $this->_customizationConfig = $customizationConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/DesignEditor/Model/Observer.php b/app/code/Magento/DesignEditor/Model/Observer.php index efb288cb10e..3a76761d5fd 100644 --- a/app/code/Magento/DesignEditor/Model/Observer.php +++ b/app/code/Magento/DesignEditor/Model/Observer.php @@ -68,11 +68,8 @@ class Observer return; } - /** @var $page \Magento\Core\Model\Page */ - $page = $this->_objectManager->get('Magento\Core\Model\Page'); - - /** @var $pageAssets \Magento\Page\Model\Asset\GroupedCollection */ - $pageAssets = $page->getAssets(); + /** @var $pageAssets \Magento\View\Asset\GroupedCollection */ + $pageAssets = $this->_objectManager->get('Magento\View\Asset\GroupedCollection'); $vdeAssets = array(); foreach ($pageAssets->getGroups() as $group) { @@ -81,7 +78,7 @@ class Observer } } - /** @var $nonVdeAssets \Magento\Core\Model\Page\Asset\AssetInterface[] */ + /** @var $nonVdeAssets \Magento\View\Asset\AssetInterface[] */ $nonVdeAssets = array_diff_key($pageAssets->getAll(), $vdeAssets); foreach ($nonVdeAssets as $assetId => $asset) { diff --git a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php index 184d8c7dc27..6e514bba87b 100644 --- a/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php +++ b/app/code/Magento/DesignEditor/Model/Theme/Resource/Change.php @@ -37,10 +37,10 @@ class Change extends \Magento\Core\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\App\Resource $resource + * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\Stdlib\DateTime $dateTime, \Magento\App\Resource $resource) + public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/DesignEditor/Model/Translate/InlineVde.php b/app/code/Magento/DesignEditor/Model/Translate/InlineVde.php index 395ce68cea8..9c94e973e88 100644 --- a/app/code/Magento/DesignEditor/Model/Translate/InlineVde.php +++ b/app/code/Magento/DesignEditor/Model/Translate/InlineVde.php @@ -165,8 +165,8 @@ class InlineVde implements \Magento\Core\Model\Translate\InlineInterface \Magento\DesignEditor\Helper\Data::TRANSLATION_MODE => $this->_helper->getTranslationMode() )); - /** @var $block \Magento\View\Block\Template */ - $block = $this->_objectManager->create('Magento\View\Block\Template'); + /** @var $block \Magento\View\Element\Template */ + $block = $this->_objectManager->create('Magento\View\Element\Template'); $block->setArea($this->_parser->getDesignPackage()->getArea()); $block->setAjaxUrl($ajaxUrl); diff --git a/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php b/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php index 4fb3d6e567f..2892d3c0612 100644 --- a/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php +++ b/app/code/Magento/DesignEditor/Model/Url/NavigationMode.php @@ -61,6 +61,7 @@ class NavigationMode extends \Magento\Core\Model\Url * @param \Magento\Core\Model\App $app * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Session $session + * @param \Magento\Session\SidResolverInterface $sidResolver * @param string $areaCode * @param array $data */ @@ -73,6 +74,7 @@ class NavigationMode extends \Magento\Core\Model\Url \Magento\Core\Model\App $app, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Session $session, + \Magento\Session\SidResolverInterface $sidResolver, $areaCode, array $data = array() ) { @@ -85,7 +87,16 @@ class NavigationMode extends \Magento\Core\Model\Url $this->_themeId = $data['themeId']; } parent::__construct( - $routeConfig, $request, $urlSecurityInfo, $coreStoreConfig, $app, $storeManager, $session, $areaCode, $data + $routeConfig, + $request, + $urlSecurityInfo, + $coreStoreConfig, + $app, + $storeManager, + $session, + $sidResolver, + $areaCode, + $data ); } diff --git a/app/code/Magento/DesignEditor/etc/module.xml b/app/code/Magento/DesignEditor/etc/module.xml index 7eac055567c..936cd901e80 100755 --- a/app/code/Magento/DesignEditor/etc/module.xml +++ b/app/code/Magento/DesignEditor/etc/module.xml @@ -26,7 +26,6 @@ <config> <module name="Magento_DesignEditor" version="1.0.0.3" active="true"> <sequence> - <module name="Magento_Page"/> <module name="Magento_Theme"/> </sequence> <depends> @@ -34,7 +33,6 @@ <module name="Magento_Backend"/> <module name="Magento_Core"/> <module name="Magento_Eav"/> - <module name="Magento_Page"/> </depends> </module> </config> diff --git a/app/code/Magento/DesignEditor/view/adminhtml/editor/toolbar.phtml b/app/code/Magento/DesignEditor/view/adminhtml/editor/toolbar.phtml index 843d6e216b5..983e5cddf37 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/editor/toolbar.phtml +++ b/app/code/Magento/DesignEditor/view/adminhtml/editor/toolbar.phtml @@ -24,7 +24,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ ?> -<?php /** @var $this \Magento\View\Block\Template */ ?> +<?php /** @var $this \Magento\View\Element\Template */ ?> <div id="vde_toolbar_row" class="header"> <div class="vde_toolbar_row_inner"> <?php echo $this->getChildHtml(); ?> diff --git a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_firstentrance.xml b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_firstentrance.xml index 84f30a7433d..b973c0bdb06 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_firstentrance.xml +++ b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_firstentrance.xml @@ -25,32 +25,32 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-dialog-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-dialog-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/dialog.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-infinitescroll-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-infinitescroll-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/infinitescroll.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-theme-selector-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-theme-selector-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/theme-selector.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-theme-assign-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-theme-assign-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/theme-assign.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-theme-edit-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-theme-edit-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/theme-edit.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-designeditor-css-styles-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-designeditor-css-styles-css"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::css/styles.css</argument> </arguments> diff --git a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_index.xml b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_index.xml index dca7bc85c26..b89d5d23cc6 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_index.xml +++ b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_index.xml @@ -25,37 +25,37 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-dialog-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-dialog-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/dialog.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-infinitescroll-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-infinitescroll-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/infinitescroll.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-theme-selector-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-theme-selector-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/theme-selector.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-theme-assign-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-theme-assign-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/theme-assign.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-theme-delete-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-theme-delete-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/theme-delete.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-theme-edit-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-theme-edit-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/theme-edit.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-designeditor-css-styles-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-designeditor-css-styles-css"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::css/styles.css</argument> </arguments> diff --git a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml index fd6b8272da1..2dab6406c17 100644 --- a/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml +++ b/app/code/Magento/DesignEditor/view/adminhtml/layout/adminhtml_system_design_editor_launch.xml @@ -33,107 +33,107 @@ <action method="setCanLoadExtJs"> <argument name="flag" xsi:type="string">1</argument> </action> - <block class="Magento\Page\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/css/jquery.fileupload-ui.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-tabs-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-tabs-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.tabs.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jstree-jquery-jstree-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jstree-jquery-jstree-js"> <arguments> <argument name="file" xsi:type="string">jquery/jstree/jquery.jstree.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-slimscroll-slimscroll-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-slimscroll-slimscroll-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/slimScroll/slimScroll.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-tools-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-tools-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/tools.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-tools-panel-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-tools-panel-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/tools-panel.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-custom-css-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-custom-css-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/custom-css.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-theme-js-custom-js-list-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-theme-js-custom-js-list-js"> <arguments> <argument name="file" xsi:type="string">Magento_Theme::js/custom-js-list.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-dialog-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-dialog-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/dialog.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-theme-assign-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-theme-assign-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/theme-assign.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-vde-frame-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-vde-frame-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/vde-frame.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-theme-save-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-theme-save-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/theme-save.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-image-sizing-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-image-sizing-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/image-sizing.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-quick-style-element-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-quick-style-element-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/quick-style-element.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.iframe-transport.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload-fp.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-quick-style-uploader-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-quick-style-uploader-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/quick-style-uploader.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-designeditor-css-styles-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-designeditor-css-styles-css"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::css/styles.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-message-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-message-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/message.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-designeditor-js-tools-files-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-designeditor-js-tools-files-js"> <arguments> <argument name="file" xsi:type="string">Magento_DesignEditor::js/tools-files.js</argument> </arguments> diff --git a/app/code/Magento/DesignEditor/view/frontend/translate_inline.phtml b/app/code/Magento/DesignEditor/view/frontend/translate_inline.phtml index 74990f09fa3..e3b735ef72f 100644 --- a/app/code/Magento/DesignEditor/view/frontend/translate_inline.phtml +++ b/app/code/Magento/DesignEditor/view/frontend/translate_inline.phtml @@ -24,7 +24,7 @@ */ ?> -<?php /** @var $this \Magento\View\Block\Template */ ?> +<?php /** @var $this \Magento\View\Element\Template */ ?> <script type="text/javascript" src="<?php echo $this->getViewFileUrl('mage/translate.js') ?>"></script> <script type="text/javascript" src="<?php echo $this->getViewFileUrl('mage/loader.js') ?>"></script> <script type="text/javascript" src="<?php echo $this->getViewFileUrl('mage/bootstrap.js') ?>"></script> diff --git a/app/code/Magento/Directory/Block/Currency.php b/app/code/Magento/Directory/Block/Currency.php index 5d55b1fbeca..d337d8ba3f4 100644 --- a/app/code/Magento/Directory/Block/Currency.php +++ b/app/code/Magento/Directory/Block/Currency.php @@ -29,7 +29,7 @@ */ namespace Magento\Directory\Block; -class Currency extends \Magento\View\Block\Template +class Currency extends \Magento\View\Element\Template { /** * Directory url @@ -44,22 +44,20 @@ class Currency extends \Magento\View\Block\Template protected $_currencyFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Directory\Helper\Url $directoryUrl * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Directory\Helper\Url $directoryUrl, \Magento\Directory\Model\CurrencyFactory $currencyFactory, array $data = array() ) { $this->_directoryUrl = $directoryUrl; $this->_currencyFactory = $currencyFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Directory/Block/Data.php b/app/code/Magento/Directory/Block/Data.php index f78cc0037f6..29d7b01370e 100644 --- a/app/code/Magento/Directory/Block/Data.php +++ b/app/code/Magento/Directory/Block/Data.php @@ -29,7 +29,7 @@ */ namespace Magento\Directory\Block; -class Data extends \Magento\View\Block\Template +class Data extends \Magento\View\Element\Template { /** * @var \Magento\App\Cache\Type\Config @@ -47,22 +47,36 @@ class Data extends \Magento\View\Block\Template protected $_countryCollFactory; /** - * @param \Magento\View\Block\Template\Context $context + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\App\Cache\Type\Config $configCacheType * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory * @param \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\App\Cache\Type\Config $configCacheType, \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory, \Magento\Directory\Model\Resource\Country\CollectionFactory $countryCollFactory, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); + $this->_coreData = $coreData; + $this->_jsonEncoder = $jsonEncoder; $this->_configCacheType = $configCacheType; $this->_regionCollFactory = $regionCollFactory; $this->_countryCollFactory = $countryCollFactory; @@ -111,7 +125,7 @@ class Data extends \Magento\View\Block\Template $options = $this->getCountryCollection()->toOptionArray(); $this->_configCacheType->save(serialize($options), $cacheKey); } - $html = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $html = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName($name) ->setId($id) ->setTitle(__($title)) @@ -154,7 +168,7 @@ class Data extends \Magento\View\Block\Template $options = $this->getRegionCollection()->toOptionArray(); $this->_configCacheType->save(serialize($options), $cacheKey); } - $html = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $html = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName('region') ->setTitle(__('State/Province')) ->setId('state') @@ -203,7 +217,7 @@ class Data extends \Magento\View\Block\Template 'name'=>$region->getName() ); } - $regionsJs = $this->_coreData->jsonEncode($regions); + $regionsJs = $this->_jsonEncoder->encode($regions); } \Magento\Profiler::stop('TEST: ' . __METHOD__); return $regionsJs; diff --git a/app/code/Magento/Directory/Helper/Url.php b/app/code/Magento/Directory/Helper/Url.php index e4479a1fb26..04fe8b56b96 100644 --- a/app/code/Magento/Directory/Helper/Url.php +++ b/app/code/Magento/Directory/Helper/Url.php @@ -39,14 +39,14 @@ class Url extends \Magento\Core\Helper\Url protected $_coreData = null; /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Core\Helper\Data $coreData */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\App\Helper\Context $context, - \Magento\Core\Model\StoreManagerInterface $storeManager + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\Helper\Data $coreData ) { $this->_coreData = $coreData; parent::__construct($context, $storeManager); diff --git a/app/code/Magento/Directory/Model/Resource/Country/Collection.php b/app/code/Magento/Directory/Model/Resource/Country/Collection.php index 39ee33d7089..bd027c81317 100644 --- a/app/code/Magento/Directory/Model/Resource/Country/Collection.php +++ b/app/code/Magento/Directory/Model/Resource/Country/Collection.php @@ -58,28 +58,30 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_arrayUtils; /** + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger + * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\LocaleInterface $locale - * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Directory\Model\Resource\CountryFactory $countryFactory * @param \Magento\Stdlib\ArrayUtils $arrayUtils + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, + \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\LocaleInterface $locale, - \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Directory\Model\Resource\CountryFactory $countryFactory, \Magento\Stdlib\ArrayUtils $arrayUtils, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_coreStoreConfig = $coreStoreConfig; $this->_locale = $locale; $this->_countryFactory = $countryFactory; diff --git a/app/code/Magento/Directory/Model/Resource/Region/Collection.php b/app/code/Magento/Directory/Model/Resource/Region/Collection.php index ce4b6dd1736..ff1fbc9128c 100644 --- a/app/code/Magento/Directory/Model/Resource/Region/Collection.php +++ b/app/code/Magento/Directory/Model/Resource/Region/Collection.php @@ -51,25 +51,25 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_locale; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\LocaleInterface $locale + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\LocaleInterface $locale, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_locale = $locale; - parent::__construct( - $eventManager, $logger, $fetchStrategy, $entityFactory, $resource - ); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Directory/Model/Resource/Setup.php b/app/code/Magento/Directory/Model/Resource/Setup.php index 81a9a8f50c0..9772f6dddf3 100644 --- a/app/code/Magento/Directory/Model/Resource/Setup.php +++ b/app/code/Magento/Directory/Model/Resource/Setup.php @@ -42,15 +42,15 @@ class Setup extends \Magento\Core\Model\Resource\Setup /** * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param string $resourceName * @param \Magento\Directory\Helper\Data $directoryData - * @param $resourceName * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, - \Magento\Directory\Helper\Data $directoryData, $resourceName, + \Magento\Directory\Helper\Data $directoryData, $moduleName = 'Magento_Directory', $connectionName = '' ) { diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php index 066f947eb7c..a96a790eeda 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable.php @@ -54,20 +54,18 @@ class Downloadable */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php index 890f781ec37..1c5d025c5c6 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Links.php @@ -93,9 +93,14 @@ class Links */ protected $_urlFactory; + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase * @param \Magento\Downloadable\Helper\File $downloadableFile * @param \Magento\Core\Model\Registry $coreRegistry @@ -107,7 +112,7 @@ class Links */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, \Magento\Downloadable\Helper\File $downloadableFile, \Magento\Core\Model\Registry $coreRegistry, @@ -117,6 +122,7 @@ class Links \Magento\Backend\Model\UrlFactory $urlFactory, array $data = array() ) { + $this->_jsonEncoder = $jsonEncoder; $this->_coreRegistry = $coreRegistry; $this->_coreFileStorageDb = $coreFileStorageDatabase; $this->_downloadableFile = $downloadableFile; @@ -124,7 +130,7 @@ class Links $this->_link = $link; $this->_attributeFactory = $attributeFactory; $this->_urlFactory = $urlFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -173,7 +179,7 @@ class Links */ public function getPurchasedSeparatelySelect() { - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName('product[links_purchased_separately]') ->setId('downloadable_link_purchase_type') ->setOptions($this->_sourceModel->toOptionArray()) @@ -190,11 +196,12 @@ class Links public function getAddButtonHtml() { $addButton = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Widget\Button') - ->setData(array( + ->setData([ 'label' => __('Add New Row'), 'id' => 'add_link_item', - 'class' => 'add' - )); + 'class' => 'add', + 'data_attribute' => ['action' => 'add-link'], + ]); return $addButton->toHtml(); } @@ -399,7 +406,7 @@ class Links $this->getConfig()->setReplaceBrowseWithRemove(true); $this->getConfig()->setWidth('32'); $this->getConfig()->setHideUploadButton(true); - return $this->_coreData->jsonEncode($this->getConfig()->getData()); + return $this->_jsonEncoder->encode($this->getConfig()->getData()); } /** diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php index e254ad3c958..0f6c00ab1e6 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/Samples.php @@ -76,33 +76,39 @@ class Samples */ protected $_urlFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase - * @param \Magento\Downloadable\Helper\File $downloadableFile - * @param \Magento\Core\Model\Registry $coreRegistry - * @param \Magento\Downloadable\Model\Sample $sampleModel - * @param \Magento\Backend\Model\UrlFactory $urlFactory - * @param array $data + /** + * @var \Magento\Json\EncoderInterface */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, - \Magento\Downloadable\Helper\File $downloadableFile, - \Magento\Core\Model\Registry $coreRegistry, - \Magento\Downloadable\Model\Sample $sampleModel, - \Magento\Backend\Model\UrlFactory $urlFactory, - array $data = array() - ) { + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase + * @param \Magento\Downloadable\Helper\File $downloadableFile + * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Downloadable\Model\Sample $sampleModel + * @param \Magento\Backend\Model\UrlFactory $urlFactory + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, + \Magento\Downloadable\Helper\File $downloadableFile, + \Magento\Core\Model\Registry $coreRegistry, + \Magento\Downloadable\Model\Sample $sampleModel, + \Magento\Backend\Model\UrlFactory $urlFactory, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_coreFileStorageDb = $coreFileStorageDatabase; $this->_downloadableFile = $downloadableFile; $this->_coreRegistry = $coreRegistry; $this->_sampleModel = $sampleModel; $this->_urlFactory = $urlFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -134,11 +140,12 @@ class Samples public function getAddButtonHtml() { $addButton = $this->getLayout()->createBlock('Magento\Adminhtml\Block\Widget\Button') - ->setData(array( + ->setData([ 'label' => __('Add New Row'), 'id' => 'add_sample_item', 'class' => 'add', - )); + 'data_attribute' => ['action' => 'add-sample'], + ]); return $addButton->toHtml(); } @@ -255,7 +262,7 @@ class Samples $this->getConfig()->setReplaceBrowseWithRemove(true); $this->getConfig()->setWidth('32'); $this->getConfig()->setHideUploadButton(true); - return $this->_coreData->jsonEncode($this->getConfig()->getData()); + return $this->_jsonEncoder->encode($this->getConfig()->getData()); } /** diff --git a/app/code/Magento/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php b/app/code/Magento/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php index bbacefd508c..950e184842c 100644 --- a/app/code/Magento/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php +++ b/app/code/Magento/Downloadable/Block/Adminhtml/Sales/Items/Column/Downloadable/Name.php @@ -43,25 +43,23 @@ class Name extends \Magento\Sales\Block\Adminhtml\Items\Column\Name */ protected $_itemsFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\Product\OptionFactory $optionFactory - * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory - * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\Product\OptionFactory $optionFactory + * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory + * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\Product\OptionFactory $optionFactory, - \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, - \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\Product\OptionFactory $optionFactory, + \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, + \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory, + array $data = array() + ) { $this->_purchasedFactory = $purchasedFactory; $this->_itemsFactory = $itemsFactory; - parent::__construct($context, $coreData, $optionFactory, $data); + parent::__construct($context, $optionFactory, $data); } public function getLinks() diff --git a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php index 50c393864bb..36a856f28d4 100644 --- a/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php +++ b/app/code/Magento/Downloadable/Block/Catalog/Product/Links.php @@ -41,29 +41,42 @@ class Links extends \Magento\Catalog\Block\Product\AbstractProduct protected $_calculationModel; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @var \Magento\Json\EncoderInterface + */ + protected $jsonEncoder; + + /** + * @var \Magento\Core\Helper\Data + */ + protected $coreData; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Math\Random $mathRandom * @param \Magento\Tax\Model\Calculation $calculationModel + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, \Magento\Tax\Model\Calculation $calculationModel, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Core\Helper\Data $coreData, array $data = array() ) { $this->_calculationModel = $calculationModel; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + $this->jsonEncoder = $jsonEncoder; + $this->coreData = $coreData; + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** @@ -161,13 +174,12 @@ class Links extends \Magento\Catalog\Block\Product\AbstractProduct public function getJsonConfig() { $config = array(); - $coreHelper = $this->_coreData; foreach ($this->getLinks() as $link) { - $config[$link->getId()] = $coreHelper->currency($link->getPrice(), false, false); + $config[$link->getId()] = $this->coreData->currency($link->getPrice(), false, false); } - return $coreHelper->jsonEncode($config); + return $this->jsonEncoder->encode($config); } public function getLinkSamlpeUrl($link) diff --git a/app/code/Magento/Downloadable/Block/Checkout/Cart/Item/Renderer.php b/app/code/Magento/Downloadable/Block/Checkout/Cart/Item/Renderer.php index b0b99d4ec01..78fa6dc2e57 100644 --- a/app/code/Magento/Downloadable/Block/Checkout/Cart/Item/Renderer.php +++ b/app/code/Magento/Downloadable/Block/Checkout/Cart/Item/Renderer.php @@ -44,23 +44,21 @@ class Renderer extends \Magento\Checkout\Block\Cart\Item\Renderer protected $_downloadProdConfig = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Product\Configuration $productConfig * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Downloadable\Helper\Catalog\Product\Configuration $dwnCtlgProdConfig * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Product\Configuration $productConfig, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Downloadable\Helper\Catalog\Product\Configuration $dwnCtlgProdConfig, array $data = array() ) { $this->_downloadProdConfig = $dwnCtlgProdConfig; - parent::__construct($context, $coreData, $productConfig, $checkoutSession, $data); + parent::__construct($context, $productConfig, $checkoutSession, $data); } /** diff --git a/app/code/Magento/Downloadable/Block/Customer/Products/ListProducts.php b/app/code/Magento/Downloadable/Block/Customer/Products/ListProducts.php index 12217b84604..7b9ffd3f4c1 100644 --- a/app/code/Magento/Downloadable/Block/Customer/Products/ListProducts.php +++ b/app/code/Magento/Downloadable/Block/Customer/Products/ListProducts.php @@ -33,7 +33,7 @@ */ namespace Magento\Downloadable\Block\Customer\Products; -class ListProducts extends \Magento\View\Block\Template +class ListProducts extends \Magento\View\Element\Template { /** * @var \Magento\Customer\Model\Session @@ -51,16 +51,14 @@ class ListProducts extends \Magento\View\Block\Template protected $_itemsFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Downloadable\Model\Resource\Link\Purchased\CollectionFactory $linksFactory * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Downloadable\Model\Resource\Link\Purchased\CollectionFactory $linksFactory, \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory, @@ -69,7 +67,7 @@ class ListProducts extends \Magento\View\Block\Template $this->_customerSession = $customerSession; $this->_linksFactory = $linksFactory; $this->_itemsFactory = $itemsFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -112,7 +110,7 @@ class ListProducts extends \Magento\View\Block\Template { parent::_prepareLayout(); - $pager = $this->getLayout()->createBlock('Magento\Page\Block\Html\Pager', 'downloadable.customer.products.pager') + $pager = $this->getLayout()->createBlock('Magento\Theme\Block\Html\Pager', 'downloadable.customer.products.pager') ->setCollection($this->getItems()); $this->setChild('pager', $pager); $this->getItems()->load(); diff --git a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php index 0437bbcb168..3f26db29f47 100644 --- a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Downloadable.php @@ -52,29 +52,27 @@ class Downloadable extends \Magento\Sales\Block\Order\Email\Items\DefaultItems protected $_itemsFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory, array $data = array() ) { $this->_purchasedFactory = $purchasedFactory; $this->_itemsFactory = $itemsFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** * Enter description here... * - * @return unknown + * @return \Magento\Downloadable\Model\Link\Purchased */ public function getLinks() { diff --git a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php index b650ab05101..57df3084287 100644 --- a/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Sales/Order/Email/Items/Order/Downloadable.php @@ -52,28 +52,26 @@ class Downloadable extends \Magento\Sales\Block\Order\Email\Items\Order\DefaultO protected $_itemsFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory, array $data = array() ) { $this->_purchasedFactory = $purchasedFactory; $this->_itemsFactory = $itemsFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** * Enter description here... * - * @return unknown + * @return \Magento\Downloadable\Model\Link\Purchased */ public function getLinks() { diff --git a/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php b/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php index f01a1cb7094..b129a2974ed 100644 --- a/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php +++ b/app/code/Magento/Downloadable/Block/Sales/Order/Item/Renderer/Downloadable.php @@ -47,8 +47,7 @@ class Downloadable extends \Magento\Sales\Block\Order\Item\Renderer\DefaultRende protected $_itemsFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Stdlib\String $string * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory @@ -56,8 +55,7 @@ class Downloadable extends \Magento\Sales\Block\Order\Item\Renderer\DefaultRende * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Stdlib\String $string, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, @@ -66,7 +64,7 @@ class Downloadable extends \Magento\Sales\Block\Order\Item\Renderer\DefaultRende ) { $this->_purchasedFactory = $purchasedFactory; $this->_itemsFactory = $itemsFactory; - parent::__construct($context, $coreData, $string, $productOptionFactory, $data); + parent::__construct($context, $string, $productOptionFactory, $data); } public function getLinks() diff --git a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File.php b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File.php index fbef1005b74..8b3b68a24fd 100644 --- a/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File.php +++ b/app/code/Magento/Downloadable/Controller/Adminhtml/Downloadable/File.php @@ -93,7 +93,7 @@ class File extends \Magento\Backend\App\Action } $result['cookie'] = array( - 'name' => session_name(), + 'name' => $this->_getSession()->getName(), 'value' => $this->_getSession()->getSessionId(), 'lifetime' => $this->_getSession()->getCookieLifetime(), 'path' => $this->_getSession()->getCookiePath(), diff --git a/app/code/Magento/Downloadable/Helper/Catalog/Product/Configuration.php b/app/code/Magento/Downloadable/Helper/Catalog/Product/Configuration.php index 7fc2ae64177..81538ca63d6 100644 --- a/app/code/Magento/Downloadable/Helper/Catalog/Product/Configuration.php +++ b/app/code/Magento/Downloadable/Helper/Catalog/Product/Configuration.php @@ -51,14 +51,14 @@ class Configuration extends \Magento\App\Helper\AbstractHelper protected $_coreStoreConfig; /** - * @param \Magento\Catalog\Helper\Product\Configuration $productConfigur * @param \Magento\App\Helper\Context $context + * @param \Magento\Catalog\Helper\Product\Configuration $productConfigur * @param \Magento\Core\Model\Store\Config $coreStoreConfig */ public function __construct( - \Magento\Catalog\Helper\Product\Configuration $productConfigur, \Magento\App\Helper\Context $context, - \Magento\Core\Model\Store\Config $coreStoreConfig + \Magento\Catalog\Helper\Product\Configuration $productConfigur, + \Magento\Core\Model\Store\Config $coreStoreConfig ) { $this->_productConfigur = $productConfigur; $this->_coreStoreConfig = $coreStoreConfig; diff --git a/app/code/Magento/Downloadable/Helper/Download.php b/app/code/Magento/Downloadable/Helper/Download.php index df7bba3f69f..f7836508d02 100644 --- a/app/code/Magento/Downloadable/Helper/Download.php +++ b/app/code/Magento/Downloadable/Helper/Download.php @@ -127,19 +127,19 @@ class Download extends \Magento\App\Helper\AbstractHelper protected $_filesystem; /** + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Downloadable\Helper\File $downloadableFile * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb - * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\App\Dir $dirModel * @param \Magento\Filesystem $filesystem */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\Downloadable\Helper\File $downloadableFile, \Magento\Core\Helper\File\Storage\Database $coreFileStorageDb, - \Magento\App\Helper\Context $context, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\App\Dir $dirModel, \Magento\Filesystem $filesystem diff --git a/app/code/Magento/Downloadable/Helper/File.php b/app/code/Magento/Downloadable/Helper/File.php index 7f21b4c2322..bb53143f047 100644 --- a/app/code/Magento/Downloadable/Helper/File.php +++ b/app/code/Magento/Downloadable/Helper/File.php @@ -43,13 +43,13 @@ class File extends \Magento\App\Helper\AbstractHelper protected $_coreFileStorageDatabase = null; /** - * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase * @param array $mimeTypes */ public function __construct( - \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, \Magento\App\Helper\Context $context, + \Magento\Core\Helper\File\Storage\Database $coreFileStorageDatabase, array $mimeTypes = array() ) { $this->_coreFileStorageDatabase = $coreFileStorageDatabase; diff --git a/app/code/Magento/Downloadable/Model/Resource/Link.php b/app/code/Magento/Downloadable/Model/Resource/Link.php index 2f57c1213e9..517bb4ac81f 100644 --- a/app/code/Magento/Downloadable/Model/Resource/Link.php +++ b/app/code/Magento/Downloadable/Model/Resource/Link.php @@ -59,15 +59,15 @@ class Link extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\App\Resource $resource + * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Core\Model\App $app * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Catalog\Helper\Data $catalogData, \Magento\App\Resource $resource, + \Magento\Catalog\Helper\Data $catalogData, \Magento\Core\Model\App $app, \Magento\Directory\Model\CurrencyFactory $currencyFactory, \Magento\Core\Model\StoreManagerInterface $storeManager diff --git a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php index aa5f61dc45f..901600565f9 100644 --- a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php +++ b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/AbstractItems.php @@ -56,9 +56,9 @@ abstract class AbstractItems extends \Magento\Sales\Model\Order\Pdf\Items\Abstra protected $_itemsFactory; /** - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Dir $coreDir * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory @@ -68,9 +68,9 @@ abstract class AbstractItems extends \Magento\Sales\Model\Order\Pdf\Items\Abstra * @param array $data */ public function __construct( - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Tax\Helper\Data $taxData, \Magento\App\Dir $coreDir, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, @@ -82,7 +82,7 @@ abstract class AbstractItems extends \Magento\Sales\Model\Order\Pdf\Items\Abstra $this->_coreStoreConfig = $coreStoreConfig; $this->_purchasedFactory = $purchasedFactory; $this->_itemsFactory = $itemsFactory; - parent::__construct($taxData, $context, $registry, $coreDir, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $taxData, $coreDir, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php index 7bb18f64e44..08fe08ccda7 100644 --- a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php +++ b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Creditmemo.php @@ -38,36 +38,36 @@ class Creditmemo protected $string; /** - * @param \Magento\Stdlib\String $string - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Dir $coreDir * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory + * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Stdlib\String $string, - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Tax\Helper\Data $taxData, \Magento\App\Dir $coreDir, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory, + \Magento\Stdlib\String $string, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->string = $string; parent::__construct( - $taxData, $context, $registry, + $taxData, $coreDir, $coreStoreConfig, $purchasedFactory, diff --git a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php index 7263a9511a6..e960c53fc84 100644 --- a/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php +++ b/app/code/Magento/Downloadable/Model/Sales/Order/Pdf/Items/Invoice.php @@ -43,36 +43,36 @@ class Invoice protected $string; /** - * @param \Magento\Stdlib\String $string - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Dir $coreDir * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory * @param \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory + * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Stdlib\String $string, - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Tax\Helper\Data $taxData, \Magento\App\Dir $coreDir, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Downloadable\Model\Link\PurchasedFactory $purchasedFactory, \Magento\Downloadable\Model\Resource\Link\Purchased\Item\CollectionFactory $itemsFactory, + \Magento\Stdlib\String $string, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->string = $string; parent::__construct( - $taxData, $context, $registry, + $taxData, $coreDir, $coreStoreConfig, $purchasedFactory, diff --git a/app/code/Magento/Downloadable/etc/module.xml b/app/code/Magento/Downloadable/etc/module.xml index 46791af9868..061d0ee728c 100755 --- a/app/code/Magento/Downloadable/etc/module.xml +++ b/app/code/Magento/Downloadable/etc/module.xml @@ -34,7 +34,7 @@ <module name="Magento_Customer"/> <module name="Magento_Adminhtml"/> <module name="Magento_Tax"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> <module name="Magento_Eav"/> <module name="Magento_Backend"/> <module name="Magento_Sales"/> diff --git a/app/code/Magento/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml b/app/code/Magento/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml index 8370ed428ee..b84790b780b 100644 --- a/app/code/Magento/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml +++ b/app/code/Magento/Downloadable/view/adminhtml/product/composite/fieldset/downloadable.phtml @@ -29,50 +29,43 @@ <?php $_skipSaleableCheck = $this->helper('Magento\Catalog\Helper\Product')->getSkipSaleableCheck(); ?> <?php if (($this->getProduct()->isSaleable() || $_skipSaleableCheck) && $this->hasLinks()):?> -<div id="catalog_product_composite_configure_fields_downloadable" class="<?php echo $this->getIsLastFieldset() ? 'last-fieldset' : '' ?>"> - <h4><?php echo __('Downloadable Information') ?></h4> - <div class="product-options"> - <dl> - <?php $_links = $this->getLinks(); ?> - <?php $_isRequired = $this->getLinkSelectionRequired(); ?> - <dt><label<?php if ($_isRequired) echo ' class="required"' ?>><?php if ($_isRequired) echo '<em>*</em>' ?><?php echo $this->getLinksTitle() ?></label></dt> - <dd class="last"> - <ul id="downloadable-links-list" class="options-list"> - <?php foreach ($_links as $_link): ?> - <li> +<fieldset id="catalog_product_composite_configure_fields_downloadable" class="fieldset downloadable information<?php echo $this->getIsLastFieldset() ? ' last-fieldset' : '' ?>"> + <legend class="legend"><span><?php echo __('Downloadable Information') ?></span></legend><br /> + <?php $_links = $this->getLinks(); ?> + <?php $_isRequired = $this->getLinkSelectionRequired(); ?> + <div class="field link<?php if ($_isRequired) echo ' required' ?>"> + <label class="label"><span><?php echo $this->getLinksTitle() ?></span></label> + <div class="control" id="downloadable-links-list"> + <?php foreach ($_links as $_link): ?> + <div class="nested"> + <?php if ($_linksPurchasedSeparately): ?> + <input type="checkbox" class="checkbox<?php if ($_isRequired):?> validate-one-required-by-name<?php endif; ?> product downloadable link" name="links[]" id="links_<?php echo $_link->getId() ?>" value="<?php echo $_link->getId(); ?>" <?php echo $this->getLinkCheckedValue($_link); ?> price="<?php echo $this->getCurrencyPrice($_link->getPrice()); ?>"/> + <?php endif; ?> + <label for="links_<?php echo $_link->getId() ?>" class="label"> + <?php echo $this->escapeHtml($_link->getTitle()) ?> + <?php if ($_link->getSampleFile() || $_link->getSampleUrl()): ?> + (<a href="<?php echo $this->getLinkSamlpeUrl($_link) ?>" <?php echo $this->getIsOpenInNewWindow()?'onclick="this.target=\'_blank\'"':''; ?>><?php echo __('sample') ?></a>) + <?php endif; ?> <?php if ($_linksPurchasedSeparately): ?> - <input type="checkbox" class="checkbox<?php if ($_isRequired):?> validate-one-required-by-name<?php endif; ?> product-downloadable-link" name="links[]" id="links_<?php echo $_link->getId() ?>" value="<?php echo $_link->getId(); ?>" <?php echo $this->getLinkCheckedValue($_link); ?> price="<?php echo $this->getCurrencyPrice($_link->getPrice()); ?>"/> - <?php endif; ?> - <span class="label"> - <label for="links_<?php echo $_link->getId() ?>"> - <?php echo $this->escapeHtml($_link->getTitle()) ?> - </label> - <?php if ($_link->getSampleFile() || $_link->getSampleUrl()): ?> - (<a href="<?php echo $this->getLinkSamlpeUrl($_link) ?>" <?php echo $this->getIsOpenInNewWindow()?'onclick="this.target=\'_blank\'"':''; ?>><?php echo __('sample') ?></a>) - <?php endif; ?> - <?php if ($_linksPurchasedSeparately): ?> - <?php echo $this->getFormattedLinkPrice($_link); ?> - <?php endif; ?> - </span> - <?php if ($_isRequired): ?> - <script type="text/javascript"> - //<![CDATA[ - $('links_<?php echo $_link->getId() ?>').advaiceContainer = 'links-advice-container'; - $('links_<?php echo $_link->getId() ?>').callbackFunction = 'validateDownloadableCallback'; - //]]> - </script> + <?php echo $this->getFormattedLinkPrice($_link); ?> <?php endif; ?> - </li> - <?php endforeach; ?> - </ul> - - <?php if ($_isRequired): ?> - <span id="links-advice-container"></span> - <?php endif;?> - </dd> - </dl> + </label> + <?php if ($_isRequired): ?> + <script type="text/javascript"> + //<![CDATA[ + $('links_<?php echo $_link->getId() ?>').advaiceContainer = 'links-advice-container'; + $('links_<?php echo $_link->getId() ?>').callbackFunction = 'validateDownloadableCallback'; + //]]> + </script> + <?php endif; ?> + </div> + <?php endforeach; ?> + <?php if ($_isRequired): ?> + <span id="links-advice-container"></span> + <?php endif;?> + </div> </div> -</div> +</fieldset> <script type="text/javascript"> //<![CDATA[ diff --git a/app/code/Magento/Downloadable/view/frontend/catalog/product/links.phtml b/app/code/Magento/Downloadable/view/frontend/catalog/product/links.phtml index 3d84f8141c8..273fb261403 100644 --- a/app/code/Magento/Downloadable/view/frontend/catalog/product/links.phtml +++ b/app/code/Magento/Downloadable/view/frontend/catalog/product/links.phtml @@ -29,9 +29,9 @@ <?php $_isRequired = $this->getLinkSelectionRequired(); ?> <div class="field downloads<?php if ($_isRequired) echo ' required' ?>"> <label class="label"><span><?php echo $this->getLinksTitle() ?></span></label> - <div class="control" id="downloadable-links-list"> + <div class="control" id="downloadable-links-list" data-container-for="downloadable-links"> <?php foreach ($_links as $_link): ?> - <div class="field choice"> + <div class="field choice" data-role="link"> <?php if ($_linksPurchasedSeparately): ?> <input type="checkbox" <?php if ($_isRequired): ?>data-validate="{'validate-one-checkbox-required-by-name':'downloadable-links-list'}" <?php endif; ?> diff --git a/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml b/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml index dbf40a97e7f..5667ca3433e 100644 --- a/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Downloadable/view/frontend/layout/customer_account.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="customer_account_navigation"> - <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-downloadable-products-link"> + <block class="Magento\View\Element\Html\Link\Current" name="customer-account-navigation-downloadable-products-link"> <arguments> <argument name="path" xsi:type="string">downloadable/customer/products</argument> <argument name="label" xsi:type="string">My Downloadable Products</argument> diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php index 335271e2207..e7483e0fbb5 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractMain.php @@ -61,33 +61,31 @@ abstract class AbstractMain */ protected $_inputTypeFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Eav\Helper\Data $eavData - * @param \Magento\Backend\Model\Config\Source\YesnoFactory $yesnoFactory - * @param \Magento\Eav\Model\Adminhtml\System\Config\Source\InputtypeFactory $inputTypeFactory - * @param \Magento\Eav\Model\Entity\Attribute\Config $attributeConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Eav\Helper\Data $eavData + * @param \Magento\Backend\Model\Config\Source\YesnoFactory $yesnoFactory + * @param \Magento\Eav\Model\Adminhtml\System\Config\Source\InputtypeFactory $inputTypeFactory + * @param \Magento\Eav\Model\Entity\Attribute\Config $attributeConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Eav\Helper\Data $eavData, - \Magento\Backend\Model\Config\Source\YesnoFactory $yesnoFactory, - \Magento\Eav\Model\Adminhtml\System\Config\Source\InputtypeFactory $inputTypeFactory, - \Magento\Eav\Model\Entity\Attribute\Config $attributeConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Eav\Helper\Data $eavData, + \Magento\Backend\Model\Config\Source\YesnoFactory $yesnoFactory, + \Magento\Eav\Model\Adminhtml\System\Config\Source\InputtypeFactory $inputTypeFactory, + \Magento\Eav\Model\Entity\Attribute\Config $attributeConfig, + array $data = array() + ) { $this->_eavData = $eavData; $this->_yesnoFactory = $yesnoFactory; $this->_inputTypeFactory = $inputTypeFactory; $this->_attributeConfig = $attributeConfig; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } public function setAttributeObject($attribute) diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/AbstractOptions.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/AbstractOptions.php index fc523591ae7..74c5092af18 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/AbstractOptions.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/AbstractOptions.php @@ -33,7 +33,7 @@ */ namespace Magento\Eav\Block\Adminhtml\Attribute\Edit\Options; -abstract class AbstractOptions extends \Magento\View\Block\AbstractBlock +abstract class AbstractOptions extends \Magento\View\Element\AbstractBlock { /** * Preparing layout, adding buttons diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Labels.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Labels.php index f7cb50c8447..65ce0249c53 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Labels.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Labels.php @@ -43,19 +43,17 @@ class Labels extends \Magento\Backend\Block\Template */ protected $_template = 'Magento_Catalog::catalog/product/attribute/labels.phtml'; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + parent::__construct($context, $data); $this->_registry = $registry; } diff --git a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php index 8aab043bd8b..be6384b002b 100644 --- a/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php +++ b/app/code/Magento/Eav/Block/Adminhtml/Attribute/Edit/Options/Options.php @@ -51,23 +51,21 @@ class Options extends \Magento\Backend\Block\Template */ protected $_universalFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptCollFactory - * @param \Magento\Validator\UniversalFactory $universalFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptCollFactory + * @param \Magento\Validator\UniversalFactory $universalFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptCollFactory, - \Magento\Validator\UniversalFactory $universalFactory, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Eav\Model\Resource\Entity\Attribute\Option\CollectionFactory $attrOptCollFactory, + \Magento\Validator\UniversalFactory $universalFactory, + array $data = array() + ) { + parent::__construct($context, $data); $this->_registry = $registry; $this->_attrOptCollFactory = $attrOptCollFactory; $this->_universalFactory = $universalFactory; diff --git a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php index 5fcd87e6ff2..593a274836a 100644 --- a/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php +++ b/app/code/Magento/Eav/Model/Entity/Collection/AbstractCollection.php @@ -136,26 +136,28 @@ abstract class AbstractCollection extends \Magento\Data\Collection\Db protected $_universalFactory; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory * @param \Magento\Eav\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, \Magento\Eav\Model\Resource\Helper $resourceHelper, - \Magento\Validator\UniversalFactory $universalFactory + \Magento\Validator\UniversalFactory $universalFactory, + $connection = null ) { $this->_eventManager = $eventManager; $this->_eavConfig = $eavConfig; @@ -163,7 +165,7 @@ abstract class AbstractCollection extends \Magento\Data\Collection\Db $this->_eavEntityFactory = $eavEntityFactory; $this->_resourceHelper = $resourceHelper; $this->_universalFactory = $universalFactory; - parent::__construct($logger, $fetchStrategy, $entityFactory); + parent::__construct($entityFactory, $logger, $fetchStrategy, $connection); $this->_construct(); $this->setConnection($this->getEntity()->getReadConnection()); $this->_prepareStaticFields(); diff --git a/app/code/Magento/Eav/Model/Entity/Setup.php b/app/code/Magento/Eav/Model/Entity/Setup.php index a9a5b613483..8caf0f584d6 100644 --- a/app/code/Magento/Eav/Model/Entity/Setup.php +++ b/app/code/Magento/Eav/Model/Entity/Setup.php @@ -48,17 +48,17 @@ class Setup extends \Magento\Core\Model\Resource\Setup /** * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param string $resourceName * @param \Magento\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory - * @param string $resourceName * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, \Magento\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory, - $resourceName, $moduleName = 'Magento_Eav', $connectionName = '' ) { diff --git a/app/code/Magento/Eav/Model/Resource/Attribute/Collection.php b/app/code/Magento/Eav/Model/Resource/Attribute/Collection.php index da6f54a92f9..bcf2aa20b72 100644 --- a/app/code/Magento/Eav/Model/Resource/Attribute/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Attribute/Collection.php @@ -67,26 +67,28 @@ abstract class Collection protected $_storeManager; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_storeManager = $storeManager; $this->_eavConfig = $eavConfig; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php index 5015f1291c6..9c3e1f7ab77 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Grid/Collection.php @@ -42,23 +42,25 @@ class Collection protected $_registryManager; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Registry $registryManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Registry $registryManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_registryManager = $registryManager; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php index c3ab70c971c..af4f465d2cd 100644 --- a/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Entity/Attribute/Option/Collection.php @@ -54,26 +54,28 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_storeManager; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\App\Resource $coreResource * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\App\Resource $coreResource, \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_storeManager = $storeManager; $this->_coreResource = $coreResource; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Form/Attribute/Collection.php b/app/code/Magento/Eav/Model/Resource/Form/Attribute/Collection.php index 5282d3053f9..93e742e98c1 100644 --- a/app/code/Magento/Eav/Model/Resource/Form/Attribute/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Form/Attribute/Collection.php @@ -75,26 +75,28 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_eavConfig; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_storeManager = $storeManager; $this->_eavConfig = $eavConfig; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Eav/Model/Resource/Form/Fieldset/Collection.php b/app/code/Magento/Eav/Model/Resource/Form/Fieldset/Collection.php index 1053a8f980a..c3690473748 100644 --- a/app/code/Magento/Eav/Model/Resource/Form/Fieldset/Collection.php +++ b/app/code/Magento/Eav/Model/Resource/Form/Fieldset/Collection.php @@ -49,23 +49,25 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_storeManager; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_storeManager = $storeManager; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Email/Block/Adminhtml/Template.php b/app/code/Magento/Email/Block/Adminhtml/Template.php index aee0059cacf..24f6cb43397 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template.php @@ -42,7 +42,7 @@ class Template extends \Magento\Backend\Block\Template /** * Create add button and grid blocks * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php b/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php index 82deb06e4d2..806a121e9dc 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Edit.php @@ -63,9 +63,14 @@ class Edit extends \Magento\Adminhtml\Block\Widget */ protected $_template = 'template/edit.phtml'; + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Core\Model\Registry $registry * @param \Magento\Backend\Model\Menu\Config $menuConfig * @param \Magento\Backend\Model\Config\Structure $configStructure @@ -74,18 +79,19 @@ class Edit extends \Magento\Adminhtml\Block\Widget */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Core\Model\Registry $registry, \Magento\Backend\Model\Menu\Config $menuConfig, \Magento\Backend\Model\Config\Structure $configStructure, \Magento\Email\Model\Template\Config $emailConfig, array $data = array() ) { + $this->_jsonEncoder = $jsonEncoder; $this->_registryManager = $registry; $this->_menuConfig = $menuConfig; $this->_configStructure = $configStructure; $this->_emailConfig = $emailConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() @@ -386,7 +392,7 @@ class Edit extends \Magento\Adminhtml\Block\Widget $paths = $template->getSystemConfigPathsWhereUsedCurrently(); $pathsParts = $this->_getSystemConfigPathsParts($paths); if ($asJSON) { - return $this->_coreData->jsonEncode($pathsParts); + return $this->_jsonEncoder->encode($pathsParts); } return $pathsParts; } diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php b/app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php index 950b2cd4d6f..7fabdb53af0 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Edit/Form.php @@ -44,7 +44,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\VariableFactory $variableFactory @@ -53,7 +52,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\VariableFactory $variableFactory, @@ -62,7 +60,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic ) { $this->_variableFactory = $variableFactory; $this->_variables = $variables; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** @@ -76,28 +74,28 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic if ($head = $this->getLayout()->getBlock('head')) { $head->addChild( 'prototype-window-js', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'prototype/window.js' ) ); $head->addChild( 'prototype-windows-themes-default-css', - 'Magento\Page\Block\Html\Head\Css', + 'Magento\Theme\Block\Html\Head\Css', array( 'file' => 'prototype/windows/themes/default.css' ) ); $head->addChild( 'magento-core-prototype-magento-css', - 'Magento\Page\Block\Html\Head\Css', + 'Magento\Theme\Block\Html\Head\Css', array( 'file' => 'Magento_Core::prototype/magento.css' ) ); $head->addChild( 'magento-adminhtml-variables-js', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'Magento_Adminhtml::variables.js' ) diff --git a/app/code/Magento/Email/Block/Adminhtml/Template/Preview.php b/app/code/Magento/Email/Block/Adminhtml/Template/Preview.php index f395693807b..234101fed8b 100644 --- a/app/code/Magento/Email/Block/Adminhtml/Template/Preview.php +++ b/app/code/Magento/Email/Block/Adminhtml/Template/Preview.php @@ -47,21 +47,19 @@ class Preview extends \Magento\Adminhtml\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Input\Filter\MaliciousCode $maliciousCode * @param \Magento\Email\Model\TemplateFactory $emailFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Input\Filter\MaliciousCode $maliciousCode, \Magento\Email\Model\TemplateFactory $emailFactory, array $data = array() ) { $this->_maliciousCode = $maliciousCode; $this->_emailFactory = $emailFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Email/Model/BackendTemplate.php b/app/code/Magento/Email/Model/BackendTemplate.php index ccb18e29353..7513f96c98c 100644 --- a/app/code/Magento/Email/Model/BackendTemplate.php +++ b/app/code/Magento/Email/Model/BackendTemplate.php @@ -43,16 +43,16 @@ class BackendTemplate extends \Magento\Email\Model\Template /** * @param \Magento\Core\Model\Context $context + * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Filesystem $filesystem * @param \Magento\View\Url $viewUrl * @param \Magento\View\FileSystem $viewFileSystem - * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Config $coreConfig * @param \Magento\Email\Model\Template\FilterFactory $emailFilterFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\Dir $dir * @param \Magento\Email\Model\Template\Config $emailConfig * @param \Magento\Backend\Model\Config\Structure $structure @@ -62,16 +62,16 @@ class BackendTemplate extends \Magento\Email\Model\Template */ public function __construct( \Magento\Core\Model\Context $context, + \Magento\View\DesignInterface $design, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Filesystem $filesystem, \Magento\View\Url $viewUrl, \Magento\View\FileSystem $viewFileSystem, - \Magento\View\DesignInterface $design, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Config $coreConfig, \Magento\Email\Model\Template\FilterFactory $emailFilterFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\Dir $dir, \Magento\Email\Model\Template\Config $emailConfig, \Magento\Backend\Model\Config\Structure $structure, @@ -79,16 +79,16 @@ class BackendTemplate extends \Magento\Email\Model\Template ) { parent::__construct( $context, + $design, $registry, $appEmulation, + $storeManager, $filesystem, $viewUrl, $viewFileSystem, - $design, $coreStoreConfig, $coreConfig, $emailFilterFactory, - $storeManager, $dir, $emailConfig, $data diff --git a/app/code/Magento/Email/Model/Resource/Template.php b/app/code/Magento/Email/Model/Resource/Template.php index 382c6a8c5a7..68392caf5e4 100644 --- a/app/code/Magento/Email/Model/Resource/Template.php +++ b/app/code/Magento/Email/Model/Resource/Template.php @@ -42,10 +42,10 @@ class Template extends \Magento\Core\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\App\Resource $resource + * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\Stdlib\DateTime $dateTime, \Magento\App\Resource $resource) + public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/Email/Model/Template.php b/app/code/Magento/Email/Model/Template.php index 189a8549257..af06fcb2b17 100644 --- a/app/code/Magento/Email/Model/Template.php +++ b/app/code/Magento/Email/Model/Template.php @@ -142,16 +142,16 @@ class Template extends \Magento\Core\Model\Template /** * @param \Magento\Core\Model\Context $context + * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Filesystem $filesystem * @param \Magento\View\Url $viewUrl * @param \Magento\View\FileSystem $viewFileSystem - * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\ConfigInterface $coreConfig * @param \Magento\Email\Model\Template\FilterFactory $emailFilterFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\Dir $dir * @param \Magento\Email\Model\Template\Config $emailConfig * @param array $data @@ -160,16 +160,16 @@ class Template extends \Magento\Core\Model\Template */ public function __construct( \Magento\Core\Model\Context $context, + \Magento\View\DesignInterface $design, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Filesystem $filesystem, \Magento\View\Url $viewUrl, \Magento\View\FileSystem $viewFileSystem, - \Magento\View\DesignInterface $design, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\ConfigInterface $coreConfig, \Magento\Email\Model\Template\FilterFactory $emailFilterFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\Dir $dir, \Magento\Email\Model\Template\Config $emailConfig, array $data = array() @@ -182,7 +182,7 @@ class Template extends \Magento\Core\Model\Template $this->_emailFilterFactory = $emailFilterFactory; $this->_dir = $dir; $this->_emailConfig = $emailConfig; - parent::__construct($design, $context, $registry, $appEmulation, $storeManager, $data); + parent::__construct($context, $design, $registry, $appEmulation, $storeManager, $data); } /** diff --git a/app/code/Magento/Email/Model/Template/Filter.php b/app/code/Magento/Email/Model/Template/Filter.php index 2b08ec58363..cfdcf34c7ad 100644 --- a/app/code/Magento/Email/Model/Template/Filter.php +++ b/app/code/Magento/Email/Model/Template/Filter.php @@ -307,7 +307,7 @@ class Filter extends \Magento\Filter\Template $rootBlock = false; foreach ($layout->getAllBlocks() as $block) { - /* @var $block \Magento\View\Block\AbstractBlock */ + /* @var $block \Magento\View\Element\AbstractBlock */ if (!$block->getParentBlock() && !$rootBlock) { $rootBlock = $block; } diff --git a/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml b/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml index d77c6da59ff..58af5b152c8 100644 --- a/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml +++ b/app/code/Magento/Email/view/adminhtml/layout/systemPreview.xml @@ -24,7 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\View\Block\Template" name="root" output="1" template="Magento_Backend::system/email/template/preview.phtml"> + <block class="Magento\View\Element\Template" name="root" output="1" template="Magento_Backend::system/email/template/preview.phtml"> <block class="Magento\Email\Block\Adminhtml\Template\Preview" name="content" as="content"/> </block> </layout> diff --git a/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php b/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php index 65cf2850d36..534aafd1013 100644 --- a/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php +++ b/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/Create/Form.php @@ -40,20 +40,18 @@ class Form extends \Magento\Backend\Block\Template */ protected $_sessionQuote; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + array $data = array() + ) { $this->_sessionQuote = $sessionQuote; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php b/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php index 2bdca45b04d..e6f4e1c5842 100644 --- a/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php +++ b/app/code/Magento/GiftMessage/Block/Adminhtml/Sales/Order/View/Form.php @@ -42,20 +42,18 @@ class Form extends \Magento\Backend\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/GiftMessage/Block/Message/Inline.php b/app/code/Magento/GiftMessage/Block/Message/Inline.php index 08424e77f2b..ae5fd09b8ef 100644 --- a/app/code/Magento/GiftMessage/Block/Message/Inline.php +++ b/app/code/Magento/GiftMessage/Block/Message/Inline.php @@ -34,7 +34,7 @@ */ namespace Magento\GiftMessage\Block\Message; -class Inline extends \Magento\View\Block\Template +class Inline extends \Magento\View\Element\Template { protected $_entity = null; protected $_type = null; @@ -55,22 +55,20 @@ class Inline extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\GiftMessage\Helper\Message $giftMessageMessage * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\GiftMessage\Helper\Message $giftMessageMessage, array $data = array() ) { $this->_giftMessageMessage = $giftMessageMessage; $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/GiftMessage/Model/Resource/Setup.php b/app/code/Magento/GiftMessage/Model/Resource/Setup.php index 65b8e12b325..204999e29fb 100644 --- a/app/code/Magento/GiftMessage/Model/Resource/Setup.php +++ b/app/code/Magento/GiftMessage/Model/Resource/Setup.php @@ -38,28 +38,26 @@ class Setup extends \Magento\Sales\Model\Resource\Setup /** * @param \Magento\Core\Model\Resource\Setup\Context $context - * @param $resourceName - * @param string $moduleName - * @param string $connectionName + * @param string $resourceName * @param \Magento\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory * @param \Magento\Core\Model\Config $config * @param \Magento\Catalog\Model\Resource\SetupFactory $catalogSetupFactory + * @param string $moduleName + * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, \Magento\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory, \Magento\Core\Model\Config $config, \Magento\Catalog\Model\Resource\SetupFactory $catalogSetupFactory, - $resourceName, $moduleName = 'Magento_GiftMessage', $connectionName = '' ) { $this->_catalogSetupFactory = $catalogSetupFactory; - parent::__construct( - $context, $cache, $attrGrCollFactory, $config, $resourceName, $moduleName, $connectionName - ); + parent::__construct($context, $resourceName, $cache, $attrGrCollFactory, $config, $moduleName, $connectionName); } /** diff --git a/app/code/Magento/GiftMessage/etc/module.xml b/app/code/Magento/GiftMessage/etc/module.xml index 4118d75e804..e2453e8b042 100644 --- a/app/code/Magento/GiftMessage/etc/module.xml +++ b/app/code/Magento/GiftMessage/etc/module.xml @@ -37,7 +37,7 @@ <module name="Magento_Core"/> <module name="Magento_Customer"/> <module name="Magento_Eav"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml index 8e55cc917a5..b4c479dfc22 100644 --- a/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/GiftMessage/view/adminhtml/layout/sales_order_view.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> <arguments> <argument name="file" xsi:type="string">Magento_Core::prototype/magento.css</argument> </arguments> diff --git a/app/code/Magento/GoogleAdwords/Block/Code.php b/app/code/Magento/GoogleAdwords/Block/Code.php index 93012f87898..93e224389e6 100644 --- a/app/code/Magento/GoogleAdwords/Block/Code.php +++ b/app/code/Magento/GoogleAdwords/Block/Code.php @@ -25,7 +25,7 @@ */ namespace Magento\GoogleAdwords\Block; -class Code extends \Magento\View\Block\Template +class Code extends \Magento\View\Element\Template { /** * @var \Magento\GoogleAdwords\Helper\Data @@ -33,19 +33,17 @@ class Code extends \Magento\View\Block\Template protected $_googleAdwordsData; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\GoogleAdwords\Helper\Data $googleAdwordsData * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\GoogleAdwords\Helper\Data $googleAdwordsData, array $data = array() ) { $this->_googleAdwordsData = $googleAdwordsData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php b/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php index 7a6ad0e8307..56c1021e3ae 100644 --- a/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php +++ b/app/code/Magento/GoogleAdwords/Model/Config/Backend/AbstractConversion.php @@ -49,6 +49,7 @@ abstract class AbstractConversion extends \Magento\Core\Model\Config\Value * @param \Magento\GoogleAdwords\Model\Validator\Factory $validatorFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection + * @param array $data */ public function __construct( \Magento\Core\Model\Context $context, @@ -58,16 +59,10 @@ abstract class AbstractConversion extends \Magento\Core\Model\Config\Value \Magento\Validator\Composite\VarienObjectFactory $validatorCompositeFactory, \Magento\GoogleAdwords\Model\Validator\Factory $validatorFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, - \Magento\Data\Collection\Db $resourceCollection = null + \Magento\Data\Collection\Db $resourceCollection = null, + array $data = array() ) { - parent::__construct( - $context, - $registry, - $storeManager, - $config, - $resource, - $resourceCollection - ); + parent::__construct($context, $registry, $storeManager, $config, $resource, $resourceCollection, $data); $this->_validatorFactory = $validatorFactory; $this->_validatorComposite = $validatorCompositeFactory->create(); diff --git a/app/code/Magento/GoogleAnalytics/Block/Ga.php b/app/code/Magento/GoogleAnalytics/Block/Ga.php index 34d45f11ab1..ddce627f475 100644 --- a/app/code/Magento/GoogleAnalytics/Block/Ga.php +++ b/app/code/Magento/GoogleAnalytics/Block/Ga.php @@ -34,7 +34,7 @@ */ namespace Magento\GoogleAnalytics\Block; -class Ga extends \Magento\View\Block\Template +class Ga extends \Magento\View\Element\Template { /** * Google analytics data @@ -49,22 +49,20 @@ class Ga extends \Magento\View\Block\Template protected $_salesOrderCollection; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Sales\Model\Resource\Order\CollectionFactory $salesOrderCollection * @param \Magento\GoogleAnalytics\Helper\Data $googleAnalyticsData * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Sales\Model\Resource\Order\CollectionFactory $salesOrderCollection, \Magento\GoogleAnalytics\Helper\Data $googleAnalyticsData, array $data = array() ) { $this->_googleAnalyticsData = $googleAnalyticsData; $this->_salesOrderCollection = $salesOrderCollection; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php b/app/code/Magento/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php index 6da2a334f8c..bb89ac76593 100644 --- a/app/code/Magento/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php +++ b/app/code/Magento/GoogleCheckout/Block/Adminhtml/Shipping/Merchant.php @@ -47,26 +47,24 @@ class Merchant */ protected $shippingConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Website\Factory $websiteFactory - * @param \Magento\Core\Model\StoreFactory $storeFactory - * @param \Magento\Shipping\Model\Config $shippingConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Website\Factory $websiteFactory + * @param \Magento\Core\Model\StoreFactory $storeFactory + * @param \Magento\Shipping\Model\Config $shippingConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Website\Factory $websiteFactory, - \Magento\Core\Model\StoreFactory $storeFactory, - \Magento\Shipping\Model\Config $shippingConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Website\Factory $websiteFactory, + \Magento\Core\Model\StoreFactory $storeFactory, + \Magento\Shipping\Model\Config $shippingConfig, + array $data = array() + ) { $this->websiteFactory = $websiteFactory; $this->storeFactory = $storeFactory; $this->shippingConfig = $shippingConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _getElementHtml(\Magento\Data\Form\Element\AbstractElement $element) diff --git a/app/code/Magento/GoogleCheckout/Block/Link.php b/app/code/Magento/GoogleCheckout/Block/Link.php index 72d178489b5..2632bf1c23e 100644 --- a/app/code/Magento/GoogleCheckout/Block/Link.php +++ b/app/code/Magento/GoogleCheckout/Block/Link.php @@ -33,7 +33,7 @@ */ namespace Magento\GoogleCheckout\Block; -class Link extends \Magento\View\Block\Template +class Link extends \Magento\View\Element\Template { /** * @var \Magento\Checkout\Model\Session @@ -46,22 +46,20 @@ class Link extends \Magento\View\Block\Template protected $paymentFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\GoogleCheckout\Model\PaymentFactory $paymentFactory * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\GoogleCheckout\Model\PaymentFactory $paymentFactory, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->paymentFactory = $paymentFactory; $this->checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getImageStyle() diff --git a/app/code/Magento/GoogleCheckout/Block/Redirect.php b/app/code/Magento/GoogleCheckout/Block/Redirect.php index 7b1beee953c..cf42c640e6b 100644 --- a/app/code/Magento/GoogleCheckout/Block/Redirect.php +++ b/app/code/Magento/GoogleCheckout/Block/Redirect.php @@ -18,40 +18,43 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_GoogleCheckout * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\GoogleCheckout\Block; + /** * Redirect to GoogleCheckout - * - * @category Magento - * @package Magento_GoogleCheckout - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\GoogleCheckout\Block; - -class Redirect extends \Magento\Page\Block\Redirect +class Redirect extends \Magento\View\Element\Redirect { /** - * Get target URL + * URL for redirect location * - * @return string + * @return string URL */ - public function getTargetURL () + public function getTargetURL() { return $this->getRedirectUrl(); } - - public function getMethod () + /** + * HTML form method attribute + * + * @return string Method + */ + public function getFormMethod() { return 'GET'; } - public function getMessage () + /** + * Additional custom message + * + * @return string Output message + */ + public function getMessage() { return __('You will be redirected to GoogleCheckout in a few seconds.'); } diff --git a/app/code/Magento/GoogleCheckout/Controller/Redirect.php b/app/code/Magento/GoogleCheckout/Controller/Redirect.php index 20d624793ff..89a54b6f32a 100644 --- a/app/code/Magento/GoogleCheckout/Controller/Redirect.php +++ b/app/code/Magento/GoogleCheckout/Controller/Redirect.php @@ -149,13 +149,14 @@ class Redirect extends \Magento\App\Action\Action public function continueAction() { + /** @var \Magento\Checkout\Model\Session $session */ $session = $this->_objectManager->get('Magento\Checkout\Model\Session'); if ($quoteId = $session->getGoogleCheckoutQuoteId()) { $quote = $this->_objectManager->create('Magento\Sales\Model\Quote')->load($quoteId) ->setIsActive(false)->save(); } - $session->clear(); + $session->clearQuote(); $hideCartContents = $this->_objectManager->get('Magento\Core\Model\Store\Config') ->getConfigFlag('google/checkout/hide_cart_contents'); diff --git a/app/code/Magento/GoogleCheckout/etc/module.xml b/app/code/Magento/GoogleCheckout/etc/module.xml index 3ecf3a3c195..67fa41e43b2 100755 --- a/app/code/Magento/GoogleCheckout/etc/module.xml +++ b/app/code/Magento/GoogleCheckout/etc/module.xml @@ -37,7 +37,6 @@ <module name="Magento_Core"/> <module name="Magento_Checkout"/> <module name="Magento_Customer"/> - <module name="Magento_Page"/> <module name="Magento_Backend"/> <module name="Magento_Shipping"/> <module name="Magento_Adminhtml"/> diff --git a/app/code/Magento/GoogleCheckout/view/frontend/layout/googlecheckout_redirect_redirect.xml b/app/code/Magento/GoogleCheckout/view/frontend/layout/googlecheckout_redirect_redirect.xml index c0089e2ee15..eeeaa1b309a 100644 --- a/app/code/Magento/GoogleCheckout/view/frontend/layout/googlecheckout_redirect_redirect.xml +++ b/app/code/Magento/GoogleCheckout/view/frontend/layout/googlecheckout_redirect_redirect.xml @@ -30,6 +30,6 @@ </action> </referenceBlock> <referenceContainer name="content"> - <block class="Magento\GoogleCheckout\Block\Redirect" name="googlecheckout_redirect" template="Magento_Page::redirect.phtml"/> + <block class="Magento\GoogleCheckout\Block\Redirect" name="googlecheckout_redirect"/> </referenceContainer> </layout> diff --git a/app/code/Magento/GoogleOptimizer/Block/AbstractCode.php b/app/code/Magento/GoogleOptimizer/Block/AbstractCode.php index 693ad5078d0..7d909a8fb5f 100644 --- a/app/code/Magento/GoogleOptimizer/Block/AbstractCode.php +++ b/app/code/Magento/GoogleOptimizer/Block/AbstractCode.php @@ -25,7 +25,7 @@ */ namespace Magento\GoogleOptimizer\Block; -abstract class AbstractCode extends \Magento\View\Block\Template +abstract class AbstractCode extends \Magento\View\Element\Template { /** * @var Entity name in registry @@ -48,16 +48,14 @@ abstract class AbstractCode extends \Magento\View\Block\Template protected $_codeHelper; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\GoogleOptimizer\Helper\Data $helper * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleOptimizer\Helper\Code $codeHelper * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\GoogleOptimizer\Helper\Data $helper, \Magento\Core\Model\Registry $registry, \Magento\GoogleOptimizer\Helper\Code $codeHelper, @@ -66,7 +64,7 @@ abstract class AbstractCode extends \Magento\View\Block\Template $this->_helper = $helper; $this->_registry = $registry; $this->_codeHelper = $codeHelper; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php index c1ba7ddc5fc..79d977382ff 100644 --- a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php +++ b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/AbstractTab.php @@ -48,27 +48,25 @@ abstract class AbstractTab */ protected $_formHelper; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\GoogleOptimizer\Helper\Data $helperData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\GoogleOptimizer\Helper\Code $codeHelper - * @param \Magento\GoogleOptimizer\Helper\Form $formHelper - * @param \Magento\Data\FormFactory $formFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\GoogleOptimizer\Helper\Data $helperData + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\GoogleOptimizer\Helper\Code $codeHelper + * @param \Magento\GoogleOptimizer\Helper\Form $formHelper + * @param \Magento\Data\FormFactory $formFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\GoogleOptimizer\Helper\Data $helperData, - \Magento\Core\Model\Registry $registry, - \Magento\GoogleOptimizer\Helper\Code $codeHelper, - \Magento\GoogleOptimizer\Helper\Form $formHelper, - \Magento\Data\FormFactory $formFactory, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\GoogleOptimizer\Helper\Data $helperData, + \Magento\Core\Model\Registry $registry, + \Magento\GoogleOptimizer\Helper\Code $codeHelper, + \Magento\GoogleOptimizer\Helper\Form $formHelper, + \Magento\Data\FormFactory $formFactory, + array $data = array() + ) { + parent::__construct($context, $data); $this->_helperData = $helperData; $this->_registry = $registry; diff --git a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php index ec00f51d5bd..47e76a6f493 100644 --- a/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php +++ b/app/code/Magento/GoogleOptimizer/Block/Adminhtml/Catalog/Category/Edit/Tab/Googleoptimizer.php @@ -43,25 +43,23 @@ class Googleoptimizer */ protected $_formHelper; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\GoogleOptimizer\Helper\Code $codeHelper - * @param \Magento\GoogleOptimizer\Helper\Form $formHelper - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\GoogleOptimizer\Helper\Code $codeHelper + * @param \Magento\GoogleOptimizer\Helper\Form $formHelper + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\GoogleOptimizer\Helper\Code $codeHelper, - \Magento\GoogleOptimizer\Helper\Form $formHelper, - array $data = array() - ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\GoogleOptimizer\Helper\Code $codeHelper, + \Magento\GoogleOptimizer\Helper\Form $formHelper, + array $data = array() + ) { + parent::__construct($context, $registry, $formFactory, $data); $this->_codeHelper = $codeHelper; $this->_formHelper = $formHelper; diff --git a/app/code/Magento/GoogleOptimizer/Block/Code/Page.php b/app/code/Magento/GoogleOptimizer/Block/Code/Page.php index 1c1f9b34985..346a2962aec 100644 --- a/app/code/Magento/GoogleOptimizer/Block/Code/Page.php +++ b/app/code/Magento/GoogleOptimizer/Block/Code/Page.php @@ -33,8 +33,7 @@ class Page extends \Magento\GoogleOptimizer\Block\AbstractCode protected $_page; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\GoogleOptimizer\Helper\Data $helper * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleOptimizer\Helper\Code $codeHelper @@ -42,8 +41,7 @@ class Page extends \Magento\GoogleOptimizer\Block\AbstractCode * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\GoogleOptimizer\Helper\Data $helper, \Magento\Core\Model\Registry $registry, \Magento\GoogleOptimizer\Helper\Code $codeHelper, @@ -52,7 +50,7 @@ class Page extends \Magento\GoogleOptimizer\Block\AbstractCode ) { // \Magento\Cms\Model\Page is singleton $this->_page = $page; - parent::__construct($context, $coreData, $helper, $registry, $codeHelper, $data); + parent::__construct($context, $helper, $registry, $codeHelper, $data); } /** diff --git a/app/code/Magento/GoogleShopping/Block/Adminhtml/Items.php b/app/code/Magento/GoogleShopping/Block/Adminhtml/Items.php index d522b25b162..899cb38cbb7 100644 --- a/app/code/Magento/GoogleShopping/Block/Adminhtml/Items.php +++ b/app/code/Magento/GoogleShopping/Block/Adminhtml/Items.php @@ -45,20 +45,18 @@ class Items extends \Magento\Adminhtml\Block\Widget\Grid\Container */ protected $_flagFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\GoogleShopping\Model\FlagFactory $flagFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\GoogleShopping\Model\FlagFactory $flagFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\GoogleShopping\Model\FlagFactory $flagFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\GoogleShopping\Model\FlagFactory $flagFactory, + array $data = array() + ) { $this->_flagFactory = $flagFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } diff --git a/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Item.php b/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Item.php index 0bce35e6c9c..697d63b622e 100644 --- a/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Item.php +++ b/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Item.php @@ -42,22 +42,20 @@ class Item extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\GoogleShopping\Model\Resource\Item\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\GoogleShopping\Model\Resource\Item\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\GoogleShopping\Model\Resource\Item\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\GoogleShopping\Model\Resource\Item\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Product.php b/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Product.php index ace0afd8b60..16da65cafc3 100644 --- a/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Product.php +++ b/app/code/Magento/GoogleShopping/Block/Adminhtml/Items/Product.php @@ -63,31 +63,29 @@ class Product extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_itemCollectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\GoogleShopping\Model\Resource\Item\CollectionFactory $itemCollectionFactory - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavCollectionFactory - * @param \Magento\Catalog\Model\Product\Type $productType - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\GoogleShopping\Model\Resource\Item\CollectionFactory $itemCollectionFactory + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavCollectionFactory + * @param \Magento\Catalog\Model\Product\Type $productType + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\GoogleShopping\Model\Resource\Item\CollectionFactory $itemCollectionFactory, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavCollectionFactory, - \Magento\Catalog\Model\Product\Type $productType, - \Magento\Catalog\Model\ProductFactory $productFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\GoogleShopping\Model\Resource\Item\CollectionFactory $itemCollectionFactory, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavCollectionFactory, + \Magento\Catalog\Model\Product\Type $productType, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { $this->_itemCollectionFactory = $itemCollectionFactory; $this->_eavCollectionFactory = $eavCollectionFactory; $this->_productType = $productType; $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit.php b/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit.php index 918564669a5..40a55f0bd98 100644 --- a/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit.php +++ b/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit.php @@ -39,20 +39,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() @@ -78,7 +76,7 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ public function getFormInitScripts() { - return $this->getLayout()->createBlock('Magento\View\Block\Template') + return $this->getLayout()->createBlock('Magento\View\Element\Template') ->setTemplate('Magento_GoogleShopping::types/edit.phtml') ->toHtml(); } diff --git a/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php b/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php index 6af7a6169a2..5b4f748039f 100644 --- a/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php +++ b/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Attributes.php @@ -53,30 +53,36 @@ class Attributes */ protected $_attributeFactory; + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\GoogleShopping\Model\AttributeFactory $attributeFactory * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\GoogleShopping\Model\Config $config, \Magento\GoogleShopping\Model\AttributeFactory $attributeFactory, array $data = array() ) { + $this->_jsonEncoder = $jsonEncoder; $this->_config = $config; $this->_attributeFactory = $attributeFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** * Preparing global layout * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { @@ -159,7 +165,7 @@ class Attributes */ public function getAttributesSelectHtml($escapeJsQuotes = false) { - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setId($this->getFieldId().'_{{index}}_attribute') ->setName($this->getFieldName().'[{{index}}][attribute_id]') ->setOptions($this->_getAttributes($this->getAttributeSetId(), $escapeJsQuotes)); @@ -216,7 +222,7 @@ class Attributes */ public function jsonFormat($data) { - return $this->_coreData->jsonEncode($data); + return $this->_jsonEncoder->encode($data); } /** diff --git a/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php b/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php index faad94c018b..b3293939617 100644 --- a/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php +++ b/app/code/Magento/GoogleShopping/Block/Adminhtml/Types/Edit/Form.php @@ -82,32 +82,30 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_typeCollectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\GoogleShopping\Model\Resource\Type\CollectionFactory $typeCollectionFactory - * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavCollectionFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\GoogleShopping\Model\Config $config - * @param \Magento\Data\Form\Element\Factory $elementFactory - * @param \Magento\GoogleShopping\Helper\Category $googleShoppingCategory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\GoogleShopping\Model\Resource\Type\CollectionFactory $typeCollectionFactory + * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavCollectionFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\GoogleShopping\Model\Config $config + * @param \Magento\Data\Form\Element\Factory $elementFactory + * @param \Magento\GoogleShopping\Helper\Category $googleShoppingCategory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\GoogleShopping\Model\Resource\Type\CollectionFactory $typeCollectionFactory, - \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavCollectionFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\GoogleShopping\Model\Config $config, - \Magento\Data\Form\Element\Factory $elementFactory, - \Magento\GoogleShopping\Helper\Category $googleShoppingCategory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\GoogleShopping\Model\Resource\Type\CollectionFactory $typeCollectionFactory, + \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $eavCollectionFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\GoogleShopping\Model\Config $config, + \Magento\Data\Form\Element\Factory $elementFactory, + \Magento\GoogleShopping\Helper\Category $googleShoppingCategory, + array $data = array() + ) { $this->_typeCollectionFactory = $typeCollectionFactory; $this->_eavCollectionFactory = $eavCollectionFactory; $this->_productFactory = $productFactory; @@ -116,7 +114,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic $this->_googleShoppingCategory = $googleShoppingCategory; $this->_elementFactory = $elementFactory; $this->_formFactory = $formFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/GoogleShopping/Block/SiteVerification.php b/app/code/Magento/GoogleShopping/Block/SiteVerification.php index 6028202a2ef..545bef39856 100644 --- a/app/code/Magento/GoogleShopping/Block/SiteVerification.php +++ b/app/code/Magento/GoogleShopping/Block/SiteVerification.php @@ -23,22 +23,23 @@ */ namespace Magento\GoogleShopping\Block; +use Magento\View\Element\AbstractBlock; /** * Google site verification <meta> tag */ -class SiteVerification extends \Magento\View\Block\AbstractBlock +class SiteVerification extends \Magento\View\Element\AbstractBlock { /** @var \Magento\GoogleShopping\Model\Config */ protected $_config; /** - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\GoogleShopping\Model\Config $config * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\GoogleShopping\Model\Config $config, array $data = array() ) { diff --git a/app/code/Magento/GoogleShopping/Helper/Data.php b/app/code/Magento/GoogleShopping/Helper/Data.php index 8a6e8b84832..66b0e7679fe 100644 --- a/app/code/Magento/GoogleShopping/Helper/Data.php +++ b/app/code/Magento/GoogleShopping/Helper/Data.php @@ -50,14 +50,14 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_storeManager; /** + * @param \Magento\App\Helper\Context $context * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Helper\Context $context */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Stdlib\String $string, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\App\Helper\Context $context + \Magento\Core\Model\StoreManagerInterface $storeManager ) { $this->string = $string; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/GoogleShopping/Model/Attribute.php b/app/code/Magento/GoogleShopping/Model/Attribute.php index 81f1a246f27..925abebb8c3 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute.php @@ -92,23 +92,23 @@ class Attribute extends \Magento\Core\Model\AbstractModel protected $_productFactory; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\GoogleShopping\Helper\Price $gsPrice - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\GoogleShopping\Helper\Price $gsPrice, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\GoogleShopping\Model\Resource\Attribute $resource, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/ContentLanguage.php b/app/code/Magento/GoogleShopping/Model/Attribute/ContentLanguage.php index a81e3225413..3116e3e7bb7 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/ContentLanguage.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/ContentLanguage.php @@ -43,32 +43,41 @@ class ContentLanguage extends \Magento\GoogleShopping\Model\Attribute\DefaultAtt protected $_config; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\GoogleShopping\Helper\Price $gsPrice - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource + * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\GoogleShopping\Model\Config $config, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\GoogleShopping\Helper\Price $gsPrice, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\GoogleShopping\Model\Resource\Attribute $resource, + \Magento\GoogleShopping\Model\Config $config, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->_config = $config; - parent::__construct($productFactory, $gsData, $gsProduct, $gsPrice, $context, $registry, $resource, - $resourceCollection, $data); + parent::__construct( + $context, + $registry, + $productFactory, + $gsData, + $gsProduct, + $gsPrice, + $resource, + $resourceCollection, + $data + ); } /** diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/Destinations.php b/app/code/Magento/GoogleShopping/Model/Attribute/Destinations.php index c090144562c..c2ec5c37de2 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/Destinations.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/Destinations.php @@ -43,32 +43,41 @@ class Destinations extends \Magento\GoogleShopping\Model\Attribute\DefaultAttrib protected $_config; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\GoogleShopping\Helper\Price $gsPrice - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource + * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\GoogleShopping\Model\Config $config, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\GoogleShopping\Helper\Price $gsPrice, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\GoogleShopping\Model\Resource\Attribute $resource, + \Magento\GoogleShopping\Model\Config $config, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->_config = $config; - parent::__construct($productFactory, $gsData, $gsProduct, $gsPrice, $context, $registry, $resource, - $resourceCollection, $data); + parent::__construct( + $context, + $registry, + $productFactory, + $gsData, + $gsProduct, + $gsPrice, + $resource, + $resourceCollection, + $data + ); } /** diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/GoogleProductCategory.php b/app/code/Magento/GoogleShopping/Model/Attribute/GoogleProductCategory.php index 8451f0e3832..cf26a21e0f5 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/GoogleProductCategory.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/GoogleProductCategory.php @@ -50,35 +50,44 @@ class GoogleProductCategory extends \Magento\GoogleShopping\Model\Attribute\Defa protected $_typeFactory; /** - * @param \Magento\GoogleShopping\Model\TypeFactory $typeFactory + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\GoogleShopping\Helper\Price $gsPrice - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource + * @param \Magento\GoogleShopping\Model\TypeFactory $typeFactory + * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\GoogleShopping\Model\TypeFactory $typeFactory, + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\GoogleShopping\Model\Config $config, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\GoogleShopping\Helper\Price $gsPrice, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\GoogleShopping\Model\Resource\Attribute $resource, + \Magento\GoogleShopping\Model\TypeFactory $typeFactory, + \Magento\GoogleShopping\Model\Config $config, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->_typeFactory = $typeFactory; $this->_config = $config; - parent::__construct($productFactory, $gsData, $gsProduct, $gsPrice, $context, $registry, $resource, - $resourceCollection, $data); + parent::__construct( + $context, + $registry, + $productFactory, + $gsData, + $gsProduct, + $gsPrice, + $resource, + $resourceCollection, + $data + ); } /** diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/ImageLink.php b/app/code/Magento/GoogleShopping/Model/Attribute/ImageLink.php index a0f6f5f234e..85c68be9955 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/ImageLink.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/ImageLink.php @@ -41,32 +41,41 @@ class ImageLink extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute protected $_catalogProduct = null; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\GoogleShopping\Helper\Price $gsPrice - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource + * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Helper\Product $catalogProduct, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\GoogleShopping\Helper\Price $gsPrice, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\GoogleShopping\Model\Resource\Attribute $resource, + \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->_catalogProduct = $catalogProduct; - parent::__construct($productFactory, $gsData, $gsProduct, $gsPrice, $context, $registry, $resource, - $resourceCollection, $data); + parent::__construct( + $context, + $registry, + $productFactory, + $gsData, + $gsProduct, + $gsPrice, + $resource, + $resourceCollection, + $data + ); } /** diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/Link.php b/app/code/Magento/GoogleShopping/Model/Attribute/Link.php index 8b0dec22cfd..4118ec4ebeb 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/Link.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/Link.php @@ -43,32 +43,41 @@ class Link extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute protected $_coreStoreConfig; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\GoogleShopping\Helper\Price $gsPrice - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource + * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\GoogleShopping\Helper\Price $gsPrice, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\GoogleShopping\Model\Resource\Attribute $resource, + \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->_coreStoreConfig = $coreStoreConfig; - parent::__construct($productFactory, $gsData, $gsProduct, $gsPrice, $context, $registry, $resource, - $resourceCollection, $data); + parent::__construct( + $context, + $registry, + $productFactory, + $gsData, + $gsProduct, + $gsPrice, + $resource, + $resourceCollection, + $data + ); } /** diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/Price.php b/app/code/Magento/GoogleShopping/Model/Attribute/Price.php index 6471e9bceed..7222545fa3b 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/Price.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/Price.php @@ -62,32 +62,32 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute protected $_storeManager; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\GoogleShopping\Helper\Price $gsPrice - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry + * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\GoogleShopping\Model\Config $config - * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Tax\Helper\Data $taxData, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\GoogleShopping\Helper\Price $gsPrice, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, + \Magento\GoogleShopping\Model\Resource\Attribute $resource, + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\GoogleShopping\Model\Config $config, - \Magento\GoogleShopping\Model\Resource\Attribute $resource, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { @@ -95,8 +95,17 @@ class Price extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute $this->_config = $config; $this->_taxData = $taxData; $this->_coreStoreConfig = $coreStoreConfig; - parent::__construct($productFactory, $gsData, $gsProduct, $gsPrice, $context, $registry, $resource, - $resourceCollection, $data); + parent::__construct( + $context, + $registry, + $productFactory, + $gsData, + $gsProduct, + $gsPrice, + $resource, + $resourceCollection, + $data + ); } /** diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/ProductType.php b/app/code/Magento/GoogleShopping/Model/Attribute/ProductType.php index afec7ea5a35..9e4267df4e9 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/ProductType.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/ProductType.php @@ -43,32 +43,41 @@ class ProductType extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribu protected $_categoryFactory; /** - * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\GoogleShopping\Helper\Price $gsPrice - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource + * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Catalog\Model\CategoryFactory $categoryFactory, + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\GoogleShopping\Helper\Price $gsPrice, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\GoogleShopping\Model\Resource\Attribute $resource, + \Magento\Catalog\Model\CategoryFactory $categoryFactory, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->_categoryFactory = $categoryFactory; - parent::__construct($productFactory, $gsData, $gsProduct, $gsPrice, $context, $registry, $resource, - $resourceCollection, $data); + parent::__construct( + $context, + $registry, + $productFactory, + $gsData, + $gsProduct, + $gsPrice, + $resource, + $resourceCollection, + $data + ); } diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/TargetCountry.php b/app/code/Magento/GoogleShopping/Model/Attribute/TargetCountry.php index f978f4bfa46..ab0a460d68a 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/TargetCountry.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/TargetCountry.php @@ -43,32 +43,41 @@ class TargetCountry extends \Magento\GoogleShopping\Model\Attribute\DefaultAttri protected $_config; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\GoogleShopping\Helper\Price $gsPrice - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource + * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\GoogleShopping\Model\Config $config, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\GoogleShopping\Helper\Price $gsPrice, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\GoogleShopping\Model\Resource\Attribute $resource, + \Magento\GoogleShopping\Model\Config $config, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->_config = $config; - parent::__construct($productFactory, $gsData, $gsProduct, $gsPrice, $context, $registry, $resource, - $resourceCollection, $data); + parent::__construct( + $context, + $registry, + $productFactory, + $gsData, + $gsProduct, + $gsPrice, + $resource, + $resourceCollection, + $data + ); } /** diff --git a/app/code/Magento/GoogleShopping/Model/Attribute/Tax.php b/app/code/Magento/GoogleShopping/Model/Attribute/Tax.php index 2d8e7cd2dfc..fe52a7e102f 100644 --- a/app/code/Magento/GoogleShopping/Model/Attribute/Tax.php +++ b/app/code/Magento/GoogleShopping/Model/Attribute/Tax.php @@ -53,35 +53,44 @@ class Tax extends \Magento\GoogleShopping\Model\Attribute\DefaultAttribute protected $_config; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\GoogleShopping\Model\Config $config - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\GoogleShopping\Helper\Data $gsData * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\GoogleShopping\Helper\Price $gsPrice - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleShopping\Model\Resource\Attribute $resource + * @param \Magento\GoogleShopping\Model\Config $config + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\GoogleShopping\Model\Config $config, - \Magento\Tax\Helper\Data $taxData, \Magento\GoogleShopping\Helper\Data $gsData, \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\GoogleShopping\Helper\Price $gsPrice, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\GoogleShopping\Model\Resource\Attribute $resource, + \Magento\GoogleShopping\Model\Config $config, + \Magento\Tax\Helper\Data $taxData, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->_config = $config; $this->_taxData = $taxData; - parent::__construct($productFactory, $gsData, $gsProduct, $gsPrice, $context, $registry, $resource, - $resourceCollection, $data); + parent::__construct( + $context, + $registry, + $productFactory, + $gsData, + $gsProduct, + $gsPrice, + $resource, + $resourceCollection, + $data + ); } /** diff --git a/app/code/Magento/GoogleShopping/Model/Item.php b/app/code/Magento/GoogleShopping/Model/Item.php index 99366d01fe6..3996b89077c 100644 --- a/app/code/Magento/GoogleShopping/Model/Item.php +++ b/app/code/Magento/GoogleShopping/Model/Item.php @@ -78,24 +78,24 @@ class Item extends \Magento\Core\Model\AbstractModel protected $_productFactory; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleShopping\Model\Service\ItemFactory $itemFactory * @param \Magento\GoogleShopping\Model\TypeFactory $typeFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param \Magento\GoogleShopping\Model\Config $config * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\GoogleShopping\Model\Service\ItemFactory $itemFactory, \Magento\GoogleShopping\Model\TypeFactory $typeFactory, \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\Resource\AbstractResource $resource = null, - \Magento\Data\Collection\Db $resourceCollection = null, + \Magento\Core\Model\Resource\AbstractResource $resource, + \Magento\Data\Collection\Db $resourceCollection, \Magento\GoogleShopping\Model\Config $config, array $data = array() ) { diff --git a/app/code/Magento/GoogleShopping/Model/Resource/Item/Collection.php b/app/code/Magento/GoogleShopping/Model/Resource/Item/Collection.php index f098c361504..8956cc49f88 100644 --- a/app/code/Magento/GoogleShopping/Model/Resource/Item/Collection.php +++ b/app/code/Magento/GoogleShopping/Model/Resource/Item/Collection.php @@ -50,26 +50,28 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_resourceHelper; /** - * @param \Magento\Core\Model\Resource\Helper $resourceHelper - * @param \Magento\Eav\Model\Config $config - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\Resource\Helper $resourceHelper + * @param \Magento\Eav\Model\Config $config + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Core\Model\Resource\Helper $resourceHelper, - \Magento\Eav\Model\Config $config, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\Resource\Helper $resourceHelper, + \Magento\Eav\Model\Config $config, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_resourceHelper = $resourceHelper; $this->_eavConfig = $config; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } protected function _construct() diff --git a/app/code/Magento/GoogleShopping/Model/Resource/Setup.php b/app/code/Magento/GoogleShopping/Model/Resource/Setup.php index 8b9debe25c2..3a55f59dea1 100644 --- a/app/code/Magento/GoogleShopping/Model/Resource/Setup.php +++ b/app/code/Magento/GoogleShopping/Model/Resource/Setup.php @@ -37,17 +37,17 @@ class Setup extends \Magento\Core\Model\Resource\Setup /** * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param string $resourceName * @param \Magento\GoogleShopping\Model\ConfigFactory $configFactory * @param \Magento\GoogleShopping\Helper\Data $googleShoppingData - * @param string $resourceName * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, \Magento\GoogleShopping\Model\ConfigFactory $configFactory, \Magento\GoogleShopping\Helper\Data $googleShoppingData, - $resourceName, $moduleName = 'Magento_GoogleShopping', $connectionName = '' ) { diff --git a/app/code/Magento/GoogleShopping/Model/Type.php b/app/code/Magento/GoogleShopping/Model/Type.php index e15b9fb1e56..0becad82f6d 100644 --- a/app/code/Magento/GoogleShopping/Model/Type.php +++ b/app/code/Magento/GoogleShopping/Model/Type.php @@ -74,25 +74,25 @@ class Type extends \Magento\Core\Model\AbstractModel protected $_collectionFactory; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleShopping\Model\Resource\Attribute\CollectionFactory $collectionFactory * @param \Magento\GoogleShopping\Model\AttributeFactory $attributeFactory * @param \Magento\GoogleShopping\Model\Config $config * @param \Magento\GoogleShopping\Helper\Product $gsProduct * @param \Magento\GoogleShopping\Helper\Data $gsData - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\GoogleShopping\Model\Resource\Type $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\GoogleShopping\Model\Resource\Attribute\CollectionFactory $collectionFactory, \Magento\GoogleShopping\Model\AttributeFactory $attributeFactory, \Magento\GoogleShopping\Model\Config $config, \Magento\GoogleShopping\Helper\Product $gsProduct, \Magento\GoogleShopping\Helper\Data $gsData, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\GoogleShopping\Model\Resource\Type $resource, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/GoogleShopping/etc/module.xml b/app/code/Magento/GoogleShopping/etc/module.xml index e3e84bdf229..4de7eba2176 100755 --- a/app/code/Magento/GoogleShopping/etc/module.xml +++ b/app/code/Magento/GoogleShopping/etc/module.xml @@ -37,7 +37,7 @@ <module name="Magento_Customer"/> <module name="Magento_Eav"/> <module name="Magento_Tax"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_items_index.xml b/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_items_index.xml index 12b40d93998..110104cf98f 100644 --- a/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_items_index.xml +++ b/app/code/Magento/GoogleShopping/view/adminhtml/layout/adminhtml_googleshopping_items_index.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-googleshopping-googleshopping-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-googleshopping-googleshopping-js"> <arguments> <argument name="file" xsi:type="string">Magento_GoogleShopping::googleshopping.js</argument> </arguments> diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php index ee00cf2152c..f771269af4e 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Edit/Form.php @@ -45,27 +45,25 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_formatFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\ImportExport\Model\Source\Export\EntityFactory $entityFactory - * @param \Magento\ImportExport\Model\Source\Export\FormatFactory $formatFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\ImportExport\Model\Source\Export\EntityFactory $entityFactory + * @param \Magento\ImportExport\Model\Source\Export\FormatFactory $formatFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\ImportExport\Model\Source\Export\EntityFactory $entityFactory, - \Magento\ImportExport\Model\Source\Export\FormatFactory $formatFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\ImportExport\Model\Source\Export\EntityFactory $entityFactory, + \Magento\ImportExport\Model\Source\Export\FormatFactory $formatFactory, + array $data = array() + ) { $this->_entityFactory = $entityFactory; $this->_formatFactory = $formatFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php index 73c0251aa90..b301aa9fba8 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Export/Filter.php @@ -49,22 +49,20 @@ class Filter extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_importExportData = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\ImportExport\Helper\Data $importExportData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\ImportExport\Helper\Data $importExportData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\ImportExport\Helper\Data $importExportData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\ImportExport\Helper\Data $importExportData, + array $data = array() + ) { $this->_importExportData = $importExportData; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** @@ -101,9 +99,9 @@ class Filter extends \Magento\Adminhtml\Block\Widget\Grid 'date_format' => $this->_locale->getDateFormat(\Magento\Core\Model\LocaleInterface::FORMAT_TYPE_SHORT), 'image' => $this->getViewFileUrl('images/grid-cal.gif') ); - /** @var $selectBlock \Magento\View\Block\Html\Date */ + /** @var $selectBlock \Magento\View\Element\Html\Date */ $dateBlock = $this->_layout->getBlockFactory()->createBlock( - 'Magento\View\Block\Html\Date', array('data' => $arguments) + 'Magento\View\Element\Html\Date', array('data' => $arguments) ); $fromValue = null; $toValue = null; @@ -163,9 +161,9 @@ class Filter extends \Magento\Adminhtml\Block\Widget\Grid 'class' => 'multiselect multiselect-export-filter', 'extra_params' => 'multiple="multiple" size="' . ($size > 5 ? 5 : ($size < 2 ? 2 : $size)) ); - /** @var $selectBlock \Magento\View\Block\Html\Select */ + /** @var $selectBlock \Magento\View\Element\Html\Select */ $selectBlock = $this->_layout->getBlockFactory()->createBlock( - 'Magento\View\Block\Html\Select', array('data' => $arguments) + 'Magento\View\Element\Html\Select', array('data' => $arguments) ); return $selectBlock->setOptions($options) ->setValue($value) @@ -232,9 +230,9 @@ class Filter extends \Magento\Adminhtml\Block\Widget\Grid 'id' => $this->getFilterElementId($attribute->getAttributeCode()), 'class' => 'select select-export-filter' ); - /** @var $selectBlock \Magento\View\Block\Html\Select */ + /** @var $selectBlock \Magento\View\Element\Html\Select */ $selectBlock = $this->_layout->getBlockFactory()->createBlock( - 'Magento\View\Block\Html\Select', array('data' => $arguments) + 'Magento\View\Element\Html\Select', array('data' => $arguments) ); return $selectBlock->setOptions($options) ->setValue($value) diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Form/After.php b/app/code/Magento/ImportExport/Block/Adminhtml/Form/After.php index bd0c6128600..c95b34130a1 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Form/After.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Form/After.php @@ -36,20 +36,18 @@ class After extends \Magento\Backend\Block\Template */ protected $_registry; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_registry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Before.php b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Before.php index 5eb2f8746a9..94bdc3cab95 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Before.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Before.php @@ -42,20 +42,26 @@ class Before extends \Magento\Backend\Block\Template */ protected $_importModel; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\ImportExport\Model\Import $importModel - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\ImportExport\Model\Import $importModel + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\ImportExport\Model\Import $importModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\ImportExport\Model\Import $importModel, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_importModel = $importModel; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -69,7 +75,7 @@ class Before extends \Magento\Backend\Block\Template foreach ($behaviors as $entityCode => $behavior) { $behaviors[$entityCode] = $behavior['code']; } - return $this->_coreData->jsonEncode($behaviors); + return $this->_jsonEncoder->encode($behaviors); } /** @@ -80,6 +86,6 @@ class Before extends \Magento\Backend\Block\Template public function getUniqueBehaviors() { $uniqueBehaviors = $this->_importModel->getUniqueEntityBehaviors(); - return $this->_coreData->jsonEncode(array_keys($uniqueBehaviors)); + return $this->_jsonEncoder->encode(array_keys($uniqueBehaviors)); } } diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php index a377f019bb2..608d1a81300 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Edit/Form.php @@ -52,29 +52,27 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_behaviorFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\ImportExport\Model\Import $importModel - * @param \Magento\ImportExport\Model\Source\Import\EntityFactory $entityFactory - * @param \Magento\ImportExport\Model\Source\Import\Behavior\Factory $behaviorFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\ImportExport\Model\Import $importModel + * @param \Magento\ImportExport\Model\Source\Import\EntityFactory $entityFactory + * @param \Magento\ImportExport\Model\Source\Import\Behavior\Factory $behaviorFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\ImportExport\Model\Import $importModel, - \Magento\ImportExport\Model\Source\Import\EntityFactory $entityFactory, - \Magento\ImportExport\Model\Source\Import\Behavior\Factory $behaviorFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\ImportExport\Model\Import $importModel, + \Magento\ImportExport\Model\Source\Import\EntityFactory $entityFactory, + \Magento\ImportExport\Model\Source\Import\Behavior\Factory $behaviorFactory, + array $data = array() + ) { $this->_entityFactory = $entityFactory; $this->_behaviorFactory = $behaviorFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); $this->_importModel = $importModel; } diff --git a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Frame/Result.php b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Frame/Result.php index 5152d148228..0ce5d312bb9 100644 --- a/app/code/Magento/ImportExport/Block/Adminhtml/Import/Frame/Result.php +++ b/app/code/Magento/ImportExport/Block/Adminhtml/Import/Frame/Result.php @@ -33,6 +33,8 @@ */ namespace Magento\ImportExport\Block\Adminhtml\Import\Frame; +use Magento\View\Element\Template; + class Result extends \Magento\Backend\Block\Template { /** @@ -61,6 +63,25 @@ class Result extends \Magento\Backend\Block\Template 'notice' => array() ); + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; + parent::__construct($context, $data); + } + /** * Add action for response. * @@ -182,8 +203,8 @@ class Result extends \Magento\Backend\Block\Template */ public function getMessagesHtml() { - /** @var $messagesBlock \Magento\View\Block\Messages */ - $messagesBlock = $this->_layout->createBlock('Magento\View\Block\Messages'); + /** @var $messagesBlock \Magento\View\Element\Messages */ + $messagesBlock = $this->_layout->createBlock('Magento\View\Element\Messages'); foreach ($this->_messages as $priority => $messages) { $method = "add{$priority}"; @@ -206,6 +227,6 @@ class Result extends \Magento\Backend\Block\Template if (!isset($this->_actions['import_validation_messages'])) { $this->addAction('innerHTML', 'import_validation_messages', $this->getMessagesHtml()); } - return $this->_coreData->jsonEncode($this->_actions); + return $this->_jsonEncoder->encode($this->_actions); } } diff --git a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml index a48e1dd20f9..95a4c0dc4d3 100644 --- a/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml +++ b/app/code/Magento/ImportExport/view/adminhtml/layout/adminhtml_import_busy.xml @@ -25,6 +25,6 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> - <block class="Magento\View\Block\Template" template="Magento_ImportExport::busy.phtml" name="busy" as="busy"/> + <block class="Magento\View\Element\Template" template="Magento_ImportExport::busy.phtml" name="busy" as="busy"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Index/Block/Adminhtml/Process/Edit.php b/app/code/Magento/Index/Block/Adminhtml/Process/Edit.php index 6d051b774a0..d6a76b0afed 100644 --- a/app/code/Magento/Index/Block/Adminhtml/Process/Edit.php +++ b/app/code/Magento/Index/Block/Adminhtml/Process/Edit.php @@ -35,20 +35,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Index/Block/Adminhtml/Process/Grid.php b/app/code/Magento/Index/Block/Adminhtml/Process/Grid.php index ed044631d8b..093f93ea5fa 100644 --- a/app/code/Magento/Index/Block/Adminhtml/Process/Grid.php +++ b/app/code/Magento/Index/Block/Adminhtml/Process/Grid.php @@ -54,25 +54,23 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Index\Model\Resource\Process\CollectionFactory $factory - * @param \Magento\Index\Model\Process $indexProcess - * @param \Magento\Index\Model\EventRepository $eventRepository - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Index\Model\Resource\Process\CollectionFactory $factory + * @param \Magento\Index\Model\Process $indexProcess + * @param \Magento\Index\Model\EventRepository $eventRepository + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Index\Model\Resource\Process\CollectionFactory $factory, - \Magento\Index\Model\Process $indexProcess, - \Magento\Index\Model\EventRepository $eventRepository, - array $data = array() - ) { - parent::__construct($context, $coreData, $urlModel, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Index\Model\Resource\Process\CollectionFactory $factory, + \Magento\Index\Model\Process $indexProcess, + \Magento\Index\Model\EventRepository $eventRepository, + array $data = array() + ) { + parent::__construct($context, $urlModel, $data); $this->_eventRepository = $eventRepository; $this->_indexProcess = $indexProcess; $this->_collectionFactory = $factory; diff --git a/app/code/Magento/Index/Model/Event.php b/app/code/Magento/Index/Model/Event.php index 288a95943f7..4bf689eca0e 100644 --- a/app/code/Magento/Index/Model/Event.php +++ b/app/code/Magento/Index/Model/Event.php @@ -82,18 +82,18 @@ class Event extends \Magento\Core\Model\AbstractModel protected $dateTime; /** - * @param \Magento\Index\Model\Indexer $indexer * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Index\Model\Indexer $indexer * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Index\Model\Indexer $indexer, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Index\Model\Indexer $indexer, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Index/Model/Process.php b/app/code/Magento/Index/Model/Process.php index eca1e4506f9..1e558f84919 100644 --- a/app/code/Magento/Index/Model/Process.php +++ b/app/code/Magento/Index/Model/Process.php @@ -117,27 +117,25 @@ class Process extends \Magento\Core\Model\AbstractModel protected $_indexerConfig; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Index\Model\Resource\Event $resourceEvent * @param \Magento\Index\Model\Indexer\Factory $indexerFactory * @param \Magento\Index\Model\Indexer $indexer - * @param \Magento\Core\Model\Context $context * @param \Magento\Index\Model\Indexer\ConfigInterface $indexerConfig - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Index\Model\Lock\Storage $lockStorage * @param \Magento\Index\Model\EventRepository $eventRepository * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Index\Model\Resource\Event $resourceEvent, \Magento\Index\Model\Indexer\Factory $indexerFactory, \Magento\Index\Model\Indexer $indexer, - \Magento\Core\Model\Context $context, \Magento\Index\Model\Indexer\ConfigInterface $indexerConfig, - \Magento\Core\Model\Registry $registry, \Magento\Index\Model\Lock\Storage $lockStorage, \Magento\Index\Model\EventRepository $eventRepository, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Index/Model/Resource/Process.php b/app/code/Magento/Index/Model/Resource/Process.php index de08adb9416..e80ec6c6974 100644 --- a/app/code/Magento/Index/Model/Resource/Process.php +++ b/app/code/Magento/Index/Model/Resource/Process.php @@ -42,10 +42,10 @@ class Process extends \Magento\Core\Model\Resource\Db\AbstractDb protected $dateTime; /** - * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\App\Resource $resource + * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\Stdlib\DateTime $dateTime, \Magento\App\Resource $resource) + public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/Index/Model/Resource/Setup.php b/app/code/Magento/Index/Model/Resource/Setup.php index 326de92a4a8..4328e068e21 100644 --- a/app/code/Magento/Index/Model/Resource/Setup.php +++ b/app/code/Magento/Index/Model/Resource/Setup.php @@ -43,15 +43,15 @@ class Setup extends \Magento\Core\Model\Resource\Setup /** * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param string $resourceName * @param \Magento\Index\Model\Indexer\ConfigInterface $indexerConfig - * @param $resourceName * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, - \Magento\Index\Model\Indexer\ConfigInterface $indexerConfig, $resourceName, + \Magento\Index\Model\Indexer\ConfigInterface $indexerConfig, $moduleName = 'Magento_Index', $connectionName = '' ) { diff --git a/app/code/Magento/Install/Block/AbstractBlock.php b/app/code/Magento/Install/Block/AbstractBlock.php index 665037b57f5..90b5e3912c4 100644 --- a/app/code/Magento/Install/Block/AbstractBlock.php +++ b/app/code/Magento/Install/Block/AbstractBlock.php @@ -31,7 +31,7 @@ */ namespace Magento\Install\Block; -abstract class AbstractBlock extends \Magento\View\Block\Template +abstract class AbstractBlock extends \Magento\View\Element\Template { /** * Installer model @@ -55,22 +55,20 @@ abstract class AbstractBlock extends \Magento\View\Block\Template protected $_session; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Install\Model\Installer $installer * @param \Magento\Install\Model\Wizard $installWizard * @param \Magento\Core\Model\Session\Generic $session * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Install\Model\Installer $installer, \Magento\Install\Model\Wizard $installWizard, \Magento\Core\Model\Session\Generic $session, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_installer = $installer; $this->_installWizard = $installWizard; $this->_session = $session; diff --git a/app/code/Magento/Install/Block/Begin.php b/app/code/Magento/Install/Block/Begin.php index fba6e31329b..c39c0e7b5c2 100644 --- a/app/code/Magento/Install/Block/Begin.php +++ b/app/code/Magento/Install/Block/Begin.php @@ -41,25 +41,24 @@ class Begin extends \Magento\Install\Block\AbstractBlock protected $_eulaFile; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Install\Model\Installer $installer * @param \Magento\Install\Model\Wizard $installWizard * @param \Magento\Core\Model\Session\Generic $session - * @param array $data * @param null $eulaFile + * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Install\Model\Installer $installer, \Magento\Install\Model\Wizard $installWizard, \Magento\Core\Model\Session\Generic $session, - array $data = array(), - $eulaFile = null + $eulaFile = null, + array $data = array() ) { - parent::__construct($context, $coreData, $installer, $installWizard, $session, $data); $this->_eulaFile = $eulaFile; + parent::__construct($context, $installer, $installWizard, $session, $data); + } /** diff --git a/app/code/Magento/Install/Block/Config.php b/app/code/Magento/Install/Block/Config.php index bfdf6e0bc09..91ed1a0b522 100644 --- a/app/code/Magento/Install/Block/Config.php +++ b/app/code/Magento/Install/Block/Config.php @@ -46,8 +46,7 @@ class Config extends \Magento\Install\Block\AbstractBlock protected $_installerConfig = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Install\Model\Installer $installer * @param \Magento\Install\Model\Wizard $installWizard * @param \Magento\Core\Model\Session\Generic $session @@ -55,15 +54,14 @@ class Config extends \Magento\Install\Block\AbstractBlock * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Install\Model\Installer $installer, \Magento\Install\Model\Wizard $installWizard, \Magento\Core\Model\Session\Generic $session, \Magento\Install\Model\Installer\Config $installerConfig, array $data = array() ) { - parent::__construct($context, $coreData, $installer, $installWizard, $session, $data); + parent::__construct($context, $installer, $installWizard, $session, $data); $this->_installerConfig = $installerConfig; } @@ -129,7 +127,7 @@ class Config extends \Magento\Install\Block\AbstractBlock */ public function getSessionSaveSelect() { - $html = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $html = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName('config[session_save]') ->setId('session_save') ->setTitle(__('Save Session Files In')) diff --git a/app/code/Magento/Install/Block/Db/Main.php b/app/code/Magento/Install/Block/Db/Main.php index b5d539b612c..2c968e68dc0 100644 --- a/app/code/Magento/Install/Block/Db/Main.php +++ b/app/code/Magento/Install/Block/Db/Main.php @@ -29,7 +29,7 @@ */ namespace Magento\Install\Block\Db; -class Main extends \Magento\View\Block\Template +class Main extends \Magento\View\Element\Template { /** * Array of Database blocks keyed by name @@ -53,20 +53,18 @@ class Main extends \Magento\View\Block\Template protected $_session; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Install\Model\Installer\Config $installerConfig * @param \Magento\Core\Model\Session\Generic $session * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Install\Model\Installer\Config $installerConfig, \Magento\Core\Model\Session\Generic $session, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_installerConfig = $installerConfig; $this->_session = $session; } @@ -94,7 +92,7 @@ class Main extends \Magento\View\Block\Template * Retrieve database block by type * * @param string $type database model type - * @return bool|\Magento\View\Block\Template + * @return bool|\Magento\View\Element\Template */ public function getDatabaseBlock($type) { diff --git a/app/code/Magento/Install/Block/Db/Type.php b/app/code/Magento/Install/Block/Db/Type.php index da98e41996c..87f308d762a 100644 --- a/app/code/Magento/Install/Block/Db/Type.php +++ b/app/code/Magento/Install/Block/Db/Type.php @@ -31,7 +31,7 @@ */ namespace Magento\Install\Block\Db; -class Type extends \Magento\View\Block\Template +class Type extends \Magento\View\Element\Template { /** * Db title @@ -55,20 +55,18 @@ class Type extends \Magento\View\Block\Template protected $_session; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Install\Model\Installer\Config $installerConfig * @param \Magento\Core\Model\Session\Generic $session * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Install\Model\Installer\Config $installerConfig, \Magento\Core\Model\Session\Generic $session, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_installerConfig = $installerConfig; $this->_session = $session; } diff --git a/app/code/Magento/Install/Block/Download.php b/app/code/Magento/Install/Block/Download.php index 2538c54aecd..1f7f2d43bb4 100644 --- a/app/code/Magento/Install/Block/Download.php +++ b/app/code/Magento/Install/Block/Download.php @@ -44,8 +44,7 @@ class Download extends \Magento\Install\Block\AbstractBlock protected $_moduleReader; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Install\Model\Installer $installer * @param \Magento\Install\Model\Wizard $installWizard * @param \Magento\Core\Model\Session\Generic $session @@ -53,15 +52,14 @@ class Download extends \Magento\Install\Block\AbstractBlock * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Install\Model\Installer $installer, \Magento\Install\Model\Wizard $installWizard, \Magento\Core\Model\Session\Generic $session, \Magento\Module\Dir\Reader $moduleReader, array $data = array() ) { - parent::__construct($context, $coreData, $installer, $installWizard, $session, $data); + parent::__construct($context, $installer, $installWizard, $session, $data); $this->_moduleReader = $moduleReader; } diff --git a/app/code/Magento/Install/Block/End.php b/app/code/Magento/Install/Block/End.php index 1b40bb5aaa2..47ad1c45f4f 100644 --- a/app/code/Magento/Install/Block/End.php +++ b/app/code/Magento/Install/Block/End.php @@ -56,8 +56,7 @@ class End extends \Magento\Install\Block\AbstractBlock protected $_cryptKey; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Install\Model\Installer $installer * @param \Magento\Install\Model\Wizard $installWizard * @param \Magento\Core\Model\Session\Generic $session @@ -67,8 +66,7 @@ class End extends \Magento\Install\Block\AbstractBlock * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Install\Model\Installer $installer, \Magento\Install\Model\Wizard $installWizard, \Magento\Core\Model\Session\Generic $session, @@ -78,7 +76,7 @@ class End extends \Magento\Install\Block\AbstractBlock array $data = array() ) { $this->_cryptKey = $cryptKey; - parent::__construct($context, $coreData, $installer, $installWizard, $session, $data); + parent::__construct($context, $installer, $installWizard, $session, $data); $this->_coreConfig = $coreConfig; $this->_survey = $survey; } diff --git a/app/code/Magento/Install/Block/Locale.php b/app/code/Magento/Install/Block/Locale.php index 4ccad27be71..1d2d5c08f9b 100644 --- a/app/code/Magento/Install/Block/Locale.php +++ b/app/code/Magento/Install/Block/Locale.php @@ -80,7 +80,7 @@ class Locale extends \Magento\Install\Block\AbstractBlock */ public function getLocaleSelect() { - $html = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $html = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName('config[locale]') ->setId('locale') ->setTitle(__('Locale')) @@ -98,7 +98,7 @@ class Locale extends \Magento\Install\Block\AbstractBlock */ public function getTimezoneSelect() { - $html = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $html = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName('config[timezone]') ->setId('timezone') ->setTitle(__('Time Zone')) @@ -132,7 +132,7 @@ class Locale extends \Magento\Install\Block\AbstractBlock */ public function getCurrencySelect() { - $html = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $html = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName('config[currency]') ->setId('currency') ->setTitle(__('Default Currency')) diff --git a/app/code/Magento/Install/Block/State.php b/app/code/Magento/Install/Block/State.php index eb11b30b60e..ac12aa72ea6 100644 --- a/app/code/Magento/Install/Block/State.php +++ b/app/code/Magento/Install/Block/State.php @@ -24,16 +24,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Install\Block; + /** * Install state block - * - * @category Magento - * @package Magento_Install - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Install\Block; - -class State extends \Magento\View\Block\Template +class State extends \Magento\View\Element\Template { /** * @var string @@ -41,38 +37,18 @@ class State extends \Magento\View\Block\Template protected $_template = 'state.phtml'; /** - * Install Wizard - * - * @var \Magento\Install\Model\Wizard - */ - protected $_wizard; - - /** - * Core Cookie - * - * @var \Magento\Core\Model\Cookie - */ - protected $_cookie; - - /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Install\Model\Wizard $wizard - * @param \Magento\Core\Model\Cookie $cookie * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Install\Model\Wizard $wizard, - \Magento\Core\Model\Cookie $cookie, array $data = array() ) { - parent::__construct($context, $coreData, $data); - $this->_wizard = $wizard; - $this->_cookie = $cookie; + parent::__construct($context, $data); - $this->assign('steps', $this->_wizard->getSteps()); + $this->assign('steps', $wizard->getSteps()); } /** @@ -101,7 +77,7 @@ class State extends \Magento\View\Block\Template */ public function isDownloaderInstall() { - $session = $this->_cookie->get('magento_downloader_session'); + $session = $this->_request->getCookie('magento_downloader_session', false); return $session ? true : false; } } diff --git a/app/code/Magento/Install/Controller/Wizard.php b/app/code/Magento/Install/Controller/Wizard.php index 9fff9f4b7d5..f89be92cd83 100644 --- a/app/code/Magento/Install/Controller/Wizard.php +++ b/app/code/Magento/Install/Controller/Wizard.php @@ -511,6 +511,6 @@ class Wizard extends \Magento\Install\Controller\Action $this->_view->getLayout()->addBlock('Magento\Install\Block\End', 'install.end', 'content'); $this->_view->renderLayout(); - $this->_session->clear(); + $this->_session->clearStorage(); } } diff --git a/app/code/Magento/Install/etc/module.xml b/app/code/Magento/Install/etc/module.xml index 7c6fc8ec61c..103276bde5e 100755 --- a/app/code/Magento/Install/etc/module.xml +++ b/app/code/Magento/Install/etc/module.xml @@ -35,7 +35,6 @@ <module name="Magento_Directory"/> <module name="Magento_User"/> <module name="Magento_Backend"/> - <module name="Magento_Page" type="soft"/> </depends> </module> </config> diff --git a/app/code/Magento/Install/view/install/begin.phtml b/app/code/Magento/Install/view/install/begin.phtml index 27e3e586376..65e721a7d3e 100644 --- a/app/code/Magento/Install/view/install/begin.phtml +++ b/app/code/Magento/Install/view/install/begin.phtml @@ -33,8 +33,8 @@ <div class="page-head"> <h3><?php echo __("Welcome to Magento's Installation Wizard") ?>!</h3> </div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> -<?php if (count($this->getMessagesBlock()->getMessages()) == 0): ?> +<?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> +<?php if (count($this->getLayout()->getMessagesBlock()->getMessages()) == 0): ?> <form action="<?php echo $this->getPostUrl() ?>" method="post"> <div style="height:20em; border:1px solid #ccc; margin-bottom:8px; padding:5px; background:#fff; overflow: auto; overflow-x:hidden; overflow-y:scroll;"> diff --git a/app/code/Magento/Install/view/install/config.phtml b/app/code/Magento/Install/view/install/config.phtml index 09aae1b06e3..b6ce06b8677 100644 --- a/app/code/Magento/Install/view/install/config.phtml +++ b/app/code/Magento/Install/view/install/config.phtml @@ -34,7 +34,7 @@ <div class="page-head"> <h3><?php echo __('Configuration') ?></h3> </div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> <?php if ($this->getInstaller()->getServerCheckStatus()): ?> <form action="<?php echo $this->getPostUrl() ?>" method="post" id="form-validate"> diff --git a/app/code/Magento/Install/view/install/create_admin.phtml b/app/code/Magento/Install/view/install/create_admin.phtml index 2d2105de578..a017abb3409 100644 --- a/app/code/Magento/Install/view/install/create_admin.phtml +++ b/app/code/Magento/Install/view/install/create_admin.phtml @@ -33,7 +33,7 @@ <div class="page-head"> <h3><?php echo __('Create Admin Account') ?></h3> </div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> <form action="<?php echo $this->getPostUrl() ?>" method="post" id="form-validate"> <fieldset class="group-select wide"> <legend><?php echo __('Personal Information') ?></legend> diff --git a/app/code/Magento/Install/view/install/download.phtml b/app/code/Magento/Install/view/install/download.phtml index d73a1ab8930..a8568e0c9cc 100644 --- a/app/code/Magento/Install/view/install/download.phtml +++ b/app/code/Magento/Install/view/install/download.phtml @@ -65,7 +65,7 @@ function installFailure() <div class="page-head"> <h3><?php echo __('Download Magento Core Modules and Updates') ?></h3> </div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> <form action="<?php echo $this->getPostUrl() ?>" method="post" id="form-validate"> <input type="hidden" id="continue" name="continue" value="svn" /> diff --git a/app/code/Magento/Install/view/install/layout/install_wizard.xml b/app/code/Magento/Install/view/install/layout/install_wizard.xml index c955a0c2904..41aea4538a2 100644 --- a/app/code/Magento/Install/view/install/layout/install_wizard.xml +++ b/app/code/Magento/Install/view/install/layout/install_wizard.xml @@ -24,7 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\View\Block\Template" name="root" output="1"> + <block class="Magento\View\Element\Template" name="root" output="1"> <action method="setTemplate"> <argument name="template" xsi:type="string">Magento_Install::page.phtml</argument> </action> diff --git a/app/code/Magento/Install/view/install/locale.phtml b/app/code/Magento/Install/view/install/locale.phtml index 720b3f7ef11..8fd99776850 100644 --- a/app/code/Magento/Install/view/install/locale.phtml +++ b/app/code/Magento/Install/view/install/locale.phtml @@ -33,7 +33,7 @@ <div class="page-head"> <h3><?php echo __('Localization') ?></h3> </div> -<?php echo $this->getMessagesBlock()->getGroupedHtml() ?> +<?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> <form action="<?php echo $this->getPostUrl() ?>" method="get" id="form-validate"> <fieldset class="group-select"> diff --git a/app/code/Magento/Install/view/install/page.phtml b/app/code/Magento/Install/view/install/page.phtml index fffeb7ee9ba..03df1042d75 100644 --- a/app/code/Magento/Install/view/install/page.phtml +++ b/app/code/Magento/Install/view/install/page.phtml @@ -26,7 +26,7 @@ ?> <?php /** - * Template for \Magento\Page\Block\Html + * Template for \Magento\Theme\Block\Html */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> @@ -35,8 +35,8 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title><?php echo __('Magento Installation Wizard') ?></title> - <link rel="icon" href="<?php echo $this->getViewFileUrl('Magento_Page::favicon.ico') ?>" type="image/x-icon"/> - <link rel="shortcut icon" href="<?php echo $this->getViewFileUrl('Magento_Page::favicon.ico') ?>" type="image/x-icon"/> + <link rel="icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico') ?>" type="image/x-icon"/> + <link rel="shortcut icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico') ?>" type="image/x-icon"/> <script type="text/javascript" src="<?php echo $this->getViewFileUrl('jquery/jquery.js') ?>"></script> <script type="text/javascript" src="<?php echo $this->getViewFileUrl('jquery/jquery-ui.js') ?>"></script> diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Activate/Permissions/Tabs.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Activate/Permissions/Tabs.php new file mode 100644 index 00000000000..a4b1a47c2cc --- /dev/null +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Activate/Permissions/Tabs.php @@ -0,0 +1,39 @@ +<?php +/** + * API permissions tab for integration activation dialog. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Integration\Block\Adminhtml\Integration\Activate\Permissions; + +use Magento\Backend\Block\Widget\Tabs as TabsWidget; + +class Tabs extends TabsWidget +{ + protected $_template = 'Magento_Adminhtml::widget/tabshoriz.phtml'; + + protected function _construct() + { + parent::_construct(); + $this->setDestElementId('integrations-activate-permissions-content'); + } +} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php index 59f577305da..a074c1c8922 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit.php @@ -36,20 +36,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_registry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_registry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -61,6 +59,8 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container $this->_controller = 'adminhtml_integration'; $this->_blockGroup = 'Magento_Integration'; parent::_construct(); + $this->_removeButton('reset'); + $this->_removeButton('delete'); } /** diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php index 36a404873d3..1eccbee1b67 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tab/Info.php @@ -33,14 +33,10 @@ use \Magento\Integration\Controller\Adminhtml\Integration; * * @category Magento * @package Magento_Integration - * @SuppressWarnings(PHPMD.DepthOfInheritance) */ class Info extends \Magento\Backend\Block\Widget\Form\Generic implements \Magento\Backend\Block\Widget\Tab\TabInterface { - /** @var \Magento\Integration\Model\Integration\Source\Authentication */ - protected $_authTypeSource; - /**#@+ * edit_form element names. */ @@ -48,30 +44,10 @@ class Info extends \Magento\Backend\Block\Widget\Form\Generic const DATA_ID = 'integration_id'; const DATA_NAME = 'name'; const DATA_EMAIL = 'email'; - const DATA_AUTHENTICATION = 'authentication'; const DATA_ENDPOINT = 'endpoint'; + const DATA_SETUP_TYPE = 'setup_type'; /**#@-*/ - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Integration\Model\Integration\Source\Authentication $authTypeSource - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Integration\Model\Integration\Source\Authentication $authTypeSource, - array $data = array() - ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); - $this->_authTypeSource = $authTypeSource; - } - /** * Set form id prefix, declare fields for integration info * @@ -83,7 +59,7 @@ class Info extends \Magento\Backend\Block\Widget\Form\Generic $form = $this->_formFactory->create(); $form->setHtmlIdPrefix(self::HTML_ID_PREFIX); $integrationData = $this->_coreRegistry->registry(Integration::REGISTRY_KEY_CURRENT_INTEGRATION); - $fieldset = $form->addFieldset('base_fieldset', array('legend' => __('Integration'))); + $fieldset = $form->addFieldset('base_fieldset', array('legend' => __('General'))); if (isset($integrationData[self::DATA_ID])) { $fieldset->addField(self::DATA_ID, 'hidden', array('name' => 'id')); } @@ -91,7 +67,7 @@ class Info extends \Magento\Backend\Block\Widget\Form\Generic self::DATA_NAME, 'text', array( - 'label' => __('Integration Name'), + 'label' => __('Name'), 'name' => self::DATA_NAME, 'required' => true, 'disabled' => false, @@ -104,27 +80,23 @@ class Info extends \Magento\Backend\Block\Widget\Form\Generic array( 'label' => __('Email'), 'name' => self::DATA_EMAIL, - 'required' => true, 'disabled' => false, 'class' => 'validate-email', - 'maxlength' => '254', + 'maxlength' => '254' ) ); $fieldset->addField( - self::DATA_AUTHENTICATION, - 'select', + self::DATA_ENDPOINT, + 'text', array( - 'label' => __('Authentication'), - 'name' => self::DATA_AUTHENTICATION, + 'label' => __('Callback URL'), + 'name' => self::DATA_ENDPOINT, 'disabled' => false, - 'options' => $this->_authTypeSource->toOptionArray() + // @codingStandardsIgnoreStart + 'note'=> __('When using Oauth for token exchange, enter URL where Oauth credentials can be POST-ed. We strongly recommend you to use https://') + // @codingStandardsIgnoreEnd ) ); - $fieldset->addField( - self::DATA_ENDPOINT, - 'text', - array('label' => __('Endpoint URL'), 'name' => self::DATA_ENDPOINT, 'required' => true, 'disabled' => false) - ); $form->setValues($integrationData); $this->setForm($form); return $this; @@ -169,25 +141,4 @@ class Info extends \Magento\Backend\Block\Widget\Form\Generic { return false; } - - /** - * Get additional script for tabs block - * - * @return string - */ - protected function _toHtml() - { - $oauth = \Magento\Integration\Model\Integration::AUTHENTICATION_OAUTH; - $authFieldIdSelector = '#' . self::HTML_ID_PREFIX . self::DATA_AUTHENTICATION; - $endpointIdSelector = '#' . self::HTML_ID_PREFIX . self::DATA_ENDPOINT; - $endpointClassSel = '.field-' . self::DATA_ENDPOINT; - $script = <<<HTML - jQuery(function(){ - jQuery('$authFieldIdSelector') - .mage('integration', {"authType": $oauth, "formSelector": '#edit_form', - endpointIdSelector: '$endpointIdSelector', endpointContainerClassSelector: '$endpointClassSel'}); - }); -HTML; - return parent::_toHtml() . sprintf('<script type="text/javascript">%s</script>', $script); - } } diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tabs.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tabs.php index 2b5e77ee31e..4baf8ae6b08 100644 --- a/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tabs.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Edit/Tabs.php @@ -37,6 +37,6 @@ class Tabs extends \Magento\Adminhtml\Block\Widget\Tabs parent::_construct(); $this->setId('integration_edit_tabs'); $this->setDestElementId('edit_form'); - $this->setTitle(__('Integration Information')); + $this->setTitle(__('Basic Settings')); } } diff --git a/app/code/Magento/Integration/Model/Integration/Source/Authentication.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Grid.php similarity index 66% rename from app/code/Magento/Integration/Model/Integration/Source/Authentication.php rename to app/code/Magento/Integration/Block/Adminhtml/Integration/Grid.php index 9deeac5ae61..c106a6ac216 100644 --- a/app/code/Magento/Integration/Model/Integration/Source/Authentication.php +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Grid.php @@ -1,5 +1,7 @@ <?php /** + * Integration grid. + * * Magento * * NOTICE OF LICENSE @@ -21,23 +23,29 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Integration\Model\Integration\Source; +namespace Magento\Integration\Block\Adminhtml\Integration; -/** - * Integration authentication options. - */ -class Authentication implements \Magento\Core\Model\Option\ArrayInterface +use Magento\Backend\Block\Widget\Grid as BackendGrid; + +class Grid extends BackendGrid { /** - * Retrieve authentication options array. + * Disable javascript callback on row clicking. + * + * @return string + */ + public function getRowClickCallback() + { + return ''; + } + + /** + * Disable javascript callback on row init. * - * @return array + * @return string */ - public function toOptionArray() + public function getRowInitCallback() { - return array( - \Magento\Integration\Model\Integration::AUTHENTICATION_OAUTH => __('OAuth'), - \Magento\Integration\Model\Integration::AUTHENTICATION_MANUAL => __('Manual'), - ); + return ''; } } diff --git a/app/code/Magento/Integration/Block/Adminhtml/Integration/Token.php b/app/code/Magento/Integration/Block/Adminhtml/Integration/Token.php new file mode 100644 index 00000000000..e64c122d423 --- /dev/null +++ b/app/code/Magento/Integration/Block/Adminhtml/Integration/Token.php @@ -0,0 +1,82 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Block\Adminhtml\Integration; + +/** + * Main Integration properties edit form + * + * @SuppressWarnings(PHPMD.DepthOfInheritance) + */ +class Token extends \Magento\Backend\Block\Widget\Form\Generic +{ + /** + * Set form id prefix, declare fields for integration consumer modal + * + * @return \Magento\Integration\Block\Adminhtml\Integration\Token + */ + protected function _prepareForm() + { + /** @var \Magento\Data\Form $form */ + $form = $this->_formFactory->create(); + $htmlIdPrefix = 'integration_token_'; + $form->setHtmlIdPrefix($htmlIdPrefix); + + $fieldset = $form->addFieldset('base_fieldset', array( + 'legend' => __('Integration Tokens for Extensions'), + 'class' => 'fieldset-wide' + )); + + $fieldset->addField('token', 'text', array( + 'label' => __('Token'), + 'name' => 'token', + 'readonly' => true + )); + + $fieldset->addField('token-secret', 'text', array( + 'label' => __('Token Secret'), + 'name' => 'token-secret', + 'readonly' => true + )); + + $fieldset->addField('client-id', 'text', array( + 'label' => __('Client ID'), + 'name' => 'client-id', + 'readonly' => true + )); + + $fieldset->addField('client-secret', 'text', array( + 'label' => __('Client Secret'), + 'name' => 'client-secret', + 'readonly' => true + )); + + // TODO: retrieve token associated to this integration to populate the form + // $form->setValues($model->getData()); + + $this->setForm($form); + + return parent::_prepareForm(); + } +} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php new file mode 100644 index 00000000000..011613dc07c --- /dev/null +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button.php @@ -0,0 +1,122 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer; + +use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer; +use \Magento\Object; + +/** + * Render HTML <button> tag. + * + * @package Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer + */ +class Button extends AbstractRenderer +{ + /** + * {@inheritDoc} + */ + public function render(Object $row) + { + /** @var array $attributes */ + $attributes = $this->_prepareAttributes($row); + return sprintf('<button %s>%s</button>', $this->_getAttributesStr($attributes), $this->_getValue($row)); + } + + /** + * Whether current item is disabled. + * + * @param \Magento\Object $row + * @return bool + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + protected function _isDisabled(Object $row) + { + return false; + } + + /** + * @param \Magento\Object $row + * @return string + */ + protected function _getDisabledAttribute(Object $row) + { + return $this->_isDisabled($row) ? 'disabled' : ''; + } + + /** + * Prepare attribute list. Values for attributes gathered from two sources: + * - If getter method exists in the class - it is taken from there (getter method for "title" + * attribute will be "_getTitleAttribute", for "onmouseup" - "_getOnmouseupAttribute" and so on.) + * - Then it tries to get it from the button's column layout description. + * If received attribute value is empty - attribute is not added to final HTML. + * + * @param \Magento\Object $row + * @return array + */ + protected function _prepareAttributes(Object $row) + { + $attributes = []; + foreach ($this->_getValidAttributes() as $attributeName) { + $methodName = sprintf('_get%sAttribute', ucfirst($attributeName)); + $rowMethodName = sprintf('get%s', ucfirst($attributeName)); + $attributeValue = method_exists($this, $methodName) + ? $this->$methodName($row) + : $this->getColumn()->$rowMethodName(); + + if ($attributeValue) { + $attributes[] = sprintf('%s="%s"', $attributeName, $this->escapeHtml($attributeValue)); + } + } + return $attributes; + } + + /** + * Get list of available HTML attributes for this element. + * + * @return array + */ + protected function _getValidAttributes() + { + return [ + // HTML global attributes + 'accesskey', 'class', 'id', 'lang', 'style', 'tabindex', 'title', + // HTML mouse event attributes + 'onclick', 'ondblclick', 'onmousedown', 'onmousemove', 'onmouseout', 'onmouseover', 'onmouseup', + // Element attributes + 'disabled', 'name', 'type', 'value', + ]; + } + + /** + * Get list of attributes rendered as a string (ready to be inserted into tag). + * + * @param array $attributes Array of attributes + * @return string + */ + protected function _getAttributesStr($attributes) + { + return join(' ', $attributes); + } +} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Delete.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Delete.php new file mode 100644 index 00000000000..a9364800f3e --- /dev/null +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Delete.php @@ -0,0 +1,54 @@ +<?php +/** + * Render HTML <button> tag with "edit" action for the integration grid. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Button; + +use Magento\Object; + +class Delete extends IntegrationAbstract +{ + /** + * Return 'onclick' action for the button (redirect to the integration edit page). + * + * @param \Magento\Object $row + * @return string + */ + protected function _getOnclickAttribute(Object $row) + { + return sprintf("window.location.href='%s'", $this->getUrl('*/*/delete', ['id' => $row->getId()])); + } + + /** + * Get title depending on whether element is disabled or not. + * + * @param \Magento\Object $row + * @return string + */ + protected function _getTitleAttribute(Object $row) + { + return $this->_isDisabled($row) ? __('Uninstall the extension to remove this integration') : __('Remove'); + } +} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Edit.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Edit.php new file mode 100644 index 00000000000..3c1d6e4a575 --- /dev/null +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/Edit.php @@ -0,0 +1,54 @@ +<?php +/** + * Render HTML <button> tag with "edit" action for the integration grid. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Button; + +use Magento\Object; + +class Edit extends IntegrationAbstract +{ + /** + * Return 'onclick' action for the button (redirect to the integration edit page). + * + * @param \Magento\Object $row + * @return string + */ + protected function _getOnclickAttribute(Object $row) + { + return sprintf("window.location.href='%s'", $this->getUrl('*/*/edit', ['id' => $row->getId()])); + } + + /** + * Get title depending on whether element is disabled or not. + * + * @param \Magento\Object $row + * @return string + */ + protected function _getTitleAttribute(Object $row) + { + return $this->_isDisabled($row) ? '' : __('Edit'); + } +} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/IntegrationAbstract.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/IntegrationAbstract.php new file mode 100644 index 00000000000..76db7a82352 --- /dev/null +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Button/IntegrationAbstract.php @@ -0,0 +1,46 @@ +<?php +/** + * Functions that shared both by Edit and Delete buttons. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Button; + +use Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Button; +use Magento\Integration\Model\Integration; +use Magento\Object; + +abstract class IntegrationAbstract extends Button +{ + /** + * Determine whether current integration came from config file, thus can not be removed or edited. + * + * @param \Magento\Object $row + * @return bool + */ + protected function _isDisabled(Object $row) + { + return ($row->hasData(Integration::SETUP_TYPE) + && $row->getData(Integration::SETUP_TYPE) == Integration::TYPE_CONFIG); + } +} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php new file mode 100644 index 00000000000..d675789d15c --- /dev/null +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link.php @@ -0,0 +1,164 @@ +<?php +/** + * Renders HTML anchor or nothing depending on isVisible(). + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer; + +use Magento\Backend\Block\Widget\Grid\Column\Renderer\AbstractRenderer; +use Magento\Customer\Block\Account\AuthorizationLink; +use Magento\Object; + +class Link extends AbstractRenderer +{ + /** @var \Magento\Object */ + protected $_row; + + /** + * Render grid row + * + * @param \Magento\Object $row + * @return string + */ + public function render(Object $row) + { + $this->_row = $row; + + if (!$this->isVisible()) { + return ''; + } + + $html = sprintf( + '<a href="%s" %s>%s</a>', + $this->_getUrl($row), + $this->_getAttributesHtml(), + $this->getCaption() + ); + + return $html; + } + + /** + * Decide whether anything should be rendered. + * + * @return bool + */ + public function isVisible() + { + return true; + } + + /** + * Decide whether action associated with the link is not available. + * + * @return bool + */ + public function isDisabled() + { + return false; + } + + /** + * Return URL pattern for action associated with the link e.g. "(star)(slash)(star)(slash)activate" -> + * will be translated to http://.../admin/integration/activate/id/X + * + * @return string + */ + public function getUrlPattern() + { + return $this->getColumn()->getUrlPattern(); + } + + /** + * Caption for the link. + * + * @return string + */ + public function getCaption() + { + return $this->isDisabled() + ? $this->getColumn()->getDisabledCaption() ?: $this->getColumn()->getCaption() + : $this->getColumn()->getCaption(); + } + + /** + * Return additional HTML parameters for tag, e.g. 'style' + * + * @return string + */ + protected function _getAttributesHtml() + { + $html = []; + + foreach ($this->_getAttributes() as $key => $value) { + if ($value === null || $value == '') { + continue; + } + $html[] = sprintf('%s="%s"', $key, $this->escapeHtml($value)); + } + + return join(' ', $html); + } + + /** + * Return additional HTML attributes for the tag. + * + * @return array + */ + protected function _getAttributes() + { + /** @var \Magento\Core\Helper\Data $helper */ + $helper = $this->helper('Magento\Core\Helper\Data'); + $attributes = ['title' => $this->getCaption()]; + + foreach ($this->_getDataAttributes() as $key => $attr) { + $attributes['data-' . $key] = is_scalar($attr) ? $attr : $helper->jsonEncode($attr); + } + + return $attributes; + } + + /** + * Return HTML data attributes, which treated in special manner: + * - prepended by "data-" + * - JSON-encoded if necessary + * + * @return array + */ + protected function _getDataAttributes() + { + return []; + } + + /** + * Render URL for current item. + * + * @param \Magento\Object $row + * @return string + */ + protected function _getUrl(Object $row) + { + return $this->isDisabled($row) ? '#' : $this->getUrl($this->getUrlPattern(), ['id' => $row->getId()]); + } +} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link/Activate.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link/Activate.php new file mode 100644 index 00000000000..c96b7e74f4b --- /dev/null +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link/Activate.php @@ -0,0 +1,78 @@ +<?php +/** + * Renders "Activate" link. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Link; + +use Magento\Integration\Model\Integration; +use Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Link; +use Magento\Object; + +class Activate extends Link +{ + /** + * {@inheritDoc} + */ + public function getUrlPattern() + { + return ($this->_row->getStatus() == Integration::STATUS_INACTIVE) ? '*/*/activate' : '*/*/deactivate'; + } + + /** + * {@inheritDoc} + */ + public function getCaption() + { + return ($this->_row->getStatus() == Integration::STATUS_INACTIVE) ? __('Activate') : __('Deactivate'); + } + + /** + * {@inheritDoc} + * @SuppressWarnings(PHPMD.UnusedFormalParameter) + */ + protected function _getUrl(Object $row) + { + return 'javascript:void(0);'; + } + + /** + * {@inheritDoc} + */ + protected function _getAttributes() + { + return array_merge(parent::_getAttributes(), ['onclick' => 'integration.popup.show(this);']); + } + + /** + * {@inheritDoc} + */ + protected function _getDataAttributes() + { + return [ + 'row-id' => $this->_row->getId(), + 'row-dialog' => $this->_row->getStatus() === Integration::STATUS_ACTIVE ? 'deactivate' : 'permissions' + ]; + } +} diff --git a/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link/Reauthorize.php b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link/Reauthorize.php new file mode 100644 index 00000000000..74bd75e6ee6 --- /dev/null +++ b/app/code/Magento/Integration/Block/Adminhtml/Widget/Grid/Column/Renderer/Link/Reauthorize.php @@ -0,0 +1,41 @@ +<?php +/** + * Renders "Re-Authorize" link. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Link; + +use Magento\Integration\Model\Integration; +use Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Link; + +class Reauthorize extends Link +{ + /** + * {@inheritDoc} + */ + public function isVisible() + { + return $this->_row->getStatus() == Integration::STATUS_ACTIVE; + } +} diff --git a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php index 5534a570ba0..f5e1693d972 100644 --- a/app/code/Magento/Integration/Controller/Adminhtml/Integration.php +++ b/app/code/Magento/Integration/Controller/Adminhtml/Integration.php @@ -21,14 +21,18 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Integration\Controller\Adminhtml; use Magento\Backend\App\Action; use Magento\Integration\Block\Adminhtml\Integration\Edit\Tab\Info; +use Magento\Integration\Model\Integration as IntegrationKeyConstants; +use Magento\Integration\Exception as IntegrationException; + /** * Controller for integrations management. */ -class Integration extends \Magento\Backend\App\Action +class Integration extends Action { /** Param Key for extracting integration id from Request */ const PARAM_INTEGRATION_ID = 'id'; @@ -36,6 +40,16 @@ class Integration extends \Magento\Backend\App\Action /** Keys used for registering data into the registry */ const REGISTRY_KEY_CURRENT_INTEGRATION = 'current_integration'; + /** Request parameter which define the dialog window requested */ + const PARAM_DIALOG_ID = 'popup_dialog'; + + /**#@+ + * Allowed values for PARAM_DIALOG_ID request parameter + */ + const DIALOG_PERMISSIONS = 'permissions'; + const DIALOG_TOKENS = 'tokens'; + /**#@-*/ + /** * Core registry * @@ -43,6 +57,9 @@ class Integration extends \Magento\Backend\App\Action */ protected $_registry = null; + /** @var \Magento\Logger */ + protected $_logger; + /** @var \Magento\Integration\Service\IntegrationV1Interface */ private $_integrationService; @@ -50,13 +67,16 @@ class Integration extends \Magento\Backend\App\Action * @param \Magento\Backend\App\Action\Context $context * @param \Magento\Integration\Service\IntegrationV1Interface $integrationService * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Logger $logger */ public function __construct( \Magento\Backend\App\Action\Context $context, \Magento\Integration\Service\IntegrationV1Interface $integrationService, - \Magento\Core\Model\Registry $registry + \Magento\Core\Model\Registry $registry, + \Magento\Logger $logger ) { $this->_registry = $registry; + $this->_logger = $logger; $this->_integrationService = $integrationService; parent::__construct($context); } @@ -118,15 +138,22 @@ class Integration extends \Magento\Backend\App\Action /** Try to recover integration data from session if it was added during previous request which failed. */ $integrationId = (int)$this->getRequest()->getParam(self::PARAM_INTEGRATION_ID); if ($integrationId) { - $integrationData = $this->_integrationService->get($integrationId); + try { + $integrationData = $this->_integrationService->get($integrationId); + } catch (IntegrationException $e) { + $this->_getSession()->addError($e->getMessage()); + $this->_redirect('*/*/'); + return; + } $restoredIntegration = $this->_getSession()->getIntegrationData(); - if (isset($restoredIntegration[Info::DATA_ID]) - && $integrationId == $restoredIntegration[Info::DATA_ID] - ) { + if (isset($restoredIntegration[Info::DATA_ID]) && $integrationId == $restoredIntegration[Info::DATA_ID]) { $integrationData = array_merge($integrationData, $restoredIntegration); } - if (!$integrationData[Info::DATA_ID]) { - $this->_getSession()->addError(__('This integration no longer exists.')); + + if (isset($integrationData[Info::DATA_SETUP_TYPE]) + && $integrationData[Info::DATA_SETUP_TYPE] == IntegrationKeyConstants::TYPE_CONFIG + ) { + //Cannot edit Integrations created from Config. No error necessary just redirect to grid $this->_redirect('*/*/'); return; } @@ -152,10 +179,10 @@ class Integration extends \Magento\Backend\App\Action */ public function saveAction() { + /** @var array $integrationData */ + $integrationData = array(); try { $integrationId = (int)$this->getRequest()->getParam(self::PARAM_INTEGRATION_ID); - /** @var array $integrationData */ - $integrationData = array(); if ($integrationId) { $integrationData = $this->_integrationService->get($integrationId); if (!$integrationData[Info::DATA_ID]) { @@ -166,16 +193,22 @@ class Integration extends \Magento\Backend\App\Action } /** @var array $data */ $data = $this->getRequest()->getPost(); - //Merge Post-ed data - $integrationData = array_merge($integrationData, $data); - $this->_registry->register(self::REGISTRY_KEY_CURRENT_INTEGRATION, $integrationData); - if (!isset($integrationData[Info::DATA_ID])) { - $this->_integrationService->create($integrationData); + if (!empty($data)) { + if (!isset($data['resource'])) { + $integrationData['resource'] = array(); + } + $integrationData = array_merge($integrationData, $data); + $this->_registry->register(self::REGISTRY_KEY_CURRENT_INTEGRATION, $integrationData); + if (!isset($integrationData[Info::DATA_ID])) { + $this->_integrationService->create($integrationData); + } else { + $this->_integrationService->update($integrationData); + } + $this->_getSession() + ->addSuccess(__('The integration \'%1\' has been saved.', $integrationData[Info::DATA_NAME])); } else { - $this->_integrationService->update($integrationData); + $this->_getSession()->addError(__('The integration was not saved.')); } - $this->_getSession()->addSuccess(__('The integration \'%1\' has been saved.', - $integrationData[Info::DATA_NAME])); $this->_redirect('*/*/'); } catch (\Magento\Integration\Exception $e) { $this->_getSession()->addError($e->getMessage())->setIntegrationData($integrationData); @@ -184,12 +217,66 @@ class Integration extends \Magento\Backend\App\Action $this->_getSession()->addError($e->getMessage()); $this->_redirectOnSaveError(); } catch (\Exception $e) { - $this->_objectManager->get('Magento\Core\Model\Logger')->logException($e); + $this->_logger->logException($e); $this->_getSession()->addError($e->getMessage()); $this->_redirectOnSaveError(); } } + /** + * Activates the integration. Also contains intermediate steps (permissions confirmation and tokens). + */ + public function activateAction() + { + $integrationId = (int)$this->getRequest()->getParam(self::PARAM_INTEGRATION_ID); + + if ($integrationId) { + $integrationData = $this->_integrationService->get($integrationId); + if (!$integrationData[Info::DATA_ID]) { + $this->_getSession()->addError(__('This integration no longer exists.')); + $this->_redirect('*/*/'); + return; + } + $this->_registry->register(self::REGISTRY_KEY_CURRENT_INTEGRATION, $integrationData); + } else { + $this->_getSession()->addError(__('Integration ID is not specified or is invalid.')); + $this->_redirect('*/*/'); + return; + } + + $dialogName = $this->getRequest()->getParam(self::PARAM_DIALOG_ID); + + if (in_array($dialogName, [self::DIALOG_PERMISSIONS, self::DIALOG_TOKENS])) { + $this->_view->loadLayout($this->_getPopupHandleNames($dialogName)); + } else { + $this->_view->loadLayout(); + } + + $this->_view->renderLayout(); + } + + /** + * @param string $dialogName + * @return array + */ + protected function _getPopupHandleNames($dialogName) + { + $handles = [sprintf('%s_%s_popup', $this->_view->getDefaultLayoutHandle(), $dialogName)]; + + if ($dialogName === self::DIALOG_PERMISSIONS) { + $handleNodes = $this->_view->getLayout()->getUpdate()->getFileLayoutUpdatesXml() + ->xpath('//referenceBlock[@name="integration.activate.permissions.tabs"]/../@id'); + + if (is_array($handleNodes)) { + foreach ($handleNodes as $node) { + $handles[] = (string)$node; + } + } + } + + return $handles; + } + /** * Redirect merchant to 'Edit integration' or 'New integration' if error happened during integration save. */ diff --git a/app/code/Magento/Integration/Helper/Data.php b/app/code/Magento/Integration/Helper/Data.php index 88b0684b8e0..7becc725d7d 100644 --- a/app/code/Magento/Integration/Helper/Data.php +++ b/app/code/Magento/Integration/Helper/Data.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Integration * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -28,5 +26,26 @@ namespace Magento\Integration\Helper; class Data extends \Magento\App\Helper\AbstractHelper { - + /** + * Make ACL resource array compatible with jQuery jsTree component. + * + * @param array $resources + * @return array + */ + public function mapResources(array $resources) + { + $output = array(); + foreach ($resources as $resource) { + $item = array(); + $item['attr']['data-id'] = $resource['id']; + $item['data'] = $resource['title']; + $item['children'] = array(); + if (isset($resource['children'])) { + $item['state'] = 'open'; + $item['children'] = $this->mapResources($resource['children']); + } + $output[] = $item; + } + return $output; + } } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/PageTest.php b/app/code/Magento/Integration/Model/Cache/Type.php similarity index 60% rename from dev/tests/unit/testsuite/Magento/Core/Model/PageTest.php rename to app/code/Magento/Integration/Model/Cache/Type.php index 19d0c78adfc..823a7fe5ff0 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/PageTest.php +++ b/app/code/Magento/Integration/Model/Cache/Type.php @@ -20,39 +20,32 @@ * * @category Magento * @package Magento_Core - * @subpackage unit_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model; +/** + * System / Cache Management / Cache type "Integration Configuration" + */ +namespace Magento\Integration\Model\Cache; -class PageTest extends \PHPUnit_Framework_TestCase +class Type extends \Magento\Cache\Frontend\Decorator\TagScope { /** - * @var \Magento\Core\Model\Page + * Cache type code unique among all cache types */ - protected $_object; + const TYPE_IDENTIFIER = 'config_integration'; /** - * @var + * Cache tag used to distinguish the cache type from all other cache */ - protected $_pageAssets; - - protected function setUp() - { - $this->_pageAssets = new \Magento\Core\Model\Page\Asset\Collection; - $this->_object = new \Magento\Core\Model\Page($this->_pageAssets); - } + const CACHE_TAG = 'INTEGRATION'; - protected function tearDown() - { - $this->_pageAssets = null; - $this->_object = null; - } - - public function testGetAssets() + /** + * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool + */ + public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) { - $this->assertSame($this->_pageAssets, $this->_object->getAssets()); + parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); } } diff --git a/app/code/Magento/Integration/Model/Config.php b/app/code/Magento/Integration/Model/Config.php new file mode 100644 index 00000000000..2b24fcd43d0 --- /dev/null +++ b/app/code/Magento/Integration/Model/Config.php @@ -0,0 +1,85 @@ +<?php + +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Model; + +use Magento\Integration\Model\Cache\Type; +/** + * Integration Config Model. + * + * This is a parent class for storing information about Integrations. + */ +class Config +{ + const CACHE_ID = 'integration'; + + /** + * @var \Magento\App\Cache\Type\Config + */ + protected $_configCacheType; + + /** + * @var \Magento\Integration\Model\Config\Reader + */ + protected $_configReader; + + /** + * Array of integrations + * + * @var array + */ + protected $_integrations; + + /** + * @param Cache\Type $configCacheType + * @param Config\Reader $configReader + */ + public function __construct( + Cache\Type $configCacheType, + Config\Reader $configReader + ) { + $this->_configCacheType = $configCacheType; + $this->_configReader = $configReader; + } + + /** + * Return integrations loaded from cache if enabled or from files merged previously + * + * @return array + */ + public function getIntegrations() + { + if (null === $this->_integrations) { + $integrations = $this->_configCacheType->load(self::CACHE_ID); + if ($integrations && is_string($integrations)) { + $this->_integrations = unserialize($integrations); + } else { + $this->_integrations = $this->_configReader->read(); + $this->_configCacheType->save(serialize($this->_integrations), self::CACHE_ID, array(Type::CACHE_TAG)); + } + } + return $this->_integrations; + } +} diff --git a/app/code/Magento/Integration/Model/Config/Converter.php b/app/code/Magento/Integration/Model/Config/Converter.php index f7674e037d0..df21a836308 100644 --- a/app/code/Magento/Integration/Model/Config/Converter.php +++ b/app/code/Magento/Integration/Model/Config/Converter.php @@ -31,10 +31,7 @@ class Converter implements \Magento\Config\ConverterInterface /**#@+ * Array keys for config internal representation. */ - const KEY_NAME = 'name'; const KEY_EMAIL = 'email'; - const KEY_AUTHENTICATION = 'authentication'; - const KEY_AUTHENTICATION_TYPE = 'type'; const KEY_AUTHENTICATION_ENDPOINT_URL = 'endpoint_url'; /**#@-*/ @@ -51,30 +48,17 @@ class Converter implements \Magento\Config\ConverterInterface if ($integration->nodeType != XML_ELEMENT_NODE) { continue; } - $integrationId = $integration->attributes->getNamedItem('id')->nodeValue; - $result[$integrationId] = array(); - - /** @var \DOMElement $name */ - $name = $integration->getElementsByTagName('name')->item(0)->nodeValue; - $result[$integrationId][self::KEY_NAME] = $name; + $integrationName = $integration->attributes->getNamedItem('name')->nodeValue; + $result[$integrationName] = array(); /** @var \DOMElement $email */ $email = $integration->getElementsByTagName('email')->item(0)->nodeValue; - $result[$integrationId][self::KEY_EMAIL] = $email; - - /** @var \DOMNodeList $authentication */ - $authentication = $integration->getElementsByTagName('authentication')->item(0); - - $authenticationType = $authentication->attributes->getNamedItem('type')->nodeValue; - $result[$integrationId][self::KEY_AUTHENTICATION] = array( - self::KEY_AUTHENTICATION_TYPE => $authenticationType - ); + $result[$integrationName][self::KEY_EMAIL] = $email; - /** @var \DOMElement $endpointUrl */ - $endpointUrl = $integration->getElementsByTagName('endpoint_url')->item(0); - if ($endpointUrl) { - $result[$integrationId][self::KEY_AUTHENTICATION][self::KEY_AUTHENTICATION_ENDPOINT_URL] = - $endpointUrl->nodeValue; + if ($integration->getElementsByTagName('endpoint_url')->length) { + /** @var \DOMElement $endpointUrl */ + $endpointUrl = $integration->getElementsByTagName('endpoint_url')->item(0)->nodeValue; + $result[$integrationName][self::KEY_AUTHENTICATION_ENDPOINT_URL] = $endpointUrl; } } return $result; diff --git a/app/code/Magento/Integration/Model/Config/Reader.php b/app/code/Magento/Integration/Model/Config/Reader.php index ed33b48afe1..4fd412169b7 100644 --- a/app/code/Magento/Integration/Model/Config/Reader.php +++ b/app/code/Magento/Integration/Model/Config/Reader.php @@ -34,8 +34,7 @@ class Reader extends \Magento\Config\Reader\Filesystem * @var array */ protected $_idAttributes = array( - '/config/service' => 'class', - '/config/service/rest-route' => 'method', + '/integrations/integration' => 'name' ); /** diff --git a/app/code/Magento/Integration/Model/Integration.php b/app/code/Magento/Integration/Model/Integration.php index bd4eb4424a5..1822d2e11ef 100644 --- a/app/code/Magento/Integration/Model/Integration.php +++ b/app/code/Magento/Integration/Model/Integration.php @@ -33,8 +33,8 @@ namespace Magento\Integration\Model; * @method Integration setEmail(\string $email) * @method \int getStatus() * @method Integration setStatus(\int $value) - * @method \int getAuthentication() - * @method Integration setAuthentication(\int $value) + * @method \int getType() + * @method Integration setType(\int $value) * @method \string getEndpoint() * @method Integration setEndpoint(\string $endpoint) * @method \string getCreatedAt() @@ -45,17 +45,27 @@ namespace Magento\Integration\Model; class Integration extends \Magento\Core\Model\AbstractModel { /**#@+ - * Integration statuses. + * Integration Status values */ const STATUS_INACTIVE = 0; const STATUS_ACTIVE = 1; /**#@-*/ /**#@+ - * Authentication mechanism + * Integration setup type */ - const AUTHENTICATION_OAUTH = 1; - const AUTHENTICATION_MANUAL = 2; + const TYPE_MANUAL = 0; + const TYPE_CONFIG = 1; + /**#@-*/ + + /**#@+ + * Integration data key constants. + */ + const ID = 'integration_id'; + const NAME = 'name'; + const EMAIL = 'email'; + const ENDPOINT = 'endpoint'; + const SETUP_TYPE = 'setup_type'; /**#@-*/ /** @@ -66,9 +76,9 @@ class Integration extends \Magento\Core\Model\AbstractModel /** * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Customer\Model\Resource\Customer $resource * @param \Magento\Stdlib\DateTime $dateTime - * @param \Magento\Data\Collection\Db|null $resourceCollection + * @param \Magento\Core\Model\Resource\AbstractResource $resource + * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( @@ -97,7 +107,7 @@ class Integration extends \Magento\Core\Model\AbstractModel /** * Prepare data to be saved to database * - * @return Integration + * @return \Magento\Integration\Model\Integration */ protected function _beforeSave() { diff --git a/app/code/Magento/Integration/Model/Manager.php b/app/code/Magento/Integration/Model/Manager.php new file mode 100644 index 00000000000..b19c32335d4 --- /dev/null +++ b/app/code/Magento/Integration/Model/Manager.php @@ -0,0 +1,100 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Integration\Model; + +use Magento\Integration\Model\Integration; +use Magento\Integration\Model\Config\Converter; + +/** + * Class to manage integrations installed from config file + * + * @package Magento\Integration\Model + */ +class Manager +{ + /** + * Integration service + * + * @var \Magento\Integration\Service\IntegrationV1Interface + */ + protected $_integrationService; + + /** + * Integration config + * + * @var Config + */ + protected $_integrationConfig; + + /** + * @param Config $integrationConfig + * @param \Magento\Integration\Service\IntegrationV1Interface $integrationService + */ + public function __construct( + Config $integrationConfig, + \Magento\Integration\Service\IntegrationV1Interface $integrationService + ) { + $this->_integrationService = $integrationService; + $this->_integrationConfig = $integrationConfig; + } + + /** + * Process integrations from config files for the given array of integration names + * + * @param array $integrationNames + * @return array + */ + public function processIntegrationConfig(array $integrationNames) + { + if (empty($integrationNames)) { + return array(); + } + /** @var array $integrations */ + $integrations = $this->_integrationConfig->getIntegrations(); + foreach ($integrationNames as $name) { + $integrationDetails = $integrations[$name]; + $integrationData = array(Integration::NAME => $name); + if (isset($integrationDetails[Converter::KEY_EMAIL])) { + $integrationData[Integration::EMAIL] = $integrationDetails[Converter::KEY_EMAIL]; + } + if (isset($integrationDetails[Converter::KEY_AUTHENTICATION_ENDPOINT_URL])) { + $integrationData[Integration::ENDPOINT] = + $integrationDetails[Converter::KEY_AUTHENTICATION_ENDPOINT_URL]; + } + $integrationData[Integration::SETUP_TYPE] = Integration::TYPE_CONFIG; + // If it already exists, update it + $data = $this->_integrationService->findByName($name); + if (isset($data[Integration::ID])) { + //If Integration already exists, update it. + //For now we will just overwrite the integration with same name but we will need a long term solution + $integrationData[Integration::ID] = $data[Integration::ID]; + $this->_integrationService->update($integrationData); + } else { + $this->_integrationService->create($integrationData); + } + + } + return $integrationNames; + } +} \ No newline at end of file diff --git a/app/code/Magento/Integration/Model/Oauth/Consumer.php b/app/code/Magento/Integration/Model/Oauth/Consumer.php index 262479304b4..e534d7214fb 100644 --- a/app/code/Magento/Integration/Model/Oauth/Consumer.php +++ b/app/code/Magento/Integration/Model/Oauth/Consumer.php @@ -58,19 +58,19 @@ class Consumer extends \Magento\Core\Model\AbstractModel implements ConsumerInte protected $_keyLengthFactory; /** - * @param \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory - * @param \Magento\Url\Validator $urlValidator * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory + * @param \Magento\Url\Validator $urlValidator * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory, - \Magento\Url\Validator $urlValidator, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory, + \Magento\Url\Validator $urlValidator, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Integration/Model/Oauth/Nonce.php b/app/code/Magento/Integration/Model/Oauth/Nonce.php index 15fcf0d959b..69d84f25309 100644 --- a/app/code/Magento/Integration/Model/Oauth/Nonce.php +++ b/app/code/Magento/Integration/Model/Oauth/Nonce.php @@ -46,17 +46,17 @@ class Nonce extends \Magento\Core\Model\AbstractModel protected $_oauthData; /** - * @param \Magento\Integration\Helper\Oauth\Data $oauthData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Integration\Helper\Oauth\Data $oauthData * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Integration\Helper\Oauth\Data $oauthData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Integration\Helper\Oauth\Data $oauthData, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Integration/Model/Oauth/Token.php b/app/code/Magento/Integration/Model/Oauth/Token.php index d5cbe354c01..f5bf1f69515 100644 --- a/app/code/Magento/Integration/Model/Oauth/Token.php +++ b/app/code/Magento/Integration/Model/Oauth/Token.php @@ -90,28 +90,29 @@ class Token extends \Magento\Core\Model\AbstractModel protected $_dateTime; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory * @param \Magento\Url\Validator $urlValidator * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory * @param \Magento\Integration\Helper\Oauth\Data $oauthData * @param \Magento\Oauth\Helper\Oauth $oauthHelper - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Integration\Model\Oauth\Consumer\Validator\KeyLengthFactory $keyLengthFactory, \Magento\Url\Validator $urlValidator, \Magento\Stdlib\DateTime $dateTime, \Magento\Integration\Model\Oauth\Consumer\Factory $consumerFactory, \Magento\Integration\Helper\Oauth\Data $oauthData, \Magento\Oauth\Helper\Oauth $oauthHelper, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Integration/Model/Resource/Integration.php b/app/code/Magento/Integration/Model/Resource/Integration.php index 9f6671a1b72..9fd2fe80c7b 100644 --- a/app/code/Magento/Integration/Model/Resource/Integration.php +++ b/app/code/Magento/Integration/Model/Resource/Integration.php @@ -21,14 +21,11 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Integration\Model\Resource; /** * Integration resource model - * - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Integration\Model\Resource; - class Integration extends \Magento\Core\Model\Resource\Db\AbstractDb { /** diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php index 21a4937a9d4..57dfef333ea 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Consumer.php @@ -32,10 +32,10 @@ class Consumer extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_dateTime; /** - * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\App\Resource $resource + * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\Stdlib\DateTime $dateTime, \Magento\App\Resource $resource) + public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->_dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php index 9495ab1e796..9463ae100b8 100644 --- a/app/code/Magento/Integration/Model/Resource/Oauth/Token.php +++ b/app/code/Magento/Integration/Model/Resource/Oauth/Token.php @@ -38,10 +38,10 @@ class Token extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_dateTime; /** - * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\App\Resource $resource + * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\Stdlib\DateTime $dateTime, \Magento\App\Resource $resource) + public function __construct(\Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime) { $this->_dateTime = $dateTime; parent::__construct($resource); diff --git a/app/code/Magento/Integration/Model/Resource/Setup.php b/app/code/Magento/Integration/Model/Resource/Setup.php new file mode 100644 index 00000000000..c7f5591334d --- /dev/null +++ b/app/code/Magento/Integration/Model/Resource/Setup.php @@ -0,0 +1,69 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Integration\Model\Resource; + +/** + * Resource Setup Model + */ +class Setup extends \Magento\Core\Model\Resource\Setup +{ + /** + * @var \Magento\Integration\Model\Manager + */ + protected $_integrationManager; + + /** + * Construct resource Setup Model + * + * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param \Magento\Integration\Model\Manager $integrationManager + * @param string $resourceName + * @param $moduleName + * @param string $connectionName + * + */ + public function __construct( + \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, + \Magento\Integration\Model\Manager $integrationManager, + $moduleName = 'Magento_Integration', + $connectionName = '' + ) { + $this->_integrationManager = $integrationManager; + parent::__construct($context, $resourceName, $moduleName, $connectionName); + } + + /** + * Initiate integration processing + * + * @param array $integrationNames + * @return array of integration names sent to the next invocation + */ + public function initIntegrationProcessing(array $integrationNames) + { + $this->_integrationManager->processIntegrationConfig($integrationNames); + return $integrationNames; + } +} diff --git a/app/code/Magento/Integration/Service/IntegrationV1.php b/app/code/Magento/Integration/Service/IntegrationV1.php index 3f57375bb72..49d3f16b533 100644 --- a/app/code/Magento/Integration/Service/IntegrationV1.php +++ b/app/code/Magento/Integration/Service/IntegrationV1.php @@ -23,45 +23,59 @@ */ namespace Magento\Integration\Service; +use Magento\Authz\Model\UserIdentifier; +use Magento\Authz\Service\AuthorizationV1Interface as AuthorizationInterface; +use Magento\Integration\Model\Integration\Factory as IntegrationFactory; +use Magento\Authz\Model\UserIdentifier\Factory as UserIdentifierFactory; +use Magento\Integration\Model\Integration as IntegrationModel; + /** * Integration Service. + * * This service is used to interact with integrations. */ class IntegrationV1 implements \Magento\Integration\Service\IntegrationV1Interface { - /** @var \Magento\Integration\Model\Integration\Factory $_integrationFactory */ - private $_integrationFactory; + /** @var IntegrationFactory */ + protected $_integrationFactory; + + /** @var AuthorizationInterface */ + protected $_authzService; + + /** @var UserIdentifierFactory */ + protected $_userIdentifierFactory; /** - * @param \Magento\Integration\Model\Integration\Factory $integrationFactory + * Construct and initialize Integration Factory + * + * @param IntegrationFactory $integrationFactory + * @param AuthorizationInterface $authzService + * @param UserIdentifierFactory $userIdentifierFactory */ - public function __construct(\Magento\Integration\Model\Integration\Factory $integrationFactory) - { + public function __construct( + IntegrationFactory $integrationFactory, + AuthorizationInterface $authzService, + UserIdentifierFactory $userIdentifierFactory + ) { $this->_integrationFactory = $integrationFactory; + $this->_authzService = $authzService; + $this->_userIdentifierFactory = $userIdentifierFactory; } /** - * Create a new Integration - * - * @param array $integrationData - * @return array Integration data - * @throws \Magento\Integration\Exception + * {@inheritdoc} */ public function create(array $integrationData) { $this->_checkIntegrationByName($integrationData['name']); $integration = $this->_integrationFactory->create($integrationData); - $this->_validateIntegration($integration); $integration->save(); + $this->_saveApiPermissions($integration); return $integration->getData(); } /** - * Update an Integration. - * - * @param array $integrationData - * @return array Integration data - * @throws \Magento\Integration\Exception + * {@inheritdoc} */ public function update(array $integrationData) { @@ -71,39 +85,34 @@ class IntegrationV1 implements \Magento\Integration\Service\IntegrationV1Interfa $this->_checkIntegrationByName($integrationData['name']); } $integration->addData($integrationData); - $this->_validateIntegration($integration); $integration->save(); + $this->_saveApiPermissions($integration); return $integration->getData(); } /** - * Get the details of a specific Integration. - * - * @param int $integrationId - * @return array Integration data - * @throws \Magento\Integration\Exception + * {@inheritdoc} */ public function get($integrationId) { $integration = $this->_loadIntegrationById($integrationId); + $this->_addAllowedResources($integration); return $integration->getData(); } /** - * Validate an integration - * - * @param \Magento\Integration\Model\Integration $integration - * @throws \Magento\Integration\Exception + * {@inheritdoc} */ - private function _validateIntegration(\Magento\Integration\Model\Integration $integration) + public function findByName($name) { - if ($integration->getAuthentication() == \Magento\Integration\Model\Integration::AUTHENTICATION_OAUTH - && !$integration->getEndpoint() - ) { - throw new \Magento\Integration\Exception(__('Please enter endpoint for oAuth.')); + if (!isset($name) || trim($name) === '') { + return null; } + $integration = $this->_integrationFactory->create()->load($name, 'name'); + return $integration->getData(); } + /** * Check if an integration exists by the name * @@ -122,7 +131,7 @@ class IntegrationV1 implements \Magento\Integration\Service\IntegrationV1Interfa * Load integration by id. * * @param int $integrationId - * @return \Magento\Integration\Model\Integration + * @return IntegrationModel * @throws \Magento\Integration\Exception */ protected function _loadIntegrationById($integrationId) @@ -133,4 +142,54 @@ class IntegrationV1 implements \Magento\Integration\Service\IntegrationV1Interfa } return $integration; } + + /** + * Persist API permissions. + * + * Permissions are expected to be set to integration object by 'resource' key. + * If 'all_resources' is set and is evaluated to true, permissions to all resources will be granted. + * + * @param IntegrationModel $integration + */ + protected function _saveApiPermissions(IntegrationModel $integration) + { + if ($integration->getId()) { + $userIdentifier = $this->_createUserIdentifier($integration->getId()); + if ($integration->getData('all_resources')) { + $this->_authzService->grantAllPermissions($userIdentifier); + } else if (is_array($integration->getData('resource'))) { + $this->_authzService->grantPermissions($userIdentifier, $integration->getData('resource')); + } else { + $this->_authzService->grantPermissions($userIdentifier, array()); + } + } + } + + /** + * Add the list of allowed resources to the integration object data by 'resource' key. + * + * @param IntegrationModel $integration + */ + protected function _addAllowedResources(IntegrationModel $integration) + { + if ($integration->getId()) { + $userIdentifier = $this->_createUserIdentifier($integration->getId()); + $integration->setData('resource', $this->_authzService->getAllowedResources($userIdentifier)); + } + } + + /** + * Instantiate new user identifier for an integration. + * + * @param int $integrationId + * @return UserIdentifier + */ + protected function _createUserIdentifier($integrationId) + { + $userIdentifier = $this->_userIdentifierFactory->create( + UserIdentifier::USER_TYPE_INTEGRATION, + (int)$integrationId + ); + return $userIdentifier; + } } diff --git a/app/code/Magento/Integration/Service/IntegrationV1Interface.php b/app/code/Magento/Integration/Service/IntegrationV1Interface.php index ecc31daa214..75a8b4e6bd5 100644 --- a/app/code/Magento/Integration/Service/IntegrationV1Interface.php +++ b/app/code/Magento/Integration/Service/IntegrationV1Interface.php @@ -47,6 +47,15 @@ interface IntegrationV1Interface */ public function get($integrationId); + /** + * Find Integration by name. + * + * @param int $integrationName + * @return array|null Integration data or null if not found + * @throws \Magento\Integration\Exception + */ + public function findByName($integrationName); + /** * Update a Integration. diff --git a/app/code/Magento/Integration/etc/cache.xml b/app/code/Magento/Integration/etc/cache.xml new file mode 100644 index 00000000000..a2d8b29b6a6 --- /dev/null +++ b/app/code/Magento/Integration/etc/cache.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config> + <type name="config_integration" translate="label,description" instance="Magento\Webapi\Model\Cache\Type"> + <label>Integrations Configuration</label> + <description>Integration configuration file.</description> + </type> +</config> diff --git a/app/code/Magento/Integration/etc/integration/config.xsd b/app/code/Magento/Integration/etc/integration/config.xsd index 5950721c7d8..1381c44c4af 100644 --- a/app/code/Magento/Integration/etc/integration/config.xsd +++ b/app/code/Magento/Integration/etc/integration/config.xsd @@ -34,24 +34,11 @@ </xs:complexType> <xs:complexType name="integrationType"> <xs:sequence> - <xs:element name="name" type="integrationNameType"/> <xs:element name="email" type="emailType"/> - <xs:element name="authentication" type="authenticationType"/> - </xs:sequence> - <xs:attribute name="id" type="integrationIdType" use="required"/> - </xs:complexType> - <xs:complexType name="authenticationType"> - <xs:sequence> <xs:element name="endpoint_url" type="urlType" minOccurs="0"/> </xs:sequence> - <xs:attribute name="type" type="authenticationTypeType" use="required"/> + <xs:attribute name="name" type="integrationNameType" use="required"/> </xs:complexType> - <xs:simpleType name="authenticationTypeType"> - <xs:restriction base="xs:string"> - <xs:enumeration value="oauth"/> - <xs:enumeration value="manual"/> - </xs:restriction> - </xs:simpleType> <xs:simpleType name="urlType"> <xs:restriction base="xs:anyURI"> <xs:minLength value="4"/> @@ -67,9 +54,4 @@ <xs:pattern value="[^@]+@[^\.]+\..+"/> </xs:restriction> </xs:simpleType> - <xs:simpleType name="integrationIdType"> - <xs:restriction base="xs:string"> - <xs:minLength value="2"/> - </xs:restriction> - </xs:simpleType> </xs:schema> diff --git a/app/code/Magento/Integration/etc/module.xml b/app/code/Magento/Integration/etc/module.xml index a064c18a09c..f4b9ad3d881 100755 --- a/app/code/Magento/Integration/etc/module.xml +++ b/app/code/Magento/Integration/etc/module.xml @@ -24,7 +24,7 @@ */ --> <config> - <module name="Magento_Integration" version="1.0.0.0" active="true"> + <module name="Magento_Integration" version="1.0.0.1" active="true"> <sequence> <module name="Magento_Core"/> <module name="Magento_Adminhtml"/> diff --git a/app/code/Magento/Integration/sql/integration_setup/install-1.0.0.0.php b/app/code/Magento/Integration/sql/integration_setup/install-1.0.0.0.php index 5159af92dee..ddada3104db 100644 --- a/app/code/Magento/Integration/sql/integration_setup/install-1.0.0.0.php +++ b/app/code/Magento/Integration/sql/integration_setup/install-1.0.0.0.php @@ -237,23 +237,11 @@ $table = $installer->getConnection() ), 'Email address of the contact person' ) - ->addColumn( - 'authentication', - \Magento\DB\Ddl\Table::TYPE_SMALLINT, - null, - array( - 'unsigned' => true, - 'nullable' => false - ), - 'Authentication mechanism' - ) ->addColumn( 'endpoint', \Magento\DB\Ddl\Table::TYPE_TEXT, 255, - array( - 'nullable' => false, - ), + array(), 'Endpoint for Oauth handshake' ) ->addColumn( @@ -266,6 +254,15 @@ $table = $installer->getConnection() ), 'Integration status' ) + ->addColumn( + 'consumer_id', + \Magento\DB\Ddl\Table::TYPE_INTEGER, + null, + array( + 'unsigned' => true + ), + 'Oauth consumer' + ) ->addColumn( 'created_at', \Magento\DB\Ddl\Table::TYPE_TIMESTAMP, @@ -282,13 +279,29 @@ $table = $installer->getConnection() ) ->addIndex( $installer->getIdxName( - 'integration', + $installer->getTable('integration'), array('name'), \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE ), array('name'), array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE) - ); + ) + ->addIndex( + $installer->getIdxName( + $installer->getTable('integration'), + array('consumer_id'), + \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE + ), + array('consumer_id'), + array('type' => \Magento\DB\Adapter\AdapterInterface::INDEX_TYPE_UNIQUE)) + ->addForeignKey( + $installer->getFkName('integration', 'consumer_id', $installer->getTable('oauth_consumer'), 'entity_id'), + 'consumer_id', + $installer->getTable('oauth_consumer'), + 'entity_id', + \Magento\DB\Ddl\Table::ACTION_CASCADE, + \Magento\DB\Ddl\Table::ACTION_CASCADE); + $installer->getConnection()->createTable($table); $installer->endSetup(); diff --git a/app/code/Magento/Integration/sql/integration_setup/upgrade-1.0.0.0-1.0.0.1.php b/app/code/Magento/Integration/sql/integration_setup/upgrade-1.0.0.0-1.0.0.1.php new file mode 100644 index 00000000000..c106a33b756 --- /dev/null +++ b/app/code/Magento/Integration/sql/integration_setup/upgrade-1.0.0.0-1.0.0.1.php @@ -0,0 +1,39 @@ +<?php +/** + * Upgrade script for integration table. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var \Magento\Integration\Model\Resource\Setup $installer */ +$installer = $this; +$installer->getConnection()->addColumn( + $installer->getTable('integration'), + 'setup_type', + array( + 'type' => \Magento\DB\Ddl\Table::TYPE_SMALLINT, + 'unsigned' => true, + 'nullable' => false, + 'default' => 0, + 'comment' => 'Integration type - manual or config file' + ) +); diff --git a/app/code/Magento/Integration/view/adminhtml/integration.css b/app/code/Magento/Integration/view/adminhtml/integration.css new file mode 100644 index 00000000000..f303d5503fb --- /dev/null +++ b/app/code/Magento/Integration/view/adminhtml/integration.css @@ -0,0 +1,91 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +#integrationGrid_table .col-name { + width: 60%; +} + +#integrationGrid_table .col-status, +#integrationGrid_table .col-reauthorize, +#integrationGrid_table .col-authorize { + width: 12%; +} + +#integrationGrid_table .col-delete, +#integrationGrid_table .col-edit { + width: 2%; +} + +#integration-popup-container #resource-tree { + max-height: 170px; + overflow: auto; +} + +#integrationGrid_table .action { + border: none; + border-radius: 0; + background: none; + margin: 0; + padding: 0; + box-shadow: none; + text-shadow: none; + filter: none; +} +#integrationGrid_table .action:before { + font-family: 'MUI-Icons'; + font-style: normal; + speak: none; + font-weight: normal; + font-size: 18px; + -webkit-font-smoothing: antialiased; + color: #b7b3ad; +} +#integrationGrid_table .action:hover:before { + color: #7e7e7e; +} + +#integrationGrid_table .action.edit:before { + content: '\e05b'; +} + +#integrationGrid_table .action.delete:before { + content: '\e07f'; +} + +#integrationGrid_table .action[disabled] { + color: #bbb3b4; + cursor: not-allowed; + opacity: 0.6; +} + +.ui-dialog .ui-dialog-buttonpane .ui-dialog-buttonset { + float: none; +} + +.ui-dialog .ui-dialog-buttonpane { + text-align: right; +} + +#integration_token_base_fieldset input[readonly] { + cursor: copy; +} diff --git a/app/code/Magento/Page/view/frontend/link/current.phtml b/app/code/Magento/Integration/view/adminhtml/integration/activate/permissions.phtml similarity index 64% rename from app/code/Magento/Page/view/frontend/link/current.phtml rename to app/code/Magento/Integration/view/adminhtml/integration/activate/permissions.phtml index d8e6268840b..d99d82572ed 100644 --- a/app/code/Magento/Page/view/frontend/link/current.phtml +++ b/app/code/Magento/Integration/view/adminhtml/integration/activate/permissions.phtml @@ -1,5 +1,7 @@ <?php /** + * Permissions form container template. + * * Magento * * NOTICE OF LICENSE @@ -20,21 +22,12 @@ * * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ -/** - * @var $this \Magento\Page\Block\Link\Current + * + * @var \Magento\Adminhtml\Block\Widget\Form\Container $this */ ?> -<?php if ($this->isCurrent()):?> -<li class="nav item current"> - <strong><?php echo $this->escapeHtml(__($this->getLabel()))?></strong> -</li> -<?php else:?> -<li class="nav item"> - <a href="<?php echo $this->escapeHtml($this->getHref())?>" - <?php if ($title = $this->getTitle()):?> title="<?php echo $this->escapeHtml(__($title))?>"<?php endif;?> - > - <?php echo $this->escapeHtml(__($this->getLabel()))?> - </a> -</li> -<?php endif;?> +<div><p><?php echo __('The integration you selected asks you to approve access to the following:'); ?></p></div> +<div id="integration-activate-permissions-tabs"> + <?php echo $this->getChildHtml('tabs'); ?> +</div> +<div id="integrations-activate-permissions-content"></div> diff --git a/app/code/Magento/Integration/view/adminhtml/integration/popup_container.phtml b/app/code/Magento/Integration/view/adminhtml/integration/popup_container.phtml new file mode 100644 index 00000000000..59fc19b33e6 --- /dev/null +++ b/app/code/Magento/Integration/view/adminhtml/integration/popup_container.phtml @@ -0,0 +1,37 @@ +<?php +/** + * Popup container template. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * + * @var \Magento\Backend\Block\Template $this + */ +?> +<script type="text/javascript"> + window.integration = new Integration( + '<?php echo $this->getUrl('*/*/activate', ['id' => ':id', '_query' => 'popup_dialog=permissions']); ?>', + '<?php echo $this->getUrl('*/*/activate', ['id' => ':id', '_query' => 'popup_dialog=tokens']); ?>', + '', // Not implemented + '' // Not implemented + ); +</script> +<div id="integration-popup-container" style="display:none;"></div> diff --git a/app/code/Magento/Integration/view/adminhtml/js/integration.js b/app/code/Magento/Integration/view/adminhtml/js/integration.js index a25c3c222d9..6e4e805e34f 100644 --- a/app/code/Magento/Integration/view/adminhtml/js/integration.js +++ b/app/code/Magento/Integration/view/adminhtml/js/integration.js @@ -21,57 +21,118 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /*jshint jquery:true*/ -(function($) { - "use strict"; - $.widget('mage.integration', { - options: { - authType: null, // Auth type : Manual or Oauth - formSelector: null, - endpointIdSelector: null, - endpointContainerClassSelector: null, - requiredClass: 'required-entry' - }, +/*global FORM_KEY*/ +/*global integration*/ +(function($, window) { + window.Integration = function (permissionsDialogUrl, tokensDialogUrl, deactivateDialogUrl, reauthorizeDialogUrl) { + var url = { + permissions: permissionsDialogUrl, + tokens: tokensDialogUrl, + deactivate: deactivateDialogUrl, + reauthorize: reauthorizeDialogUrl + }; - /** - * Initialize integration widget - * @private - */ - _init: function() { - this._toggleEndpoint(); - }, + var _showPopup = function (dialog, title, okButton, url) { + var that = this; - /** - * Bind a click handler to the widget's context element. - * @private - */ - _create: function() { - this._on({ - change: '_toggleEndpoint' - }); - this._on($(this.options.formSelector), { - submit: '_resetEndpoint' - }); - }, + $.ajax({ + url: url, + cache: false, + dataType: 'html', + data: {form_key: window.FORM_KEY}, + method: 'GET', + beforeSend: function () { + // Show the spinner + $('body').trigger('processStart'); + }, + success: function (html) { + var popup = $('#integration-popup-container'); - /** - * Toggle the visibility of the endpoint field based on Auth thype selected - * @private - */ - _toggleEndpoint: function() { - var isOauth = parseInt(this.element.val()) === this.options.authType; - $(this.options.endpointContainerClassSelector).children().toggle(isOauth); - $(this.options.endpointIdSelector).toggleClass(this.options.requiredClass, isOauth); - }, + popup.html(html); - /** - * Reset endpoint field if the Authentication type is not Oauth - * - * @private - */ - _resetEndpoint: function() { - if (parseInt(this.element.val()) !== this.options.authType) { - $(this.options.endpointIdSelector).val(''); + var buttons = [{ + text: $.mage.__('Cancel'), + click: function() { + $(this).dialog('destroy'); + } + }]; + + // Add confirmation button to the list of dialog buttons + buttons.push(okButton); + + popup.dialog({ + title: title, + modal: true, + autoOpen: true, + minHeight: 450, + minWidth: 600, + dialogClass: 'integration-dialog', + position: {at: 'center'}, + buttons: buttons + }); + }, + complete: function () { + // Hide the spinner + $('body').trigger('processStop'); + } + }) + }; + + return { + popup: { + show: function (ctx) { + var dialog = $(ctx).attr('data-row-dialog'); + + if (['permissions', 'deactivate', 'reauthorize', 'tokens'].indexOf(dialog) === -1) { + throw 'Invalid dialog type'; + } + + var integrationId = $(ctx).attr('data-row-id'); + + if (!integrationId) { + throw 'Unable to find integration ID'; + } + + // Replace placeholder in URL with actual ID + var ajaxUrl = url[dialog].replace(':id', integrationId); + + try { + // Get integration name either from current element or from neighbor column + var integrationName = $(ctx).attr('data-row-name') + || $(ctx).parents('tr').find('.col-name').html().trim(); + } catch (e) { + throw 'Unable to find integration name'; + } + + var okButton = { + permissions: { + text: $.mage.__('Allow'), + 'class': 'primary', + // This data is going to be used in the next dialog + 'data-row-id': integrationId, + 'data-row-name': integrationName, + 'data-row-dialog': 'tokens', + click: function () { + // Find the 'Allow' button and clone - it has all necessary data, but is going to be + // destroyed along with the current dialog + var ctx = $(this).parent().find('button.primary').clone(true); + $(this).dialog('destroy'); + // Make popup out of data we saved from 'Allow' button + window.integration.popup.show(ctx); + } + }, + tokens: { + text: $.mage.__('Activate'), + 'class': 'primary', + click: function () { + alert('Not implemented'); + } + } + }; + + _showPopup(dialog, integrationName, okButton[dialog], ajaxUrl); + } } - } - }); -})(jQuery); \ No newline at end of file + }; + }; +})(jQuery, window); diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_permissions_popup.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_permissions_popup.xml new file mode 100644 index 00000000000..ad4945eacb6 --- /dev/null +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_permissions_popup.xml @@ -0,0 +1,32 @@ +<?xml version="1.0"?> +<!-- +/** + * Integration activation permissions confirmation popup. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <block class="Magento\Backend\Block\Template" name="integration.activate.permissions" template="Magento_Integration::integration/activate/permissions.phtml" output="1"> + <block class="Magento\Integration\Block\Adminhtml\Integration\Activate\Permissions\Tabs" name="integration.activate.permissions.tabs" as="tabs" /> + </block> +</layout> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_tokens_popup.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_tokens_popup.xml new file mode 100644 index 00000000000..e06c57704e8 --- /dev/null +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_activate_tokens_popup.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> + +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <block class="Magento\Integration\Block\Adminhtml\Integration\Token" name="integration_token_popup" output="1"/> +</layout> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml index d31f9200534..65c4a962739 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_edit.xml @@ -24,13 +24,6 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-integration-adminhtml-integration-js"> - <arguments> - <argument name="file" xsi:type="string">Magento_Integration::js/integration.js</argument> - </arguments> - </block> - </referenceBlock> <update handle="editor"/> <referenceContainer name="left"> <block class="Magento\Integration\Block\Adminhtml\Integration\Edit\Tabs" name="integration_edit_tabs"> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml index 32c982c2dae..bc2a4f7d68e 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_grid_block.xml @@ -27,7 +27,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="integration.grid.container"> - <block class="Magento\Backend\Block\Widget\Grid" name="integration.grid" as="grid"> + <block class="Magento\Integration\Block\Adminhtml\Integration\Grid" name="integration.grid" as="grid"> <arguments> <argument name="id" xsi:type="string">integrationGrid</argument> <argument name="dataSource" xsi:type="object">\Magento\Integration\Model\Resource\Integration\Collection</argument> @@ -41,10 +41,7 @@ <block class="Magento\Backend\Block\Widget\Grid\ColumnSet" as="grid.columnSet" name="integration.grid.columnSet"> <arguments> <argument name="rowUrl" xsi:type="array"> - <item name="path" xsi:type="string">*/*/edit</item> - <item name="extraParamsTemplate" xsi:type="array"> - <item name="id" xsi:type="string">getId</item> - </item> + <item name="path" xsi:type="string"></item> </argument> <argument name="empty_text" xsi:type="string" translate="true">No Integrations Found</argument> </arguments> @@ -61,11 +58,48 @@ <argument name="header" xsi:type="string" translate="true">Status</argument> <argument name="type" xsi:type="string">options</argument> <argument name="options" xsi:type="options" model="Magento\Integration\Model\Integration\Source\Status"/> - <argument name="width" xsi:type="string">50px</argument> <argument name="index" xsi:type="string">status</argument> <argument name="id" xsi:type="string">status</argument> </arguments> </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="reauthorize"> + <arguments> + <argument name="renderer" xsi:type="string">Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Link\Reauthorize</argument> + <argument name="index" xsi:type="string">reauthorize</argument> + <argument name="id" xsi:type="string">reauthorize</argument> + <argument name="sortable" xsi:type="string">0</argument> + <argument name="filter" xsi:type="string">0</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="activate"> + <arguments> + <argument name="renderer" xsi:type="string">Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Link\Activate</argument> + <argument name="index" xsi:type="string">activate</argument> + <argument name="id" xsi:type="string">activate</argument> + <argument name="sortable" xsi:type="string">0</argument> + <argument name="filter" xsi:type="string">0</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="edit"> + <arguments> + <argument name="renderer" xsi:type="string">Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Button\Edit</argument> + <argument name="class" xsi:type="string">action edit</argument> + <argument name="index" xsi:type="string">edit</argument> + <argument name="id" xsi:type="string">edit</argument> + <argument name="sortable" xsi:type="string">0</argument> + <argument name="filter" xsi:type="string">0</argument> + </arguments> + </block> + <block class="Magento\Backend\Block\Widget\Grid\Column" as="delete"> + <arguments> + <argument name="renderer" xsi:type="string">Magento\Integration\Block\Adminhtml\Widget\Grid\Column\Renderer\Button\Delete</argument> + <argument name="class" xsi:type="string">action delete</argument> + <argument name="index" xsi:type="string">delete</argument> + <argument name="id" xsi:type="string">delete</argument> + <argument name="sortable" xsi:type="string">0</argument> + <argument name="filter" xsi:type="string">0</argument> + </arguments> + </block> </block> </block> </referenceBlock> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml index b66612e929e..718ae1d6e80 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_index.xml @@ -26,6 +26,21 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="head"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-integration-styles-css"> + <arguments> + <argument name="file" xsi:type="string">Magento_Integration::integration.css</argument> + </arguments> + </block> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-integration-js"> + <arguments> + <argument name="file" xsi:type="string">Magento_Integration::js/integration.js</argument> + </arguments> + </block> + </referenceBlock> + <referenceBlock name="content"> + <block class="Magento\Backend\Block\Template" name="integration.popup.container" template="Magento_Integration::integration/popup_container.phtml" before="-"/> + </referenceBlock> <update handle="adminhtml_integration_grid_block"/> <referenceContainer name="content"> <block class="Magento\Integration\Block\Adminhtml\Integration" name="integration.grid.container"/> diff --git a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml index f4ea556b8ec..dadd55f1a45 100644 --- a/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml +++ b/app/code/Magento/Integration/view/adminhtml/layout/adminhtml_integration_new.xml @@ -25,11 +25,4 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="adminhtml_integration_edit"/> - <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-integration-adminhtml-integration-js"> - <arguments> - <argument name="file" xsi:type="string">Magento_Integration::js/integration.js</argument> - </arguments> - </block> - </referenceBlock> </layout> diff --git a/app/code/Magento/Log/Model/Aggregation.php b/app/code/Magento/Log/Model/Aggregation.php index 4432918d76f..ff87155c8f1 100644 --- a/app/code/Magento/Log/Model/Aggregation.php +++ b/app/code/Magento/Log/Model/Aggregation.php @@ -51,17 +51,17 @@ class Aggregation extends \Magento\Core\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Log/Model/Cron.php b/app/code/Magento/Log/Model/Cron.php index d94d838949a..06c1765f3a1 100644 --- a/app/code/Magento/Log/Model/Cron.php +++ b/app/code/Magento/Log/Model/Cron.php @@ -76,24 +76,24 @@ class Cron extends \Magento\Core\Model\AbstractModel protected $_templateFactory; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Email\Model\TemplateFactory $templateFactory * @param \Magento\Log\Model\Log $log * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Translate $translate - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Email\Model\TemplateFactory $templateFactory, \Magento\Log\Model\Log $log, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Translate $translate, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Log/Model/Resource/Log.php b/app/code/Magento/Log/Model/Resource/Log.php index 4a09bf99a4b..e8b0d357535 100644 --- a/app/code/Magento/Log/Model/Resource/Log.php +++ b/app/code/Magento/Log/Model/Resource/Log.php @@ -54,16 +54,16 @@ class Log extends \Magento\Core\Model\Resource\Db\AbstractDb protected $dateTime; /** + * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\Date $date * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Stdlib\DateTime $dateTime - * @param \Magento\App\Resource $resource */ public function __construct( + \Magento\App\Resource $resource, \Magento\Core\Model\Date $date, \Magento\Event\ManagerInterface $eventManager, - \Magento\Stdlib\DateTime $dateTime, - \Magento\App\Resource $resource + \Magento\Stdlib\DateTime $dateTime ) { $this->_date = $date; $this->_eventManager = $eventManager; diff --git a/app/code/Magento/Log/Model/Resource/Visitor.php b/app/code/Magento/Log/Model/Resource/Visitor.php index dceb0cd97ed..53966211ae2 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor.php +++ b/app/code/Magento/Log/Model/Resource/Visitor.php @@ -49,16 +49,16 @@ class Visitor extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_storeManager; /** + * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\Date $date * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Stdlib\String $string - * @param \Magento\App\Resource $resource */ public function __construct( + \Magento\App\Resource $resource, \Magento\Core\Model\Date $date, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Stdlib\String $string, - \Magento\App\Resource $resource + \Magento\Stdlib\String $string ) { $this->_date = $date; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Log/Model/Resource/Visitor/Online.php b/app/code/Magento/Log/Model/Resource/Visitor/Online.php index 2978812ff2b..265654db0e6 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor/Online.php +++ b/app/code/Magento/Log/Model/Resource/Visitor/Online.php @@ -42,13 +42,11 @@ class Online extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_date; /** - * @param \Magento\Core\Model\Date $date * @param \Magento\App\Resource $resource + * @param \Magento\Core\Model\Date $date */ - public function __construct( - \Magento\Core\Model\Date $date, - \Magento\App\Resource $resource - ) { + public function __construct(\Magento\App\Resource $resource, \Magento\Core\Model\Date $date) + { $this->_date = $date; parent::__construct($resource); } diff --git a/app/code/Magento/Log/Model/Resource/Visitor/Online/Collection.php b/app/code/Magento/Log/Model/Resource/Visitor/Online/Collection.php index 8e16d8a6343..8920aa07e32 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor/Online/Collection.php +++ b/app/code/Magento/Log/Model/Resource/Visitor/Online/Collection.php @@ -49,23 +49,25 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_customerFactory; /** - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Customer\Model\CustomerFactory $customerFactory, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_customerFactory = $customerFactory; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Log/Model/Resource/Visitor/Online/Grid/Collection.php b/app/code/Magento/Log/Model/Resource/Visitor/Online/Grid/Collection.php index e2db507913d..6aa27621535 100644 --- a/app/code/Magento/Log/Model/Resource/Visitor/Online/Grid/Collection.php +++ b/app/code/Magento/Log/Model/Resource/Visitor/Online/Grid/Collection.php @@ -33,25 +33,35 @@ class Collection extends \Magento\Log\Model\Resource\Visitor\Online\Collection protected $_onlineFactory; /** - * @param \Magento\Log\Model\Visitor\OnlineFactory $onlineFactory - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param \Magento\Log\Model\Visitor\OnlineFactory $onlineFactory + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Log\Model\Visitor\OnlineFactory $onlineFactory, - \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Customer\Model\CustomerFactory $customerFactory, + \Magento\Log\Model\Visitor\OnlineFactory $onlineFactory, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_onlineFactory = $onlineFactory; - parent::__construct($customerFactory, $eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $customerFactory, + $connection, + $resource + ); } /** diff --git a/app/code/Magento/Log/Model/Visitor.php b/app/code/Magento/Log/Model/Visitor.php index 9e4deb50052..701c8a91542 100644 --- a/app/code/Magento/Log/Model/Visitor.php +++ b/app/code/Magento/Log/Model/Visitor.php @@ -126,13 +126,11 @@ class Visitor extends \Magento\Core\Model\AbstractModel * @param \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress * @param \Magento\HTTP\PhpEnvironment\ServerAddress $serverAddress * @param \Magento\Stdlib\DateTime $dateTime - * @param array $data - * @param array $ignoredUserAgents - * @param array $ignores * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) + * @param array $ignoredUserAgents + * @param array $ignores + * @param array $data */ public function __construct( \Magento\Core\Model\Context $context, @@ -147,11 +145,11 @@ class Visitor extends \Magento\Core\Model\AbstractModel \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress, \Magento\HTTP\PhpEnvironment\ServerAddress $serverAddress, \Magento\Stdlib\DateTime $dateTime, - array $data = array(), + \Magento\Core\Model\Resource\AbstractResource $resource = null, + \Magento\Data\Collection\Db $resourceCollection = null, array $ignoredUserAgents = array(), array $ignores = array(), - \Magento\Core\Model\Resource\AbstractResource $resource = null, - \Magento\Data\Collection\Db $resourceCollection = null + array $data = array() ) { $this->_coreStoreConfig = $coreStoreConfig; $this->_customerFactory = $customerFactory; diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Problem.php b/app/code/Magento/Newsletter/Block/Adminhtml/Problem.php index 15256a4debb..cba4e53d636 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Problem.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Problem.php @@ -43,20 +43,18 @@ class Problem extends \Magento\Backend\Block\Template */ protected $_problemCollection; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Newsletter\Model\Resource\Problem\Collection $problemCollection - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Newsletter\Model\Resource\Problem\Collection $problemCollection + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Newsletter\Model\Resource\Problem\Collection $problemCollection, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Newsletter\Model\Resource\Problem\Collection $problemCollection, + array $data = array() + ) { $this->_problemCollection = $problemCollection; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php index acdd2df811a..0f85f9b8944 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit.php @@ -45,23 +45,21 @@ class Edit extends \Magento\Backend\Block\Template */ protected $_wysiwygConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_wysiwygConfig = $wysiwygConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit/Form.php b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit/Form.php index 34935345434..c90e9667445 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit/Form.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Edit/Form.php @@ -51,30 +51,28 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_queueFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Newsletter\Model\QueueFactory $queueFactory - * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Newsletter\Model\QueueFactory $queueFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Newsletter\Model\QueueFactory $queueFactory, - \Magento\Core\Model\System\Store $systemStore, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Newsletter\Model\QueueFactory $queueFactory, + \Magento\Core\Model\System\Store $systemStore, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; $this->_systemStore = $systemStore; $this->_queueFactory = $queueFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Preview.php b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Preview.php index 58d240b9887..ecc6068997b 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Preview.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Queue/Preview.php @@ -50,26 +50,24 @@ class Preview extends \Magento\Adminhtml\Block\Widget */ protected $_subscriberFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory - * @param \Magento\Newsletter\Model\QueueFactory $queueFactory - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory + * @param \Magento\Newsletter\Model\QueueFactory $queueFactory + * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Newsletter\Model\TemplateFactory $templateFactory, - \Magento\Newsletter\Model\QueueFactory $queueFactory, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Newsletter\Model\TemplateFactory $templateFactory, + \Magento\Newsletter\Model\QueueFactory $queueFactory, + \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, + array $data = array() + ) { $this->_templateFactory = $templateFactory; $this->_queueFactory = $queueFactory; $this->_subscriberFactory = $subscriberFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _toHtml() diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber.php b/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber.php index 6ec289fd7c6..de3148d60de 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber.php @@ -50,20 +50,18 @@ class Subscriber extends \Magento\Backend\Block\Template */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Newsletter\Model\Resource\Queue\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid.php b/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid.php index db184b5912e..f6f9f93c971 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid.php @@ -40,22 +40,20 @@ class Grid extends \Magento\Backend\Block\Widget\Grid */ protected $_queueFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Newsletter\Model\QueueFactory $queueFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Newsletter\Model\QueueFactory $queueFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Newsletter\Model\QueueFactory $queueFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Newsletter\Model\QueueFactory $queueFactory, + array $data = array() + ) { $this->_queueFactory = $queueFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid/Filter/Website.php b/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid/Filter/Website.php index ee139ca5be6..9c29f3623bb 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid/Filter/Website.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Subscriber/Grid/Filter/Website.php @@ -51,22 +51,22 @@ class Website */ protected $_websitesFactory; - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Model\Resource\Helper $resourceHelper - * @param \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Core\Model\Resource\Helper $resourceHelper + * @param \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Core\Model\Resource\Helper $resourceHelper, - \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Core\Model\Resource\Helper $resourceHelper, + \Magento\Core\Model\Resource\Website\CollectionFactory $websitesFactory, + \Magento\Core\Model\StoreManagerInterface $storeManager, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_storeManager = $storeManager; $this->_websitesFactory = $websitesFactory; diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit.php b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit.php index 713c2d132cf..ee4a5631bb1 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit.php @@ -54,23 +54,21 @@ class Edit extends \Magento\Adminhtml\Block\Widget */ protected $_wysiwygConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_wysiwygConfig = $wysiwygConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php index f0a77f8b77d..a5ec8f0576c 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Edit/Form.php @@ -41,24 +41,22 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_wysiwygConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Cms\Model\Wysiwyg\Config $wysiwygConfig, + array $data = array() + ) { $this->_wysiwygConfig = $wysiwygConfig; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Grid.php b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Grid.php index a9d911787ce..f2ddc03b6ee 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Grid.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Grid.php @@ -40,22 +40,20 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_templateCollection; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Newsletter\Model\Resource\Template\Collection $templateCollection - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Newsletter\Model\Resource\Template\Collection $templateCollection + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Newsletter\Model\Resource\Template\Collection $templateCollection, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Newsletter\Model\Resource\Template\Collection $templateCollection, + array $data = array() + ) { $this->_templateCollection = $templateCollection; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); $this->setEmptyText(__('No Templates Found')); } diff --git a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Preview.php b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Preview.php index 745ae4d6a86..90b906a6621 100644 --- a/app/code/Magento/Newsletter/Block/Adminhtml/Template/Preview.php +++ b/app/code/Magento/Newsletter/Block/Adminhtml/Template/Preview.php @@ -45,23 +45,21 @@ class Preview extends \Magento\Adminhtml\Block\Widget */ protected $_subscriberFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory - * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory + * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Newsletter\Model\TemplateFactory $templateFactory, - \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Newsletter\Model\TemplateFactory $templateFactory, + \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, + array $data = array() + ) { $this->_templateFactory = $templateFactory; $this->_subscriberFactory = $subscriberFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _toHtml() diff --git a/app/code/Magento/Newsletter/Block/Subscribe.php b/app/code/Magento/Newsletter/Block/Subscribe.php index 146ffc73aa1..3a055f7c1cd 100644 --- a/app/code/Magento/Newsletter/Block/Subscribe.php +++ b/app/code/Magento/Newsletter/Block/Subscribe.php @@ -34,7 +34,7 @@ namespace Magento\Newsletter\Block; -class Subscribe extends \Magento\View\Block\Template +class Subscribe extends \Magento\View\Element\Template { /** * Newsletter session @@ -44,18 +44,16 @@ class Subscribe extends \Magento\View\Block\Template protected $_newsletterSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Newsletter\Model\Session $newsletterSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Newsletter\Model\Session $newsletterSession, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_newsletterSession = $newsletterSession; } diff --git a/app/code/Magento/Newsletter/Controller/Adminhtml/Problem.php b/app/code/Magento/Newsletter/Controller/Adminhtml/Problem.php index b6b32228ad0..389881968ba 100644 --- a/app/code/Magento/Newsletter/Controller/Adminhtml/Problem.php +++ b/app/code/Magento/Newsletter/Controller/Adminhtml/Problem.php @@ -24,15 +24,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Newsletter\Controller\Adminhtml; + /** * Newsletter subscribers controller - * - * @category Magento - * @package Magento_Newsletter - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Newsletter\Controller\Adminhtml; - class Problem extends \Magento\Backend\App\Action { public function indexAction() @@ -58,9 +54,9 @@ class Problem extends \Magento\Backend\App\Action public function gridAction() { - if($this->getRequest()->getParam('_unsubscribe')) { + if ($this->getRequest()->getParam('_unsubscribe')) { $problems = (array) $this->getRequest()->getParam('problem', array()); - if (count($problems)>0) { + if (count($problems) > 0) { $collection = $this->_objectManager->create('Magento\Newsletter\Model\Resource\Problem\Collection'); $collection ->addSubscriberInfo() @@ -75,13 +71,14 @@ class Problem extends \Magento\Backend\App\Action ->addSuccess(__('We unsubscribed the people you identified.')); } - if($this->getRequest()->getParam('_delete')) { + if ($this->getRequest()->getParam('_delete')) { $problems = (array) $this->getRequest()->getParam('problem', array()); - if (count($problems)>0) { + if (count($problems) > 0) { $collection = $this->_objectManager->create('Magento\Newsletter\Model\Resource\Problem\Collection'); - $collection - ->addFieldToFilter($collection->getResource()->getIdFieldName(), - array('in'=>$problems)) + $collection->addFieldToFilter( + $collection->getResource()->getIdFieldName(), + array('in' => $problems) + ) ->load(); $collection->walk('delete'); } @@ -89,7 +86,9 @@ class Problem extends \Magento\Backend\App\Action $this->_objectManager->get('Magento\Adminhtml\Model\Session') ->addSuccess(__('The problems you identified have been deleted.')); } - $this->_view->getLayout()->getMessagesBlock()->setMessages($this->_objectManager->get('Magento\Adminhtml\Model\Session')->getMessages(true)); + $this->_view->getLayout()->getMessagesBlock()->setMessages( + $this->_objectManager->get('Magento\Adminhtml\Model\Session')->getMessages(true) + ); $this->_view->loadLayout(false); $this->_view->renderLayout(); diff --git a/app/code/Magento/Newsletter/Model/Queue.php b/app/code/Magento/Newsletter/Model/Queue.php index 42760efec49..35a9ca2a0c7 100644 --- a/app/code/Magento/Newsletter/Model/Queue.php +++ b/app/code/Magento/Newsletter/Model/Queue.php @@ -137,10 +137,8 @@ class Queue extends \Magento\Core\Model\Template protected $_templateFactory; /** - * Construct - * - * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Context $context + * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -154,8 +152,8 @@ class Queue extends \Magento\Core\Model\Template * @param array $data */ public function __construct( - \Magento\View\DesignInterface $design, \Magento\Core\Model\Context $context, + \Magento\View\DesignInterface $design, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -168,7 +166,7 @@ class Queue extends \Magento\Core\Model\Template \Magento\Newsletter\Model\Resource\Subscriber\CollectionFactory $subscriberCollectionFactory, array $data = array() ) { - parent::__construct($design, $context, $registry, $appEmulation, $storeManager, $data); + parent::__construct($context, $design, $registry, $appEmulation, $storeManager, $data); $this->_templateFilter = $templateFilter; $this->_date = $date; $this->_locale = $locale; diff --git a/app/code/Magento/Newsletter/Model/Resource/Problem/Collection.php b/app/code/Magento/Newsletter/Model/Resource/Problem/Collection.php index cfecd07e597..908260980b2 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Problem/Collection.php +++ b/app/code/Magento/Newsletter/Model/Resource/Problem/Collection.php @@ -55,24 +55,24 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_customerCollectionFactory; /** - * Construct - * - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerCollectionFactory + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerCollectionFactory, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_customerCollectionFactory = $customerCollectionFactory; } diff --git a/app/code/Magento/Newsletter/Model/Resource/Queue/Collection.php b/app/code/Magento/Newsletter/Model/Resource/Queue/Collection.php index 9e0a5c342cd..7a108b5f9a7 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Queue/Collection.php +++ b/app/code/Magento/Newsletter/Model/Resource/Queue/Collection.php @@ -58,24 +58,24 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_date; /** - * Construct - * - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Date $date + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Date $date, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_date = $date; } diff --git a/app/code/Magento/Newsletter/Model/Resource/Subscriber/Collection.php b/app/code/Magento/Newsletter/Model/Resource/Subscriber/Collection.php index 31e4589d514..1e5adbcbb77 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Subscriber/Collection.php +++ b/app/code/Magento/Newsletter/Model/Resource/Subscriber/Collection.php @@ -80,26 +80,26 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_customerFactory; /** - * Construct - * - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Customer\Model\CustomerFactory $customerFactory, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { // _customerFactory is used in parent class constructor $this->_customerFactory = $customerFactory; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Newsletter/Model/Resource/Template.php b/app/code/Magento/Newsletter/Model/Resource/Template.php index 4499857d0b0..31469b3c14f 100644 --- a/app/code/Magento/Newsletter/Model/Resource/Template.php +++ b/app/code/Magento/Newsletter/Model/Resource/Template.php @@ -44,15 +44,11 @@ class Template extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_date; /** - * Construct - * * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\Date $date */ - public function __construct( - \Magento\Core\Model\Date $date, - \Magento\App\Resource $resource - ) { + public function __construct(\Magento\App\Resource $resource, \Magento\Core\Model\Date $date) + { parent::__construct($resource); $this->_date = $date; } diff --git a/app/code/Magento/Newsletter/Model/Session.php b/app/code/Magento/Newsletter/Model/Session.php index 4cc5ebbecc3..fc51c6bed0a 100644 --- a/app/code/Magento/Newsletter/Model/Session.php +++ b/app/code/Magento/Newsletter/Model/Session.php @@ -38,16 +38,20 @@ class Session extends \Magento\Core\Model\Session\AbstractSession { /** * @param \Magento\Core\Model\Session\Context $context + * @param \Magento\Session\SidResolverInterface $sidResolver + * @param \Magento\Session\Config\ConfigInterface $sessionConfig * @param array $data * @param null $sessionName */ public function __construct( \Magento\Core\Model\Session\Context $context, + \Magento\Session\SidResolverInterface $sidResolver, + \Magento\Session\Config\ConfigInterface $sessionConfig, array $data = array(), $sessionName = null ) { - parent::__construct($context, $data); - $this->init('newsletter', $sessionName); + parent::__construct($context, $sidResolver, $sessionConfig, $data); + $this->start('newsletter', $sessionName); } public function addError($message) diff --git a/app/code/Magento/Newsletter/Model/Template.php b/app/code/Magento/Newsletter/Model/Template.php index bd27e408093..fc1a2dd8865 100644 --- a/app/code/Magento/Newsletter/Model/Template.php +++ b/app/code/Magento/Newsletter/Model/Template.php @@ -114,32 +114,32 @@ class Template extends \Magento\Core\Model\Template protected $_filterManager; /** - * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Context $context + * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\RequestInterface $request * @param \Magento\Newsletter\Model\Template\Filter $filter * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Newsletter\Model\TemplateFactory $templateFactory - * @param \Magento\Core\Model\App\Emulation $appEmulation * @param \Magento\Filter\FilterManager $filterManager * @param array $data */ public function __construct( - \Magento\View\DesignInterface $design, \Magento\Core\Model\Context $context, + \Magento\View\DesignInterface $design, \Magento\Core\Model\Registry $registry, + \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\RequestInterface $request, \Magento\Newsletter\Model\Template\Filter $filter, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Newsletter\Model\TemplateFactory $templateFactory, - \Magento\Core\Model\App\Emulation $appEmulation, \Magento\Filter\FilterManager $filterManager, array $data = array() ) { - parent::__construct($design, $context, $registry, $appEmulation, $storeManager, $data); + parent::__construct($context, $design, $registry, $appEmulation, $storeManager, $data); $this->_storeManager = $storeManager; $this->_request = $request; $this->_filter = $filter; diff --git a/app/code/Magento/Newsletter/etc/module.xml b/app/code/Magento/Newsletter/etc/module.xml index 9e3e41fdad1..e32e58a1ec0 100755 --- a/app/code/Magento/Newsletter/etc/module.xml +++ b/app/code/Magento/Newsletter/etc/module.xml @@ -37,7 +37,6 @@ <module name="Magento_Widget"/> <module name="Magento_Catalog"/> <module name="Magento_Backend"/> - <module name="Magento_Page"/> </depends> </module> </config> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml index 516baf9cc90..66ca330b778 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_edit.xml @@ -26,22 +26,22 @@ <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="editor"/> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/css/jquery.fileupload-ui.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/load-image.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload-fp.js</argument> </arguments> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml index ceac2a72187..63dffb21b2f 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_queue_preview_popup.xml @@ -24,7 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\View\Block\Template" name="root" output="1" template="Magento_Newsletter::queue/preview.phtml"> + <block class="Magento\View\Element\Template" name="root" output="1" template="Magento_Newsletter::queue/preview.phtml"> <block class="Magento\Newsletter\Block\Adminhtml\Queue\Preview" name="content" as="content"/> </block> <block class="Magento\Newsletter\Block\Adminhtml\Queue\Preview" name="preview_template"/> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml index 2b67f4ce7e5..a811ac8b5ac 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_edit.xml @@ -26,32 +26,32 @@ <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <update handle="editor"/> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/css/jquery.fileupload-ui.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.iframe-transport.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/load-image.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/canvas-to-blob.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload-fp.js</argument> </arguments> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml index e7c0615d8e3..76e46107159 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/newsletter_template_preview_popup.xml @@ -24,7 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\View\Block\Template" name="root" output="1" template="Magento_Newsletter::template/preview.phtml"> + <block class="Magento\View\Element\Template" name="root" output="1" template="Magento_Newsletter::template/preview.phtml"> <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview" name="content" as="content"/> </block> <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview" name="preview_template"/> diff --git a/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml b/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml index 48ec7d0baa0..911f9c400e0 100644 --- a/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml +++ b/app/code/Magento/Newsletter/view/adminhtml/layout/preview.xml @@ -24,7 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\View\Block\Template" name="root" output="1" template="Magento_Newsletter::template/preview.phtml"> + <block class="Magento\View\Element\Template" name="root" output="1" template="Magento_Newsletter::template/preview.phtml"> <block class="Magento\Newsletter\Block\Adminhtml\Template\Preview" name="content" as="content"/> </block> </layout> diff --git a/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml b/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml index ebd4622d346..b740b9f8b63 100644 --- a/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Newsletter/view/frontend/layout/customer_account.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="customer_account_navigation"> - <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-newsletter-subscriptions-link"> + <block class="Magento\View\Element\Html\Link\Current" name="customer-account-navigation-newsletter-subscriptions-link"> <arguments> <argument name="path" xsi:type="string">newsletter/manage</argument> <argument name="label" xsi:type="string">Newsletter Subscriptions</argument> diff --git a/app/code/Magento/Ogone/Block/Paypage.php b/app/code/Magento/Ogone/Block/Paypage.php index 414cf73dbe5..bde8c0d1b4b 100644 --- a/app/code/Magento/Ogone/Block/Paypage.php +++ b/app/code/Magento/Ogone/Block/Paypage.php @@ -27,7 +27,7 @@ namespace Magento\Ogone\Block; -class Paypage extends \Magento\View\Block\Template +class Paypage extends \Magento\View\Element\Template { protected $_template = 'paypage.phtml'; } diff --git a/app/code/Magento/Ogone/Block/Placeform.php b/app/code/Magento/Ogone/Block/Placeform.php index 5c7885efc9d..2e3033c9649 100644 --- a/app/code/Magento/Ogone/Block/Placeform.php +++ b/app/code/Magento/Ogone/Block/Placeform.php @@ -26,7 +26,7 @@ namespace Magento\Ogone\Block; -class Placeform extends \Magento\View\Block\Template +class Placeform extends \Magento\View\Element\Template { /** * @var \Magento\Sales\Model\OrderFactory @@ -44,16 +44,14 @@ class Placeform extends \Magento\View\Block\Template protected $_ogoneApi; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Ogone\Model\Api $ogoneApi * @param \Magento\Sales\Model\OrderFactory $salesOrderFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Ogone\Model\Api $ogoneApi, \Magento\Sales\Model\OrderFactory $salesOrderFactory, @@ -62,7 +60,7 @@ class Placeform extends \Magento\View\Block\Template $this->_checkoutSession = $checkoutSession; $this->_ogoneApi = $ogoneApi; $this->_salesOrderFactory = $salesOrderFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Ogone/Controller/Api.php b/app/code/Magento/Ogone/Controller/Api.php index e89f4080588..54bd77aa35f 100644 --- a/app/code/Magento/Ogone/Controller/Api.php +++ b/app/code/Magento/Ogone/Controller/Api.php @@ -159,7 +159,7 @@ class Api extends \Magento\App\Action\Action $this->_getCheckout()->getQuote()->setIsActive(false)->save(); $this->_getCheckout()->setOgoneQuoteId($this->_getCheckout()->getQuoteId()); $this->_getCheckout()->setOgoneLastSuccessQuoteId($this->_getCheckout()->getLastSuccessQuoteId()); - $this->_getCheckout()->clear(); + $this->_getCheckout()->clearQuote(); $this->_view->loadLayout(); $this->_view->renderLayout(); diff --git a/app/code/Magento/Page/Block/Template/Links/Block.php b/app/code/Magento/Page/Block/Template/Links/Block.php deleted file mode 100644 index 3b9b844e53b..00000000000 --- a/app/code/Magento/Page/Block/Template/Links/Block.php +++ /dev/null @@ -1,195 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Page - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - - -/** - * Simple links list block - * - * @category Magento - * @package Magento_Core - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Page\Block\Template\Links; - -class Block extends \Magento\View\Block\Template -{ - - /** - * First link flag - * - * @var bool - */ - protected $_isFirst = false; - - /** - * Last link flag - * - * @var bool - */ - protected $_isLast = false; - - /** - * Link label - * - * @var string - */ - protected $_label = null; - - /** - * Link url - * - * @var string - */ - protected $_url = null; - - /** - * Link title - * - * @var string - */ - protected $_title = null; - - /** - * Li elemnt params - * - * @var string - */ - protected $_liPparams = null; - - /** - * A elemnt params - * - * @var string - */ - protected $_aPparams = null; - - /** - * Message before link text - * - * @var string - */ - protected $_beforeText = null; - - /** - * Message after link text - * - * @var string - */ - protected $_afterText = null; - - /** - * Position in link list - * @var int - */ - protected $_position = 0; - - protected $_template = 'Magento_Page::template/linksblock.phtml'; - - /** - * Return link position in link list - * - * @return in - */ - public function getPosition() - { - return $this->_position; - } - - /** - * Return first position flag - * - * @return bool - */ - public function getIsFirst() - { - return $this->_isFirst; - } - - /** - * Set first list flag - * - * @param bool $value - * return \Magento\Page\Block\Template\Links\Block - */ - public function setIsFirst($value) - { - $this->_isFirst = (bool)$value; - return $this; - } - - /** - * Return last position flag - * - * @return bool - */ - public function getIsLast() - { - return $this->_isLast; - } - - /** - * Set last list flag - * - * @param bool $value - * return \Magento\Page\Block\Template\Links\Block - */ - public function setIsLast($value) - { - $this->_isLast = (bool)$value; - return $this; - } - - /** - * Return link label - * - * @return string - */ - public function getLabel() - { - return $this->_label; - } - - /** - * Return link title - * - * @return string - */ - public function getTitle() - { - return $this->_title; - } - - /** - * Return link url - * - * @return string - */ - public function getLinkUrl() - { - return $this->_url; - } - -} diff --git a/app/code/Magento/Page/Helper/Robots.php b/app/code/Magento/Page/Helper/Robots.php deleted file mode 100644 index 3ceaa0738d3..00000000000 --- a/app/code/Magento/Page/Helper/Robots.php +++ /dev/null @@ -1,70 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Page - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -/** - * Helper for "Search Engine Robots" functionality - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Page\Helper; - -class Robots extends \Magento\App\Helper\AbstractHelper -{ - const XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS = 'design/search_engine_robots/default_custom_instructions'; - - /** - * @var \Magento\Core\Model\Config - */ - protected $_coreConfig; - - /** - * Constructor - * - * @param \Magento\App\Helper\Context $context - * @param \Magento\Core\Model\Config $coreConfig - */ - public function __construct( - \Magento\App\Helper\Context $context, - \Magento\Core\Model\Config $coreConfig - ) { - parent::__construct( - $context - ); - $this->_coreConfig = $coreConfig; - } - - /** - * Get default value of custom instruction in robots.txt from config - * - * @return string - */ - public function getRobotsDefaultCustomInstructions() - { - return trim((string)$this->_coreConfig->getValue(self::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS, 'default')); - } -} diff --git a/app/code/Magento/Page/etc/config.xml b/app/code/Magento/Page/etc/config.xml deleted file mode 100644 index ed801ae2e29..00000000000 --- a/app/code/Magento/Page/etc/config.xml +++ /dev/null @@ -1,80 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Page - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<config> - <default> - <design> - <head translate="default_description"> - <default_title>Magento Commerce</default_title> - <default_description>Default Description</default_description> - <default_keywords>Magento, Varien, E-commerce</default_keywords> - <default_media_type>text/html</default_media_type> - <default_charset>utf-8</default_charset> - </head> - <search_engine_robots> - <default_robots>INDEX,FOLLOW</default_robots> - <default_custom_instructions> - <![CDATA[ -User-agent: * -Disallow: /index.php/ -Disallow: /*? -Disallow: /*.js$ -Disallow: /*.css$ -Disallow: /checkout/ -Disallow: /app/ -Disallow: /downloader/ -Disallow: /js/ -Disallow: /lib/ -Disallow: /*.php$ -Disallow: /pkginfo/ -Disallow: /report/ -Disallow: /var/ -Disallow: /catalog/ -Disallow: /customer/ -Disallow: /sendfriend/ -Disallow: /review/ -Disallow: /*SID= - ]]> - </default_custom_instructions> - </search_engine_robots> - <header translate="welcome"> - <logo_alt>Magento Commerce</logo_alt> - <welcome>Default welcome msg!</welcome> - </header> - <footer translate="copyright"> - <copyright>&copy; 2013 Magento Demo Store. All Rights Reserved.</copyright> - </footer> - </design> - <system> - <media_storage_configuration> - <allowed_resources> - <site_favicons>favicon</site_favicons> - </allowed_resources> - </media_storage_configuration> - </system> - </default> -</config> diff --git a/app/code/Magento/Page/etc/di.xml b/app/code/Magento/Page/etc/di.xml deleted file mode 100644 index 7c75b50d25b..00000000000 --- a/app/code/Magento/Page/etc/di.xml +++ /dev/null @@ -1,57 +0,0 @@ -<?xml version="1.0"?> -<!-- -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ ---> -<config> - <type name="Magento\Core\Model\Page"> - <param name="assets"> - <instance type="Magento\Page\Model\Asset\GroupedCollection" /> - </param> - </type> - <type name="Magento\Page\Model\Asset\GroupedCollection" shared="false" /> - <type name="Magento\Page\Model\Config\Reader"> - <param name="fileName"> - <value>page_layouts.xml</value> - </param> - <param name="converter"> - <instance type="Magento\Page\Model\Config\Converter" /> - </param> - <param name="schemaLocator"> - <instance type="Magento\Page\Model\Config\SchemaLocator" /> - </param> - </type> - <virtualType name="Magento\Page\Model\Config\Data" type="Magento\Config\Data"> - <param name='reader'> - <instance type="Magento\Page\Model\Config\Reader" /> - </param> - <param name="cacheId"> - <value>page_layouts_config</value> - </param> - </virtualType> - <type name="Magento\Page\Model\Config"> - <param name="dataStorage"> - <instance type="Magento\Page\Model\Config\Data" /> - </param> - </type> -</config> diff --git a/app/code/Magento/Page/view/frontend/js/splitbutton.js b/app/code/Magento/Page/view/frontend/js/splitbutton.js deleted file mode 100644 index 9f2418eb54e..00000000000 --- a/app/code/Magento/Page/view/frontend/js/splitbutton.js +++ /dev/null @@ -1,74 +0,0 @@ -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Academic Free License (AFL 3.0) - * that is bundled with this package in the file LICENSE_AFL.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/afl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Persistent - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) - */ - -/*jshint browser:true jquery:true*/ -(function($, undefined) { - "use strict"; - $.widget('mage.splitButton', { - /** - * options with default values - */ - options: { - splitButton: '.split-button', - arrowButton: '.change', - activeClass: 'active' - }, - - /** - * Initialize split button events - * @private - */ - _create: function() { - $(document).on('click', this.options.splitButton + ' > ' + this.options.arrowButton, $.proxy(this._toggleDropDown, this)); - $(document).on('click', $.proxy(this._hideDropDown, this)); - }, - - /** - * Toggle css class for the split button to hide or show drop down menu - * Saves current state of the target. Closes all open drop downs and then - * depending on the stored state the target drop down is toggled. - * @private - * @param {Object} e - */ - _toggleDropDown: function(e) { - var state = $(e.target).closest(this.options.splitButton).hasClass(this.options.activeClass); - this._hideDropDown(); - if (state) { - this._hideDropDown(); - } else { - $(e.target).closest(this.options.splitButton).addClass(this.options.activeClass); - } - return false; - }, - - /** - * Hide all the drop down menus when clicked any where on the page - * @private - */ - _hideDropDown: function() { - $(document).find(this.options.splitButton).removeClass(this.options.activeClass); - } - }); -})(jQuery); diff --git a/app/code/Magento/PageCache/Block/Adminhtml/Cache/Additional.php b/app/code/Magento/PageCache/Block/Adminhtml/Cache/Additional.php index 89e03c5a3da..06da984fad2 100644 --- a/app/code/Magento/PageCache/Block/Adminhtml/Cache/Additional.php +++ b/app/code/Magento/PageCache/Block/Adminhtml/Cache/Additional.php @@ -42,20 +42,18 @@ class Additional extends \Magento\Backend\Block\Template */ protected $_pageCacheData = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\PageCache\Helper\Data $pageCacheData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\PageCache\Helper\Data $pageCacheData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\PageCache\Helper\Data $pageCacheData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\PageCache\Helper\Data $pageCacheData, + array $data = array() + ) { $this->_pageCacheData = $pageCacheData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/PageCache/Helper/Data.php b/app/code/Magento/PageCache/Helper/Data.php index 7bc45d76bd1..af498dc6131 100644 --- a/app/code/Magento/PageCache/Helper/Data.php +++ b/app/code/Magento/PageCache/Helper/Data.php @@ -64,15 +64,15 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_coreStoreConfig; /** - * @param \Magento\App\Helper\Context $context + * @param \Magento\App\Helper\Context $context * @param \Magento\PageCache\Model\CacheControlFactory $ccFactory - * @param \Magento\Core\Model\Cookie $cookie - * @param \Magento\Core\Model\Store\Config $coreStoreConfig + * @param \Magento\Stdlib\Cookie $cookie + * @param \Magento\Core\Model\Store\Config $coreStoreConfig */ function __construct( \Magento\App\Helper\Context $context, \Magento\PageCache\Model\CacheControlFactory $ccFactory, - \Magento\Core\Model\Cookie $cookie, + \Magento\Stdlib\Cookie $cookie, \Magento\Core\Model\Store\Config $coreStoreConfig ) { parent::__construct($context); @@ -114,7 +114,9 @@ class Data extends \Magento\App\Helper\AbstractHelper if ($this->_isNoCacheCookieLocked) { return $this; } - $lifetime = $lifetime !== null ? $lifetime : $this->_coreStoreConfig->getConfig(self::XML_PATH_EXTERNAL_CACHE_LIFETIME); + $lifetime = $lifetime !== null + ? $lifetime + : $this->_coreStoreConfig->getConfig(self::XML_PATH_EXTERNAL_CACHE_LIFETIME); if ($this->_cookie->get(self::NO_CACHE_COOKIE)) { $this->_cookie->renew(self::NO_CACHE_COOKIE, $lifetime); } else { @@ -131,7 +133,7 @@ class Data extends \Magento\App\Helper\AbstractHelper public function removeNoCacheCookie() { if (!$this->_isNoCacheCookieLocked) { - $this->_cookie->delete(self::NO_CACHE_COOKIE); + $this->_cookie->set(self::NO_CACHE_COOKIE, null); } return $this; } @@ -155,7 +157,7 @@ class Data extends \Magento\App\Helper\AbstractHelper */ public function unlockNoCacheCookie() { - $this->_cookie->delete(self::NO_CACHE_LOCK_COOKIE); + $this->_cookie->set(self::NO_CACHE_LOCK_COOKIE, null); $this->_isNoCacheCookieLocked = false; return $this; } diff --git a/app/code/Magento/PageCache/view/frontend/layout/catalog_product_view.xml b/app/code/Magento/PageCache/view/frontend/layout/catalog_product_view.xml index 773199f930a..129c5e9fa62 100644 --- a/app/code/Magento/PageCache/view/frontend/layout/catalog_product_view.xml +++ b/app/code/Magento/PageCache/view/frontend/layout/catalog_product_view.xml @@ -25,6 +25,6 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="content"> - <block class="Magento\View\Block\Template" name="external.pagecache.cookie" template="Magento_PageCache::cookie.phtml"/> + <block class="Magento\View\Element\Template" name="external.pagecache.cookie" template="Magento_PageCache::cookie.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Paygate/Block/Authorizenet/Info/Cc.php b/app/code/Magento/Paygate/Block/Authorizenet/Info/Cc.php index aa2419e2929..b8796c1f1db 100644 --- a/app/code/Magento/Paygate/Block/Authorizenet/Info/Cc.php +++ b/app/code/Magento/Paygate/Block/Authorizenet/Info/Cc.php @@ -26,6 +26,8 @@ namespace Magento\Paygate\Block\Authorizenet\Info; +use Magento\Payment\Block\Info; + class Cc extends \Magento\Payment\Block\Info\Cc { /** @@ -37,6 +39,27 @@ class Cc extends \Magento\Payment\Block\Info\Cc protected $_template = 'Magento_Paygate::info/cc.phtml'; + /** + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\Payment\Model\Config $paymentConfig + * @param \Magento\Core\Helper\Data $coreData + * @param array $data + */ + public function __construct( + \Magento\View\Element\Template\Context $context, + \Magento\Payment\Model\Config $paymentConfig, + \Magento\Core\Helper\Data $coreData, + array $data = array() + ) { + $this->_coreData = $coreData; + parent::__construct($context, $paymentConfig, $data); + } + /** * Render as PDF * diff --git a/app/code/Magento/Payment/Block/Catalog/Product/View/Profile.php b/app/code/Magento/Payment/Block/Catalog/Product/View/Profile.php index 5577a9c0e21..14568cb69cd 100644 --- a/app/code/Magento/Payment/Block/Catalog/Product/View/Profile.php +++ b/app/code/Magento/Payment/Block/Catalog/Product/View/Profile.php @@ -27,7 +27,7 @@ */ namespace Magento\Payment\Block\Catalog\Product\View; -class Profile extends \Magento\View\Block\Template +class Profile extends \Magento\View\Element\Template { /** * Recurring profile instance @@ -52,20 +52,18 @@ class Profile extends \Magento\View\Block\Template protected $_profileFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Payment\Model\Recurring\ProfileFactory $profileFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Payment\Model\Recurring\ProfileFactory $profileFactory, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_registry = $registry; $this->_profileFactory = $profileFactory; } @@ -97,7 +95,7 @@ class Profile extends \Magento\View\Block\Template if ($this->_profile->getStartDateIsEditable()) { $this->setDateHtmlId('recurring_start_date'); $calendar = $this->getLayout() - ->createBlock('Magento\View\Block\Html\Date') + ->createBlock('Magento\View\Element\Html\Date') ->setId('recurring_start_date') ->setName(\Magento\Payment\Model\Recurring\Profile::BUY_REQUEST_START_DATETIME) ->setClass('datetime-picker input-text') diff --git a/app/code/Magento/Payment/Block/Form.php b/app/code/Magento/Payment/Block/Form.php index 15536b24333..7106e22e882 100644 --- a/app/code/Magento/Payment/Block/Form.php +++ b/app/code/Magento/Payment/Block/Form.php @@ -29,7 +29,7 @@ */ namespace Magento\Payment\Block; -class Form extends \Magento\View\Block\Template +class Form extends \Magento\View\Element\Template { /** * Retrieve payment method model diff --git a/app/code/Magento/Payment/Block/Form/Cc.php b/app/code/Magento/Payment/Block/Form/Cc.php index 48245e15900..86cbe83c24f 100644 --- a/app/code/Magento/Payment/Block/Form/Cc.php +++ b/app/code/Magento/Payment/Block/Form/Cc.php @@ -39,18 +39,16 @@ class Cc extends \Magento\Payment\Block\Form protected $_paymentConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Payment\Model\Config $paymentConfig * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Payment\Model\Config $paymentConfig, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_paymentConfig = $paymentConfig; } diff --git a/app/code/Magento/Payment/Block/Form/Container.php b/app/code/Magento/Payment/Block/Form/Container.php index 1ae3e7242ec..f20abbce92e 100644 --- a/app/code/Magento/Payment/Block/Form/Container.php +++ b/app/code/Magento/Payment/Block/Form/Container.php @@ -35,7 +35,7 @@ */ namespace Magento\Payment\Block\Form; -class Container extends \Magento\View\Block\Template +class Container extends \Magento\View\Element\Template { /** * Prepare children blocks diff --git a/app/code/Magento/Payment/Block/Info.php b/app/code/Magento/Payment/Block/Info.php index 7baed204b2b..4ccd4762583 100644 --- a/app/code/Magento/Payment/Block/Info.php +++ b/app/code/Magento/Payment/Block/Info.php @@ -29,7 +29,7 @@ */ namespace Magento\Payment\Block; -class Info extends \Magento\View\Block\Template +class Info extends \Magento\View\Element\Template { /** * Payment rendered specific information diff --git a/app/code/Magento/Payment/Block/Info/AbstractContainer.php b/app/code/Magento/Payment/Block/Info/AbstractContainer.php index cf9e7f12252..498804dd3f0 100644 --- a/app/code/Magento/Payment/Block/Info/AbstractContainer.php +++ b/app/code/Magento/Payment/Block/Info/AbstractContainer.php @@ -33,7 +33,7 @@ */ namespace Magento\Payment\Block\Info; -abstract class AbstractContainer extends \Magento\View\Block\Template +abstract class AbstractContainer extends \Magento\View\Element\Template { /** * Payment data @@ -43,19 +43,17 @@ abstract class AbstractContainer extends \Magento\View\Block\Template protected $_paymentData = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Payment\Helper\Data $paymentData * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Payment\Helper\Data $paymentData, array $data = array() ) { $this->_paymentData = $paymentData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Payment/Block/Info/Cc.php b/app/code/Magento/Payment/Block/Info/Cc.php index 7e4ce2c7265..779c219025b 100644 --- a/app/code/Magento/Payment/Block/Info/Cc.php +++ b/app/code/Magento/Payment/Block/Info/Cc.php @@ -39,18 +39,16 @@ class Cc extends \Magento\Payment\Block\Info protected $_paymentConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Payment\Model\Config $paymentConfig * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Payment\Model\Config $paymentConfig, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_paymentConfig = $paymentConfig; } /** diff --git a/app/code/Magento/Payment/Helper/Data.php b/app/code/Magento/Payment/Helper/Data.php index ccf2dc17c03..e6a94db8300 100644 --- a/app/code/Magento/Payment/Helper/Data.php +++ b/app/code/Magento/Payment/Helper/Data.php @@ -177,7 +177,7 @@ class Data extends \Magento\App\Helper\AbstractHelper * Retrieve payment information block * * @param \Magento\Payment\Model\Info $info - * @return \Magento\View\Block\Template + * @return \Magento\View\Element\Template */ public function getInfoBlock(\Magento\Payment\Model\Info $info) { diff --git a/app/code/Magento/Payment/Model/Billing/AbstractAgreement.php b/app/code/Magento/Payment/Model/Billing/AbstractAgreement.php index c74ffc2bd13..1239e5dbaf9 100644 --- a/app/code/Magento/Payment/Model/Billing/AbstractAgreement.php +++ b/app/code/Magento/Payment/Model/Billing/AbstractAgreement.php @@ -79,17 +79,17 @@ abstract class AbstractAgreement extends \Magento\Core\Model\AbstractModel protected $_paymentData = null; /** - * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Payment/Model/Info.php b/app/code/Magento/Payment/Model/Info.php index 15a7d07acde..aa918498f4c 100644 --- a/app/code/Magento/Payment/Model/Info.php +++ b/app/code/Magento/Payment/Model/Info.php @@ -51,18 +51,18 @@ class Info extends \Magento\Core\Model\AbstractModel protected $_encryptor; /** - * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Payment\Helper\Data $paymentData, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Payment/Model/Recurring/Profile.php b/app/code/Magento/Payment/Model/Recurring/Profile.php index e73f9fc19f7..9958e2fdbae 100644 --- a/app/code/Magento/Payment/Model/Recurring/Profile.php +++ b/app/code/Magento/Payment/Model/Recurring/Profile.php @@ -93,17 +93,17 @@ class Profile extends \Magento\Core\Model\AbstractModel protected $_paymentData = null; /** - * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php index ca41e7aa837..9a9c28e9f7e 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/Settlement/Details/Form.php @@ -36,24 +36,22 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_settlement; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Paypal\Model\Report\Settlement $settlement - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Paypal\Model\Report\Settlement $settlement + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Paypal\Model\Report\Settlement $settlement, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Paypal\Model\Report\Settlement $settlement, + array $data = array() + ) { $this->_settlement = $settlement; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php index 41080a46a66..06698a1170b 100644 --- a/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php +++ b/app/code/Magento/Paypal/Block/Adminhtml/System/Config/Fieldset/Store.php @@ -49,17 +49,15 @@ class Store /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Config $coreConfig * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Config $coreConfig, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_coreConfig = $coreConfig; } diff --git a/app/code/Magento/Paypal/Block/Express/Form.php b/app/code/Magento/Paypal/Block/Express/Form.php index 5583bc112b5..f9f5ff5aa29 100644 --- a/app/code/Magento/Paypal/Block/Express/Form.php +++ b/app/code/Magento/Paypal/Block/Express/Form.php @@ -51,16 +51,14 @@ class Form extends \Magento\Paypal\Block\Standard\Form protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Paypal\Model\ConfigFactory $paypalConfigFactory * @param \Magento\Paypal\Helper\Data $paypalData * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Paypal\Model\ConfigFactory $paypalConfigFactory, \Magento\Paypal\Helper\Data $paypalData, \Magento\Customer\Model\Session $customerSession, @@ -68,7 +66,7 @@ class Form extends \Magento\Paypal\Block\Standard\Form ) { $this->_paypalData = $paypalData; $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $paypalConfigFactory, $data); + parent::__construct($context, $paypalConfigFactory, $data); } /** @@ -84,7 +82,7 @@ class Form extends \Magento\Paypal\Block\Standard\Form /** * Set data to block * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Paypal/Block/Express/Review.php b/app/code/Magento/Paypal/Block/Express/Review.php index 6f55be3452b..6d2cf3c07bf 100644 --- a/app/code/Magento/Paypal/Block/Express/Review.php +++ b/app/code/Magento/Paypal/Block/Express/Review.php @@ -33,7 +33,7 @@ */ namespace Magento\Paypal\Block\Express; -class Review extends \Magento\View\Block\Template +class Review extends \Magento\View\Element\Template { /** * @var \Magento\Sales\Model\Quote diff --git a/app/code/Magento/Paypal/Block/Express/Shortcut.php b/app/code/Magento/Paypal/Block/Express/Shortcut.php index 202a726da88..0812475998d 100644 --- a/app/code/Magento/Paypal/Block/Express/Shortcut.php +++ b/app/code/Magento/Paypal/Block/Express/Shortcut.php @@ -29,7 +29,7 @@ */ namespace Magento\Paypal\Block\Express; -class Shortcut extends \Magento\View\Block\Template +class Shortcut extends \Magento\View\Element\Template { /** * Position of "OR" label against shortcut @@ -112,8 +112,7 @@ class Shortcut extends \Magento\View\Block\Template protected $mathRandom; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Paypal\Helper\Data $paypalData * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Registry $registry @@ -125,8 +124,7 @@ class Shortcut extends \Magento\View\Block\Template * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Paypal\Helper\Data $paypalData, \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Registry $registry, @@ -145,11 +143,11 @@ class Shortcut extends \Magento\View\Block\Template $this->_checkoutSession = $checkoutSession; $this->_checkoutFactory = $checkoutFactory; $this->mathRandom = $mathRandom; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Paypal/Block/Iframe.php b/app/code/Magento/Paypal/Block/Iframe.php index 2e8eb96bad9..99d2ca240f3 100644 --- a/app/code/Magento/Paypal/Block/Iframe.php +++ b/app/code/Magento/Paypal/Block/Iframe.php @@ -75,22 +75,20 @@ class Iframe extends \Magento\Payment\Block\Form protected $_checkoutSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Checkout\Model\Session $checkoutSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Checkout\Model\Session $checkoutSession, array $data = array() ) { $this->_orderFactory = $orderFactory; $this->_checkoutSession = $checkoutSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -164,7 +162,7 @@ class Iframe extends \Magento\Payment\Block\Form /** * Before rendering html, check if is block rendering needed * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Paypal/Block/Logo.php b/app/code/Magento/Paypal/Block/Logo.php index c07fcde8f2b..909243ffd23 100644 --- a/app/code/Magento/Paypal/Block/Logo.php +++ b/app/code/Magento/Paypal/Block/Logo.php @@ -29,7 +29,7 @@ */ namespace Magento\Paypal\Block; -class Logo extends \Magento\View\Block\Template +class Logo extends \Magento\View\Element\Template { /** * @var \Magento\Paypal\Model\Config @@ -37,19 +37,17 @@ class Logo extends \Magento\View\Block\Template protected $_paypalConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Paypal\Model\Config $paypalConfig * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Paypal\Model\Config $paypalConfig, array $data = array() ) { $this->_paypalConfig = $paypalConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php b/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php index dd80bd9909a..c2f1780a0f9 100644 --- a/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php +++ b/app/code/Magento/Paypal/Block/Payflow/Link/Iframe.php @@ -39,23 +39,21 @@ class Iframe extends \Magento\Paypal\Block\Iframe protected $_paymentData = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Payment\Helper\Data $paymentData * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Payment\Helper\Data $paymentData, array $data = array() ) { $this->_paymentData = $paymentData; - parent::__construct($context, $coreData, $orderFactory, $checkoutSession, $data); + parent::__construct($context, $orderFactory, $checkoutSession, $data); } /** diff --git a/app/code/Magento/Paypal/Block/Payment/Info.php b/app/code/Magento/Paypal/Block/Payment/Info.php index 43185675a35..8a5091a426d 100644 --- a/app/code/Magento/Paypal/Block/Payment/Info.php +++ b/app/code/Magento/Paypal/Block/Payment/Info.php @@ -38,21 +38,19 @@ class Info extends \Magento\Payment\Block\Info\Cc protected $_paypalInfoFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Payment\Model\Config $paymentConfig * @param \Magento\Paypal\Model\InfoFactory $paypalInfoFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Payment\Model\Config $paymentConfig, \Magento\Paypal\Model\InfoFactory $paypalInfoFactory, array $data = array() ) { $this->_paypalInfoFactory = $paypalInfoFactory; - parent::__construct($context, $coreData, $paymentConfig, $data); + parent::__construct($context, $paymentConfig, $data); } /** diff --git a/app/code/Magento/Paypal/Block/Standard/Form.php b/app/code/Magento/Paypal/Block/Standard/Form.php index 24b4c428152..a55739f86c2 100644 --- a/app/code/Magento/Paypal/Block/Standard/Form.php +++ b/app/code/Magento/Paypal/Block/Standard/Form.php @@ -50,19 +50,17 @@ class Form extends \Magento\Payment\Block\Form protected $_paypalConfigFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Paypal\Model\ConfigFactory $paypalConfigFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Paypal\Model\ConfigFactory $paypalConfigFactory, array $data = array() ) { $this->_paypalConfigFactory = $paypalConfigFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -71,8 +69,8 @@ class Form extends \Magento\Payment\Block\Form protected function _construct() { $this->_config = $this->_paypalConfigFactory->create()->setMethod($this->getMethodCode()); - /** @var $mark \Magento\View\Block\Template */ - $mark = $this->_layout->createBlock('Magento\View\Block\Template'); + /** @var $mark \Magento\View\Element\Template */ + $mark = $this->_layout->createBlock('Magento\View\Element\Template'); $mark->setTemplate('Magento_Paypal::payment/mark.phtml') ->setPaymentAcceptanceMarkHref($this->_config->getPaymentMarkWhatIsPaypalUrl($this->_locale)) ->setPaymentAcceptanceMarkSrc($this->_config->getPaymentMarkImageUrl($this->_locale->getLocaleCode())); diff --git a/app/code/Magento/Paypal/Block/Standard/Redirect.php b/app/code/Magento/Paypal/Block/Standard/Redirect.php index 7756aae0040..4a4f077c901 100644 --- a/app/code/Magento/Paypal/Block/Standard/Redirect.php +++ b/app/code/Magento/Paypal/Block/Standard/Redirect.php @@ -25,7 +25,7 @@ */ namespace Magento\Paypal\Block\Standard; -class Redirect extends \Magento\View\Block\AbstractBlock +class Redirect extends \Magento\View\Element\AbstractBlock { /** * @var \Magento\Data\FormFactory @@ -48,7 +48,7 @@ class Redirect extends \Magento\View\Block\AbstractBlock protected $mathRandom; /** - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Data\Form\Element\Factory $elementFactory * @param \Magento\Paypal\Model\StandardFactory $paypalStandardFactory @@ -56,7 +56,7 @@ class Redirect extends \Magento\View\Block\AbstractBlock * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\Data\FormFactory $formFactory, \Magento\Data\Form\Element\Factory $elementFactory, \Magento\Paypal\Model\StandardFactory $paypalStandardFactory, diff --git a/app/code/Magento/Paypal/Helper/Checkout.php b/app/code/Magento/Paypal/Helper/Checkout.php index 0631e8b5d99..8d82dada502 100644 --- a/app/code/Magento/Paypal/Helper/Checkout.php +++ b/app/code/Magento/Paypal/Helper/Checkout.php @@ -27,7 +27,7 @@ */ namespace Magento\Paypal\Helper; -class Checkout extends \Magento\App\Helper\AbstractHelper +class Checkout { /** * @var \Magento\Checkout\Model\SessionFactory diff --git a/app/code/Magento/Paypal/Helper/Data.php b/app/code/Magento/Paypal/Helper/Data.php index e74fa3a260e..4e998b6cbca 100644 --- a/app/code/Magento/Paypal/Helper/Data.php +++ b/app/code/Magento/Paypal/Helper/Data.php @@ -49,13 +49,13 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_agreementFactory; /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Sales\Model\Billing\AgreementFactory $agreementFactory */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\App\Helper\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Sales\Model\Billing\AgreementFactory $agreementFactory ) { $this->_coreData = $coreData; diff --git a/app/code/Magento/Paypal/Model/Observer.php b/app/code/Magento/Paypal/Model/Observer.php index bf3d0d42e12..95001ff51f6 100644 --- a/app/code/Magento/Paypal/Model/Observer.php +++ b/app/code/Magento/Paypal/Model/Observer.php @@ -156,10 +156,7 @@ class Observer if ($payment && in_array($payment->getMethod(), $this->_paypalHss->getHssMethods())) { /* @var $controller \Magento\App\Action\Action */ $controller = $observer->getEvent()->getData('controller_action'); - $result = $this->_coreData->jsonDecode( - $controller->getResponse()->getBody('default'), - \Zend_Json::TYPE_ARRAY - ); + $result = $this->_coreData->jsonDecode($controller->getResponse()->getBody('default')); if (empty($result['error'])) { $this->_view->loadLayout('checkout_onepage_review'); diff --git a/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php b/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php index 9bbf8b65aa3..51d8d2d943c 100644 --- a/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php +++ b/app/code/Magento/Paypal/Model/System/Config/Backend/MerchantCountry.php @@ -39,21 +39,21 @@ class MerchantCountry extends \Magento\Core\Model\Config\Value protected $_coreData; /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, + \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Paypal/etc/module.xml b/app/code/Magento/Paypal/etc/module.xml index ddab4ebe5d1..dcb5fbc9763 100755 --- a/app/code/Magento/Paypal/etc/module.xml +++ b/app/code/Magento/Paypal/etc/module.xml @@ -40,7 +40,7 @@ <module name="Magento_Backend"/> <module name="Magento_Tax"/> <module name="Magento_Directory"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> <module name="Magento_Centinel"/> </depends> </module> diff --git a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml index 111ee6f1796..ad591c87467 100644 --- a/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml +++ b/app/code/Magento/Paypal/view/adminhtml/layout/adminhtml_system_config_edit.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-paypal-styles-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-paypal-styles-css"> <arguments> <argument name="file" xsi:type="string">Magento_Paypal::styles.css</argument> </arguments> diff --git a/app/code/Magento/Paypal/view/frontend/express/review.phtml b/app/code/Magento/Paypal/view/frontend/express/review.phtml index 4da5cd85e50..25417eff442 100644 --- a/app/code/Magento/Paypal/view/frontend/express/review.phtml +++ b/app/code/Magento/Paypal/view/frontend/express/review.phtml @@ -30,7 +30,7 @@ $shippingAddress = $this->getShippingAddress(); <hgroup class="page title"> <h1 class="title"><span class="base"><?php echo __('Review Order') ?></span></h1> </hgroup> -<?php echo $this->getMessagesBlock()->toHtml() ?> +<?php echo $this->getLayout()->getMessagesBlock()->toHtml() ?> <div class="paypal review view"> <div class="paypal subtitle caption"><strong>Please confirm your addresses</strong></div> diff --git a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml index 7f3dda071f2..60f67beed9f 100644 --- a/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml +++ b/app/code/Magento/Paypal/view/frontend/layout/paypal_express_review.xml @@ -52,5 +52,5 @@ as="agreements" template="onepage/agreements.phtml"/> </block> </referenceContainer> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Persistent/Block/Form/Remember.php b/app/code/Magento/Persistent/Block/Form/Remember.php index 249c6320ff1..0ca27a09770 100644 --- a/app/code/Magento/Persistent/Block/Form/Remember.php +++ b/app/code/Magento/Persistent/Block/Form/Remember.php @@ -34,7 +34,7 @@ namespace Magento\Persistent\Block\Form; -class Remember extends \Magento\View\Block\Template +class Remember extends \Magento\View\Element\Template { /** * Persistent data @@ -49,22 +49,20 @@ class Remember extends \Magento\View\Block\Template protected $mathRandom; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Persistent\Helper\Data $persistentData * @param \Magento\Math\Random $mathRandom * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Persistent\Helper\Data $persistentData, \Magento\Math\Random $mathRandom, array $data = array() ) { $this->_persistentData = $persistentData; $this->mathRandom = $mathRandom; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Persistent/Block/Header/Additional.php b/app/code/Magento/Persistent/Block/Header/Additional.php index 9a748b9526c..52094da7e11 100644 --- a/app/code/Magento/Persistent/Block/Header/Additional.php +++ b/app/code/Magento/Persistent/Block/Header/Additional.php @@ -34,7 +34,7 @@ namespace Magento\Persistent\Block\Header; -class Additional extends \Magento\View\Block\Html\Link +class Additional extends \Magento\View\Element\Html\Link { /** * Persistent session @@ -44,19 +44,17 @@ class Additional extends \Magento\View\Block\Html\Link protected $_persistentSession = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Persistent\Helper\Session $persistentSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Persistent\Helper\Session $persistentSession, array $data = array() ) { $this->_persistentSession = $persistentSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Persistent/Controller/Index.php b/app/code/Magento/Persistent/Controller/Index.php index 3c688069565..29c57019dd0 100644 --- a/app/code/Magento/Persistent/Controller/Index.php +++ b/app/code/Magento/Persistent/Controller/Index.php @@ -135,7 +135,7 @@ class Index extends \Magento\App\Action\Action ->setCustomerId(null) ->setCustomerGroupId(null); if ($this->_clearCheckoutSession) { - $this->_checkoutSession->unsetAll(); + $this->_checkoutSession->clearStorage(); } $this->_getHelper()->getSession()->removePersistentCookie(); return $this; diff --git a/app/code/Magento/Persistent/Model/Observer.php b/app/code/Magento/Persistent/Model/Observer.php index 4ccc784c9fc..8abbc6edf14 100644 --- a/app/code/Magento/Persistent/Model/Observer.php +++ b/app/code/Magento/Persistent/Model/Observer.php @@ -231,7 +231,7 @@ class Observer return $this; } - /** @var $block \Magento\View\Block\AbstractBlock */ + /** @var $block \Magento\View\Element\AbstractBlock */ $block = $observer->getEvent()->getBlock(); if (!$block) { @@ -257,7 +257,7 @@ class Observer /** * Emulate 'welcome' block with persistent data * - * @param \Magento\View\Block\AbstractBlock $block + * @param \Magento\View\Element\AbstractBlock $block * @return \Magento\Persistent\Model\Observer */ public function emulateWelcomeBlock($block) @@ -284,7 +284,7 @@ class Observer /** * Emulate 'top links' block with persistent data * - * @param \Magento\View\Block\AbstractBlock $block + * @param \Magento\View\Element\AbstractBlock $block */ public function emulateTopLinks($block) { @@ -566,7 +566,7 @@ class Observer && !$this->_persistentData->isShoppingCartPersist() && !$quote->getIsPersistent() ) { - $this->_checkoutSession->unsetAll(); + $this->_checkoutSession->clearQuote()->clearStorage(); return; } @@ -619,7 +619,7 @@ class Observer { $quote = $this->_checkoutSession->setLoadInactive()->getQuote(); if ($quote->getIsActive() && $quote->getCustomerId()) { - $this->_checkoutSession->setCustomer(null)->unsetAll(); + $this->_checkoutSession->setCustomer(null)->clearQuote()->clearStorage(); } else { $quote->setIsActive(true) ->setIsPersistent(false) diff --git a/app/code/Magento/Persistent/Model/Observer/Session.php b/app/code/Magento/Persistent/Model/Observer/Session.php index 9cd0ceb598b..245b89f6736 100644 --- a/app/code/Magento/Persistent/Model/Observer/Session.php +++ b/app/code/Magento/Persistent/Model/Observer/Session.php @@ -61,7 +61,7 @@ class Session /** * Cookie model * - * @var \Magento\Core\Model\Cookie + * @var \Magento\Stdlib\Cookie */ protected $_cookie; @@ -86,7 +86,7 @@ class Session * @param \Magento\Persistent\Helper\Session $persistentSession * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Core\Model\Cookie $cookie + * @param \Magento\Stdlib\Cookie $cookie * @param \Magento\Persistent\Model\SessionFactory $sessionFactory */ public function __construct( @@ -94,7 +94,7 @@ class Session \Magento\Persistent\Helper\Session $persistentSession, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, - \Magento\Core\Model\Cookie $cookie, + \Magento\Stdlib\Cookie $cookie, \Magento\Persistent\Model\SessionFactory $sessionFactory ) { $this->_persistentData = $persistentData; diff --git a/app/code/Magento/Persistent/Model/Session.php b/app/code/Magento/Persistent/Model/Session.php index 18bc72cc3be..354d5a32079 100644 --- a/app/code/Magento/Persistent/Model/Session.php +++ b/app/code/Magento/Persistent/Model/Session.php @@ -82,7 +82,7 @@ class Session extends \Magento\Core\Model\AbstractModel /** * Cookie model * - * @var \Magento\Core\Model\Cookie + * @var \Magento\Stdlib\Cookie */ protected $_cookie; @@ -99,7 +99,7 @@ class Session extends \Magento\Core\Model\AbstractModel * @param \Magento\Core\Model\Config $coreConfig * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Persistent\Helper\Data $persistentData - * @param \Magento\Core\Model\Cookie $cookie + * @param \Magento\Stdlib\Cookie $cookie * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Math\Random $mathRandom * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -112,7 +112,7 @@ class Session extends \Magento\Core\Model\AbstractModel \Magento\Core\Model\Config $coreConfig, \Magento\Core\Helper\Data $coreData, \Magento\Persistent\Helper\Data $persistentData, - \Magento\Core\Model\Cookie $cookie, + \Magento\Stdlib\Cookie $cookie, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Math\Random $mathRandom, \Magento\Core\Model\Resource\AbstractResource $resource = null, @@ -268,7 +268,7 @@ class Session extends \Magento\Core\Model\AbstractModel */ public function removePersistentCookie() { - $this->_cookie->delete(\Magento\Persistent\Model\Session::COOKIE_NAME); + $this->_cookie->set(\Magento\Persistent\Model\Session::COOKIE_NAME, null); return $this; } @@ -305,8 +305,9 @@ class Session extends \Magento\Core\Model\AbstractModel * * @return \Magento\Core\Model\AbstractModel */ - protected function _afterDeleteCommit() { - $this->_cookie->delete(\Magento\Persistent\Model\Session::COOKIE_NAME); + protected function _afterDeleteCommit() + { + $this->_cookie->set(\Magento\Persistent\Model\Session::COOKIE_NAME, null, 0); return parent::_afterDeleteCommit(); } diff --git a/app/code/Magento/Persistent/etc/persistent.xml b/app/code/Magento/Persistent/etc/persistent.xml index 016f203c612..044f76275d7 100644 --- a/app/code/Magento/Persistent/etc/persistent.xml +++ b/app/code/Magento/Persistent/etc/persistent.xml @@ -32,13 +32,13 @@ <name_in_layout>header</name_in_layout> <class>Magento\Persistent\Model\Observer</class> <method>emulateWelcomeBlock</method> - <block_type>Magento\Page\Block\Html\Header</block_type> + <block_type>Magento\Theme\Block\Html\Header</block_type> </reference> <reference id="top_links"> <name_in_layout>top.links</name_in_layout> <class>Magento\Persistent\Model\Observer</class> <method>emulateTopLinks</method> - <block_type>Magento\Page\Block\Template\Links</block_type> + <block_type>Magento\Theme\Block\Template\Links</block_type> </reference> </blocks> </instances> diff --git a/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml b/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml index 71a0624c3df..461198c273a 100644 --- a/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml +++ b/app/code/Magento/Persistent/view/frontend/layout/checkout_onepage_index.xml @@ -26,10 +26,10 @@ <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="form.login.additional.info"> <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> - <block class="Magento\View\Block\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> + <block class="Magento\View\Element\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> </referenceContainer> <referenceContainer name="form.billing.additional.info"> <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me.billing" template="remember_me.phtml" before="-"/> - <block class="Magento\View\Block\Template" name="persistent.remember.me.tooltip.billing" template="Magento_Persistent::remember_me_tooltip.phtml"/> + <block class="Magento\View\Element\Template" name="persistent.remember.me.tooltip.billing" template="Magento_Persistent::remember_me_tooltip.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml b/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml index 448a2a52b69..4fc02398917 100644 --- a/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml +++ b/app/code/Magento/Persistent/view/frontend/layout/customer_account_create.xml @@ -26,6 +26,6 @@ <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="form.additional.info"> <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> - <block class="Magento\View\Block\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> + <block class="Magento\View\Element\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml b/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml index 448a2a52b69..4fc02398917 100644 --- a/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml +++ b/app/code/Magento/Persistent/view/frontend/layout/customer_account_login.xml @@ -26,6 +26,6 @@ <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceContainer name="form.additional.info"> <block class="Magento\Persistent\Block\Form\Remember" name="persistent.remember.me" template="remember_me.phtml" before="-"/> - <block class="Magento\View\Block\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> + <block class="Magento\View\Element\Template" name="persistent.remember.me.tooltip" template="Magento_Persistent::remember_me_tooltip.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Persistent/view/frontend/remember_me_tooltip.phtml b/app/code/Magento/Persistent/view/frontend/remember_me_tooltip.phtml index 918f120f611..955184f57ef 100644 --- a/app/code/Magento/Persistent/view/frontend/remember_me_tooltip.phtml +++ b/app/code/Magento/Persistent/view/frontend/remember_me_tooltip.phtml @@ -29,7 +29,7 @@ * "Remember Me" popup template (when click on "What's this?") * */ -/** @var $this \Magento\View\Block\Template */ +/** @var $this \Magento\View\Element\Template */ ?> <script type="text/javascript"> (function($) { diff --git a/app/code/Magento/ProductAlert/Block/Email/AbstractEmail.php b/app/code/Magento/ProductAlert/Block/Email/AbstractEmail.php index 0d125e31ce5..ceee4d8a5d3 100644 --- a/app/code/Magento/ProductAlert/Block/Email/AbstractEmail.php +++ b/app/code/Magento/ProductAlert/Block/Email/AbstractEmail.php @@ -33,7 +33,7 @@ */ namespace Magento\ProductAlert\Block\Email; -abstract class AbstractEmail extends \Magento\View\Block\Template +abstract class AbstractEmail extends \Magento\View\Element\Template { /** * Product collection array diff --git a/app/code/Magento/ProductAlert/Block/Product/View.php b/app/code/Magento/ProductAlert/Block/Product/View.php index 00e74527880..3c72adffd0f 100644 --- a/app/code/Magento/ProductAlert/Block/Product/View.php +++ b/app/code/Magento/ProductAlert/Block/Product/View.php @@ -29,7 +29,7 @@ */ namespace Magento\ProductAlert\Block\Product; -class View extends \Magento\View\Block\Template +class View extends \Magento\View\Element\Template { /** * @var \Magento\Core\Model\Registry @@ -51,20 +51,18 @@ class View extends \Magento\View\Block\Template protected $_helper; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\ProductAlert\Helper\Data $helper * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\ProductAlert\Helper\Data $helper, \Magento\Core\Model\Registry $registry, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_registry = $registry; $this->_helper = $helper; } diff --git a/app/code/Magento/ProductAlert/Helper/Data.php b/app/code/Magento/ProductAlert/Helper/Data.php index 2b2c68f40f3..c186694d561 100644 --- a/app/code/Magento/ProductAlert/Helper/Data.php +++ b/app/code/Magento/ProductAlert/Helper/Data.php @@ -136,8 +136,8 @@ class Data extends \Magento\Core\Helper\Url /** * Create block instance * - * @param string|\Magento\View\Block\AbstractBlock $block - * @return \Magento\View\Block\AbstractBlock + * @param string|\Magento\View\Element\AbstractBlock $block + * @return \Magento\View\Element\AbstractBlock * @throws \Magento\Core\Exception */ public function createBlock($block) @@ -147,7 +147,7 @@ class Data extends \Magento\Core\Helper\Url $block = $this->_layout->createBlock($block); } } - if (!$block instanceof \Magento\View\Block\AbstractBlock) { + if (!$block instanceof \Magento\View\Element\AbstractBlock) { throw new \Magento\Core\Exception(__('Invalid block type: %1', $block)); } return $block; diff --git a/app/code/Magento/ProductAlert/Model/Email.php b/app/code/Magento/ProductAlert/Model/Email.php index 61c1cc7d4a4..2446a6cd993 100644 --- a/app/code/Magento/ProductAlert/Model/Email.php +++ b/app/code/Magento/ProductAlert/Model/Email.php @@ -124,9 +124,9 @@ class Email extends \Magento\Core\Model\AbstractModel protected $_templateFactory; /** - * @param \Magento\ProductAlert\Helper\Data $productAlertData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\ProductAlert\Helper\Data $productAlertData * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\CustomerFactory $customerFactory @@ -137,9 +137,9 @@ class Email extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\ProductAlert\Helper\Data $productAlertData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\ProductAlert\Helper\Data $productAlertData, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\CustomerFactory $customerFactory, diff --git a/app/code/Magento/Rating/Block/Adminhtml/Edit.php b/app/code/Magento/Rating/Block/Adminhtml/Edit.php index 028e7078255..4c1233b3c78 100644 --- a/app/code/Magento/Rating/Block/Adminhtml/Edit.php +++ b/app/code/Magento/Rating/Block/Adminhtml/Edit.php @@ -46,23 +46,21 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container protected $_ratingFactory; protected $_blockGroup = 'Magento_Rating'; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Rating\Model\RatingFactory $ratingFactory - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Rating\Model\RatingFactory $ratingFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Rating\Model\RatingFactory $ratingFactory, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Rating\Model\RatingFactory $ratingFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_ratingFactory = $ratingFactory; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Form.php b/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Form.php index 93dd0c2fcdd..7cb0c24c52b 100644 --- a/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Form.php +++ b/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Form.php @@ -52,7 +52,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Rating\Model\Rating\OptionFactory $optionFactory @@ -63,7 +62,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Rating\Model\Rating\OptionFactory $optionFactory, @@ -75,7 +73,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic $this->_optionFactory = $optionFactory; $this->_session = $session; $this->_systemStore = $systemStore; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } diff --git a/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Options.php b/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Options.php index 5684753ad5e..a9787276ceb 100644 --- a/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Options.php +++ b/app/code/Magento/Rating/Block/Adminhtml/Edit/Tab/Options.php @@ -35,24 +35,22 @@ class Options extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_optionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Rating\Model\Rating\OptionFactory $optionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Rating\Model\Rating\OptionFactory $optionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Rating\Model\Rating\OptionFactory $optionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Rating\Model\Rating\OptionFactory $optionFactory, + array $data = array() + ) { $this->_optionFactory = $optionFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } diff --git a/app/code/Magento/Rating/Block/Entity/Detailed.php b/app/code/Magento/Rating/Block/Entity/Detailed.php index 8514e417ca4..b511f76f213 100644 --- a/app/code/Magento/Rating/Block/Entity/Detailed.php +++ b/app/code/Magento/Rating/Block/Entity/Detailed.php @@ -33,7 +33,7 @@ */ namespace Magento\Rating\Block\Entity; -class Detailed extends \Magento\View\Block\Template +class Detailed extends \Magento\View\Element\Template { /** * @var string @@ -46,19 +46,17 @@ class Detailed extends \Magento\View\Block\Template protected $_ratingFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Rating\Model\RatingFactory $ratingFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Rating\Model\RatingFactory $ratingFactory, array $data = array() ) { $this->_ratingFactory = $ratingFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Rating/Model/Resource/Rating.php b/app/code/Magento/Rating/Model/Resource/Rating.php index c7f415cc053..494f05937a8 100644 --- a/app/code/Magento/Rating/Model/Resource/Rating.php +++ b/app/code/Magento/Rating/Model/Resource/Rating.php @@ -57,16 +57,16 @@ class Rating extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_logger; /** + * @param \Magento\App\Resource $resource * @param \Magento\Logger $logger * @param \Magento\Rating\Helper\Data $ratingData - * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Review\Model\Resource\Review\Summary $reviewSummary */ public function __construct( + \Magento\App\Resource $resource, \Magento\Logger $logger, \Magento\Rating\Helper\Data $ratingData, - \Magento\App\Resource $resource, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Review\Model\Resource\Review\Summary $reviewSummary ) { diff --git a/app/code/Magento/Rating/Model/Resource/Rating/Collection.php b/app/code/Magento/Rating/Model/Resource/Rating/Collection.php index 2c8bbaf4012..3447aa2f82f 100644 --- a/app/code/Magento/Rating/Model/Resource/Rating/Collection.php +++ b/app/code/Magento/Rating/Model/Resource/Rating/Collection.php @@ -46,26 +46,28 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_ratingCollectionF; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Rating\Model\Resource\Rating\Option\CollectionFactory $ratingCollectionF + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Rating\Model\Resource\Rating\Option\CollectionFactory $ratingCollectionF, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_storeManager = $storeManager; $this->_ratingCollectionF = $ratingCollectionF; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Rating/Model/Resource/Rating/Grid/Collection.php b/app/code/Magento/Rating/Model/Resource/Rating/Grid/Collection.php index b720426d35f..5deac36da70 100644 --- a/app/code/Magento/Rating/Model/Resource/Rating/Grid/Collection.php +++ b/app/code/Magento/Rating/Model/Resource/Rating/Grid/Collection.php @@ -43,28 +43,38 @@ class Collection extends \Magento\Rating\Model\Resource\Rating\Collection protected $_coreRegistry = null; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Rating\Model\Resource\Rating\Option\CollectionFactory $ratingCollectionF * @param \Magento\Core\Model\Registry $coreRegistry + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Rating\Model\Resource\Rating\Option\CollectionFactory $ratingCollectionF, \Magento\Core\Model\Registry $coreRegistry, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_coreRegistry = $coreRegistry; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $storeManager, $ratingCollectionF, - $resource); + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $storeManager, + $ratingCollectionF, + $connection, + $resource + ); } /** diff --git a/app/code/Magento/Rating/Model/Resource/Rating/Option/Vote/Collection.php b/app/code/Magento/Rating/Model/Resource/Rating/Option/Vote/Collection.php index 705e0687f74..14c822830e8 100644 --- a/app/code/Magento/Rating/Model/Resource/Rating/Option/Vote/Collection.php +++ b/app/code/Magento/Rating/Model/Resource/Rating/Option/Vote/Collection.php @@ -48,26 +48,28 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_ratingCollectionF; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Rating\Model\Resource\Rating\Option\CollectionFactory $ratingCollectionF + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Rating\Model\Resource\Rating\Option\CollectionFactory $ratingCollectionF, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_storeManager = $storeManager; $this->_ratingCollectionF = $ratingCollectionF; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php b/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php index 3d1e86ac381..7756fa9b371 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Grid/AbstractGrid.php @@ -57,7 +57,6 @@ class AbstractGrid extends \Magento\Backend\Block\Widget\Grid\Extended /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Url $urlModel * @param \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory * @param \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory @@ -66,7 +65,6 @@ class AbstractGrid extends \Magento\Backend\Block\Widget\Grid\Extended */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Url $urlModel, \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory, \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory, @@ -76,7 +74,7 @@ class AbstractGrid extends \Magento\Backend\Block\Widget\Grid\Extended $this->_resourceFactory = $resourceFactory; $this->_collectionFactory = $collectionFactory; $this->_reportsData = $reportsData; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Reports/Block/Adminhtml/Product/Downloads/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Product/Downloads/Grid.php index 81b117d39eb..3d954099402 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Product/Downloads/Grid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Product/Downloads/Grid.php @@ -40,22 +40,20 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_downloadsFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Product\Downloads\CollectionFactory $downloadsFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Product\Downloads\CollectionFactory $downloadsFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Product\Downloads\CollectionFactory $downloadsFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Product\Downloads\CollectionFactory $downloadsFactory, + array $data = array() + ) { $this->_downloadsFactory = $downloadsFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Reports/Block/Adminhtml/Product/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Product/Grid.php index 7fc96321abc..85a1c2a5a54 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Product/Grid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Product/Grid.php @@ -40,22 +40,20 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Product\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Product\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Product\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Product\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Reports/Block/Adminhtml/Product/Lowstock/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Product/Lowstock/Grid.php index aada0221fe9..1c2cb24199a 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Product/Lowstock/Grid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Product/Lowstock/Grid.php @@ -40,22 +40,20 @@ class Grid extends \Magento\Backend\Block\Widget\Grid */ protected $_lowstocksFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Product\Lowstock\CollectionFactory $lowstocksFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Product\Lowstock\CollectionFactory $lowstocksFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Product\Lowstock\CollectionFactory $lowstocksFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Product\Lowstock\CollectionFactory $lowstocksFactory, + array $data = array() + ) { $this->_lowstocksFactory = $lowstocksFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Reports/Block/Adminhtml/Review/Detail.php b/app/code/Magento/Reports/Block/Adminhtml/Review/Detail.php index f8fb2d79dc0..a8ef09d4678 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Review/Detail.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Review/Detail.php @@ -41,20 +41,18 @@ class Detail extends \Magento\Adminhtml\Block\Widget\Grid\Container */ protected $_productFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\ProductFactory $productFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Reports/Block/Adminhtml/Review/Detail/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Review/Detail/Grid.php index ed52b112651..ac81efa1550 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Review/Detail/Grid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Review/Detail/Grid.php @@ -40,22 +40,20 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_reviewsFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Review\CollectionFactory $reviewsFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Review\CollectionFactory $reviewsFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Review\CollectionFactory $reviewsFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Review\CollectionFactory $reviewsFactory, + array $data = array() + ) { $this->_reviewsFactory = $reviewsFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Reports/Block/Adminhtml/Sales/Tax/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Sales/Tax/Grid.php index 965b745578c..5bb9a34d558 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Sales/Tax/Grid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Sales/Tax/Grid.php @@ -42,28 +42,26 @@ class Grid extends \Magento\Reports\Block\Adminhtml\Grid\AbstractGrid */ protected $_configFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory - * @param \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory - * @param \Magento\Reports\Helper\Data $reportsData - * @param \Magento\Sales\Model\Order\ConfigFactory $configFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory + * @param \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory + * @param \Magento\Reports\Helper\Data $reportsData + * @param \Magento\Sales\Model\Order\ConfigFactory $configFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory, - \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory, - \Magento\Reports\Helper\Data $reportsData, - \Magento\Sales\Model\Order\ConfigFactory $configFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Report\Collection\Factory $resourceFactory, + \Magento\Reports\Model\Grouped\CollectionFactory $collectionFactory, + \Magento\Reports\Helper\Data $reportsData, + \Magento\Sales\Model\Order\ConfigFactory $configFactory, + array $data = array() + ) { $this->_configFactory = $configFactory; - parent::__construct($context, $coreData, $urlModel, $resourceFactory, $collectionFactory, $reportsData, $data); + parent::__construct($context, $urlModel, $resourceFactory, $collectionFactory, $reportsData, $data); } protected function _construct() diff --git a/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Abandoned/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Abandoned/Grid.php index c2f84aaec91..a85b83d5153 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Abandoned/Grid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Abandoned/Grid.php @@ -40,22 +40,20 @@ class Grid extends \Magento\Reports\Block\Adminhtml\Grid\Shopcart */ protected $_quotesFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory, + array $data = array() + ) { $this->_quotesFactory = $quotesFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Customer/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Customer/Grid.php index 8f3fb5280eb..33eefd1309d 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Customer/Grid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Customer/Grid.php @@ -40,22 +40,20 @@ class Grid extends \Magento\Reports\Block\Adminhtml\Grid\Shopcart */ protected $_customersFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Customer\CollectionFactory $customersFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Customer\CollectionFactory $customersFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Customer\CollectionFactory $customersFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Customer\CollectionFactory $customersFactory, + array $data = array() + ) { $this->_customersFactory = $customersFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Product/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Product/Grid.php index 1c55591d983..12e1db3778b 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Product/Grid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Shopcart/Product/Grid.php @@ -40,22 +40,20 @@ class Grid extends \Magento\Reports\Block\Adminhtml\Grid\Shopcart */ protected $_quotesFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Quote\CollectionFactory $quotesFactory, + array $data = array() + ) { $this->_quotesFactory = $quotesFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Reports/Block/Adminhtml/Wishlist.php b/app/code/Magento/Reports/Block/Adminhtml/Wishlist.php index 2665fc7d457..b25f018d29e 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Wishlist.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Wishlist.php @@ -52,20 +52,18 @@ class Wishlist extends \Magento\Backend\Block\Template */ protected $_wishlistFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Reports\Model\Resource\Wishlist\CollectionFactory $wishlistFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Reports\Model\Resource\Wishlist\CollectionFactory $wishlistFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Reports\Model\Resource\Wishlist\CollectionFactory $wishlistFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Reports\Model\Resource\Wishlist\CollectionFactory $wishlistFactory, + array $data = array() + ) { $this->_wishlistFactory = $wishlistFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function _beforeToHtml() diff --git a/app/code/Magento/Reports/Block/Adminhtml/Wishlist/Grid.php b/app/code/Magento/Reports/Block/Adminhtml/Wishlist/Grid.php index 5862a8a0394..b785995c13d 100644 --- a/app/code/Magento/Reports/Block/Adminhtml/Wishlist/Grid.php +++ b/app/code/Magento/Reports/Block/Adminhtml/Wishlist/Grid.php @@ -40,22 +40,20 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_productsFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Reports\Model\Resource\Wishlist\Product\CollectionFactory $productsFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Reports\Model\Resource\Wishlist\Product\CollectionFactory $productsFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Reports\Model\Resource\Wishlist\Product\CollectionFactory $productsFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Reports\Model\Resource\Wishlist\Product\CollectionFactory $productsFactory, + array $data = array() + ) { $this->_productsFactory = $productsFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Reports/Block/Product/AbstractProduct.php b/app/code/Magento/Reports/Block/Product/AbstractProduct.php index a323af2d41b..ce2908b0e5b 100644 --- a/app/code/Magento/Reports/Block/Product/AbstractProduct.php +++ b/app/code/Magento/Reports/Block/Product/AbstractProduct.php @@ -61,8 +61,7 @@ abstract class AbstractProduct extends \Magento\Catalog\Block\Product\AbstractPr protected $_indexFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -73,8 +72,7 @@ abstract class AbstractProduct extends \Magento\Catalog\Block\Product\AbstractPr * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -84,7 +82,7 @@ abstract class AbstractProduct extends \Magento\Catalog\Block\Product\AbstractPr \Magento\Reports\Model\Product\Index\Factory $indexFactory, array $data = array() ) { - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); $this->_productVisibility = $productVisibility; $this->_indexFactory = $indexFactory; } diff --git a/app/code/Magento/Reports/Model/Product/Index/Compared.php b/app/code/Magento/Reports/Model/Product/Index/Compared.php index 05d91f033e6..48aa58fe091 100644 --- a/app/code/Magento/Reports/Model/Product/Index/Compared.php +++ b/app/code/Magento/Reports/Model/Product/Index/Compared.php @@ -61,7 +61,6 @@ class Compared extends \Magento\Reports\Model\Product\Index\AbstractIndex protected $_productCompare = null; /** - * @param \Magento\Catalog\Helper\Product\Compare $productCompare * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager @@ -70,12 +69,12 @@ class Compared extends \Magento\Reports\Model\Product\Index\AbstractIndex * @param \Magento\Core\Model\Session\Generic $reportSession * @param \Magento\Catalog\Model\Product\Visibility $productVisibility * @param \Magento\Stdlib\DateTime $dateTime + * @param \Magento\Catalog\Helper\Product\Compare $productCompare * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Catalog\Helper\Product\Compare $productCompare, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, @@ -84,13 +83,23 @@ class Compared extends \Magento\Reports\Model\Product\Index\AbstractIndex \Magento\Core\Model\Session\Generic $reportSession, \Magento\Catalog\Model\Product\Visibility $productVisibility, \Magento\Stdlib\DateTime $dateTime, + \Magento\Catalog\Helper\Product\Compare $productCompare, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { parent::__construct( - $context, $registry, $storeManager, $logVisitor, $customerSession, - $reportSession, $productVisibility, $dateTime, $resource, $resourceCollection, $data + $context, + $registry, + $storeManager, + $logVisitor, + $customerSession, + $reportSession, + $productVisibility, + $dateTime, + $resource, + $resourceCollection, + $data ); $this->_productCompare = $productCompare; } diff --git a/app/code/Magento/Reports/Model/Resource/Customer/Collection.php b/app/code/Magento/Reports/Model/Resource/Customer/Collection.php index 537ab80d1ff..07d352d6189 100644 --- a/app/code/Magento/Reports/Model/Resource/Customer/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Customer/Collection.php @@ -88,10 +88,10 @@ class Collection extends \Magento\Customer\Model\Resource\Customer\Collection protected $_quoteItemFactory; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory @@ -100,15 +100,16 @@ class Collection extends \Magento\Customer\Model\Resource\Customer\Collection * @param \Magento\Object\Copy\Config $fieldsetConfig * @param \Magento\Sales\Model\QuoteFactory $quoteFactory * @param \Magento\Sales\Model\Resource\Quote\Item\CollectionFactory $quoteItemFactory + * @param mixed $connection * @param string $modelName - * + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, @@ -117,10 +118,22 @@ class Collection extends \Magento\Customer\Model\Resource\Customer\Collection \Magento\Object\Copy\Config $fieldsetConfig, \Magento\Sales\Model\QuoteFactory $quoteFactory, \Magento\Sales\Model\Resource\Quote\Item\CollectionFactory $quoteItemFactory, + $connection = null, $modelName = self::CUSTOMER_MODEL_NAME ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, - $resource, $eavEntityFactory, $resourceHelper, $universalFactory, $fieldsetConfig, $modelName + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $fieldsetConfig, + $connection, + $modelName ); $this->_quoteFactory = $quoteFactory; $this->_quoteItemFactory = $quoteItemFactory; diff --git a/app/code/Magento/Reports/Model/Resource/Entity/Summary/Collection/AbstractCollection.php b/app/code/Magento/Reports/Model/Resource/Entity/Summary/Collection/AbstractCollection.php index 7ab0246581e..337418dd95a 100644 --- a/app/code/Magento/Reports/Model/Resource/Entity/Summary/Collection/AbstractCollection.php +++ b/app/code/Magento/Reports/Model/Resource/Entity/Summary/Collection/AbstractCollection.php @@ -49,11 +49,13 @@ class AbstractCollection extends \Magento\Data\Collection protected $dateTime; /** - * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Stdlib\DateTime $dateTime */ - public function __construct(\Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\EntityFactory $entityFactory) - { + public function __construct( + \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Stdlib\DateTime $dateTime + ) { $this->dateTime = $dateTime; parent::__construct($entityFactory); } diff --git a/app/code/Magento/Reports/Model/Resource/Order/Collection.php b/app/code/Magento/Reports/Model/Resource/Order/Collection.php index 3ac93095fa5..75745759013 100644 --- a/app/code/Magento/Reports/Model/Resource/Order/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Order/Collection.php @@ -78,33 +78,43 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Collection protected $_reportOrderFactory; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\Store\Config $coreStoreConfig + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Resource\Helper $coreResourceHelper - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Sales\Model\Order\Config $orderConfig * @param \Magento\Sales\Model\Resource\Report\OrderFactory $reportOrderFactory + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\Store\Config $coreStoreConfig, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Resource\Helper $coreResourceHelper, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\LocaleInterface $locale, \Magento\Sales\Model\Order\Config $orderConfig, \Magento\Sales\Model\Resource\Report\OrderFactory $reportOrderFactory, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { parent::__construct( - $eventManager, $logger, $fetchStrategy, $entityFactory, $coreResourceHelper, $resource + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $coreResourceHelper, + $connection, + $resource ); $this->_coreStoreConfig = $coreStoreConfig; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Reports/Model/Resource/Product/Collection.php b/app/code/Magento/Reports/Model/Resource/Product/Collection.php index 64d1977fb9e..d2dade74d1f 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Collection.php @@ -77,15 +77,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection protected $_productType; /** - * Construct - * - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData @@ -95,22 +94,23 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Catalog\Model\Resource\Product $product * @param \Magento\Reports\Model\Event\TypeFactory $eventTypeFactory * @param \Magento\Catalog\Model\Product\Type $productType - * + * @param mixed $connection + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, @@ -120,18 +120,35 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime, \Magento\Catalog\Model\Resource\Product $product, \Magento\Reports\Model\Event\TypeFactory $eventTypeFactory, - \Magento\Catalog\Model\Product\Type $productType + \Magento\Catalog\Model\Product\Type $productType, + $connection = null ) { $this->setProductEntityId($product->getEntityIdField()); $this->setProductEntityTableName($product->getEntityTable()); $this->setProductEntityTypeId($product->getTypeId()); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, - $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, $coreStoreConfig, - $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $storeManager, + $catalogData, + $catalogProductFlat, + $coreStoreConfig, + $productOptionFactory, + $catalogUrl, + $locale, + $customerSession, + $dateTime, + $connection ); $this->_eventTypeFactory = $eventTypeFactory; $this->_productType = $productType; diff --git a/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php b/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php index 0dd5e80667b..6d7a92b4883 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Index/Collection/AbstractCollection.php @@ -50,15 +50,14 @@ abstract class AbstractCollection protected $_logVisitor; /** - * Construct - * - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData @@ -68,20 +67,21 @@ abstract class AbstractCollection * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Log\Model\Visitor $logVisitor - * + * @param mixed $connection + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, @@ -91,13 +91,30 @@ abstract class AbstractCollection \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime, - \Magento\Log\Model\Visitor $logVisitor + \Magento\Log\Model\Visitor $logVisitor, + $connection = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, - $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, $coreStoreConfig, - $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $storeManager, + $catalogData, + $catalogProductFlat, + $coreStoreConfig, + $productOptionFactory, + $catalogUrl, + $locale, + $customerSession, + $dateTime, + $connection ); $this->_logVisitor = $logVisitor; } diff --git a/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php b/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php index ffdc8b4bbdc..96294c5503c 100644 --- a/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Product/Lowstock/Collection.php @@ -63,15 +63,14 @@ class Collection extends \Magento\Reports\Model\Resource\Product\Collection protected $_itemResource; /** - * Construct - * - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData @@ -81,24 +80,25 @@ class Collection extends \Magento\Reports\Model\Resource\Product\Collection * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Catalog\Model\Resource\Product $product * @param \Magento\Reports\Model\Event\TypeFactory $eventTypeFactory * @param \Magento\Catalog\Model\Product\Type $productType * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData * @param \Magento\CatalogInventory\Model\Resource\Stock\Item $itemResource - * + * @param mixed $connection + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, @@ -108,18 +108,37 @@ class Collection extends \Magento\Reports\Model\Resource\Product\Collection \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime, \Magento\Catalog\Model\Resource\Product $product, \Magento\Reports\Model\Event\TypeFactory $eventTypeFactory, \Magento\Catalog\Model\Product\Type $productType, \Magento\CatalogInventory\Helper\Data $catalogInventoryData, - \Magento\CatalogInventory\Model\Resource\Stock\Item $itemResource + \Magento\CatalogInventory\Model\Resource\Stock\Item $itemResource, + $connection = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, - $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, $coreStoreConfig, - $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime, $product, - $eventTypeFactory, $productType + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $storeManager, + $catalogData, + $catalogProductFlat, + $coreStoreConfig, + $productOptionFactory, + $catalogUrl, + $locale, + $customerSession, + $dateTime, + $product, + $eventTypeFactory, + $productType, + $connection ); $this->_inventoryData = $catalogInventoryData; $this->_itemResource = $itemResource; diff --git a/app/code/Magento/Reports/Model/Resource/Quote/Collection.php b/app/code/Magento/Reports/Model/Resource/Quote/Collection.php index 47543894e6c..be1fc3cd1c7 100644 --- a/app/code/Magento/Reports/Model/Resource/Quote/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Quote/Collection.php @@ -66,15 +66,16 @@ class Collection extends \Magento\Sales\Model\Resource\Quote\Collection protected $_customerResource; public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Catalog\Model\Resource\Product\Collection $productResource, \Magento\Customer\Model\Resource\Customer $customerResource, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_productResource = $productResource; $this->_customerResource = $customerResource; } diff --git a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php index d23826f27d0..0ef1e8b77f3 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php +++ b/app/code/Magento/Reports/Model/Resource/Report/AbstractReport.php @@ -59,15 +59,15 @@ abstract class AbstractReport extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_reportsFlagFactory; /** - * @param \Magento\Logger $logger * @param \Magento\App\Resource $resource + * @param \Magento\Logger $logger * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Stdlib\DateTime $dateTime */ public function __construct( - \Magento\Logger $logger, \Magento\App\Resource $resource, + \Magento\Logger $logger, \Magento\Core\Model\LocaleInterface $locale, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Stdlib\DateTime $dateTime diff --git a/app/code/Magento/Reports/Model/Resource/Report/Collection.php b/app/code/Magento/Reports/Model/Resource/Report/Collection.php index dd47253cc36..129297469ae 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Report/Collection.php @@ -108,16 +108,16 @@ class Collection extends \Magento\Data\Collection protected $_collectionFactory; /** + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Reports\Model\DateFactory $dateFactory - * @param Collection\Factory $collectionFactory - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Reports\Model\Resource\Report\Collection\Factory $collectionFactory */ public function __construct( + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Core\Model\LocaleInterface $locale, \Magento\Reports\Model\DateFactory $dateFactory, - \Magento\Reports\Model\Resource\Report\Collection\Factory $collectionFactory, - \Magento\Core\Model\EntityFactory $entityFactory + \Magento\Reports\Model\Resource\Report\Collection\Factory $collectionFactory ) { $this->_dateFactory = $dateFactory; $this->_locale = $locale; diff --git a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php index 057332551ed..594df752055 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php +++ b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed.php @@ -62,8 +62,8 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport protected $_helperFactory; /** - * @param \Magento\Logger $logger * @param \Magento\App\Resource $resource + * @param \Magento\Logger $logger * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Stdlib\DateTime $dateTime @@ -71,15 +71,15 @@ class Viewed extends \Magento\Sales\Model\Resource\Report\AbstractReport * @param \Magento\Reports\Model\Resource\HelperFactory $helperFactory */ public function __construct( - \Magento\Logger $logger, \Magento\App\Resource $resource, + \Magento\Logger $logger, \Magento\Core\Model\LocaleInterface $locale, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Stdlib\DateTime $dateTime, \Magento\Catalog\Model\Resource\Product $productResource, \Magento\Reports\Model\Resource\HelperFactory $helperFactory ) { - parent::__construct($logger, $resource, $locale, $reportsFlagFactory, $dateTime); + parent::__construct($resource, $logger, $locale, $reportsFlagFactory, $dateTime); $this->_productResource = $productResource; $this->_helperFactory = $helperFactory; } diff --git a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed/Collection.php b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed/Collection.php index bf48a88423c..cbd0ed38f82 100644 --- a/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Report/Product/Viewed/Collection.php @@ -48,21 +48,23 @@ class Collection protected $_selectedColumns = array(); /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + $connection = null ) { $resource->init(\Magento\Reports\Model\Resource\Report\Product\Viewed::AGGREGATION_DAILY); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->setModel('Magento\Reports\Model\Item'); } diff --git a/app/code/Magento/Reports/Model/Resource/Review/Customer/Collection.php b/app/code/Magento/Reports/Model/Resource/Review/Customer/Collection.php index 4a99ca15354..df106894252 100644 --- a/app/code/Magento/Reports/Model/Resource/Review/Customer/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Review/Customer/Collection.php @@ -42,31 +42,40 @@ class Collection extends \Magento\Review\Model\Resource\Review\Collection protected $_customerResource; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger - * @param \Magento\Review\Helper\Data $reviewData * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Review\Helper\Data $reviewData * @param \Magento\Rating\Model\Rating\Option\VoteFactory $voteFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\Resource\Customer $customerResource + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, - \Magento\Review\Helper\Data $reviewData, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Review\Helper\Data $reviewData, \Magento\Rating\Model\Rating\Option\VoteFactory $voteFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\Resource\Customer $customerResource, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_customerResource = $customerResource; parent::__construct( - $eventManager, $logger, $reviewData, $fetchStrategy, - $entityFactory, $voteFactory, $storeManager, $resource + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $reviewData, + $voteFactory, + $storeManager, + $connection, + $resource ); } diff --git a/app/code/Magento/Reports/Model/Resource/Setup.php b/app/code/Magento/Reports/Model/Resource/Setup.php index 83130a8060d..584bb900d8a 100644 --- a/app/code/Magento/Reports/Model/Resource/Setup.php +++ b/app/code/Magento/Reports/Model/Resource/Setup.php @@ -38,15 +38,15 @@ class Setup extends \Magento\Core\Model\Resource\Setup /** * @param \Magento\Core\Model\Resource\Setup\Context $context - * @param \Magento\Cms\Model\PageFactory $pageFactory * @param string $resourceName + * @param \Magento\Cms\Model\PageFactory $pageFactory * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, - \Magento\Cms\Model\PageFactory $pageFactory, $resourceName, + \Magento\Cms\Model\PageFactory $pageFactory, $moduleName = 'Magento_Reports', $connectionName = '' ) { diff --git a/app/code/Magento/Reports/Model/Resource/Wishlist/Collection.php b/app/code/Magento/Reports/Model/Resource/Wishlist/Collection.php index 69f27ede6ee..999e06d2e01 100644 --- a/app/code/Magento/Reports/Model/Resource/Wishlist/Collection.php +++ b/app/code/Magento/Reports/Model/Resource/Wishlist/Collection.php @@ -49,22 +49,24 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_customerResFactory; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerResFactory + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Customer\Model\Resource\Customer\CollectionFactory $customerResFactory, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_customerResFactory = $customerResFactory; } diff --git a/app/code/Magento/Reports/view/adminhtml/grid.phtml b/app/code/Magento/Reports/view/adminhtml/grid.phtml index 3bdf0fbe691..43ad1c96ad4 100644 --- a/app/code/Magento/Reports/view/adminhtml/grid.phtml +++ b/app/code/Magento/Reports/view/adminhtml/grid.phtml @@ -32,7 +32,7 @@ $numColumns = sizeof($this->getColumns()); <?php if ($this->canDisplayContainer()): ?> <div id="<?php echo $this->getId() ?>"> <?php else: ?> - <?php echo $this->getMessagesBlock()->getGroupedHtml() ?> + <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml() ?> <?php endif; ?> <?php if ($this->getStoreSwitcherVisibility() || $this->getDateFilterVisibility()): ?> <?php if ($this->getStoreSwitcherVisibility()): ?> @@ -44,21 +44,30 @@ $numColumns = sizeof($this->getColumns()); <?php echo $this->getChildHtml('grid.export');?> </div> <?php endif; ?> - <?php if ($this->getDateFilterVisibility()): ?> - <div class="filter" id="<?php echo $this->getSuffixId('period_date_range')?>"> - <div class="date"> - <label class="required"><?php echo __('From') ?>: - <input class="input-text no-changes required-entry" type="text" id="<?php echo $this->getSuffixId('period_date_from')?>" name="report_from" value="<?php echo $this->getFilter('report_from') ?>"> + <div class="filter required" id="<?php echo $this->getSuffixId('period_date_range')?>"> + <div class="field date"> + <label class="label"> + <span><?php echo __('From') ?>:</span> + <input class="input-text no-changes required-entry" + type="text" + id="<?php echo $this->getSuffixId('period_date_from') ?>" + name="report_from" + value="<?php echo $this->getFilter('report_from') ?>"> + <div id="<?php echo $this->getSuffixId('period_date_from_advice')?>"></div> </label> - <div id="<?php echo $this->getSuffixId('period_date_from_advice')?>"></div> </div> - <div class="date"> - <label class="required"><?php echo __('To') ?>: - <input class="input-text no-changes required-entry" type="text" id="<?php echo $this->getSuffixId('period_date_to')?>" name="report_to" value="<?php echo $this->getFilter('report_to') ?>" /> + <div class="field date"> + <label class="label"> + <span><?php echo __('To') ?>:</span> + <input class="input-text no-changes required-entry" + type="text" + id="<?php echo $this->getSuffixId('period_date_to') ?>" + name="report_to" + value="<?php echo $this->getFilter('report_to') ?>"/> + <div id="<?php echo $this->getSuffixId('period_date_to_advice')?>"></div> </label> - <div id="<?php echo $this->getSuffixId('period_date_to_advice')?>"></div> </div> <div class="show-by"> @@ -117,7 +126,7 @@ $numColumns = sizeof($this->getColumns()); if (period_date_from && period_date_to) { var valid = true; jQuery(period_date_from).add(period_date_to).each(function() { - valid = jQuery.validator.validateElement(this) && valid; + valid = Validation.validate(this) && valid; }); return valid; } diff --git a/app/code/Magento/Review/Block/Adminhtml/Add/Form.php b/app/code/Magento/Review/Block/Adminhtml/Add/Form.php index b776d41b517..4b3dfb805c5 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Add/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Add/Form.php @@ -48,27 +48,25 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Review\Helper\Data $reviewData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param \Magento\Review\Helper\Data $reviewData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\System\Store $systemStore, - \Magento\Review\Helper\Data $reviewData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\System\Store $systemStore, + \Magento\Review\Helper\Data $reviewData, + array $data = array() + ) { $this->_reviewData = $reviewData; $this->_systemStore = $systemStore; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Review/Block/Adminhtml/Edit.php b/app/code/Magento/Review/Block/Adminhtml/Edit.php index db21dcdecb3..f269dc72a41 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Edit.php +++ b/app/code/Magento/Review/Block/Adminhtml/Edit.php @@ -50,26 +50,24 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_reviewFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Review\Model\ReviewFactory $reviewFactory - * @param \Magento\Review\Helper\Action\Pager $reviewActionPager - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Review\Model\ReviewFactory $reviewFactory + * @param \Magento\Review\Helper\Action\Pager $reviewActionPager + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Review\Model\ReviewFactory $reviewFactory, - \Magento\Review\Helper\Action\Pager $reviewActionPager, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Review\Model\ReviewFactory $reviewFactory, + \Magento\Review\Helper\Action\Pager $reviewActionPager, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_reviewActionPager = $reviewActionPager; $this->_reviewFactory = $reviewFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php b/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php index 0a0cd2d72f4..b9e2a64d164 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php +++ b/app/code/Magento/Review/Block/Adminhtml/Edit/Form.php @@ -53,33 +53,31 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\System\Store $systemStore - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Review\Helper\Data $reviewData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Review\Helper\Data $reviewData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\System\Store $systemStore, - \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Review\Helper\Data $reviewData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\System\Store $systemStore, + \Magento\Customer\Model\CustomerFactory $customerFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Review\Helper\Data $reviewData, + array $data = array() + ) { $this->_reviewData = $reviewData; $this->_customerFactory = $customerFactory; $this->_productFactory = $productFactory; $this->_systemStore = $systemStore; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } protected function _prepareForm() diff --git a/app/code/Magento/Review/Block/Adminhtml/Grid.php b/app/code/Magento/Review/Block/Adminhtml/Grid.php index 3bc06c4618e..f8b0433e306 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Grid.php +++ b/app/code/Magento/Review/Block/Adminhtml/Grid.php @@ -72,34 +72,32 @@ class Grid extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_reviewFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Review\Model\ReviewFactory $reviewFactory - * @param \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productsFactory - * @param \Magento\Review\Helper\Data $reviewData - * @param \Magento\Review\Helper\Action\Pager $reviewActionPager - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Review\Model\ReviewFactory $reviewFactory + * @param \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productsFactory + * @param \Magento\Review\Helper\Data $reviewData + * @param \Magento\Review\Helper\Action\Pager $reviewActionPager + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Review\Model\ReviewFactory $reviewFactory, - \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productsFactory, - \Magento\Review\Helper\Data $reviewData, - \Magento\Review\Helper\Action\Pager $reviewActionPager, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Review\Model\ReviewFactory $reviewFactory, + \Magento\Review\Model\Resource\Review\Product\CollectionFactory $productsFactory, + \Magento\Review\Helper\Data $reviewData, + \Magento\Review\Helper\Action\Pager $reviewActionPager, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_productsFactory = $productsFactory; $this->_coreRegistry = $coreRegistry; $this->_reviewData = $reviewData; $this->_reviewActionPager = $reviewActionPager; $this->_reviewFactory = $reviewFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Review/Block/Adminhtml/Main.php b/app/code/Magento/Review/Block/Adminhtml/Main.php index 5c0c75035b2..25db0febac1 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Main.php +++ b/app/code/Magento/Review/Block/Adminhtml/Main.php @@ -48,26 +48,24 @@ class Main extends \Magento\Adminhtml\Block\Widget\Grid\Container */ protected $_productFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Customer\Model\CustomerFactory $customerFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_customerFactory = $customerFactory; $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php b/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php index ae43818c089..03f19458251 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php +++ b/app/code/Magento/Review/Block/Adminhtml/Product/Grid.php @@ -42,7 +42,6 @@ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Url $urlModel * @param \Magento\Core\Model\WebsiteFactory $websiteFactory * @param \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory @@ -56,7 +55,6 @@ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Url $urlModel, \Magento\Core\Model\WebsiteFactory $websiteFactory, \Magento\Eav\Model\Resource\Entity\Attribute\Set\CollectionFactory $setsFactory, @@ -71,7 +69,6 @@ class Grid extends \Magento\Catalog\Block\Adminhtml\Product\Grid $this->_websitesFactory = $websitesFactory; parent::__construct( $context, - $coreData, $urlModel, $websiteFactory, $setsFactory, diff --git a/app/code/Magento/Review/Block/Adminhtml/Rating/Detailed.php b/app/code/Magento/Review/Block/Adminhtml/Rating/Detailed.php index 2a0ae6edb25..44672479f5a 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Rating/Detailed.php +++ b/app/code/Magento/Review/Block/Adminhtml/Rating/Detailed.php @@ -52,26 +52,24 @@ class Detailed extends \Magento\Backend\Block\Template */ protected $_votesFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Rating\Model\Resource\Rating\CollectionFactory $ratingsFactory - * @param \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Rating\Model\Resource\Rating\CollectionFactory $ratingsFactory + * @param \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Rating\Model\Resource\Rating\CollectionFactory $ratingsFactory, - \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Rating\Model\Resource\Rating\CollectionFactory $ratingsFactory, + \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_ratingsFactory = $ratingsFactory; $this->_votesFactory = $votesFactory; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Review/Block/Adminhtml/Rating/Summary.php b/app/code/Magento/Review/Block/Adminhtml/Rating/Summary.php index e4c98732802..7c842d5e01d 100644 --- a/app/code/Magento/Review/Block/Adminhtml/Rating/Summary.php +++ b/app/code/Magento/Review/Block/Adminhtml/Rating/Summary.php @@ -50,26 +50,24 @@ class Summary extends \Magento\Backend\Block\Template */ protected $_ratingFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory - * @param \Magento\Rating\Model\RatingFactory $ratingFactory - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory + * @param \Magento\Rating\Model\RatingFactory $ratingFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory, - \Magento\Rating\Model\RatingFactory $ratingFactory, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Rating\Model\Resource\Rating\Option\Vote\CollectionFactory $votesFactory, + \Magento\Rating\Model\RatingFactory $ratingFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_votesFactory = $votesFactory; $this->_ratingFactory = $ratingFactory; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Review/Block/Customer/ListCustomer.php b/app/code/Magento/Review/Block/Customer/ListCustomer.php index 843db456b5e..cec94c8a202 100644 --- a/app/code/Magento/Review/Block/Customer/ListCustomer.php +++ b/app/code/Magento/Review/Block/Customer/ListCustomer.php @@ -49,23 +49,21 @@ class ListCustomer extends \Magento\Customer\Block\Account\Dashboard protected $_collectionFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory * @param \Magento\Review\Model\Resource\Review\Product\CollectionFactory $collectionFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Newsletter\Model\SubscriberFactory $subscriberFactory, \Magento\Review\Model\Resource\Review\Product\CollectionFactory $collectionFactory, array $data = array() ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $customerSession, $subscriberFactory, $data); + parent::__construct($context, $customerSession, $subscriberFactory, $data); } protected function _initCollection() @@ -101,11 +99,11 @@ class ListCustomer extends \Magento\Customer\Block\Account\Dashboard /** * Initializes toolbar * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { - $toolbar = $this->getLayout()->createBlock('Magento\Page\Block\Html\Pager', 'customer_review_list.toolbar') + $toolbar = $this->getLayout()->createBlock('Magento\Theme\Block\Html\Pager', 'customer_review_list.toolbar') ->setCollection($this->getCollection()); $this->setChild('toolbar', $toolbar); @@ -167,7 +165,7 @@ class ListCustomer extends \Magento\Customer\Block\Account\Dashboard } /** - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Review/Block/Customer/Recent.php b/app/code/Magento/Review/Block/Customer/Recent.php index 2bef95fbf73..1eb8b524054 100644 --- a/app/code/Magento/Review/Block/Customer/Recent.php +++ b/app/code/Magento/Review/Block/Customer/Recent.php @@ -29,7 +29,7 @@ namespace Magento\Review\Block\Customer; /** * Recent Customer Reviews Block */ -class Recent extends \Magento\View\Block\Template +class Recent extends \Magento\View\Element\Template { /** * @var string @@ -49,22 +49,20 @@ class Recent extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Review\Model\Resource\Review\Product\CollectionFactory $collectionFactory * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Review\Model\Resource\Review\Product\CollectionFactory $collectionFactory, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_collection = $collectionFactory->create(); $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Review/Block/Customer/View.php b/app/code/Magento/Review/Block/Customer/View.php index aa674f80220..99ec5202c27 100644 --- a/app/code/Magento/Review/Block/Customer/View.php +++ b/app/code/Magento/Review/Block/Customer/View.php @@ -64,8 +64,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -79,8 +78,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -99,7 +97,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct $this->_ratingFactory = $ratingFactory; $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } diff --git a/app/code/Magento/Review/Block/Form.php b/app/code/Magento/Review/Block/Form.php index 67e9e2f2b80..1c7deb78c3d 100644 --- a/app/code/Magento/Review/Block/Form.php +++ b/app/code/Magento/Review/Block/Form.php @@ -33,7 +33,7 @@ */ namespace Magento\Review\Block; -class Form extends \Magento\View\Block\Template +class Form extends \Magento\View\Element\Template { /** * Review data @@ -63,7 +63,12 @@ class Form extends \Magento\View\Block\Template protected $_reviewSession; /** - * @param \Magento\View\Block\Template\Context $context + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Session\Generic $reviewSession * @param \Magento\Review\Helper\Data $reviewData @@ -73,7 +78,7 @@ class Form extends \Magento\View\Block\Template * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Session\Generic $reviewSession, \Magento\Review\Helper\Data $reviewData, @@ -82,12 +87,13 @@ class Form extends \Magento\View\Block\Template \Magento\Rating\Model\RatingFactory $ratingFactory, array $data = array() ) { + $this->_coreData = $coreData; $this->_reviewSession = $reviewSession; $this->_reviewData = $reviewData; $this->_customerSession = $customerSession; $this->_productFactory = $productFactory; $this->_ratingFactory = $ratingFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Review/Block/Helper.php b/app/code/Magento/Review/Block/Helper.php index 8eb65421b13..04dd3814d79 100644 --- a/app/code/Magento/Review/Block/Helper.php +++ b/app/code/Magento/Review/Block/Helper.php @@ -33,7 +33,7 @@ */ namespace Magento\Review\Block; -class Helper extends \Magento\View\Block\Template +class Helper extends \Magento\View\Element\Template { protected $_availableTemplates = array( 'default' => 'helper/summary.phtml', @@ -46,19 +46,17 @@ class Helper extends \Magento\View\Block\Template protected $_reviewFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Review\Model\ReviewFactory $reviewFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Review\Model\ReviewFactory $reviewFactory, array $data = array() ) { $this->_reviewFactory = $reviewFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getSummaryHtml($product, $templateType, $displayIfNoReviews) diff --git a/app/code/Magento/Review/Block/Product/View.php b/app/code/Magento/Review/Block/Product/View.php index 946d7081469..36843b4bd10 100644 --- a/app/code/Magento/Review/Block/Product/View.php +++ b/app/code/Magento/Review/Block/Product/View.php @@ -46,8 +46,9 @@ class View extends \Magento\Catalog\Block\Product\View protected $_reviewsColFactory; /** - * @param \Magento\View\Block\Template\Context $context + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -60,13 +61,14 @@ class View extends \Magento\Catalog\Block\Product\View * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, \Magento\Catalog\Helper\Data $catalogData, \Magento\Math\Random $mathRandom, + \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Tax\Model\Calculation $taxCalculation, \Magento\Stdlib\String $string, @@ -76,12 +78,13 @@ class View extends \Magento\Catalog\Block\Product\View $this->_reviewsColFactory = $collectionFactory; parent::__construct( $context, - $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, + $coreData, + $jsonEncoder, $productFactory, $taxCalculation, $string, diff --git a/app/code/Magento/Review/Block/Product/View/Other.php b/app/code/Magento/Review/Block/Product/View/Other.php index ce3a248e659..656b65d9169 100644 --- a/app/code/Magento/Review/Block/Product/View/Other.php +++ b/app/code/Magento/Review/Block/Product/View/Other.php @@ -29,7 +29,7 @@ */ namespace Magento\Review\Block\Product\View; -class Other extends \Magento\View\Block\Template +class Other extends \Magento\View\Element\Template { /** * @var \Magento\Core\Model\Registry @@ -37,19 +37,17 @@ class Other extends \Magento\View\Block\Template protected $_registry; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_registry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Review/Block/View.php b/app/code/Magento/Review/Block/View.php index f28615023c4..900f0e1b2ae 100644 --- a/app/code/Magento/Review/Block/View.php +++ b/app/code/Magento/Review/Block/View.php @@ -54,8 +54,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct protected $_reviewFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -67,8 +66,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -82,7 +80,7 @@ class View extends \Magento\Catalog\Block\Product\AbstractProduct $this->_voteFactory = $voteFactory; $this->_reviewFactory = $reviewFactory; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** diff --git a/app/code/Magento/Review/Controller/Product.php b/app/code/Magento/Review/Controller/Product.php index 34376721cca..a5063d50ff3 100644 --- a/app/code/Magento/Review/Controller/Product.php +++ b/app/code/Magento/Review/Controller/Product.php @@ -390,13 +390,13 @@ class Product extends \Magento\App\Action\Action ); if ($product->getPageLayout()) { - $this->_objectManager->get('Magento\Page\Helper\Layout') + $this->_objectManager->get('Magento\Theme\Helper\Layout') ->applyHandle($product->getPageLayout()); } $this->_view->loadLayoutUpdates(); if ($product->getPageLayout()) { - $this->_objectManager->get('Magento\Page\Helper\Layout') + $this->_objectManager->get('Magento\Theme\Helper\Layout') ->applyTemplate($product->getPageLayout()); } $update->addUpdate($product->getCustomLayoutUpdate()); diff --git a/app/code/Magento/Review/Helper/Action/Pager.php b/app/code/Magento/Review/Helper/Action/Pager.php index 75813d38db5..77861503c75 100644 --- a/app/code/Magento/Review/Helper/Action/Pager.php +++ b/app/code/Magento/Review/Helper/Action/Pager.php @@ -51,12 +51,12 @@ class Pager extends \Magento\App\Helper\AbstractHelper protected $_backendSession; /** - * @param \Magento\Backend\Model\Session $backendSession * @param \Magento\App\Helper\Context $context + * @param \Magento\Backend\Model\Session $backendSession */ public function __construct( - \Magento\Backend\Model\Session $backendSession, - \Magento\App\Helper\Context $context + \Magento\App\Helper\Context $context, + \Magento\Backend\Model\Session $backendSession ) { $this->_backendSession = $backendSession; parent::__construct($context); diff --git a/app/code/Magento/Review/Model/Resource/Review/Collection.php b/app/code/Magento/Review/Model/Resource/Review/Collection.php index 093bade1e48..009d5456d5e 100644 --- a/app/code/Magento/Review/Model/Resource/Review/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Review/Collection.php @@ -95,30 +95,32 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_storeManager; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger - * @param \Magento\Review\Helper\Data $reviewData * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Review\Helper\Data $reviewData * @param \Magento\Rating\Model\Rating\Option\VoteFactory $voteFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, - \Magento\Review\Helper\Data $reviewData, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Review\Helper\Data $reviewData, \Magento\Rating\Model\Rating\Option\VoteFactory $voteFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_reviewData = $reviewData; $this->_voteFactory = $voteFactory; $this->_storeManager = $storeManager; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php b/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php index 64f5023ee04..d7eb5878051 100644 --- a/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Review/Product/Collection.php @@ -76,13 +76,14 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection protected $_voteFactory; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\App\Resource $resource * @param \Magento\Eav\Model\EntityFactory $eavEntityFactory + * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Validator\UniversalFactory $universalFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Catalog\Helper\Data $catalogData @@ -92,21 +93,22 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection * @param \Magento\Catalog\Model\Resource\Url $catalogUrl * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Catalog\Model\Resource\Helper $resourceHelper * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Rating\Model\RatingFactory $ratingFactory * @param \Magento\Rating\Model\Rating\Option\VoteFactory $voteFactory - * + * @param mixed $connection + * * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Config $eavConfig, \Magento\App\Resource $resource, \Magento\Eav\Model\EntityFactory $eavEntityFactory, + \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Validator\UniversalFactory $universalFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Helper\Data $catalogData, @@ -116,16 +118,33 @@ class Collection extends \Magento\Catalog\Model\Resource\Product\Collection \Magento\Catalog\Model\Resource\Url $catalogUrl, \Magento\Core\Model\LocaleInterface $locale, \Magento\Customer\Model\Session $customerSession, - \Magento\Catalog\Model\Resource\Helper $resourceHelper, \Magento\Stdlib\DateTime $dateTime, \Magento\Rating\Model\RatingFactory $ratingFactory, - \Magento\Rating\Model\Rating\Option\VoteFactory $voteFactory + \Magento\Rating\Model\Rating\Option\VoteFactory $voteFactory, + $connection = null ) { $this->_ratingFactory = $ratingFactory; $this->_voteFactory = $voteFactory; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $eavConfig, $resource, - $eavEntityFactory, $universalFactory, $storeManager, $catalogData, $catalogProductFlat, $coreStoreConfig, - $productOptionFactory, $catalogUrl, $locale, $customerSession, $resourceHelper, $dateTime + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $eavConfig, + $resource, + $eavEntityFactory, + $resourceHelper, + $universalFactory, + $storeManager, + $catalogData, + $catalogProductFlat, + $coreStoreConfig, + $productOptionFactory, + $catalogUrl, + $locale, + $customerSession, + $dateTime, + $connection ); } diff --git a/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php b/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php index cef26369d3a..310e2b9a2fb 100644 --- a/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php +++ b/app/code/Magento/Review/Model/Resource/Review/Summary/Collection.php @@ -42,20 +42,20 @@ class Collection extends \Magento\Data\Collection\Db protected $_summaryTable; /** + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\App\Resource $resource */ public function __construct( + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, \Magento\App\Resource $resource ) { $this->_setIdFieldName('primary_id'); - parent::__construct($logger, $fetchStrategy, $entityFactory, $resource->getConnection('review_read')); + parent::__construct($entityFactory, $logger, $fetchStrategy, $resource->getConnection('review_read')); $this->_summaryTable = $resource->getTableName('review_entity_summary'); $this->_select->from($this->_summaryTable); diff --git a/app/code/Magento/Review/etc/module.xml b/app/code/Magento/Review/etc/module.xml index 3a3d42c9552..3f8ee5e7034 100755 --- a/app/code/Magento/Review/etc/module.xml +++ b/app/code/Magento/Review/etc/module.xml @@ -35,7 +35,7 @@ <module name="Magento_Customer"/> <module name="Magento_Eav"/> <module name="Magento_Rating"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> <module name="Magento_Backend"/> <module name="Magento_Paypal"/> <module name="Magento_Tax"/> diff --git a/app/code/Magento/Review/view/frontend/layout/customer_account.xml b/app/code/Magento/Review/view/frontend/layout/customer_account.xml index 025a6bbd2d8..5d915465b5e 100644 --- a/app/code/Magento/Review/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Review/view/frontend/layout/customer_account.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="customer_account_navigation"> - <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-product-reviews-link"> + <block class="Magento\View\Element\Html\Link\Current" name="customer-account-navigation-product-reviews-link"> <arguments> <argument name="path" xsi:type="string">review/customer</argument> <argument name="label" xsi:type="string">My Product Reviews</argument> diff --git a/app/code/Magento/Review/view/frontend/layout/review_product_list.xml b/app/code/Magento/Review/view/frontend/layout/review_product_list.xml index 8a1e673fbda..fac7ed741f3 100644 --- a/app/code/Magento/Review/view/frontend/layout/review_product_list.xml +++ b/app/code/Magento/Review/view/frontend/layout/review_product_list.xml @@ -30,7 +30,7 @@ </action> </referenceBlock> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-catalog-zoom-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-catalog-zoom-css"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::zoom.css</argument> </arguments> @@ -52,8 +52,8 @@ </block> <block class="Magento\Catalog\Block\Product\View" name="product.tierprices" as="tierprices" template="product/view/tierprices.phtml"/> <block class="Magento\Review\Block\Product\View\Other" name="product.info.other" as="other" template="Magento_Review::product/view/other.phtml"/> - <block class="Magento\Page\Block\Html\Pager" name="product_review_list.toolbar"/> - <block class="Magento\View\Block\Template" name="product_review_list.count" template="Magento_Review::product/view/count.phtml"/> + <block class="Magento\Theme\Block\Html\Pager" name="product_review_list.toolbar"/> + <block class="Magento\View\Element\Template" name="product_review_list.count" template="Magento_Review::product/view/count.phtml"/> <block class="Magento\Review\Block\Product\View\ListView" name="product.info.product_additional_data" as="product_additional_data" template="product/view/list.phtml"> <block class="Magento\Review\Block\Form" name="product.review.form" as="review_form"> <container name="product.review.form.fields.before" as="form_fields_before" label="Review Form Fields Before"/> diff --git a/app/code/Magento/Rss/App/Action/Plugin/Authentication.php b/app/code/Magento/Rss/App/Action/Plugin/Authentication.php index d75915b84ef..9453c666631 100644 --- a/app/code/Magento/Rss/App/Action/Plugin/Authentication.php +++ b/app/code/Magento/Rss/App/Action/Plugin/Authentication.php @@ -33,7 +33,7 @@ class Authentication extends \Magento\Backend\App\Action\Plugin\Authentication protected $_httpAuthentication; /** - * @var \Magento\Core\Model\Logger + * @var \Magento\Logger */ protected $_logger; diff --git a/app/code/Magento/Rss/Block/AbstractBlock.php b/app/code/Magento/Rss/Block/AbstractBlock.php index 25da8573e46..774067370be 100644 --- a/app/code/Magento/Rss/Block/AbstractBlock.php +++ b/app/code/Magento/Rss/Block/AbstractBlock.php @@ -26,7 +26,7 @@ namespace Magento\Rss\Block; -class AbstractBlock extends \Magento\View\Block\Template +class AbstractBlock extends \Magento\View\Element\Template { /** * @var \Magento\Customer\Model\Session @@ -34,19 +34,17 @@ class AbstractBlock extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Rss/Block/Catalog/AbstractCatalog.php b/app/code/Magento/Rss/Block/Catalog/AbstractCatalog.php index ca826facc60..103c9486f20 100644 --- a/app/code/Magento/Rss/Block/Catalog/AbstractCatalog.php +++ b/app/code/Magento/Rss/Block/Catalog/AbstractCatalog.php @@ -68,28 +68,26 @@ class AbstractCatalog extends \Magento\Rss\Block\AbstractBlock protected $_catalogData = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Helper\Data $catalogData * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Helper\Data $catalogData, array $data = array() ) { $this->_catalogData = $catalogData; - parent::__construct($context, $coreData, $customerSession, $data); + parent::__construct($context, $customerSession, $data); } /** * Return Price Block renderer for specified product type * * @param string $productTypeId Catalog Product type - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _getPriceBlock($productTypeId) { diff --git a/app/code/Magento/Rss/Block/Catalog/Category.php b/app/code/Magento/Rss/Block/Catalog/Category.php index 4a2716f10c1..d57324b2843 100644 --- a/app/code/Magento/Rss/Block/Catalog/Category.php +++ b/app/code/Magento/Rss/Block/Catalog/Category.php @@ -57,8 +57,7 @@ class Category extends \Magento\Rss\Block\Catalog\AbstractCatalog protected $_collectionFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Catalog\Model\Layer $catalogLayer @@ -69,8 +68,7 @@ class Category extends \Magento\Rss\Block\Catalog\AbstractCatalog * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Helper\Data $catalogData, \Magento\Catalog\Model\Layer $catalogLayer, @@ -85,7 +83,7 @@ class Category extends \Magento\Rss\Block\Catalog\AbstractCatalog $this->_rssFactory = $rssFactory; $this->_categoryFactory = $categoryFactory; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $customerSession, $catalogData, $data); + parent::__construct($context, $customerSession, $catalogData, $data); } protected function _construct() diff --git a/app/code/Magento/Rss/Block/Catalog/NewCatalog.php b/app/code/Magento/Rss/Block/Catalog/NewCatalog.php index 04c8b050c68..3b5fd823bc9 100644 --- a/app/code/Magento/Rss/Block/Catalog/NewCatalog.php +++ b/app/code/Magento/Rss/Block/Catalog/NewCatalog.php @@ -52,8 +52,7 @@ class NewCatalog extends \Magento\Rss\Block\Catalog\AbstractCatalog protected $_resourceIterator; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Rss\Model\RssFactory $rssFactory @@ -63,8 +62,7 @@ class NewCatalog extends \Magento\Rss\Block\Catalog\AbstractCatalog * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Helper\Data $catalogData, \Magento\Rss\Model\RssFactory $rssFactory, @@ -77,7 +75,7 @@ class NewCatalog extends \Magento\Rss\Block\Catalog\AbstractCatalog $this->_productFactory = $productFactory; $this->_visibility = $visibility; $this->_resourceIterator = $resourceIterator; - parent::__construct($context, $coreData, $customerSession, $catalogData, $data); + parent::__construct($context, $customerSession, $catalogData, $data); } protected function _toHtml() diff --git a/app/code/Magento/Rss/Block/Catalog/Salesrule.php b/app/code/Magento/Rss/Block/Catalog/Salesrule.php index 3a240f76a1a..774c1a1c2bc 100644 --- a/app/code/Magento/Rss/Block/Catalog/Salesrule.php +++ b/app/code/Magento/Rss/Block/Catalog/Salesrule.php @@ -42,16 +42,14 @@ class Salesrule extends \Magento\Rss\Block\AbstractBlock protected $_collectionFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Rss\Model\RssFactory $rssFactory * @param \Magento\SalesRule\Model\Resource\Rule\CollectionFactory $collectionFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Rss\Model\RssFactory $rssFactory, \Magento\SalesRule\Model\Resource\Rule\CollectionFactory $collectionFactory, @@ -59,7 +57,7 @@ class Salesrule extends \Magento\Rss\Block\AbstractBlock ) { $this->_rssFactory = $rssFactory; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $customerSession, $data); + parent::__construct($context, $customerSession, $data); } protected function _construct() diff --git a/app/code/Magento/Rss/Block/Catalog/Special.php b/app/code/Magento/Rss/Block/Catalog/Special.php index e6e2bacc310..cf9c370a691 100644 --- a/app/code/Magento/Rss/Block/Catalog/Special.php +++ b/app/code/Magento/Rss/Block/Catalog/Special.php @@ -54,7 +54,12 @@ class Special extends \Magento\Rss\Block\Catalog\AbstractCatalog protected $_resourceIterator; /** - * @param \Magento\View\Block\Template\Context $context + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Helper\Data $catalogData @@ -64,19 +69,20 @@ class Special extends \Magento\Rss\Block\Catalog\AbstractCatalog * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Helper\Data $catalogData, + \Magento\Core\Helper\Data $coreData, \Magento\Catalog\Model\ProductFactory $productFactory, \Magento\Rss\Model\RssFactory $rssFactory, \Magento\Core\Model\Resource\Iterator $resourceIterator, array $data = array() ) { + $this->_coreData = $coreData; $this->_productFactory = $productFactory; $this->_rssFactory = $rssFactory; $this->_resourceIterator = $resourceIterator; - parent::__construct($context, $coreData, $customerSession, $catalogData, $data); + parent::__construct($context, $customerSession, $catalogData, $data); } protected function _construct() diff --git a/app/code/Magento/Rss/Block/ListBlock.php b/app/code/Magento/Rss/Block/ListBlock.php index b2285ce6a5a..7be09080f37 100644 --- a/app/code/Magento/Rss/Block/ListBlock.php +++ b/app/code/Magento/Rss/Block/ListBlock.php @@ -29,7 +29,7 @@ */ namespace Magento\Rss\Block; -class ListBlock extends \Magento\View\Block\Template +class ListBlock extends \Magento\View\Element\Template { const XML_PATH_RSS_METHODS = 'rss'; @@ -46,22 +46,20 @@ class ListBlock extends \Magento\View\Block\Template protected $_categoryFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Catalog\Model\CategoryFactory $categoryFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\CategoryFactory $categoryFactory, array $data = array() ) { $this->_customerSession = $customerSession; $this->_categoryFactory = $categoryFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Rss/Block/Order/Details.php b/app/code/Magento/Rss/Block/Order/Details.php index 3c598e44353..40979c93a3c 100644 --- a/app/code/Magento/Rss/Block/Order/Details.php +++ b/app/code/Magento/Rss/Block/Order/Details.php @@ -26,7 +26,7 @@ namespace Magento\Rss\Block\Order; -class Details extends \Magento\View\Block\Template +class Details extends \Magento\View\Element\Template { protected $_template = 'order/details.phtml'; diff --git a/app/code/Magento/Rss/Block/Order/Status.php b/app/code/Magento/Rss/Block/Order/Status.php index af53dbb762b..e466f9a5690 100644 --- a/app/code/Magento/Rss/Block/Order/Status.php +++ b/app/code/Magento/Rss/Block/Order/Status.php @@ -29,7 +29,7 @@ */ namespace Magento\Rss\Block\Order; -class Status extends \Magento\View\Block\Template +class Status extends \Magento\View\Element\Template { /** * Core registry @@ -49,16 +49,14 @@ class Status extends \Magento\View\Block\Template protected $_orderFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Rss\Model\RssFactory $rssFactory * @param \Magento\Rss\Model\Resource\OrderFactory $orderFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Rss\Model\RssFactory $rssFactory, \Magento\Rss\Model\Resource\OrderFactory $orderFactory, @@ -67,7 +65,7 @@ class Status extends \Magento\View\Block\Template $this->_coreRegistry = $registry; $this->_rssFactory = $rssFactory; $this->_orderFactory = $orderFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Rss/Block/Wishlist.php b/app/code/Magento/Rss/Block/Wishlist.php index 09c62d9e293..887a8144013 100644 --- a/app/code/Magento/Rss/Block/Wishlist.php +++ b/app/code/Magento/Rss/Block/Wishlist.php @@ -65,7 +65,12 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock protected $_rssFactory; /** - * @param \Magento\View\Block\Template\Context $context + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry @@ -81,8 +86,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -91,17 +95,18 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Customer\Model\Session $customerSession, \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Helper\Data $coreData, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, \Magento\Customer\Model\CustomerFactory $customerFactory, \Magento\Rss\Model\RssFactory $rssFactory, array $data = array() ) { + $this->_coreData = $coreData; $this->_wishlistFactory = $wishlistFactory; $this->_customerFactory = $customerFactory; $this->_rssFactory = $rssFactory; parent::__construct( $context, - $coreData, $catalogConfig, $registry, $taxData, diff --git a/app/code/Magento/Rss/Model/System/Config/Backend/Links.php b/app/code/Magento/Rss/Model/System/Config/Backend/Links.php index 56c899aed98..4bbb373501a 100644 --- a/app/code/Magento/Rss/Model/System/Config/Backend/Links.php +++ b/app/code/Magento/Rss/Model/System/Config/Backend/Links.php @@ -68,7 +68,7 @@ class Links extends \Magento\Core\Model\Config\Value protected function _afterSave() { if ($this->isValueChanged()) { - $this->_cacheTypeList->invalidate(\Magento\View\Block\AbstractBlock::CACHE_GROUP); + $this->_cacheTypeList->invalidate(\Magento\View\Element\AbstractBlock::CACHE_GROUP); } } } diff --git a/app/code/Magento/Rss/etc/module.xml b/app/code/Magento/Rss/etc/module.xml index ec96b30ed73..6eef11c3fe3 100755 --- a/app/code/Magento/Rss/etc/module.xml +++ b/app/code/Magento/Rss/etc/module.xml @@ -46,7 +46,6 @@ <module name="Magento_Customer"/> <module name="Magento_Backend"/> <module name="Magento_GiftMessage"/> - <module name="Magento_Page"/> </depends> </module> </config> diff --git a/app/code/Magento/Rss/view/frontend/layout/default.xml b/app/code/Magento/Rss/view/frontend/layout/default.xml index 35d1c4bbaef..6f604d63359 100644 --- a/app/code/Magento/Rss/view/frontend/layout/default.xml +++ b/app/code/Magento/Rss/view/frontend/layout/default.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="footer_links"> - <block class="Magento\Page\Block\Link\Current" name="rss-link" ifconfig="rss/config/active"> + <block class="Magento\View\Element\Html\Link\Current" name="rss-link" ifconfig="rss/config/active"> <arguments> <argument name="label" xsi:type="string">RSS</argument> <argument name="path" xsi:type="string">rss</argument> diff --git a/app/code/Magento/Rule/Block/Editable.php b/app/code/Magento/Rule/Block/Editable.php index 484b5128ece..6f46cb2b776 100644 --- a/app/code/Magento/Rule/Block/Editable.php +++ b/app/code/Magento/Rule/Block/Editable.php @@ -26,31 +26,12 @@ namespace Magento\Rule\Block; +use Magento\View\Element\AbstractBlock; + class Editable - extends \Magento\View\Block\AbstractBlock + extends \Magento\View\Element\AbstractBlock implements \Magento\Data\Form\Element\Renderer\RendererInterface { - /** - * Core data - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData; - - /** - * @param \Magento\View\Block\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param array $data - */ - public function __construct( - \Magento\View\Block\Context $context, - \Magento\Core\Helper\Data $coreData, - array $data = array() - ) { - $this->_coreData = $coreData; - parent::__construct($context, $data); - } - /** * Render element * diff --git a/app/code/Magento/Rule/Block/Newchild.php b/app/code/Magento/Rule/Block/Newchild.php index 02ac9061005..e5658c16fba 100644 --- a/app/code/Magento/Rule/Block/Newchild.php +++ b/app/code/Magento/Rule/Block/Newchild.php @@ -27,7 +27,7 @@ namespace Magento\Rule\Block; -class Newchild extends \Magento\View\Block\AbstractBlock +class Newchild extends \Magento\View\Element\AbstractBlock implements \Magento\Data\Form\Element\Renderer\RendererInterface { public function render(\Magento\Data\Form\Element\AbstractElement $element) diff --git a/app/code/Magento/Rule/Block/Rule.php b/app/code/Magento/Rule/Block/Rule.php index 3659b7b8621..edfce215433 100644 --- a/app/code/Magento/Rule/Block/Rule.php +++ b/app/code/Magento/Rule/Block/Rule.php @@ -27,7 +27,7 @@ namespace Magento\Rule\Block; -class Rule extends \Magento\View\Block\AbstractBlock +class Rule extends \Magento\View\Element\AbstractBlock { } diff --git a/app/code/Magento/Rule/Model/AbstractModel.php b/app/code/Magento/Rule/Model/AbstractModel.php index ee4a13dbb46..b8fe4bce0f9 100644 --- a/app/code/Magento/Rule/Model/AbstractModel.php +++ b/app/code/Magento/Rule/Model/AbstractModel.php @@ -91,18 +91,18 @@ abstract class AbstractModel extends \Magento\Core\Model\AbstractModel protected $_locale; /** - * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\LocaleInterface $locale, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Rule/Model/Rule.php b/app/code/Magento/Rule/Model/Rule.php index b45da837cb5..2109835fee7 100644 --- a/app/code/Magento/Rule/Model/Rule.php +++ b/app/code/Magento/Rule/Model/Rule.php @@ -48,9 +48,9 @@ class Rule extends \Magento\Rule\Model\AbstractModel protected $_actions; /** - * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Rule\Model\Condition\CombineFactory $conditionsFactory * @param \Magento\Rule\Model\Action\CollectionFactory $actionsFactory @@ -59,9 +59,9 @@ class Rule extends \Magento\Rule\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\LocaleInterface $locale, \Magento\Rule\Model\Condition\CombineFactory $conditionsFactory, \Magento\Rule\Model\Action\CollectionFactory $actionsFactory, @@ -71,7 +71,7 @@ class Rule extends \Magento\Rule\Model\AbstractModel ) { $this->_conditionsFactory = $conditionsFactory; $this->_actionsFactory = $actionsFactory; - parent::__construct($formFactory, $context, $registry, $locale, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $formFactory, $locale, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/Grid.php index f0afe1c4215..40ec49d3627 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/Grid.php @@ -50,28 +50,26 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_agreementModel; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $agreementFactory - * @param \Magento\Sales\Model\Billing\Agreement $agreementModel - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $agreementFactory + * @param \Magento\Sales\Model\Billing\Agreement $agreementModel + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Payment\Helper\Data $paymentData, - \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $agreementFactory, - \Magento\Sales\Model\Billing\Agreement $agreementModel, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Payment\Helper\Data $paymentData, + \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $agreementFactory, + \Magento\Sales\Model\Billing\Agreement $agreementModel, + array $data = array() + ) { $this->_paymentData = $paymentData; $this->_agreementFactory = $agreementFactory; $this->_agreementModel = $agreementModel; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View.php b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View.php index ab80e19e795..b171c8c2530 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View.php @@ -40,20 +40,18 @@ class View extends \Magento\Backend\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php index c58dbc5fdfd..65216720015 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Info.php @@ -50,23 +50,21 @@ class Info extends \Magento\Backend\Block\Template */ protected $_customerFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Customer\Model\CustomerFactory $customerFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Customer\Model\CustomerFactory $customerFactory, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_customerFactory = $customerFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php index a870799ddf6..82095805e7c 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Billing/Agreement/View/Tab/Orders.php @@ -31,7 +31,7 @@ */ namespace Magento\Sales\Block\Adminhtml\Billing\Agreement\View\Tab; -class Orders extends \Magento\View\Block\Text\ListText +class Orders extends \Magento\View\Element\Text\ListText implements \Magento\Backend\Block\Widget\Tab\TabInterface { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Creditmemo/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Creditmemo/Grid.php index 0f490d411e8..03af0cb5de5 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Creditmemo/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Creditmemo/Grid.php @@ -43,25 +43,23 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_creditmemoFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory - * @param \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory + * @param \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory, - \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\Order\CreditmemoFactory $creditmemoFactory, + \Magento\Sales\Model\Resource\Order\Creditmemo\Grid\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_creditmemoFactory = $creditmemoFactory; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php b/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php index 4315d23149e..0f350b4f5b0 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Agreement.php @@ -49,28 +49,26 @@ class Agreement */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $agreementFactory - * @param \Magento\Sales\Model\Billing\Agreement $agreementModel - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $agreementFactory + * @param \Magento\Sales\Model\Billing\Agreement $agreementModel + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Payment\Helper\Data $paymentData, - \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $agreementFactory, - \Magento\Sales\Model\Billing\Agreement $agreementModel, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Payment\Helper\Data $paymentData, + \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $agreementFactory, + \Magento\Sales\Model\Billing\Agreement $agreementModel, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; - parent::__construct($context, $coreData, $urlModel, $paymentData, $agreementFactory, $agreementModel, $data); + parent::__construct($context, $urlModel, $paymentData, $agreementFactory, $agreementModel, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php b/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php index 0b32b738475..8164162624f 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Customer/Edit/Tab/Recurring/Profile.php @@ -42,28 +42,26 @@ class Profile */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $profileCollection - * @param \Magento\Sales\Model\Recurring\ProfileFactory $recurringProfile - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $profileCollection + * @param \Magento\Sales\Model\Recurring\ProfileFactory $recurringProfile + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Payment\Helper\Data $paymentData, - \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $profileCollection, - \Magento\Sales\Model\Recurring\ProfileFactory $recurringProfile, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Payment\Helper\Data $paymentData, + \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $profileCollection, + \Magento\Sales\Model\Recurring\ProfileFactory $recurringProfile, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; - parent::__construct($context, $coreData, $urlModel, $paymentData, $profileCollection, $recurringProfile, $data); + parent::__construct($context, $urlModel, $paymentData, $profileCollection, $recurringProfile, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Invoice/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Invoice/Grid.php index 171a82cf579..fbe748f877c 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Invoice/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Invoice/Grid.php @@ -43,25 +43,23 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_invoiceFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\Order\InvoiceFactory $invoiceFactory - * @param \Magento\Sales\Model\Resource\Order\Invoice\Grid\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\Order\InvoiceFactory $invoiceFactory + * @param \Magento\Sales\Model\Resource\Order\Invoice\Grid\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\Order\InvoiceFactory $invoiceFactory, - \Magento\Sales\Model\Resource\Order\Invoice\Grid\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\Order\InvoiceFactory $invoiceFactory, + \Magento\Sales\Model\Resource\Order\Invoice\Grid\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_invoiceFactory = $invoiceFactory; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Items/AbstractItems.php b/app/code/Magento/Sales/Block/Adminhtml/Items/AbstractItems.php index 6fa5f43c289..6e37f368abe 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Items/AbstractItems.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Items/AbstractItems.php @@ -65,23 +65,21 @@ class AbstractItems extends \Magento\Backend\Block\Template */ protected $_productFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $registry - * @param array $data - */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_productFactory = $productFactory; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -106,7 +104,7 @@ class AbstractItems extends \Magento\Backend\Block\Template * Retrieve item renderer block * * @param string $type - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock * @throws \RuntimeException */ public function getItemRenderer($type) @@ -126,7 +124,7 @@ class AbstractItems extends \Magento\Backend\Block\Template * * @param string $column * @param string $compositePart - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function getColumnRenderer($column, $compositePart = '') { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Items/Column/DefaultColumn.php b/app/code/Magento/Sales/Block/Adminhtml/Items/Column/DefaultColumn.php index 63044d68f96..9001f4f8a1f 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Items/Column/DefaultColumn.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Items/Column/DefaultColumn.php @@ -41,20 +41,18 @@ class DefaultColumn extends \Magento\Backend\Block\Template */ protected $_optionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\Product\OptionFactory $optionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\Product\OptionFactory $optionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\Product\OptionFactory $optionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\Product\OptionFactory $optionFactory, + array $data = array() + ) { $this->_optionFactory = $optionFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/AbstractOrder.php b/app/code/Magento/Sales/Block/Adminhtml/Order/AbstractOrder.php index 62f1a861e18..d6b4aec3989 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/AbstractOrder.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/AbstractOrder.php @@ -42,20 +42,18 @@ class AbstractOrder extends \Magento\Adminhtml\Block\Widget */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Address.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Address.php index 2f67b1db59b..706adfc282c 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Address.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Address.php @@ -38,20 +38,18 @@ class Address extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php index 6f48f0ad4bd..aaebd85de95 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Address/Form.php @@ -45,41 +45,44 @@ class Form */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Customer\Model\AddressFactory $addressFactory - * @param \Magento\Customer\Model\FormFactory $customerFormFactory - * @param \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Customer\Model\AddressFactory $addressFactory + * @param \Magento\Customer\Model\FormFactory $customerFormFactory + * @param \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Data\FormFactory $formFactory, - \Magento\Customer\Model\AddressFactory $addressFactory, - \Magento\Customer\Model\FormFactory $customerFormFactory, - \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Customer\Model\AddressFactory $addressFactory, + \Magento\Customer\Model\FormFactory $customerFormFactory, + \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct( - $context, - $coreData, - $sessionQuote, - $orderCreate, - $formFactory, - $addressFactory, - $customerFormFactory, - $adminhtmlAddresses, - $data + parent::__construct( + $context, + $sessionQuote, + $orderCreate, + $formFactory, + $coreData, + $jsonEncoder, + $addressFactory, + $customerFormFactory, + $adminhtmlAddresses, + $data ); } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Comments/View.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Comments/View.php index 8b902908b4c..ae17815db74 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Comments/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Comments/View.php @@ -42,20 +42,18 @@ class View extends \Magento\Backend\Block\Template */ protected $_salesData = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Sales\Helper\Data $salesData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Sales\Helper\Data $salesData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Sales\Helper\Data $salesData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Sales\Helper\Data $salesData, + array $data = array() + ) { $this->_salesData = $salesData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create.php index d47f24cee54..52d5e3ec879 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create.php @@ -41,20 +41,18 @@ class Create extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_sessionQuote; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + array $data = array() + ) { $this->_sessionQuote = $sessionQuote; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/AbstractCreate.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/AbstractCreate.php index 2204c7df282..f48991437a4 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/AbstractCreate.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/AbstractCreate.php @@ -45,16 +45,15 @@ abstract class AbstractCreate extends \Magento\Backend\Block\Widget */ protected $_orderCreate; - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + array $data = array() + ) { $this->_sessionQuote = $sessionQuote; $this->_orderCreate = $orderCreate; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php index 4ab31bd7cef..80ad6bc6864 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Billing/Method/Form.php @@ -41,19 +41,17 @@ class Form extends \Magento\Payment\Block\Form\Container protected $_sessionQuote; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Adminhtml\Model\Session\Quote $sessionQuote, array $data = array() ) { $this->_sessionQuote = $sessionQuote; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Data.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Data.php index 4a781628b99..78ed7447d76 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Data.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Data.php @@ -40,24 +40,22 @@ class Data extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCreate */ protected $_currencyFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Directory\Model\CurrencyFactory $currencyFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Directory\Model\CurrencyFactory $currencyFactory, + array $data = array() + ) { $this->_currencyFactory = $currencyFactory; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php index 85e0b429c21..57792332ea2 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form.php @@ -41,24 +41,30 @@ class Form extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCreate */ protected $_customerFormFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Customer\Model\FormFactory $customerFormFactory - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Customer\Model\FormFactory $customerFormFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Customer\Model\FormFactory $customerFormFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Customer\Model\FormFactory $customerFormFactory, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_customerFormFactory = $customerFormFactory; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $data); } protected function _construct() @@ -138,6 +144,6 @@ class Form extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCreate $data['shipping_method_reseted'] = !(bool)$this->getQuote()->getShippingAddress()->getShippingMethod(); $data['payment_method'] = $this->getQuote()->getPayment()->getMethod(); } - return $this->_coreData->jsonEncode($data); + return $this->_jsonEncoder->encode($data); } } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/AbstractForm.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/AbstractForm.php index 8a85c7f3b21..da0559ae19e 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/AbstractForm.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/AbstractForm.php @@ -49,24 +49,22 @@ abstract class AbstractForm */ protected $_form; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Data\FormFactory $formFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Data\FormFactory $formFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Data\FormFactory $formFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Data\FormFactory $formFactory, + array $data = array() + ) { $this->_formFactory = $formFactory; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php index f66e3168ee5..297bd0b41c8 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Account.php @@ -43,29 +43,27 @@ class Account extends \Magento\Sales\Block\Adminhtml\Order\Create\Form\AbstractF */ protected $_customerFormFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Customer\Model\FormFactory $customerFormFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param \Magento\Customer\Model\FormFactory $customerFormFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Data\FormFactory $formFactory, - \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Customer\Model\FormFactory $customerFormFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Data\FormFactory $formFactory, + \Magento\Customer\Model\CustomerFactory $customerFactory, + \Magento\Customer\Model\FormFactory $customerFormFactory, + array $data = array() + ) { $this->_customerFactory = $customerFactory; $this->_customerFormFactory = $customerFormFactory; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $formFactory, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $formFactory, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php index d4c7fcf7fd4..c3424d9777b 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Form/Address.php @@ -60,32 +60,46 @@ class Address */ protected $_customerFormFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Customer\Model\AddressFactory $addressFactory - * @param \Magento\Customer\Model\FormFactory $customerFormFactory - * @param \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @var \Magento\Core\Helper\Data + */ + protected $_coreData; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Customer\Model\AddressFactory $addressFactory + * @param \Magento\Customer\Model\FormFactory $customerFormFactory + * @param \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Data\FormFactory $formFactory, - \Magento\Customer\Model\AddressFactory $addressFactory, - \Magento\Customer\Model\FormFactory $customerFormFactory, - \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Helper\Data $coreData, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Customer\Model\AddressFactory $addressFactory, + \Magento\Customer\Model\FormFactory $customerFormFactory, + \Magento\Adminhtml\Helper\Addresses $adminhtmlAddresses, + array $data = array() + ) { + $this->_coreData = $coreData; + $this->_jsonEncoder = $jsonEncoder; $this->_addressFactory = $addressFactory; $this->_customerFormFactory = $customerFormFactory; $this->_adminhtmlAddresses = $adminhtmlAddresses; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $formFactory, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $formFactory, $data); } /** @@ -145,7 +159,7 @@ class Address \Magento\Eav\Model\AttributeDataFactory::OUTPUT_FORMAT_JSON ); } - return $this->_coreData->jsonEncode($data); + return $this->_jsonEncoder->encode($data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage.php index 9c5ccadd5ef..da36b489464 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage.php @@ -43,7 +43,6 @@ class Giftmessage extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCr /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate * @param \Magento\GiftMessage\Model\Save $giftMessageSave @@ -51,14 +50,13 @@ class Giftmessage extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCr */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Adminhtml\Model\Session\Quote $sessionQuote, \Magento\Sales\Model\AdminOrder\Create $orderCreate, \Magento\GiftMessage\Model\Save $giftMessageSave, array $data = array() ) { $this->_giftMessageSave = $giftMessageSave; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php index 857729fce0d..b5f56553bcf 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Giftmessage/Form.php @@ -60,7 +60,6 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote @@ -68,14 +67,13 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Adminhtml\Model\Session\Quote $sessionQuote, array $data = array() ) { $this->_sessionQuote = $sessionQuote; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php index f2e016968ac..b5617feb083 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Items/Grid.php @@ -66,7 +66,6 @@ class Grid extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCreate /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate * @param \Magento\Wishlist\Model\WishlistFactory $wishlistFactory @@ -77,7 +76,6 @@ class Grid extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCreate */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Adminhtml\Model\Session\Quote $sessionQuote, \Magento\Sales\Model\AdminOrder\Create $orderCreate, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, @@ -90,7 +88,7 @@ class Grid extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCreate $this->_giftMessageSave = $giftMessageSave; $this->_taxConfig = $taxConfig; $this->_taxData = $taxData; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $data); } protected function _construct() @@ -427,7 +425,7 @@ class Grid extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCreate * Get order item extra info block * * @param \Magento\Sales\Model\Quote\Item $item - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function getItemExtraInfo($item) { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Load.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Load.php index ee4283a7040..821415d5d1d 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Load.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Load.php @@ -34,7 +34,7 @@ */ namespace Magento\Sales\Block\Adminhtml\Order\Create; -class Load extends \Magento\View\Block\Template +class Load extends \Magento\View\Element\Template { /** * Adminhtml js @@ -44,19 +44,25 @@ class Load extends \Magento\View\Block\Template protected $_adminhtmlJs = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder * @param \Magento\Adminhtml\Helper\Js $adminhtmlJs * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, \Magento\Adminhtml\Helper\Js $adminhtmlJs, array $data = array() ) { + $this->_jsonEncoder = $jsonEncoder; $this->_adminhtmlJs = $adminhtmlJs; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _toHtml() @@ -66,7 +72,7 @@ class Load extends \Magento\View\Block\Template foreach ($this->getChildNames() as $name) { $result[$name] = $layout->renderElement($name); } - $resultJson = $this->_coreData->jsonEncode($result); + $resultJson = $this->_jsonEncoder->encode($result); $jsVarname = $this->getRequest()->getParam('as_js_varname'); if ($jsVarname) { return $this->_adminhtmlJs->getScript(sprintf('var %s = %s', $jsVarname, $resultJson)); diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Messages.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Messages.php index 25c30ed3d98..bdc1b6e2ab4 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Messages.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Messages.php @@ -33,7 +33,7 @@ */ namespace Magento\Sales\Block\Adminhtml\Order\Create; -class Messages extends \Magento\View\Block\Messages +class Messages extends \Magento\View\Element\Messages { /** * @var \Magento\Adminhtml\Model\Session\Quote @@ -41,27 +41,25 @@ class Messages extends \Magento\View\Block\Messages protected $sessionQuote; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Message\Factory $messageFactory * @param \Magento\Message\CollectionFactory $collectionFactory * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Message\Factory $messageFactory, \Magento\Message\CollectionFactory $collectionFactory, \Magento\Adminhtml\Model\Session\Quote $sessionQuote, array $data = array() ) { $this->sessionQuote = $sessionQuote; - parent::__construct($context, $coreData, $messageFactory, $collectionFactory, $data); + parent::__construct($context, $messageFactory, $collectionFactory, $data); } /** - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ protected function _prepareLayout() { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Search/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Search/Grid.php index b3b133a34b8..fb5b4a81a89 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Search/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Search/Grid.php @@ -55,31 +55,29 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_productFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Catalog\Model\Config $catalogConfig - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\Config $salesConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Catalog\Model\Config $catalogConfig + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\Config $salesConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Catalog\Model\Config $catalogConfig, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\Config $salesConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Catalog\Model\Config $catalogConfig, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\Config $salesConfig, + array $data = array() + ) { $this->_productFactory = $productFactory; $this->_catalogConfig = $catalogConfig; $this->_sessionQuote = $sessionQuote; $this->_salesConfig = $salesConfig; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Shipping/Method/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Shipping/Method/Form.php index 97c9dbb6a7a..57b3c88c0fb 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Shipping/Method/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Shipping/Method/Form.php @@ -45,24 +45,22 @@ class Form */ protected $_taxData = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Tax\Helper\Data $taxData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Tax\Helper\Data $taxData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Tax\Helper\Data $taxData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Tax\Helper\Data $taxData, + array $data = array() + ) { $this->_taxData = $taxData; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/AbstractSidebar.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/AbstractSidebar.php index dda12bd9e24..a7ccb1db8a5 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/AbstractSidebar.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/AbstractSidebar.php @@ -49,7 +49,6 @@ class AbstractSidebar extends \Magento\Sales\Block\Adminhtml\Order\Create\Abstra /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate * @param \Magento\Sales\Model\Config $salesConfig @@ -57,13 +56,12 @@ class AbstractSidebar extends \Magento\Sales\Block\Adminhtml\Order\Create\Abstra */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Adminhtml\Model\Session\Quote $sessionQuote, \Magento\Sales\Model\AdminOrder\Create $orderCreate, \Magento\Sales\Model\Config $salesConfig, array $data = array() ) { - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $data); $this->_salesConfig = $salesConfig; } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Pcompared.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Pcompared.php index f7bddf65e4a..02f8fa6d81e 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Pcompared.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Pcompared.php @@ -46,29 +46,27 @@ class Pcompared extends \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Abst */ protected $_event; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Sales\Model\Config $salesConfig - * @param \Magento\Reports\Model\Resource\Event $event - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Sales\Model\Config $salesConfig + * @param \Magento\Reports\Model\Resource\Event $event + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Sales\Model\Config $salesConfig, - \Magento\Reports\Model\Resource\Event $event, - \Magento\Catalog\Model\ProductFactory $productFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Sales\Model\Config $salesConfig, + \Magento\Reports\Model\Resource\Event $event, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { $this->_event = $event; $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $salesConfig, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $salesConfig, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Pviewed.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Pviewed.php index 415a389c163..2e9c799a887 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Pviewed.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Pviewed.php @@ -46,29 +46,27 @@ class Pviewed extends \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Abstra */ protected $_eventFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Sales\Model\Config $salesConfig - * @param \Magento\Reports\Model\EventFactory $eventFactory - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Sales\Model\Config $salesConfig + * @param \Magento\Reports\Model\EventFactory $eventFactory + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Sales\Model\Config $salesConfig, - \Magento\Reports\Model\EventFactory $eventFactory, - \Magento\Catalog\Model\ProductFactory $productFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Sales\Model\Config $salesConfig, + \Magento\Reports\Model\EventFactory $eventFactory, + \Magento\Catalog\Model\ProductFactory $productFactory, + array $data = array() + ) { $this->_eventFactory = $eventFactory; $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $salesConfig, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $salesConfig, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Reorder.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Reorder.php index 5e56fe587e7..0a5ad6b5fbb 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Reorder.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Sidebar/Reorder.php @@ -47,26 +47,24 @@ class Reorder extends \Magento\Sales\Block\Adminhtml\Order\Create\Sidebar\Abstra */ protected $_ordersFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Sales\Model\Config $salesConfig - * @param \Magento\Sales\Model\Resource\Order\CollectionFactory $ordersFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Sales\Model\Config $salesConfig + * @param \Magento\Sales\Model\Resource\Order\CollectionFactory $ordersFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Sales\Model\Config $salesConfig, - \Magento\Sales\Model\Resource\Order\CollectionFactory $ordersFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Sales\Model\Config $salesConfig, + \Magento\Sales\Model\Resource\Order\CollectionFactory $ordersFactory, + array $data = array() + ) { $this->_ordersFactory = $ordersFactory; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $salesConfig, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $salesConfig, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals.php index 57b0210dfed..6df8ba4adde 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals.php @@ -51,27 +51,25 @@ class Totals extends \Magento\Sales\Block\Adminhtml\Order\Create\AbstractCreate */ protected $_salesConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\Sales\Model\Config $salesConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Sales\Helper\Data $salesData + * @param \Magento\Sales\Model\Config $salesConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Sales\Helper\Data $salesData, - \Magento\Sales\Model\Config $salesConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Sales\Helper\Data $salesData, + \Magento\Sales\Model\Config $salesConfig, + array $data = array() + ) { $this->_salesData = $salesData; $this->_salesConfig = $salesConfig; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Discount.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Discount.php index 953121a3939..32ae4837088 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Discount.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Discount.php @@ -41,28 +41,26 @@ class Discount extends \Magento\Sales\Block\Adminhtml\Order\Create\Totals\Defaul */ protected $_taxConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\Sales\Model\Config $salesConfig - * @param \Magento\Tax\Model\Config $taxConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Sales\Helper\Data $salesData + * @param \Magento\Sales\Model\Config $salesConfig + * @param \Magento\Tax\Model\Config $taxConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Sales\Helper\Data $salesData, - \Magento\Sales\Model\Config $salesConfig, - \Magento\Tax\Model\Config $taxConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Sales\Helper\Data $salesData, + \Magento\Sales\Model\Config $salesConfig, + \Magento\Tax\Model\Config $taxConfig, + array $data = array() + ) { $this->_taxConfig = $taxConfig; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $salesData, $salesConfig, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $salesData, $salesConfig, $data); } public function displayBoth() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Grandtotal.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Grandtotal.php index cc78c772a15..1bafa6eb255 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Grandtotal.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Grandtotal.php @@ -41,28 +41,26 @@ class Grandtotal extends \Magento\Sales\Block\Adminhtml\Order\Create\Totals\Defa */ protected $_taxConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\Sales\Model\Config $salesConfig - * @param \Magento\Tax\Model\Config $taxConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Sales\Helper\Data $salesData + * @param \Magento\Sales\Model\Config $salesConfig + * @param \Magento\Tax\Model\Config $taxConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Sales\Helper\Data $salesData, - \Magento\Sales\Model\Config $salesConfig, - \Magento\Tax\Model\Config $taxConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Sales\Helper\Data $salesData, + \Magento\Sales\Model\Config $salesConfig, + \Magento\Tax\Model\Config $taxConfig, + array $data = array() + ) { $this->_taxConfig = $taxConfig; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $salesData, $salesConfig, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $salesData, $salesConfig, $data); } public function includeTax() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Shipping.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Shipping.php index e880922bdc8..7fdc7fe6499 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Shipping.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Shipping.php @@ -42,28 +42,26 @@ class Shipping */ protected $_taxConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\Sales\Model\Config $salesConfig - * @param \Magento\Tax\Model\Config $taxConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Sales\Helper\Data $salesData + * @param \Magento\Sales\Model\Config $salesConfig + * @param \Magento\Tax\Model\Config $taxConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Sales\Helper\Data $salesData, - \Magento\Sales\Model\Config $salesConfig, - \Magento\Tax\Model\Config $taxConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Sales\Helper\Data $salesData, + \Magento\Sales\Model\Config $salesConfig, + \Magento\Tax\Model\Config $taxConfig, + array $data = array() + ) { $this->_taxConfig = $taxConfig; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $salesData, $salesConfig, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $salesData, $salesConfig, $data); } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Subtotal.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Subtotal.php index adc4130d3b2..49f5d41ea81 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Subtotal.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Create/Totals/Subtotal.php @@ -41,28 +41,26 @@ class Subtotal extends \Magento\Sales\Block\Adminhtml\Order\Create\Totals\Defaul */ protected $_taxConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote - * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate - * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\Sales\Model\Config $salesConfig - * @param \Magento\Tax\Model\Config $taxConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Adminhtml\Model\Session\Quote $sessionQuote + * @param \Magento\Sales\Model\AdminOrder\Create $orderCreate + * @param \Magento\Sales\Helper\Data $salesData + * @param \Magento\Sales\Model\Config $salesConfig + * @param \Magento\Tax\Model\Config $taxConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Adminhtml\Model\Session\Quote $sessionQuote, - \Magento\Sales\Model\AdminOrder\Create $orderCreate, - \Magento\Sales\Helper\Data $salesData, - \Magento\Sales\Model\Config $salesConfig, - \Magento\Tax\Model\Config $taxConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Adminhtml\Model\Session\Quote $sessionQuote, + \Magento\Sales\Model\AdminOrder\Create $orderCreate, + \Magento\Sales\Helper\Data $salesData, + \Magento\Sales\Model\Config $salesConfig, + \Magento\Tax\Model\Config $taxConfig, + array $data = array() + ) { $this->_taxConfig = $taxConfig; - parent::__construct($context, $coreData, $sessionQuote, $orderCreate, $salesData, $salesConfig, $data); + parent::__construct($context, $sessionQuote, $orderCreate, $salesData, $salesConfig, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create.php index f78b111896f..4851388c9c4 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create.php @@ -39,20 +39,18 @@ class Create extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Adjustments.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Adjustments.php index 88ad92e7561..6e0591c2064 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Adjustments.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Adjustments.php @@ -34,20 +34,18 @@ class Adjustments extends \Magento\Backend\Block\Template */ protected $_taxConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Tax\Model\Config $taxConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Tax\Model\Config $taxConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Tax\Model\Config $taxConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Tax\Model\Config $taxConfig, + array $data = array() + ) { $this->_taxConfig = $taxConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php index 4f400bb644a..afe51a21f55 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/Create/Items.php @@ -40,24 +40,22 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems */ protected $_salesData = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Sales\Helper\Data $salesData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Sales\Helper\Data $salesData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, - \Magento\Sales\Helper\Data $salesData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Model\Registry $registry, + \Magento\Sales\Helper\Data $salesData, + array $data = array() + ) { $this->_salesData = $salesData; - parent::__construct($context, $coreData, $productFactory, $registry, $data); + parent::__construct($context, $productFactory, $registry, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View.php index ec495a54640..ddd8f385f0a 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View.php @@ -42,20 +42,18 @@ class View extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View/Comments.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View/Comments.php index 29d7bc5ac48..f43d7f05c57 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View/Comments.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Creditmemo/View/Comments.php @@ -44,12 +44,12 @@ class Comments extends \Magento\Backend\Block\Text\ListText protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create.php index ec74e3fe195..2de1206afbe 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create.php @@ -39,20 +39,18 @@ class Create extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php index cd199ec4302..f8cfd8708a9 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Items.php @@ -40,24 +40,22 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems */ protected $_salesData = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Sales\Helper\Data $salesData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Sales\Helper\Data $salesData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, - \Magento\Sales\Helper\Data $salesData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Model\Registry $registry, + \Magento\Sales\Helper\Data $salesData, + array $data = array() + ) { $this->_salesData = $salesData; - parent::__construct($context, $coreData, $productFactory, $registry, $data); + parent::__construct($context, $productFactory, $registry, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Tracking.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Tracking.php index b585ea2838a..73cabe06b8f 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Tracking.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/Create/Tracking.php @@ -47,23 +47,21 @@ class Tracking extends \Magento\Backend\Block\Template */ protected $_shippingConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Shipping\Model\Config $shippingConfig - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Shipping\Model\Config $shippingConfig + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Shipping\Model\Config $shippingConfig, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Shipping\Model\Config $shippingConfig, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_shippingConfig = $shippingConfig; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View.php index 5e957e1fab7..ab240c338f1 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View.php @@ -54,23 +54,21 @@ class View extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_backendSession; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Auth\Session $backendSession - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Backend\Model\Auth\Session $backendSession + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Auth\Session $backendSession, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Backend\Model\Auth\Session $backendSession, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_backendSession = $backendSession; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View/Comments.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View/Comments.php index a9966598efa..0266b460a3d 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View/Comments.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Invoice/View/Comments.php @@ -44,12 +44,12 @@ class Comments extends \Magento\Backend\Block\Text\ListText protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Payment.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Payment.php index f832578c232..ff2f6f5cd15 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Payment.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Payment.php @@ -42,20 +42,18 @@ class Payment extends \Magento\Backend\Block\Template */ protected $_paymentData = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Payment\Helper\Data $paymentData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Payment\Helper\Data $paymentData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Payment\Helper\Data $paymentData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Payment\Helper\Data $paymentData, + array $data = array() + ) { $this->_paymentData = $paymentData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create.php index c127560b1c9..7b13d540eb1 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create.php @@ -39,20 +39,18 @@ class Create extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create/Items.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create/Items.php index 9008b47e820..a0ef8beecc6 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create/Items.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create/Items.php @@ -38,24 +38,22 @@ class Items extends \Magento\Sales\Block\Adminhtml\Items\AbstractItems */ protected $_salesData = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\ProductFactory $productFactory - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Sales\Helper\Data $salesData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\ProductFactory $productFactory + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Sales\Helper\Data $salesData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\ProductFactory $productFactory, - \Magento\Core\Model\Registry $registry, - \Magento\Sales\Helper\Data $salesData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\ProductFactory $productFactory, + \Magento\Core\Model\Registry $registry, + \Magento\Sales\Helper\Data $salesData, + array $data = array() + ) { $this->_salesData = $salesData; - parent::__construct($context, $coreData, $productFactory, $registry, $data); + parent::__construct($context, $productFactory, $registry, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create/Tracking.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create/Tracking.php index e8b8388b146..d1ec8fc1fc6 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create/Tracking.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Create/Tracking.php @@ -47,23 +47,21 @@ class Tracking extends \Magento\Backend\Block\Template */ protected $_shippingConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Shipping\Model\Config $shippingConfig - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Shipping\Model\Config $shippingConfig + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Shipping\Model\Config $shippingConfig, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Shipping\Model\Config $shippingConfig, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_shippingConfig = $shippingConfig; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Packaging.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Packaging.php index 7b52408e48e..b48e3ff021c 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Packaging.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Packaging.php @@ -44,23 +44,29 @@ class Packaging extends \Magento\Backend\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Usa\Model\Shipping\Carrier\Usps\Source\Size $sourceSizeModel - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Usa\Model\Shipping\Carrier\Usps\Source\Size $sourceSizeModel + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Usa\Model\Shipping\Carrier\Usps\Source\Size $sourceSizeModel, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Usa\Model\Shipping\Carrier\Usps\Source\Size $sourceSizeModel, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_coreRegistry = $coreRegistry; $this->_sourceSizeModel = $sourceSizeModel; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -130,7 +136,7 @@ class Packaging extends \Magento\Backend\Block\Template 'shipmentItemsOrderItemId' => $itemsOrderItemId, 'customizable' => $this->_getCustomizableContainers(), ); - return $this->_coreData->jsonEncode($data); + return $this->_jsonEncoder->encode($data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Packaging/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Packaging/Grid.php index 97b53054f98..23afb4f4f81 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Packaging/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/Packaging/Grid.php @@ -50,23 +50,21 @@ class Grid extends \Magento\Backend\Block\Template */ protected $_shipmentItemFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Sales\Model\Order\Shipment\ItemFactory $shipmentItemFactory - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Sales\Model\Order\Shipment\ItemFactory $shipmentItemFactory + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Sales\Model\Order\Shipment\ItemFactory $shipmentItemFactory, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Sales\Model\Order\Shipment\ItemFactory $shipmentItemFactory, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_shipmentItemFactory = $shipmentItemFactory; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View.php index 4d5c1e9b073..07e95dbfe1b 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View.php @@ -42,20 +42,18 @@ class View extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View/Comments.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View/Comments.php index e37767f3274..02641fd3c4d 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View/Comments.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View/Comments.php @@ -44,12 +44,12 @@ class Comments extends \Magento\Backend\Block\Text\ListText protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View/Tracking.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View/Tracking.php index 31f7af846c1..fd691ec74e0 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View/Tracking.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Shipment/View/Tracking.php @@ -49,21 +49,19 @@ class Tracking extends \Magento\Backend\Block\Template /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Shipping\Model\Config $shippingConfig * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Shipping\Model\Config $shippingConfig, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_shippingConfig = $shippingConfig; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Status/Assign/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Status/Assign/Form.php index 443d4cb6f28..ee7ec5b6a93 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Status/Assign/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Status/Assign/Form.php @@ -41,27 +41,25 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_orderConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Sales\Model\Order\Config $orderConfig - * @param \Magento\Sales\Model\Resource\Order\Status\CollectionFactory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Sales\Model\Order\Config $orderConfig + * @param \Magento\Sales\Model\Resource\Order\Status\CollectionFactory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Sales\Model\Order\Config $orderConfig, - \Magento\Sales\Model\Resource\Order\Status\CollectionFactory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Sales\Model\Order\Config $orderConfig, + \Magento\Sales\Model\Resource\Order\Status\CollectionFactory $collectionFactory, + array $data = array() + ) { $this->_orderConfig = $orderConfig; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/Totals/Tax.php b/app/code/Magento/Sales/Block/Adminhtml/Order/Totals/Tax.php index 3ca69a76d81..ad6128801ff 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/Totals/Tax.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/Totals/Tax.php @@ -52,7 +52,6 @@ class Tax extends \Magento\Tax\Block\Sales\Order\Tax /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Tax\Model\Config $taxConfig * @param \Magento\Tax\Helper\Data $taxHelper * @param \Magento\Tax\Model\Calculation $taxCalculation @@ -61,7 +60,6 @@ class Tax extends \Magento\Tax\Block\Sales\Order\Tax */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Tax\Model\Config $taxConfig, \Magento\Tax\Helper\Data $taxHelper, \Magento\Tax\Model\Calculation $taxCalculation, @@ -71,7 +69,7 @@ class Tax extends \Magento\Tax\Block\Sales\Order\Tax $this->_taxHelper = $taxHelper; $this->_taxCalculation = $taxCalculation; $this->_taxOrderFactory = $taxOrderFactory; - parent::__construct($context, $coreData, $taxConfig, $data); + parent::__construct($context, $taxConfig, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View.php index fca1ea07cd7..ffaa79576fd 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View.php @@ -52,23 +52,21 @@ class View extends \Magento\Backend\Block\Widget\Form\Container */ protected $_salesConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Sales\Model\Config $salesConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Sales\Model\Config $salesConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Sales\Model\Config $salesConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Sales\Model\Config $salesConfig, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_salesConfig = $salesConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Giftmessage.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Giftmessage.php index c6d9de87ecd..1581fe3a9b8 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Giftmessage.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Giftmessage.php @@ -56,21 +56,19 @@ class Giftmessage extends \Magento\Adminhtml\Block\Widget /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\GiftMessage\Model\MessageFactory $messageFactory * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\GiftMessage\Model\MessageFactory $messageFactory, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; $this->_messageFactory = $messageFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/History.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/History.php index 218f4cb4313..c004bd4914b 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/History.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/History.php @@ -49,23 +49,21 @@ class History extends \Magento\Backend\Block\Template */ protected $_salesData = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Sales\Helper\Data $salesData + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Sales\Helper\Data $salesData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Sales\Helper\Data $salesData, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; $this->_salesData = $salesData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php index b370c769e57..c33c7583e3e 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Info.php @@ -55,31 +55,29 @@ class Info extends \Magento\Sales\Block\Adminhtml\Order\AbstractOrder */ protected $_eavConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Customer\Model\GroupFactory $groupFactory - * @param \Magento\Customer\Model\CustomerFactory $customerFactory - * @param \Magento\Eav\Model\Config $eavConfig - * @param \Magento\Eav\Model\AttributeDataFactory $attrDataFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Customer\Model\GroupFactory $groupFactory + * @param \Magento\Customer\Model\CustomerFactory $customerFactory + * @param \Magento\Eav\Model\Config $eavConfig + * @param \Magento\Eav\Model\AttributeDataFactory $attrDataFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Customer\Model\GroupFactory $groupFactory, - \Magento\Customer\Model\CustomerFactory $customerFactory, - \Magento\Eav\Model\Config $eavConfig, - \Magento\Eav\Model\AttributeDataFactory $attrDataFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Customer\Model\GroupFactory $groupFactory, + \Magento\Customer\Model\CustomerFactory $customerFactory, + \Magento\Eav\Model\Config $eavConfig, + \Magento\Eav\Model\AttributeDataFactory $attrDataFactory, + array $data = array() + ) { $this->_customerFactory = $customerFactory; $this->_groupFactory = $groupFactory; $this->_eavConfig = $eavConfig; $this->_attrDataFactory = $attrDataFactory; - parent::__construct($context, $coreData, $registry, $data); + parent::__construct($context, $registry, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Messages.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Messages.php index 43c60ebf14c..d3bd3078a7e 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Messages.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Messages.php @@ -33,7 +33,7 @@ */ namespace Magento\Sales\Block\Adminhtml\Order\View; -class Messages extends \Magento\View\Block\Messages +class Messages extends \Magento\View\Element\Messages { /** * Core registry @@ -43,23 +43,21 @@ class Messages extends \Magento\View\Block\Messages protected $coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Message\Factory $messageFactory * @param \Magento\Message\CollectionFactory $collectionFactory * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Message\Factory $messageFactory, \Magento\Message\CollectionFactory $collectionFactory, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->coreRegistry = $registry; - parent::__construct($context, $coreData, $messageFactory, $collectionFactory, $data); + parent::__construct($context, $messageFactory, $collectionFactory, $data); } protected function _getOrder() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php index 12aad575db3..f4fc1cb4fc6 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Creditmemos.php @@ -54,28 +54,26 @@ class Creditmemos */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory - * @param \Magento\Sales\Model\Order\Creditmemo $orderCreditmemo - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory + * @param \Magento\Sales\Model\Order\Creditmemo $orderCreditmemo + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, - \Magento\Sales\Model\Order\Creditmemo $orderCreditmemo, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, + \Magento\Sales\Model\Order\Creditmemo $orderCreditmemo, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; $this->_orderCreditmemo = $orderCreditmemo; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php index 95b535b3702..00456af4385 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/History.php @@ -47,20 +47,18 @@ class History */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php index ddf5be61a87..f63d7ccda8f 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Invoices.php @@ -54,28 +54,26 @@ class Invoices */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory - * @param \Magento\Sales\Model\Order\Invoice $orderInvoice - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory + * @param \Magento\Sales\Model\Order\Invoice $orderInvoice + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, - \Magento\Sales\Model\Order\Invoice $orderInvoice, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, + \Magento\Sales\Model\Order\Invoice $orderInvoice, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; $this->_orderInvoice = $orderInvoice; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php index c8f4f3123eb..9f92736c5b6 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tab/Shipments.php @@ -45,25 +45,23 @@ class Shipments */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tabs.php b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tabs.php index bebf0f768b2..9f29b52c850 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tabs.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Order/View/Tabs.php @@ -38,22 +38,22 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $authSession, $data); + parent::__construct($context, $jsonEncoder, $authSession, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/Grid.php index a3a0557d99d..2b13b96b8c0 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/Grid.php @@ -51,28 +51,26 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_recurringProfile; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $profileCollection - * @param \Magento\Sales\Model\Recurring\ProfileFactory $recurringProfile - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $profileCollection + * @param \Magento\Sales\Model\Recurring\ProfileFactory $recurringProfile + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Payment\Helper\Data $paymentData, - \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $profileCollection, - \Magento\Sales\Model\Recurring\ProfileFactory $recurringProfile, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Payment\Helper\Data $paymentData, + \Magento\Sales\Model\Resource\Recurring\Profile\CollectionFactory $profileCollection, + \Magento\Sales\Model\Recurring\ProfileFactory $recurringProfile, + array $data = array() + ) { $this->_paymentData = $paymentData; $this->_profileCollection = $profileCollection; $this->_recurringProfile = $recurringProfile; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View.php b/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View.php index 20070d81a9c..8342fd18559 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View.php @@ -40,18 +40,16 @@ class View extends \Magento\Backend\Block\Widget\Container /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php b/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php index 8d00e2f8cde..943b27b41c2 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Getawayinfo.php @@ -42,20 +42,18 @@ class Getawayinfo extends \Magento\Adminhtml\Block\Widget */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php b/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php index 8f366c50f3b..f8d6f57547f 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Info.php @@ -42,20 +42,18 @@ class Info extends \Magento\Adminhtml\Block\Widget */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php b/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php index d349e7225bc..f5a1e885b59 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Recurring/Profile/View/Tab/Orders.php @@ -50,28 +50,26 @@ class Orders */ protected $_orderConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Core\Model\Registry $coreRegistry - * @param \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $orderCollection - * @param \Magento\Sales\Model\Order\ConfigFactory $orderConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $orderCollection + * @param \Magento\Sales\Model\Order\ConfigFactory $orderConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Core\Model\Registry $coreRegistry, - \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $orderCollection, - \Magento\Sales\Model\Order\ConfigFactory $orderConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Core\Model\Registry $coreRegistry, + \Magento\Sales\Model\Resource\Order\Grid\CollectionFactory $orderCollection, + \Magento\Sales\Model\Order\ConfigFactory $orderConfig, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; $this->_orderCollection = $orderCollection; $this->_orderConfig = $orderConfig; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form.php b/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form.php index bfb80743e1f..25566efa7b1 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form.php @@ -40,24 +40,22 @@ class Form extends \Magento\Reports\Block\Adminhtml\Filter\Form */ protected $_orderConfig; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Sales\Model\Order\ConfigFactory $orderConfig - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Sales\Model\Order\ConfigFactory $orderConfig + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Sales\Model\Order\ConfigFactory $orderConfig, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Sales\Model\Order\ConfigFactory $orderConfig, + array $data = array() + ) { $this->_orderConfig = $orderConfig; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php b/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php index 43ba18ee490..904bb13c41c 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Report/Filter/Form/Coupon.php @@ -47,26 +47,24 @@ class Coupon extends \Magento\Sales\Block\Adminhtml\Report\Filter\Form */ protected $_reportRule; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Sales\Model\Order\ConfigFactory $orderConfig - * @param \Magento\SalesRule\Model\Resource\Report\RuleFactory $reportRule - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Sales\Model\Order\ConfigFactory $orderConfig + * @param \Magento\SalesRule\Model\Resource\Report\RuleFactory $reportRule + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Sales\Model\Order\ConfigFactory $orderConfig, - \Magento\SalesRule\Model\Resource\Report\RuleFactory $reportRule, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Sales\Model\Order\ConfigFactory $orderConfig, + \Magento\SalesRule\Model\Resource\Report\RuleFactory $reportRule, + array $data = array() + ) { $this->_reportRule = $reportRule; - parent::__construct($context, $coreData, $registry, $formFactory, $orderConfig, $data); + parent::__construct($context, $registry, $formFactory, $orderConfig, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Shipment/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Shipment/Grid.php index 40897ae3b12..ed0ff1d8235 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Shipment/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Shipment/Grid.php @@ -38,22 +38,20 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\Resource\Order\Collection\Factory $collectionFactory, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } diff --git a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail.php b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail.php index d427dc9a4f4..1948bef9a68 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail.php @@ -49,20 +49,18 @@ class Detail extends \Magento\Adminhtml\Block\Widget\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail/Grid.php index 09237015c7a..2f8f3a62c48 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Detail/Grid.php @@ -47,25 +47,23 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Data\CollectionFactory $collectionFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Data\CollectionFactory $collectionFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Data\CollectionFactory $collectionFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Data\CollectionFactory $collectionFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; $this->_coreRegistry = $coreRegistry; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php index d2c6a46bfb0..bb3fd2b16fe 100644 --- a/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php +++ b/app/code/Magento/Sales/Block/Adminhtml/Transactions/Grid.php @@ -59,31 +59,29 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Sales\Model\Order\Payment\Transaction $transaction - * @param \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory $collectionFactory - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Sales\Model\Order\Payment\Transaction $transaction + * @param \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory $collectionFactory + * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Sales\Model\Order\Payment\Transaction $transaction, - \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory $collectionFactory, - \Magento\Payment\Helper\Data $paymentData, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Sales\Model\Order\Payment\Transaction $transaction, + \Magento\Sales\Model\Resource\Order\Payment\Transaction\CollectionFactory $collectionFactory, + \Magento\Payment\Helper\Data $paymentData, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; $this->_paymentData = $paymentData; $this->_transaction = $transaction; $this->_collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Sales/Block/Billing/Agreement/View.php b/app/code/Magento/Sales/Block/Billing/Agreement/View.php index e3b7078a0fc..ec41ea64a89 100644 --- a/app/code/Magento/Sales/Block/Billing/Agreement/View.php +++ b/app/code/Magento/Sales/Block/Billing/Agreement/View.php @@ -31,7 +31,7 @@ */ namespace Magento\Sales\Block\Billing\Agreement; -class View extends \Magento\View\Block\Template +class View extends \Magento\View\Element\Template { /** * Payment methods array @@ -77,8 +77,7 @@ class View extends \Magento\View\Block\Template protected $_orderConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory * @param \Magento\Customer\Model\Session $customerSession @@ -86,8 +85,7 @@ class View extends \Magento\View\Block\Template * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory, \Magento\Customer\Model\Session $customerSession, @@ -98,7 +96,7 @@ class View extends \Magento\View\Block\Template $this->_customerSession = $customerSession; $this->_orderConfig = $orderConfig; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -163,7 +161,7 @@ class View extends \Magento\View\Block\Template /** * Set pager * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { @@ -172,7 +170,7 @@ class View extends \Magento\View\Block\Template } parent::_prepareLayout(); - $pager = $this->getLayout()->createBlock('Magento\Page\Block\Html\Pager') + $pager = $this->getLayout()->createBlock('Magento\Theme\Block\Html\Pager') ->setCollection($this->getRelatedOrders())->setIsOutputRequired(false); $this->setChild('pager', $pager); $this->getRelatedOrders()->load(); diff --git a/app/code/Magento/Sales/Block/Billing/Agreements.php b/app/code/Magento/Sales/Block/Billing/Agreements.php index f38db14ff44..532070565c7 100644 --- a/app/code/Magento/Sales/Block/Billing/Agreements.php +++ b/app/code/Magento/Sales/Block/Billing/Agreements.php @@ -31,7 +31,7 @@ */ namespace Magento\Sales\Block\Billing; -class Agreements extends \Magento\View\Block\Template +class Agreements extends \Magento\View\Element\Template { /** * Payment methods array @@ -58,33 +58,31 @@ class Agreements extends \Magento\View\Block\Template protected $_agreementCollection; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $agreementCollection * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $agreementCollection, array $data = array() ) { $this->_customerSession = $customerSession; $this->_agreementCollection = $agreementCollection; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** * Set Billing Agreement instance * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { parent::_prepareLayout(); - $pager = $this->getLayout()->createBlock('Magento\Page\Block\Html\Pager') + $pager = $this->getLayout()->createBlock('Magento\Theme\Block\Html\Pager') ->setCollection($this->getBillingAgreements())->setIsOutputRequired(false); $this->setChild('pager', $pager) ->setBackUrl($this->getUrl('customer/account/')); diff --git a/app/code/Magento/Sales/Block/Guest/Link.php b/app/code/Magento/Sales/Block/Guest/Link.php index 029b43619a8..c1f5c7f9159 100644 --- a/app/code/Magento/Sales/Block/Guest/Link.php +++ b/app/code/Magento/Sales/Block/Guest/Link.php @@ -27,7 +27,7 @@ namespace Magento\Sales\Block\Guest; /** * "Orders and Returns" link */ -class Link extends \Magento\Page\Block\Link +class Link extends \Magento\View\Element\Html\Link\Current { /** * @var \Magento\Customer\Model\Session @@ -35,18 +35,18 @@ class Link extends \Magento\Page\Block\Link protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\App\DefaultPathInterface $defaultPath * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, + \Magento\App\DefaultPathInterface $defaultPath, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $defaultPath, $data); $this->_customerSession = $customerSession; } diff --git a/app/code/Magento/Sales/Block/Items/AbstractItems.php b/app/code/Magento/Sales/Block/Items/AbstractItems.php index d64872e55bd..d9b6dbf75f5 100644 --- a/app/code/Magento/Sales/Block/Items/AbstractItems.php +++ b/app/code/Magento/Sales/Block/Items/AbstractItems.php @@ -33,7 +33,7 @@ */ namespace Magento\Sales\Block\Items; -class AbstractItems extends \Magento\View\Block\Template +class AbstractItems extends \Magento\View\Element\Template { /** * Block alias fallback @@ -59,7 +59,7 @@ class AbstractItems extends \Magento\View\Block\Template * Retrieve item renderer block * * @param string $type - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock * @throws \RuntimeException */ public function getItemRenderer($type) @@ -75,10 +75,10 @@ class AbstractItems extends \Magento\View\Block\Template /** * Prepare item before output * - * @param \Magento\View\Block\AbstractBlock $renderer + * @param \Magento\View\Element\AbstractBlock $renderer * @return \Magento\Sales\Block\Items\AbstractItems */ - protected function _prepareItem(\Magento\View\Block\AbstractBlock $renderer) + protected function _prepareItem(\Magento\View\Element\AbstractBlock $renderer) { return $this; } diff --git a/app/code/Magento/Sales/Block/Order/Comments.php b/app/code/Magento/Sales/Block/Order/Comments.php index c315751642a..bd97cc0ee36 100644 --- a/app/code/Magento/Sales/Block/Order/Comments.php +++ b/app/code/Magento/Sales/Block/Order/Comments.php @@ -25,22 +25,20 @@ */ namespace Magento\Sales\Block\Order; -class Comments extends \Magento\View\Block\Template +class Comments extends \Magento\View\Element\Template { /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Sales\Model\ResourceFactory $resourceFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Sales\Model\ResourceFactory $resourceFactory, array $data = array() ) { $this->_resourceFactory = $resourceFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Order/Creditmemo.php b/app/code/Magento/Sales/Block/Order/Creditmemo.php index bfce082a79a..2d845a588d1 100644 --- a/app/code/Magento/Sales/Block/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Block/Order/Creditmemo.php @@ -46,21 +46,19 @@ class Creditmemo extends \Magento\Sales\Block\Order\Creditmemo\Items protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $registry, $data); + parent::__construct($context, $registry, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php b/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php index caff09b4016..8693dceb7da 100644 --- a/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php +++ b/app/code/Magento/Sales/Block/Order/Creditmemo/Items.php @@ -39,19 +39,17 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Order/Email/Creditmemo/Items.php b/app/code/Magento/Sales/Block/Order/Email/Creditmemo/Items.php index c616d9cb5c0..114887b530e 100644 --- a/app/code/Magento/Sales/Block/Order/Email/Creditmemo/Items.php +++ b/app/code/Magento/Sales/Block/Order/Email/Creditmemo/Items.php @@ -39,10 +39,10 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems /** * Prepare item before output * - * @param \Magento\View\Block\AbstractBlock $renderer + * @param \Magento\View\Element\AbstractBlock $renderer * @return \Magento\Sales\Block\Items\AbstractItems */ - protected function _prepareItem(\Magento\View\Block\AbstractBlock $renderer) + protected function _prepareItem(\Magento\View\Element\AbstractBlock $renderer) { $renderer->getItem()->setOrder($this->getOrder()); $renderer->getItem()->setSource($this->getCreditmemo()); diff --git a/app/code/Magento/Sales/Block/Order/Email/Invoice/Items.php b/app/code/Magento/Sales/Block/Order/Email/Invoice/Items.php index 19ca544e709..6b233d19cc6 100644 --- a/app/code/Magento/Sales/Block/Order/Email/Invoice/Items.php +++ b/app/code/Magento/Sales/Block/Order/Email/Invoice/Items.php @@ -39,10 +39,10 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems /** * Prepare item before output * - * @param \Magento\View\Block\AbstractBlock $renderer + * @param \Magento\View\Element\AbstractBlock $renderer * @return \Magento\Sales\Block\Items\AbstractItems */ - protected function _prepareItem(\Magento\View\Block\AbstractBlock $renderer) + protected function _prepareItem(\Magento\View\Element\AbstractBlock $renderer) { $renderer->getItem()->setOrder($this->getOrder()); $renderer->getItem()->setSource($this->getInvoice()); diff --git a/app/code/Magento/Sales/Block/Order/Email/Items/DefaultItems.php b/app/code/Magento/Sales/Block/Order/Email/Items/DefaultItems.php index f55802e36a1..ba11afaaa41 100644 --- a/app/code/Magento/Sales/Block/Order/Email/Items/DefaultItems.php +++ b/app/code/Magento/Sales/Block/Order/Email/Items/DefaultItems.php @@ -34,7 +34,7 @@ */ namespace Magento\Sales\Block\Order\Email\Items; -class DefaultItems extends \Magento\View\Block\Template +class DefaultItems extends \Magento\View\Element\Template { /** * Retrieve current order model instance @@ -85,7 +85,7 @@ class DefaultItems extends \Magento\View\Block\Template /** * Return product additional information block * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function getProductAdditionalInformationBlock() { diff --git a/app/code/Magento/Sales/Block/Order/Email/Items/Order/DefaultOrder.php b/app/code/Magento/Sales/Block/Order/Email/Items/Order/DefaultOrder.php index 7edd9af7113..b956b9933e4 100644 --- a/app/code/Magento/Sales/Block/Order/Email/Items/Order/DefaultOrder.php +++ b/app/code/Magento/Sales/Block/Order/Email/Items/Order/DefaultOrder.php @@ -34,7 +34,7 @@ */ namespace Magento\Sales\Block\Order\Email\Items\Order; -class DefaultOrder extends \Magento\View\Block\Template +class DefaultOrder extends \Magento\View\Element\Template { /** * Retrieve current order model instance @@ -85,7 +85,7 @@ class DefaultOrder extends \Magento\View\Block\Template /** * Return product additional information block * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function getProductAdditionalInformationBlock() { diff --git a/app/code/Magento/Sales/Block/Order/Email/Shipment/Items.php b/app/code/Magento/Sales/Block/Order/Email/Shipment/Items.php index 523f208ca5c..21801a76139 100644 --- a/app/code/Magento/Sales/Block/Order/Email/Shipment/Items.php +++ b/app/code/Magento/Sales/Block/Order/Email/Shipment/Items.php @@ -39,10 +39,10 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems /** * Prepare item before output * - * @param \Magento\View\Block\AbstractBlock $renderer + * @param \Magento\View\Element\AbstractBlock $renderer * @return \Magento\Sales\Block\Items\AbstractItems */ - protected function _prepareItem(\Magento\View\Block\AbstractBlock $renderer) + protected function _prepareItem(\Magento\View\Element\AbstractBlock $renderer) { $renderer->getItem()->setOrder($this->getOrder()); $renderer->getItem()->setSource($this->getShipment()); diff --git a/app/code/Magento/Sales/Block/Order/History.php b/app/code/Magento/Sales/Block/Order/History.php index 50cff275683..f8436c38bf5 100644 --- a/app/code/Magento/Sales/Block/Order/History.php +++ b/app/code/Magento/Sales/Block/Order/History.php @@ -29,7 +29,7 @@ */ namespace Magento\Sales\Block\Order; -class History extends \Magento\View\Block\Template +class History extends \Magento\View\Element\Template { /** * @var string @@ -52,16 +52,14 @@ class History extends \Magento\View\Block\Template protected $_orderConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\Order\Config $orderConfig * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\Order\Config $orderConfig, @@ -70,7 +68,7 @@ class History extends \Magento\View\Block\Template $this->_orderCollectionFactory = $orderCollectionFactory; $this->_customerSession = $customerSession; $this->_orderConfig = $orderConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() @@ -91,13 +89,13 @@ class History extends \Magento\View\Block\Template } /** - * @return $this|\Magento\View\Block\AbstractBlock + * @return $this|\Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { parent::_prepareLayout(); - $pager = $this->getLayout()->createBlock('Magento\Page\Block\Html\Pager', 'sales.order.history.pager') + $pager = $this->getLayout()->createBlock('Magento\Theme\Block\Html\Pager', 'sales.order.history.pager') ->setCollection($this->getOrders()); $this->setChild('pager', $pager); $this->getOrders()->load(); diff --git a/app/code/Magento/Sales/Block/Order/Info.php b/app/code/Magento/Sales/Block/Order/Info.php index d1a77779afd..d8c4f81d718 100644 --- a/app/code/Magento/Sales/Block/Order/Info.php +++ b/app/code/Magento/Sales/Block/Order/Info.php @@ -34,7 +34,7 @@ */ namespace Magento\Sales\Block\Order; -class Info extends \Magento\View\Block\Template +class Info extends \Magento\View\Element\Template { protected $_template = 'order/info.phtml'; @@ -46,19 +46,17 @@ class Info extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Sales/Block/Order/Info/Buttons.php b/app/code/Magento/Sales/Block/Order/Info/Buttons.php index 4934749a5e6..2ef6e2d649f 100644 --- a/app/code/Magento/Sales/Block/Order/Info/Buttons.php +++ b/app/code/Magento/Sales/Block/Order/Info/Buttons.php @@ -30,7 +30,7 @@ */ namespace Magento\Sales\Block\Order\Info; -class Buttons extends \Magento\View\Block\Template +class Buttons extends \Magento\View\Element\Template { /** * @var string @@ -50,22 +50,20 @@ class Buttons extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_coreRegistry = $registry; $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Order/Invoice.php b/app/code/Magento/Sales/Block/Order/Invoice.php index e88783358d7..882d5bc9ab1 100644 --- a/app/code/Magento/Sales/Block/Order/Invoice.php +++ b/app/code/Magento/Sales/Block/Order/Invoice.php @@ -42,21 +42,19 @@ class Invoice extends \Magento\Sales\Block\Order\Invoice\Items protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $registry, $data); + parent::__construct($context, $registry, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Sales/Block/Order/Invoice/Items.php b/app/code/Magento/Sales/Block/Order/Invoice/Items.php index 415f10cd6a7..6619b32c5bf 100644 --- a/app/code/Magento/Sales/Block/Order/Invoice/Items.php +++ b/app/code/Magento/Sales/Block/Order/Invoice/Items.php @@ -43,19 +43,17 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Order/Item/Renderer/DefaultRenderer.php b/app/code/Magento/Sales/Block/Order/Item/Renderer/DefaultRenderer.php index 92f690775d1..ffadf7597fd 100644 --- a/app/code/Magento/Sales/Block/Order/Item/Renderer/DefaultRenderer.php +++ b/app/code/Magento/Sales/Block/Order/Item/Renderer/DefaultRenderer.php @@ -29,7 +29,7 @@ namespace Magento\Sales\Block\Order\Item\Renderer; /** * Order item render block */ -class DefaultRenderer extends \Magento\View\Block\Template +class DefaultRenderer extends \Magento\View\Element\Template { /** * Magento string lib @@ -44,22 +44,20 @@ class DefaultRenderer extends \Magento\View\Block\Template protected $_productOptionFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Stdlib\String $string * @param \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Stdlib\String $string, \Magento\Catalog\Model\Product\OptionFactory $productOptionFactory, array $data = array() ) { $this->string = $string; $this->_productOptionFactory = $productOptionFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function setItem(\Magento\Object $item) @@ -196,7 +194,7 @@ class DefaultRenderer extends \Magento\View\Block\Template /** * Return product additional information block * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function getProductAdditionalInformationBlock() { diff --git a/app/code/Magento/Sales/Block/Order/Items.php b/app/code/Magento/Sales/Block/Order/Items.php index c5635f4ed39..225bc6d8db4 100644 --- a/app/code/Magento/Sales/Block/Order/Items.php +++ b/app/code/Magento/Sales/Block/Order/Items.php @@ -43,19 +43,17 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Order/Link.php b/app/code/Magento/Sales/Block/Order/Link.php index 783a125b22e..d668af9e019 100644 --- a/app/code/Magento/Sales/Block/Order/Link.php +++ b/app/code/Magento/Sales/Block/Order/Link.php @@ -27,26 +27,24 @@ namespace Magento\Sales\Block\Order; /** * Sales order link */ -class Link extends \Magento\Page\Block\Link\Current +class Link extends \Magento\View\Element\Html\Link\Current { /** @var \Magento\Core\Model\Registry */ protected $_registry; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\App\DefaultPathInterface $defaultPath * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\App\DefaultPathInterface $defaultPath, \Magento\Core\Model\Registry $registry, array $data = array() ) { - parent::__construct($context, $coreData, $defaultPath, $data); + parent::__construct($context, $defaultPath, $data); $this->_registry = $registry; } diff --git a/app/code/Magento/Sales/Block/Order/PrintOrder/Creditmemo.php b/app/code/Magento/Sales/Block/Order/PrintOrder/Creditmemo.php index fdbbbf0dccb..c089df81227 100644 --- a/app/code/Magento/Sales/Block/Order/PrintOrder/Creditmemo.php +++ b/app/code/Magento/Sales/Block/Order/PrintOrder/Creditmemo.php @@ -39,19 +39,17 @@ class Creditmemo extends \Magento\Sales\Block\Items\AbstractItems protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() @@ -99,7 +97,7 @@ class Creditmemo extends \Magento\Sales\Block\Items\AbstractItems return $this->_coreRegistry->registry('current_creditmemo'); } - protected function _prepareItem(\Magento\View\Block\AbstractBlock $renderer) + protected function _prepareItem(\Magento\View\Element\AbstractBlock $renderer) { $renderer->setPrintStatus(true); return parent::_prepareItem($renderer); diff --git a/app/code/Magento/Sales/Block/Order/PrintOrder/Invoice.php b/app/code/Magento/Sales/Block/Order/PrintOrder/Invoice.php index 6914aca5705..4acaa71941b 100644 --- a/app/code/Magento/Sales/Block/Order/PrintOrder/Invoice.php +++ b/app/code/Magento/Sales/Block/Order/PrintOrder/Invoice.php @@ -39,19 +39,17 @@ class Invoice extends \Magento\Sales\Block\Items\AbstractItems protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() @@ -100,7 +98,7 @@ class Invoice extends \Magento\Sales\Block\Items\AbstractItems return $this->_coreRegistry->registry('current_invoice'); } - protected function _prepareItem(\Magento\View\Block\AbstractBlock $renderer) + protected function _prepareItem(\Magento\View\Element\AbstractBlock $renderer) { $renderer->setPrintStatus(true); return parent::_prepareItem($renderer); diff --git a/app/code/Magento/Sales/Block/Order/PrintOrder/Shipment.php b/app/code/Magento/Sales/Block/Order/PrintOrder/Shipment.php index 81b3a5720d0..e6dcf8935b1 100644 --- a/app/code/Magento/Sales/Block/Order/PrintOrder/Shipment.php +++ b/app/code/Magento/Sales/Block/Order/PrintOrder/Shipment.php @@ -53,19 +53,17 @@ class Shipment extends \Magento\Sales\Block\Items\AbstractItems protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -138,7 +136,7 @@ class Shipment extends \Magento\Sales\Block\Items\AbstractItems return $this->_coreRegistry->registry('current_shipment'); } - protected function _prepareItem(\Magento\View\Block\AbstractBlock $renderer) + protected function _prepareItem(\Magento\View\Element\AbstractBlock $renderer) { $renderer->setPrintStatus(true); diff --git a/app/code/Magento/Sales/Block/Order/PrintShipment.php b/app/code/Magento/Sales/Block/Order/PrintShipment.php index bff6cf0fa6b..6427c52a36a 100644 --- a/app/code/Magento/Sales/Block/Order/PrintShipment.php +++ b/app/code/Magento/Sales/Block/Order/PrintShipment.php @@ -43,19 +43,17 @@ class PrintShipment extends \Magento\Sales\Block\Items\AbstractItems protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() @@ -79,7 +77,7 @@ class PrintShipment extends \Magento\Sales\Block\Items\AbstractItems return $this->_coreRegistry->registry('current_order'); } - protected function _prepareItem(\Magento\View\Block\AbstractBlock $renderer) + protected function _prepareItem(\Magento\View\Element\AbstractBlock $renderer) { $renderer->setPrintStatus(true); diff --git a/app/code/Magento/Sales/Block/Order/Recent.php b/app/code/Magento/Sales/Block/Order/Recent.php index 603339c14d8..6233f1b3ecc 100644 --- a/app/code/Magento/Sales/Block/Order/Recent.php +++ b/app/code/Magento/Sales/Block/Order/Recent.php @@ -29,7 +29,7 @@ */ namespace Magento\Sales\Block\Order; -class Recent extends \Magento\View\Block\Template +class Recent extends \Magento\View\Element\Template { /** * @var \Magento\Sales\Model\Resource\Order\CollectionFactory @@ -47,16 +47,14 @@ class Recent extends \Magento\View\Block\Template protected $_orderConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sales\Model\Order\Config $orderConfig * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Sales\Model\Order\Config $orderConfig, @@ -65,7 +63,7 @@ class Recent extends \Magento\View\Block\Template $this->_orderCollectionFactory = $orderCollectionFactory; $this->_customerSession = $customerSession; $this->_orderConfig = $orderConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Order/Shipment.php b/app/code/Magento/Sales/Block/Order/Shipment.php index 5febabbfb3e..38a4abfcc84 100644 --- a/app/code/Magento/Sales/Block/Order/Shipment.php +++ b/app/code/Magento/Sales/Block/Order/Shipment.php @@ -29,7 +29,7 @@ */ namespace Magento\Sales\Block\Order; -class Shipment extends \Magento\View\Block\Template +class Shipment extends \Magento\View\Element\Template { /** * @var string @@ -49,22 +49,20 @@ class Shipment extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_coreRegistry = $registry; $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Sales/Block/Order/Shipment/Items.php b/app/code/Magento/Sales/Block/Order/Shipment/Items.php index 99606bb83bf..c323037606b 100644 --- a/app/code/Magento/Sales/Block/Order/Shipment/Items.php +++ b/app/code/Magento/Sales/Block/Order/Shipment/Items.php @@ -43,19 +43,17 @@ class Items extends \Magento\Sales\Block\Items\AbstractItems protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Order/Totals.php b/app/code/Magento/Sales/Block/Order/Totals.php index 837b3eb68b7..443af18f784 100644 --- a/app/code/Magento/Sales/Block/Order/Totals.php +++ b/app/code/Magento/Sales/Block/Order/Totals.php @@ -25,7 +25,7 @@ */ namespace Magento\Sales\Block\Order; -class Totals extends \Magento\View\Block\Template +class Totals extends \Magento\View\Element\Template { /** * Associated array of totals @@ -46,19 +46,17 @@ class Totals extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Order/View.php b/app/code/Magento/Sales/Block/Order/View.php index aa532d026f9..fae90cb3304 100644 --- a/app/code/Magento/Sales/Block/Order/View.php +++ b/app/code/Magento/Sales/Block/Order/View.php @@ -29,7 +29,7 @@ */ namespace Magento\Sales\Block\Order; -class View extends \Magento\View\Block\Template +class View extends \Magento\View\Element\Template { /** * @var string @@ -49,22 +49,20 @@ class View extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_coreRegistry = $registry; $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/Sales/Block/Payment/Form/Billing/Agreement.php b/app/code/Magento/Sales/Block/Payment/Form/Billing/Agreement.php index 39363c0452c..a3c3fc3f1f0 100644 --- a/app/code/Magento/Sales/Block/Payment/Form/Billing/Agreement.php +++ b/app/code/Magento/Sales/Block/Payment/Form/Billing/Agreement.php @@ -42,19 +42,17 @@ class Agreement extends \Magento\Payment\Block\Form protected $_agreementFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Sales\Model\Billing\AgreementFactory $agreementFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Sales\Model\Billing\AgreementFactory $agreementFactory, array $data = array() ) { $this->_agreementFactory = $agreementFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/Sales/Block/Recurring/Profile/Grid.php b/app/code/Magento/Sales/Block/Recurring/Profile/Grid.php index b1136de470f..0dd96d3b3c6 100644 --- a/app/code/Magento/Sales/Block/Recurring/Profile/Grid.php +++ b/app/code/Magento/Sales/Block/Recurring/Profile/Grid.php @@ -49,22 +49,20 @@ class Grid extends \Magento\Sales\Block\Recurring\Profiles protected $_profiles = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Sales\Model\Recurring\Profile $profile * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Sales\Model\Recurring\Profile $profile, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_recurringProfile = $profile; $this->_registry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } @@ -91,7 +89,7 @@ class Grid extends \Magento\Sales\Block\Recurring\Profiles parent::_prepareLayout(); $this->_prepareProfiles(array('reference_id', 'state', 'created_at', 'updated_at', 'method_code')); - $pager = $this->getLayout()->createBlock('Magento\Page\Block\Html\Pager') + $pager = $this->getLayout()->createBlock('Magento\Theme\Block\Html\Pager') ->setCollection($this->_profiles)->setIsOutputRequired(false); $this->setChild('pager', $pager); diff --git a/app/code/Magento/Sales/Block/Recurring/Profile/Related/Orders/Grid.php b/app/code/Magento/Sales/Block/Recurring/Profile/Related/Orders/Grid.php index 23caafb65c4..d73454dff02 100644 --- a/app/code/Magento/Sales/Block/Recurring/Profile/Related/Orders/Grid.php +++ b/app/code/Magento/Sales/Block/Recurring/Profile/Related/Orders/Grid.php @@ -41,22 +41,20 @@ class Grid extends \Magento\Sales\Block\Recurring\Profile\View protected $_config; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Sales\Model\Resource\Order\Collection $collection * @param \Magento\Sales\Model\Order\Config $config * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Sales\Model\Resource\Order\Collection $collection, \Magento\Sales\Model\Order\Config $config, array $data = array() ) { - parent::__construct($context, $coreData, $registry, $data); + parent::__construct($context, $registry, $data); $this->_orderCollection = $collection; $this->_config = $config; } @@ -92,7 +90,7 @@ class Grid extends \Magento\Sales\Block\Recurring\Profile\View 'in' => $this->_config->getVisibleOnFrontStates() )); - $pager = $this->getLayout()->createBlock('Magento\Page\Block\Html\Pager') + $pager = $this->getLayout()->createBlock('Magento\Theme\Block\Html\Pager') ->setCollection($this->_relatedOrders)->setIsOutputRequired(false); $this->setChild('pager', $pager); diff --git a/app/code/Magento/Sales/Block/Recurring/Profile/View.php b/app/code/Magento/Sales/Block/Recurring/Profile/View.php index 388cf363ccf..cf6ca337f2c 100644 --- a/app/code/Magento/Sales/Block/Recurring/Profile/View.php +++ b/app/code/Magento/Sales/Block/Recurring/Profile/View.php @@ -29,7 +29,7 @@ */ namespace Magento\Sales\Block\Recurring\Profile; -class View extends \Magento\View\Block\Template +class View extends \Magento\View\Element\Template { /** * @var \Magento\Sales\Model\Recurring\Profile @@ -70,19 +70,17 @@ class View extends \Magento\View\Block\Template protected $_template = 'recurring/profile/view/info.phtml'; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_registry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } diff --git a/app/code/Magento/Sales/Block/Recurring/Profile/View/Address.php b/app/code/Magento/Sales/Block/Recurring/Profile/View/Address.php index b799ff96f25..62810684039 100644 --- a/app/code/Magento/Sales/Block/Recurring/Profile/View/Address.php +++ b/app/code/Magento/Sales/Block/Recurring/Profile/View/Address.php @@ -32,20 +32,18 @@ namespace Magento\Sales\Block\Recurring\Profile\View; class Address extends \Magento\Sales\Block\Recurring\Profile\View { /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Sales\Model\Order\AddressFactory $addressFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Sales\Model\Order\AddressFactory $addressFactory, array $data = array() ) { - parent::__construct($context, $coreData, $registry, $data); + parent::__construct($context, $registry, $data); $this->_addressFactory = $addressFactory; } diff --git a/app/code/Magento/Sales/Block/Recurring/Profile/View/Item.php b/app/code/Magento/Sales/Block/Recurring/Profile/View/Item.php index 3785093d5cf..8daf78f347a 100644 --- a/app/code/Magento/Sales/Block/Recurring/Profile/View/Item.php +++ b/app/code/Magento/Sales/Block/Recurring/Profile/View/Item.php @@ -41,16 +41,14 @@ class Item extends \Magento\Sales\Block\Recurring\Profile\View protected $_product; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\Product\Option $option * @param \Magento\Catalog\Model\Product $product * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\Product\Option $option, \Magento\Catalog\Model\Product $product, @@ -58,7 +56,7 @@ class Item extends \Magento\Sales\Block\Recurring\Profile\View ) { $this->_option = $option; $this->_product = $product; - parent::__construct($context, $coreData, $registry, $data); + parent::__construct($context, $registry, $data); } /** diff --git a/app/code/Magento/Sales/Block/Recurring/Profiles.php b/app/code/Magento/Sales/Block/Recurring/Profiles.php index 728deaa35eb..88df1db0d0b 100644 --- a/app/code/Magento/Sales/Block/Recurring/Profiles.php +++ b/app/code/Magento/Sales/Block/Recurring/Profiles.php @@ -29,7 +29,7 @@ */ namespace Magento\Sales\Block\Recurring; -class Profiles extends \Magento\View\Block\Template +class Profiles extends \Magento\View\Element\Template { /** diff --git a/app/code/Magento/Sales/Block/Reorder/Sidebar.php b/app/code/Magento/Sales/Block/Reorder/Sidebar.php index cd826ab68ec..19e1c0d1a10 100644 --- a/app/code/Magento/Sales/Block/Reorder/Sidebar.php +++ b/app/code/Magento/Sales/Block/Reorder/Sidebar.php @@ -29,7 +29,7 @@ */ namespace Magento\Sales\Block\Reorder; -class Sidebar extends \Magento\View\Block\Template +class Sidebar extends \Magento\View\Element\Template { /** * @var string @@ -52,16 +52,14 @@ class Sidebar extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory * @param \Magento\Sales\Model\Order\Config $orderConfig * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Sales\Model\Resource\Order\CollectionFactory $orderCollectionFactory, \Magento\Sales\Model\Order\Config $orderConfig, \Magento\Customer\Model\Session $customerSession, @@ -70,7 +68,7 @@ class Sidebar extends \Magento\View\Block\Template $this->_orderCollectionFactory = $orderCollectionFactory; $this->_orderConfig = $orderConfig; $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sales/Block/Status/Grid/Column/State.php b/app/code/Magento/Sales/Block/Status/Grid/Column/State.php index 3066ab14194..4303fb167b2 100644 --- a/app/code/Magento/Sales/Block/Status/Grid/Column/State.php +++ b/app/code/Magento/Sales/Block/Status/Grid/Column/State.php @@ -33,19 +33,17 @@ class State extends \Magento\Backend\Block\Widget\Grid\Column */ protected $_config; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Sales\Model\Order\Config $config - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Sales\Model\Order\Config $config + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Sales\Model\Order\Config $config, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Sales\Model\Order\Config $config, + array $data = array() + ) { + parent::__construct($context, $data); $this->_config = $config; } diff --git a/app/code/Magento/Sales/Block/Widget/Guest/Form.php b/app/code/Magento/Sales/Block/Widget/Guest/Form.php index 30468f65764..73ab58faa03 100644 --- a/app/code/Magento/Sales/Block/Widget/Guest/Form.php +++ b/app/code/Magento/Sales/Block/Widget/Guest/Form.php @@ -30,7 +30,7 @@ namespace Magento\Sales\Block\Widget\Guest; class Form - extends \Magento\View\Block\Template + extends \Magento\View\Element\Template implements \Magento\Widget\Block\BlockInterface { /** @@ -39,19 +39,17 @@ class Form protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -71,7 +69,7 @@ class Form */ public function getTypeSelectHtml() { - $select = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $select = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setData(array( 'id' => 'quick_search_type_id', 'class' => 'select guest-select', diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php index d62941eb0ff..aa858f81a04 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Create.php @@ -352,7 +352,7 @@ class Create extends \Magento\Backend\App\Action public function reorderAction() { - $this->_getSession()->clear(); + $this->_getSession()->clearStorage(); $orderId = $this->getRequest()->getParam('order_id'); $order = $this->_objectManager->create('Magento\Sales\Model\Order')->load($orderId); if (!$this->_objectManager->get('Magento\Sales\Helper\Reorder')->canReorder($order)) { @@ -464,7 +464,7 @@ class Create extends \Magento\Backend\App\Action */ public function startAction() { - $this->_getSession()->clear(); + $this->_getSession()->clearStorage(); $this->_redirect('sales/*', array('customer_id' => $this->getRequest()->getParam('customer_id'))); } @@ -474,12 +474,12 @@ class Create extends \Magento\Backend\App\Action public function cancelAction() { if ($orderId = $this->_getSession()->getReordered()) { - $this->_getSession()->clear(); + $this->_getSession()->clearStorage(); $this->_redirect('sales/order/view', array( 'order_id'=>$orderId )); } else { - $this->_getSession()->clear(); + $this->_getSession()->clearStorage(); $this->_redirect('sales/*'); } @@ -508,7 +508,7 @@ class Create extends \Magento\Backend\App\Action ->importPostData($this->getRequest()->getPost('order')) ->createOrder(); - $this->_getSession()->clear(); + $this->_getSession()->clearStorage(); $this->_objectManager->get('Magento\Adminhtml\Model\Session')->addSuccess(__('You created the order.')); if ($this->_authorization->isAllowed('Magento_Sales::actions_view')) { $this->_redirect('sales/order/view', array('order_id' => $order->getId())); diff --git a/app/code/Magento/Sales/Controller/Adminhtml/Order/Edit.php b/app/code/Magento/Sales/Controller/Adminhtml/Order/Edit.php index 50c0d283af2..4963e9a0575 100644 --- a/app/code/Magento/Sales/Controller/Adminhtml/Order/Edit.php +++ b/app/code/Magento/Sales/Controller/Adminhtml/Order/Edit.php @@ -40,7 +40,7 @@ class Edit extends \Magento\Sales\Controller\Adminhtml\Order\Create */ public function startAction() { - $this->_getSession()->clear(); + $this->_getSession()->clearStorage(); $orderId = $this->getRequest()->getParam('order_id'); $order = $this->_objectManager->create('Magento\Sales\Model\Order')->load($orderId); @@ -49,8 +49,7 @@ class Edit extends \Magento\Sales\Controller\Adminhtml\Order\Create $this->_getSession()->setUseOldShippingMethod(true); $this->_getOrderCreateModel()->initFromOrder($order); $this->_redirect('sales/*'); - } - else { + } else { $this->_redirect('sales/order/'); } } catch (\Magento\Core\Exception $e) { diff --git a/app/code/Magento/Sales/Helper/Admin.php b/app/code/Magento/Sales/Helper/Admin.php index 47d1aea6e19..5d51fd52f2a 100644 --- a/app/code/Magento/Sales/Helper/Admin.php +++ b/app/code/Magento/Sales/Helper/Admin.php @@ -39,13 +39,13 @@ class Admin extends \Magento\App\Helper\AbstractHelper protected $_storeManager; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Sales\Model\Config $salesConfig */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\App\Helper\Context $context, + \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\Config $salesConfig ) { $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Sales/Helper/Guest.php b/app/code/Magento/Sales/Helper/Guest.php index 8bea985d11c..750b6e34e42 100644 --- a/app/code/Magento/Sales/Helper/Guest.php +++ b/app/code/Magento/Sales/Helper/Guest.php @@ -53,7 +53,7 @@ class Guest extends \Magento\Core\Helper\Data protected $_customerSession; /** - * @var \Magento\Core\Model\Cookie + * @var \Magento\Stdlib\Cookie */ protected $_coreCookie; @@ -75,7 +75,7 @@ class Guest extends \Magento\Core\Helper\Data * @param \Magento\App\State $appState * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Customer\Model\Session $customerSession - * @param \Magento\Core\Model\Cookie $coreCookie + * @param \Magento\Stdlib\Cookie $coreCookie * @param \Magento\Core\Model\Session $coreSession * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\App\ViewInterface $view @@ -89,7 +89,7 @@ class Guest extends \Magento\Core\Helper\Data \Magento\App\State $appState, \Magento\Core\Model\Registry $coreRegistry, \Magento\Customer\Model\Session $customerSession, - \Magento\Core\Model\Cookie $coreCookie, + \Magento\Stdlib\Cookie $coreCookie, \Magento\Core\Model\Session $coreSession, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\App\ViewInterface $view, diff --git a/app/code/Magento/Sales/Model/Billing/Agreement.php b/app/code/Magento/Sales/Model/Billing/Agreement.php index e965f6259fc..735197093bd 100644 --- a/app/code/Magento/Sales/Model/Billing/Agreement.php +++ b/app/code/Magento/Sales/Model/Billing/Agreement.php @@ -71,9 +71,9 @@ class Agreement extends \Magento\Payment\Model\Billing\AbstractAgreement protected $_dateFactory; /** - * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $billingAgreementFactory * @param \Magento\Core\Model\DateFactory $dateFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -81,16 +81,16 @@ class Agreement extends \Magento\Payment\Model\Billing\AbstractAgreement * @param array $data */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Payment\Helper\Data $paymentData, \Magento\Sales\Model\Resource\Billing\Agreement\CollectionFactory $billingAgreementFactory, \Magento\Core\Model\DateFactory $dateFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { - parent::__construct($paymentData, $context, $registry, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $paymentData, $resource, $resourceCollection, $data); $this->_billingAgreementFactory = $billingAgreementFactory; $this->_dateFactory = $dateFactory; } diff --git a/app/code/Magento/Sales/Model/Observer.php b/app/code/Magento/Sales/Model/Observer.php index 884563bf248..cd7bcbc4b65 100644 --- a/app/code/Magento/Sales/Model/Observer.php +++ b/app/code/Magento/Sales/Model/Observer.php @@ -343,92 +343,6 @@ class Observer return $requiredAddress; } - /** - * Handle customer VAT number if needed on collect_totals_before event of quote address - * - * @param \Magento\Event\Observer $observer - */ - public function changeQuoteCustomerGroupId(\Magento\Event\Observer $observer) - { - /** @var $addressHelper \Magento\Customer\Helper\Address */ - $addressHelper = $this->_customerAddress; - - $quoteAddress = $observer->getQuoteAddress(); - $quoteInstance = $quoteAddress->getQuote(); - $customerInstance = $quoteInstance->getCustomer(); - - $storeId = $customerInstance->getStore(); - - $configAddressType = $this->_customerAddress->getTaxCalculationAddressType($storeId); - - // When VAT is based on billing address then Magento have to handle only billing addresses - $additionalBillingAddressCondition = ($configAddressType == \Magento\Customer\Model\Address\AbstractAddress::TYPE_BILLING) - ? $configAddressType != $quoteAddress->getAddressType() : false; - // Handle only addresses that corresponds to VAT configuration - if (!$addressHelper->isVatValidationEnabled($storeId) || $additionalBillingAddressCondition) { - return; - } - - $customerCountryCode = $quoteAddress->getCountryId(); - $customerVatNumber = $quoteAddress->getVatId(); - - if (empty($customerVatNumber) || !$this->_customerData->isCountryInEU($customerCountryCode)) { - $groupId = ($customerInstance->getId()) ? $this->_customerData->getDefaultCustomerGroupId($storeId) - : \Magento\Customer\Model\Group::NOT_LOGGED_IN_ID; - - $quoteAddress->setPrevQuoteCustomerGroupId($quoteInstance->getCustomerGroupId()); - $customerInstance->setGroupId($groupId); - $quoteInstance->setCustomerGroupId($groupId); - - return; - } - - $merchantCountryCode = $this->_customerData->getMerchantCountryCode(); - $merchantVatNumber = $this->_customerData->getMerchantVatNumber(); - - $gatewayResponse = null; - if ($addressHelper->getValidateOnEachTransaction($storeId) - || $customerCountryCode != $quoteAddress->getValidatedCountryCode() - || $customerVatNumber != $quoteAddress->getValidatedVatNumber() - ) { - // Send request to gateway - $gatewayResponse = $this->_customerData->checkVatNumber( - $customerCountryCode, - $customerVatNumber, - ($merchantVatNumber !== '') ? $merchantCountryCode : '', - $merchantVatNumber - ); - - // Store validation results in corresponding quote address - $quoteAddress->setVatIsValid((int)$gatewayResponse->getIsValid()) - ->setVatRequestId($gatewayResponse->getRequestIdentifier()) - ->setVatRequestDate($gatewayResponse->getRequestDate()) - ->setVatRequestSuccess($gatewayResponse->getRequestSuccess()) - ->setValidatedVatNumber($customerVatNumber) - ->setValidatedCountryCode($customerCountryCode) - ->save(); - } else { - // Restore validation results from corresponding quote address - $gatewayResponse = new \Magento\Object(array( - 'is_valid' => (int)$quoteAddress->getVatIsValid(), - 'request_identifier' => (string)$quoteAddress->getVatRequestId(), - 'request_date' => (string)$quoteAddress->getVatRequestDate(), - 'request_success' => (boolean)$quoteAddress->getVatRequestSuccess() - )); - } - - // Magento always has to emulate group even if customer uses default billing/shipping address - $groupId = $this->_customerData->getCustomerGroupIdBasedOnVatNumber( - $customerCountryCode, $gatewayResponse, $customerInstance->getStore() - ); - - if ($groupId) { - $quoteAddress->setPrevQuoteCustomerGroupId($quoteInstance->getCustomerGroupId()); - $customerInstance->setGroupId($groupId); - $quoteInstance->setCustomerGroupId($groupId); - } - } - /** * Restore initial customer group ID in quote if needed on collect_totals_after event of quote address * diff --git a/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotals.php b/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotals.php new file mode 100644 index 00000000000..71cf369ac5d --- /dev/null +++ b/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotals.php @@ -0,0 +1,107 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Model\Observer\Frontend\Quote\Address; + +class CollectTotals +{ + /** + * Customer address + * + * @var \Magento\Customer\Helper\Address + */ + protected $customerAddress; + + /** + * Customer data + * + * @var \Magento\Customer\Helper\Data + */ + protected $customerData; + + /** + * @var VatValidator + */ + protected $vatValidator; + + /** + * @param \Magento\Customer\Helper\Address $customerAddress + * @param \Magento\Customer\Helper\Data $customerData + * @param VatValidator $vatValidator + */ + public function __construct( + \Magento\Customer\Helper\Address $customerAddress, + \Magento\Customer\Helper\Data $customerData, + VatValidator $vatValidator + ) { + $this->customerData = $customerData; + $this->customerAddress = $customerAddress; + $this->vatValidator = $vatValidator; + } + + /** + * Handle customer VAT number if needed on collect_totals_before event of quote address + * + * @param \Magento\Event\Observer $observer + */ + public function dispatch(\Magento\Event\Observer $observer) + { + /** @var \Magento\Sales\Model\Quote\Address $quoteAddress */ + $quoteAddress = $observer->getQuoteAddress(); + + /** @var \Magento\Sales\Model\Quote $quote */ + $quote = $quoteAddress->getQuote(); + + /** @var \Magento\Customer\Model\Customer $customer */ + $customer = $quote->getCustomer(); + + /** @var \Magento\Core\Model\Store $store */ + $store = $customer->getStore(); + + if ($customer->getDisableAutoGroupChange() || false == $this->vatValidator->isEnabled($quoteAddress, $store)) { + return; + } + + $customerCountryCode = $quoteAddress->getCountryId(); + $customerVatNumber = $quoteAddress->getVatId(); + $groupId = null; + + if (empty($customerVatNumber) || false == $this->customerData->isCountryInEU($customerCountryCode)) { + $groupId = $customer->getId() + ? $this->customerData->getDefaultCustomerGroupId($store) + : \Magento\Customer\Model\Group::NOT_LOGGED_IN_ID; + } else { + // Magento always has to emulate group even if customer uses default billing/shipping address + $groupId = $this->customerData->getCustomerGroupIdBasedOnVatNumber( + $customerCountryCode, $this->vatValidator->validate($quoteAddress, $store), $store + ); + } + + if ($groupId) { + $quoteAddress->setPrevQuoteCustomerGroupId($quote->getCustomerGroupId()); + $customer->setGroupId($groupId); + $quote->setCustomerGroupId($groupId); + } + } +} diff --git a/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidator.php b/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidator.php new file mode 100644 index 00000000000..83bc2aea29f --- /dev/null +++ b/app/code/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidator.php @@ -0,0 +1,128 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Model\Observer\Frontend\Quote\Address; + +class VatValidator +{ + /** + * Customer address + * + * @var \Magento\Customer\Helper\Address + */ + protected $customerAddress; + + /** + * Customer data + * + * @var \Magento\Customer\Helper\Data + */ + protected $customerData; + + /** + * @param \Magento\Customer\Helper\Address $customerAddress + * @param \Magento\Customer\Helper\Data $customerData + */ + public function __construct( + \Magento\Customer\Helper\Address $customerAddress, + \Magento\Customer\Helper\Data $customerData + ) { + $this->customerData = $customerData; + $this->customerAddress = $customerAddress; + } + + /** + * Validate VAT number + * + * @param \Magento\Sales\Model\Quote\Address $quoteAddress + * @param \Magento\Core\Model\Store $store + * @return \Magento\Object + */ + public function validate(\Magento\Sales\Model\Quote\Address $quoteAddress, \Magento\Core\Model\Store $store) + { + $customerCountryCode = $quoteAddress->getCountryId(); + $customerVatNumber = $quoteAddress->getVatId(); + + $merchantCountryCode = $this->customerData->getMerchantCountryCode(); + $merchantVatNumber = $this->customerData->getMerchantVatNumber(); + + $validationResult = null; + if ($this->customerAddress->getValidateOnEachTransaction($store) + || $customerCountryCode != $quoteAddress->getValidatedCountryCode() + || $customerVatNumber != $quoteAddress->getValidatedVatNumber() + ) { + // Send request to gateway + $validationResult = $this->customerData->checkVatNumber( + $customerCountryCode, + $customerVatNumber, + $merchantVatNumber !== '' ? $merchantCountryCode : '', + $merchantVatNumber + ); + + // Store validation results in corresponding quote address + $quoteAddress->setVatIsValid((int)$validationResult->getIsValid()); + $quoteAddress->setVatRequestId($validationResult->getRequestIdentifier()); + $quoteAddress->setVatRequestDate($validationResult->getRequestDate()); + $quoteAddress->setVatRequestSuccess($validationResult->getRequestSuccess()); + $quoteAddress->setValidatedVatNumber($customerVatNumber); + $quoteAddress->setValidatedCountryCode($customerCountryCode); + $quoteAddress->save(); + } else { + // Restore validation results from corresponding quote address + $validationResult = new \Magento\Object(array( + 'is_valid' => (int)$quoteAddress->getVatIsValid(), + 'request_identifier' => (string)$quoteAddress->getVatRequestId(), + 'request_date' => (string)$quoteAddress->getVatRequestDate(), + 'request_success' => (boolean)$quoteAddress->getVatRequestSuccess() + )); + } + + return $validationResult; + } + + /** + * Check whether VAT ID validation is enabled + * + * @param \Magento\Sales\Model\Quote\Address $quoteAddress + * @param \Magento\Core\Model\Store $store + * @return bool + */ + public function isEnabled(\Magento\Sales\Model\Quote\Address $quoteAddress, $store) + { + $configAddressType = $this->customerAddress->getTaxCalculationAddressType($store); + + // When VAT is based on billing address then Magento have to handle only billing addresses + $additionalBillingAddressCondition = + $configAddressType == \Magento\Customer\Model\Address\AbstractAddress::TYPE_BILLING + ? $configAddressType != $quoteAddress->getAddressType() + : false; + + // Handle only addresses that corresponds to VAT configuration + if (!$this->customerAddress->isVatValidationEnabled($store) || $additionalBillingAddressCondition) { + return false; + } + + return true; + } +} diff --git a/app/code/Magento/Sales/Model/Order.php b/app/code/Magento/Sales/Model/Order.php index a5786283bd7..e7d574bdcc9 100644 --- a/app/code/Magento/Sales/Model/Order.php +++ b/app/code/Magento/Sales/Model/Order.php @@ -499,42 +499,40 @@ class Order extends \Magento\Sales\Model\AbstractModel protected $_carrierFactory; /** - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Sales\Helper\Data $salesData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime + * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\Sales\Helper\Data $salesData + * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param ResourceFactory $resourceFactory - * @param Order\Config $orderConfig + * @param \Magento\Sales\Model\ResourceFactory $resourceFactory + * @param \Magento\Sales\Model\Order\Config $orderConfig * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Email\Model\Template\MailerFactory $templateMailerFactory * @param \Magento\Email\Model\InfoFactory $emailInfoFactory - * @param Resource\Order\Item\CollectionFactory $orderItemCollFactory + * @param \Magento\Sales\Model\Resource\Order\Item\CollectionFactory $orderItemCollFactory * @param \Magento\Catalog\Model\Product\Visibility $productVisibility * @param \Magento\Tax\Model\Calculation $taxCalculation - * @param Service\OrderFactory $serviceOrderFactory + * @param \Magento\Sales\Model\Service\OrderFactory $serviceOrderFactory * @param \Magento\Directory\Model\CurrencyFactory $currencyFactory * @param \Magento\Eav\Model\Config $eavConfig - * @param Order\Status\HistoryFactory $orderHistoryFactory + * @param \Magento\Sales\Model\Order\Status\HistoryFactory $orderHistoryFactory * @param \Magento\Tax\Model\Resource\Sales\Order\Tax\CollectionFactory $orderTaxCollFactory - * @param CarrierFactory $carrierFactory + * @param \Magento\Sales\Model\CarrierFactory $carrierFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, - \Magento\Sales\Helper\Data $salesData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, + \Magento\Payment\Helper\Data $paymentData, + \Magento\Sales\Helper\Data $salesData, + \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Sales\Model\ResourceFactory $resourceFactory, \Magento\Sales\Model\Order\Config $orderConfig, diff --git a/app/code/Magento/Sales/Model/Order/Address.php b/app/code/Magento/Sales/Model/Order/Address.php index 600a32d43ed..fc11da31d02 100644 --- a/app/code/Magento/Sales/Model/Order/Address.php +++ b/app/code/Magento/Sales/Model/Order/Address.php @@ -91,9 +91,9 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress protected $_orderFactory; /** - * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Customer\Model\Address\Config $addressConfig * @param \Magento\Directory\Model\RegionFactory $regionFactory @@ -102,13 +102,11 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Directory\Helper\Data $directoryData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Directory\Helper\Data $directoryData, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Address\Config $addressConfig, \Magento\Directory\Model\RegionFactory $regionFactory, @@ -119,9 +117,9 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress array $data = array() ) { parent::__construct( - $directoryData, $context, $registry, + $directoryData, $eavConfig, $addressConfig, $regionFactory, diff --git a/app/code/Magento/Sales/Model/Order/Creditmemo.php b/app/code/Magento/Sales/Model/Order/Creditmemo.php index f43f0d0320a..b7ac592f309 100644 --- a/app/code/Magento/Sales/Model/Order/Creditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Creditmemo.php @@ -232,36 +232,34 @@ class Creditmemo extends \Magento\Sales\Model\AbstractModel protected $_emailInfoFactory; /** - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Sales\Helper\Data $salesData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime - * @param Creditmemo\Config $creditmemoConfig + * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\Sales\Helper\Data $salesData + * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig + * @param \Magento\Sales\Model\Order\Creditmemo\Config $creditmemoConfig * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory $cmItemCollFactory * @param \Magento\Core\Model\CalculatorFactory $calculatorFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param Creditmemo\CommentFactory $commentFactory + * @param \Magento\Sales\Model\Order\Creditmemo\CommentFactory $commentFactory * @param \Magento\Sales\Model\Resource\Order\Creditmemo\Comment\CollectionFactory $commentCollFactory * @param \Magento\Email\Model\Template\MailerFactory $templateMailerFactory * @param \Magento\Email\Model\InfoFactory $emailInfoFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, - \Magento\Sales\Helper\Data $salesData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, + \Magento\Payment\Helper\Data $paymentData, + \Magento\Sales\Helper\Data $salesData, + \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Sales\Model\Order\Creditmemo\Config $creditmemoConfig, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Resource\Order\Creditmemo\Item\CollectionFactory $cmItemCollFactory, diff --git a/app/code/Magento/Sales/Model/Order/Invoice.php b/app/code/Magento/Sales/Model/Order/Invoice.php index 31657ad745b..70ba5ca4647 100644 --- a/app/code/Magento/Sales/Model/Order/Invoice.php +++ b/app/code/Magento/Sales/Model/Order/Invoice.php @@ -238,36 +238,34 @@ class Invoice extends \Magento\Sales\Model\AbstractModel protected $_emailInfoFactory; /** - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Sales\Helper\Data $salesData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime - * @param Invoice\Config $invoiceConfig + * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\Sales\Helper\Data $salesData + * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig + * @param \Magento\Sales\Model\Order\Invoice\Config $invoiceConfig * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Resource\OrderFactory $orderResourceFactory * @param \Magento\Core\Model\CalculatorFactory $calculatorFactory * @param \Magento\Sales\Model\Resource\Order\Invoice\Item\CollectionFactory $invoiceItemCollFactory - * @param Invoice\CommentFactory $invoiceCommentFactory + * @param \Magento\Sales\Model\Order\Invoice\CommentFactory $invoiceCommentFactory * @param \Magento\Sales\Model\Resource\Order\Invoice\Comment\CollectionFactory $commentCollFactory * @param \Magento\Email\Model\Template\MailerFactory $templateMailerFactory * @param \Magento\Email\Model\InfoFactory $emailInfoFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, - \Magento\Sales\Helper\Data $salesData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, + \Magento\Payment\Helper\Data $paymentData, + \Magento\Sales\Helper\Data $salesData, + \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Sales\Model\Order\Invoice\Config $invoiceConfig, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Resource\OrderFactory $orderResourceFactory, diff --git a/app/code/Magento/Sales/Model/Order/Payment.php b/app/code/Magento/Sales/Model/Order/Payment.php index d459c5e1b54..f99901c5fad 100644 --- a/app/code/Magento/Sales/Model/Order/Payment.php +++ b/app/code/Magento/Sales/Model/Order/Payment.php @@ -210,9 +210,9 @@ class Payment extends \Magento\Payment\Model\Info protected $_storeManager; /** - * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Encryption\EncryptorInterface $encryptor * @param \Magento\Sales\Model\Service\OrderFactory $serviceOrderFactory * @param \Magento\Sales\Model\Order\Payment\TransactionFactory $transactionFactory @@ -224,9 +224,9 @@ class Payment extends \Magento\Payment\Model\Info * @param array $data */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Payment\Helper\Data $paymentData, \Magento\Encryption\EncryptorInterface $encryptor, \Magento\Sales\Model\Service\OrderFactory $serviceOrderFactory, \Magento\Sales\Model\Order\Payment\TransactionFactory $transactionFactory, @@ -242,7 +242,7 @@ class Payment extends \Magento\Payment\Model\Info $this->_transactionCollFactory = $transactionCollFactory; $this->_agreementFactory = $agreementFactory; $this->_storeManager = $storeManager; - parent::__construct($paymentData, $context, $registry, $encryptor, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $paymentData, $encryptor, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php index af20dc5e224..fd7ddf30dcc 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/AbstractItems.php @@ -79,18 +79,18 @@ abstract class AbstractItems extends \Magento\Core\Model\AbstractModel protected $_coreDir; /** - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Dir $coreDir * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Tax\Helper\Data $taxData, \Magento\App\Dir $coreDir, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php index de69a8580a1..e3151ecd8da 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Creditmemo/DefaultCreditmemo.php @@ -43,27 +43,27 @@ class DefaultCreditmemo extends \Magento\Sales\Model\Order\Pdf\Items\AbstractIte protected $string; /** - * @param \Magento\Stdlib\String $string - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Dir $coreDir + * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Stdlib\String $string, - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Tax\Helper\Data $taxData, \Magento\App\Dir $coreDir, + \Magento\Stdlib\String $string, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->string = $string; - parent::__construct($taxData, $context, $registry, $coreDir, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $taxData, $coreDir, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php index b4f36c5d9ae..c889863e2ff 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Invoice/DefaultInvoice.php @@ -39,27 +39,27 @@ class DefaultInvoice extends \Magento\Sales\Model\Order\Pdf\Items\AbstractItems protected $string; /** - * @param \Magento\Stdlib\String $string - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Dir $coreDir + * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Stdlib\String $string, - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Tax\Helper\Data $taxData, \Magento\App\Dir $coreDir, + \Magento\Stdlib\String $string, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->string = $string; - parent::__construct($taxData, $context, $registry, $coreDir, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $taxData, $coreDir, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php index c2d8acc6ab6..209dbb3e153 100644 --- a/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php +++ b/app/code/Magento/Sales/Model/Order/Pdf/Items/Shipment/DefaultShipment.php @@ -39,27 +39,27 @@ class DefaultShipment extends \Magento\Sales\Model\Order\Pdf\Items\AbstractItems protected $string; /** - * @param \Magento\Stdlib\String $string - * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\App\Dir $coreDir + * @param \Magento\Stdlib\String $string * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Stdlib\String $string, - \Magento\Tax\Helper\Data $taxData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Tax\Helper\Data $taxData, \Magento\App\Dir $coreDir, + \Magento\Stdlib\String $string, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() ) { $this->string = $string; - parent::__construct($taxData, $context, $registry, $coreDir, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $taxData, $coreDir, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Sales/Model/Order/Shipment.php b/app/code/Magento/Sales/Model/Order/Shipment.php index 53153d71bcb..1d5e8e618ae 100644 --- a/app/code/Magento/Sales/Model/Order/Shipment.php +++ b/app/code/Magento/Sales/Model/Order/Shipment.php @@ -147,13 +147,13 @@ class Shipment extends \Magento\Sales\Model\AbstractModel protected $_emailInfoFactory; /** - * @param \Magento\Payment\Helper\Data $paymentData - * @param \Magento\Sales\Helper\Data $salesData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\LocaleInterface $coreLocale * @param \Magento\Stdlib\DateTime $dateTime + * @param \Magento\Payment\Helper\Data $paymentData + * @param \Magento\Sales\Helper\Data $salesData + * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Resource\Order\Shipment\Item\CollectionFactory $shipmentItemCollFactory * @param \Magento\Sales\Model\Resource\Order\Shipment\Track\CollectionFactory $trackCollFactory @@ -164,17 +164,15 @@ class Shipment extends \Magento\Sales\Model\AbstractModel * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, - \Magento\Sales\Helper\Data $salesData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, - \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\LocaleInterface $coreLocale, \Magento\Stdlib\DateTime $dateTime, + \Magento\Payment\Helper\Data $paymentData, + \Magento\Sales\Helper\Data $salesData, + \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Resource\Order\Shipment\Item\CollectionFactory $shipmentItemCollFactory, \Magento\Sales\Model\Resource\Order\Shipment\Track\CollectionFactory $trackCollFactory, diff --git a/app/code/Magento/Sales/Model/Quote.php b/app/code/Magento/Sales/Model/Quote.php index 42678d50259..febdab2346c 100644 --- a/app/code/Magento/Sales/Model/Quote.php +++ b/app/code/Magento/Sales/Model/Quote.php @@ -285,11 +285,10 @@ class Quote extends \Magento\Core\Model\AbstractModel protected $_objectCopyService; /** - * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Sales\Helper\Data $salesData - * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Sales\Helper\Data $salesData + * @param \Magento\Catalog\Helper\Product $catalogProduct * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Config $config @@ -308,14 +307,12 @@ class Quote extends \Magento\Core\Model\AbstractModel * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Sales\Helper\Data $salesData, - \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Sales\Helper\Data $salesData, + \Magento\Catalog\Helper\Product $catalogProduct, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Config $config, diff --git a/app/code/Magento/Sales/Model/Quote/Address.php b/app/code/Magento/Sales/Model/Quote/Address.php index 659949e3a44..872e7d1d5ac 100644 --- a/app/code/Magento/Sales/Model/Quote/Address.php +++ b/app/code/Magento/Sales/Model/Quote/Address.php @@ -250,34 +250,32 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress protected $_addressTotalFactory; /** - * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Directory\Helper\Data $directoryData * @param \Magento\Eav\Model\Config $eavConfig * @param \Magento\Customer\Model\Address\Config $addressConfig * @param \Magento\Directory\Model\RegionFactory $regionFactory * @param \Magento\Directory\Model\CountryFactory $countryFactory * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig * @param \Magento\Customer\Model\AddressFactory $addressFactory - * @param Address\ItemFactory $addressItemFactory + * @param \Magento\Sales\Model\Quote\Address\ItemFactory $addressItemFactory * @param \Magento\Sales\Model\Resource\Quote\Address\Item\CollectionFactory $itemCollFactory - * @param Address\RateFactory $addressRateFactory + * @param \Magento\Sales\Model\Quote\Address\RateFactory $addressRateFactory * @param \Magento\Shipping\Model\ShippingFactory $shippingFactory * @param \Magento\Sales\Model\Resource\Quote\Address\Rate\CollectionFactory $rateCollFactory * @param \Magento\Shipping\Model\Rate\RequestFactory $rateRequestFactory - * @param Address\Total\CollectorFactory $totalCollectorFactory - * @param Address\TotalFactory $addressTotalFactory + * @param \Magento\Sales\Model\Quote\Address\Total\CollectorFactory $totalCollectorFactory + * @param \Magento\Sales\Model\Quote\Address\TotalFactory $addressTotalFactory * @param \Magento\Object\Copy $objectCopyService * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Directory\Helper\Data $directoryData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Directory\Helper\Data $directoryData, \Magento\Eav\Model\Config $eavConfig, \Magento\Customer\Model\Address\Config $addressConfig, \Magento\Directory\Model\RegionFactory $regionFactory, @@ -309,9 +307,9 @@ class Address extends \Magento\Customer\Model\Address\AbstractAddress $this->_addressTotalFactory = $addressTotalFactory; $this->_objectCopyService = $objectCopyService; parent::__construct( - $directoryData, $context, $registry, + $directoryData, $eavConfig, $addressConfig, $regionFactory, diff --git a/app/code/Magento/Sales/Model/Recurring/Profile.php b/app/code/Magento/Sales/Model/Recurring/Profile.php index 62465e26724..b832c85067b 100644 --- a/app/code/Magento/Sales/Model/Recurring/Profile.php +++ b/app/code/Magento/Sales/Model/Recurring/Profile.php @@ -157,9 +157,9 @@ class Profile extends \Magento\Payment\Model\Recurring\Profile protected $mathRandom; /** - * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Payment\Helper\Data $paymentData * @param \Magento\Sales\Model\OrderFactory $orderFactory * @param \Magento\Sales\Model\Order\AddressFactory $addressFactory * @param \Magento\Sales\Model\Order\PaymentFactory $paymentFactory @@ -168,13 +168,11 @@ class Profile extends \Magento\Payment\Model\Recurring\Profile * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\Payment\Helper\Data $paymentData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Payment\Helper\Data $paymentData, \Magento\Sales\Model\OrderFactory $orderFactory, \Magento\Sales\Model\Order\AddressFactory $addressFactory, \Magento\Sales\Model\Order\PaymentFactory $paymentFactory, @@ -189,7 +187,7 @@ class Profile extends \Magento\Payment\Model\Recurring\Profile $this->_paymentFactory = $paymentFactory; $this->_orderItemFactory = $orderItemFactory; $this->mathRandom = $mathRandom; - parent::__construct($paymentData, $context, $registry, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $paymentData, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Billing/Agreement/Collection.php b/app/code/Magento/Sales/Model/Resource/Billing/Agreement/Collection.php index 81695dcb94b..2fccf492cff 100644 --- a/app/code/Magento/Sales/Model/Resource/Billing/Agreement/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Billing/Agreement/Collection.php @@ -51,22 +51,24 @@ class Collection protected $_customerResource; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Customer\Model\Resource\Customer $customerResource + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Customer\Model\Resource\Customer $customerResource, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_customerResource = $customerResource; } diff --git a/app/code/Magento/Sales/Model/Resource/Order/AbstractOrder.php b/app/code/Magento/Sales/Model/Resource/Order/AbstractOrder.php index 21c549330d1..b9105193cf5 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/AbstractOrder.php +++ b/app/code/Magento/Sales/Model/Resource/Order/AbstractOrder.php @@ -100,15 +100,15 @@ abstract class AbstractOrder extends \Magento\Sales\Model\Resource\AbstractResou protected $_eavEntityTypeFactory; /** - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, \Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory ) { $this->_eventManager = $eventManager; diff --git a/app/code/Magento/Sales/Model/Resource/Order/Address.php b/app/code/Magento/Sales/Model/Resource/Order/Address.php index cedb9e98ea2..1cd6403b7a4 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Address.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Address.php @@ -44,20 +44,20 @@ class Address extends \Magento\Sales\Model\Resource\Order\AbstractOrder protected $_salesResourceFactory; /** - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory * @param \Magento\Sales\Model\Resource\Factory $salesResourceFactory */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, \Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory, \Magento\Sales\Model\Resource\Factory $salesResourceFactory ) { - parent::__construct($eventManager, $resource, $dateTime, $eavEntityTypeFactory); + parent::__construct($resource, $dateTime, $eventManager, $eavEntityTypeFactory); $this->_salesResourceFactory = $salesResourceFactory; } diff --git a/app/code/Magento/Sales/Model/Resource/Order/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Collection.php index b66e787399c..30ae949c00d 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Collection.php @@ -56,22 +56,24 @@ class Collection extends \Magento\Sales\Model\Resource\Collection\AbstractCollec protected $_coreResourceHelper; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Resource\Helper $coreResourceHelper + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Resource\Helper $coreResourceHelper, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_coreResourceHelper = $coreResourceHelper; } diff --git a/app/code/Magento/Sales/Model/Resource/Order/Payment.php b/app/code/Magento/Sales/Model/Resource/Order/Payment.php index 75fb12c3b55..b301e526dc5 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Payment.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Payment.php @@ -53,21 +53,21 @@ class Payment extends \Magento\Sales\Model\Resource\Order\AbstractOrder protected $_paymentConverter; /** - * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\App\Resource $resource * @param \Magento\Stdlib\DateTime $dateTime + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory * @param \Magento\Sales\Model\Payment\Method\Converter $paymentConverter */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, \Magento\App\Resource $resource, \Magento\Stdlib\DateTime $dateTime, + \Magento\Event\ManagerInterface $eventManager, \Magento\Eav\Model\Entity\TypeFactory $eavEntityTypeFactory, \Magento\Sales\Model\Payment\Method\Converter $paymentConverter ) { $this->_paymentConverter = $paymentConverter; - parent::__construct($eventManager, $resource, $dateTime, $eavEntityTypeFactory); + parent::__construct($resource, $dateTime, $eventManager, $eavEntityTypeFactory); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Order/Payment/Collection.php b/app/code/Magento/Sales/Model/Resource/Order/Payment/Collection.php index 6b2985b98da..f31ff8c46b2 100644 --- a/app/code/Magento/Sales/Model/Resource/Order/Payment/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Order/Payment/Collection.php @@ -51,23 +51,25 @@ class Collection extends \Magento\Sales\Model\Resource\Order\Collection\Abstract protected $_converter; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Payment\Method\Converter $converter + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Payment\Method\Converter $converter, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_converter = $converter; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Quote/Item/Collection.php b/app/code/Magento/Sales/Model/Resource/Quote/Item/Collection.php index 7b4de1b1ad7..3a5b98dc8ca 100644 --- a/app/code/Magento/Sales/Model/Resource/Quote/Item/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Quote/Item/Collection.php @@ -61,26 +61,28 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_quoteConfig; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Quote\Item\Option\CollectionFactory $itemOptionCollFactory * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory * @param \Magento\Sales\Model\Quote\Config $quoteConfig + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Quote\Item\Option\CollectionFactory $itemOptionCollFactory, \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory, \Magento\Sales\Model\Quote\Config $quoteConfig, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_itemOptionCollFactory = $itemOptionCollFactory; $this->_productCollFactory = $productCollFactory; $this->_quoteConfig = $quoteConfig; diff --git a/app/code/Magento/Sales/Model/Resource/Quote/Payment/Collection.php b/app/code/Magento/Sales/Model/Resource/Quote/Payment/Collection.php index 0bf37626e08..2cf8aa0c4a7 100644 --- a/app/code/Magento/Sales/Model/Resource/Quote/Payment/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Quote/Payment/Collection.php @@ -37,22 +37,24 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_converter; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Payment\Method\Converter $converter + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Payment\Method\Converter $converter, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_converter = $converter; } diff --git a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php index 4a2293c5299..00497552f08 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers.php @@ -46,8 +46,8 @@ class Bestsellers extends \Magento\Sales\Model\Resource\Report\AbstractReport protected $_salesResourceHelper; /** - * @param \Magento\Logger $logger * @param \Magento\App\Resource $resource + * @param \Magento\Logger $logger * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Stdlib\DateTime $dateTime @@ -55,15 +55,15 @@ class Bestsellers extends \Magento\Sales\Model\Resource\Report\AbstractReport * @param \Magento\Sales\Model\Resource\Helper $salesResourceHelper */ public function __construct( - \Magento\Logger $logger, \Magento\App\Resource $resource, + \Magento\Logger $logger, \Magento\Core\Model\LocaleInterface $locale, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Stdlib\DateTime $dateTime, \Magento\Catalog\Model\Resource\Product $productResource, \Magento\Sales\Model\Resource\Helper $salesResourceHelper ) { - parent::__construct($logger, $resource, $locale, $reportsFlagFactory, $dateTime); + parent::__construct($resource, $logger, $locale, $reportsFlagFactory, $dateTime); $this->_productResource = $productResource; $this->_salesResourceHelper = $salesResourceHelper; } diff --git a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers/Collection.php b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers/Collection.php index c5d164aa056..0889cb595fa 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Bestsellers/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Bestsellers/Collection.php @@ -52,21 +52,23 @@ class Collection protected $_selectedColumns = array(); /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + $connection = null ) { $resource->init('sales_bestsellers_aggregated_daily'); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $resource, $connection); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Report/Collection/AbstractCollection.php b/app/code/Magento/Sales/Model/Resource/Report/Collection/AbstractCollection.php index 04b2469f226..bf79e9fda2e 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Collection/AbstractCollection.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Collection/AbstractCollection.php @@ -45,20 +45,22 @@ class AbstractCollection protected $_orderStatus = null; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + $connection = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->setModel('Magento\Reports\Model\Item'); } diff --git a/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php b/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php index 84f420d7b9e..2e2d289c3fd 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Invoiced.php @@ -38,20 +38,22 @@ class Invoiced extends \Magento\Sales\Model\Resource\Report\Invoiced\Collection\Order { /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + $connection = null ) { $resource->init('sales_invoiced_aggregated'); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $resource, $connection); } } diff --git a/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Order.php index c5c4ef2824d..63ce4639909 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Invoiced/Collection/Order.php @@ -52,21 +52,23 @@ class Order protected $_selectedColumns = array(); /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + $connection = null ) { $resource->init('sales_invoiced_aggregated_order'); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $resource, $connection); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Report/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Order.php index 44ef6292d2c..a17d3e82511 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Order.php @@ -42,24 +42,24 @@ class Order extends \Magento\Sales\Model\Resource\Report\AbstractReport protected $_updateDatFactory; /** - * @param \Magento\Logger $logger * @param \Magento\App\Resource $resource + * @param \Magento\Logger $logger * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Stdlib\DateTime $dateTime - * @param Order\CreatedatFactory $createDatFactory - * @param Order\UpdatedatFactory $updateDatFactory + * @param \Magento\Sales\Model\Resource\Report\Order\CreatedatFactory $createDatFactory + * @param \Magento\Sales\Model\Resource\Report\Order\UpdatedatFactory $updateDatFactory */ public function __construct( - \Magento\Logger $logger, \Magento\App\Resource $resource, + \Magento\Logger $logger, \Magento\Core\Model\LocaleInterface $locale, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Stdlib\DateTime $dateTime, \Magento\Sales\Model\Resource\Report\Order\CreatedatFactory $createDatFactory, \Magento\Sales\Model\Resource\Report\Order\UpdatedatFactory $updateDatFactory ) { - parent::__construct($logger, $resource, $locale, $reportsFlagFactory, $dateTime); + parent::__construct($resource, $logger, $locale, $reportsFlagFactory, $dateTime); $this->_createDatFactory = $createDatFactory; $this->_updateDatFactory = $updateDatFactory; } diff --git a/app/code/Magento/Sales/Model/Resource/Report/Order/Collection.php b/app/code/Magento/Sales/Model/Resource/Report/Order/Collection.php index 56d4e5f062c..d273d960bfa 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Order/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Order/Collection.php @@ -58,21 +58,23 @@ class Collection extends \Magento\Sales\Model\Resource\Report\Collection\Abstrac protected $_selectedColumns = array(); /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + $connection = null ) { $resource->init($this->_aggregationTable); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $resource, $connection); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Order.php index 4f9375aa708..9d5f2cb5ca4 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Order.php @@ -52,21 +52,23 @@ class Order protected $_selectedColumns = array(); /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + $connection = null ) { $resource->init('sales_refunded_aggregated_order'); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $resource, $connection); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php b/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php index 123c79040c9..1f4d4525eb2 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Refunded/Collection/Refunded.php @@ -38,20 +38,22 @@ class Refunded extends \Magento\Sales\Model\Resource\Report\Refunded\Collection\Order { /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + $connection = null ) { $resource->init('sales_refunded_aggregated'); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $resource, $connection); } } diff --git a/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Order.php b/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Order.php index 9022ed9d8dd..c2be70e1e0f 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Order.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Order.php @@ -52,21 +52,23 @@ class Order protected $_selectedColumns = array(); /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + $connection = null ) { $resource->init('sales_shipping_aggregated_order'); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $resource, $connection); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php b/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php index f335ab4b22e..86317e343c9 100644 --- a/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php +++ b/app/code/Magento/Sales/Model/Resource/Report/Shipping/Collection/Shipment.php @@ -38,20 +38,22 @@ class Shipment extends \Magento\Sales\Model\Resource\Report\Shipping\Collection\Order { /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + $connection = null ) { $resource->init('sales_shipping_aggregated'); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $resource, $connection); } } diff --git a/app/code/Magento/Sales/Model/Resource/Sale/Collection.php b/app/code/Magento/Sales/Model/Resource/Sale/Collection.php index 334220fcec5..c67766a776b 100644 --- a/app/code/Magento/Sales/Model/Resource/Sale/Collection.php +++ b/app/code/Magento/Sales/Model/Resource/Sale/Collection.php @@ -86,32 +86,21 @@ class Collection extends \Magento\Data\Collection\Db */ protected $_storeManager; - /** - * Set sales order entity and establish read connection - * - * @param \Magento\Event\ManagerInterface $eventManager - * @param \Magento\Logger $logger - * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Sales\Model\Resource\Order $resource - * @param \Magento\Core\Model\Resource\Store\CollectionFactory $storeCollFactory - * @param \Magento\Core\Model\StoreManagerInterface $storeManager - */ + public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Sales\Model\Resource\Order $resource, \Magento\Core\Model\Resource\Store\CollectionFactory $storeCollFactory, - \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Core\Model\StoreManagerInterface $storeManager ) { $this->_eventManager = $eventManager; $this->_orderResource = $resource; $this->_storeCollFactory = $storeCollFactory; $this->_storeManager = $storeManager; - parent::__construct($logger, $fetchStrategy, $entityFactory, $this->_orderResource->getReadConnection()); + parent::__construct($entityFactory, $logger, $fetchStrategy, $this->_orderResource->getReadConnection()); } /** diff --git a/app/code/Magento/Sales/Model/Resource/Setup.php b/app/code/Magento/Sales/Model/Resource/Setup.php index 61302020f77..e37da694080 100644 --- a/app/code/Magento/Sales/Model/Resource/Setup.php +++ b/app/code/Magento/Sales/Model/Resource/Setup.php @@ -43,25 +43,25 @@ class Setup extends \Magento\Eav\Model\Entity\Setup /** * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param string $resourceName * @param \Magento\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory * @param \Magento\Core\Model\Config $config - * @param string $resourceName * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, \Magento\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory, \Magento\Core\Model\Config $config, - $resourceName, $moduleName = 'Magento_Sales', $connectionName = '' ) { $this->_config = $config; $this->_encryptor = $context->getEncryptor(); - parent::__construct($context, $cache, $attrGrCollFactory, $resourceName, $moduleName, $connectionName); + parent::__construct($context, $resourceName, $cache, $attrGrCollFactory, $moduleName, $connectionName); } /** diff --git a/app/code/Magento/Sales/etc/adminhtml/menu.xml b/app/code/Magento/Sales/etc/adminhtml/menu.xml index 9339c419c83..0777158997b 100644 --- a/app/code/Magento/Sales/etc/adminhtml/menu.xml +++ b/app/code/Magento/Sales/etc/adminhtml/menu.xml @@ -27,7 +27,7 @@ --> <config> <menu> - <add id="Magento_Sales::sales" title="Sales" module="Magento_Sales" sortOrder="10" dependsOnModule="Magento_Sales" resource="Magento_Sales::sales"/> + <add id="Magento_Sales::sales" title="Sales" module="Magento_Sales" sortOrder="15" dependsOnModule="Magento_Sales" resource="Magento_Sales::sales"/> <add id="Magento_Sales::sales_operation" title="Operations" module="Magento_Sales" sortOrder="10" parent="Magento_Sales::sales" resource="Magento_Sales::sales_operation" /> <add id="Magento_Sales::sales_order" title="Orders" module="Magento_Sales" sortOrder="10" parent="Magento_Sales::sales_operation" action="sales/order" resource="Magento_Sales::sales_order"/> <add id="Magento_Sales::sales_invoice" title="Invoices" module="Magento_Sales" sortOrder="20" parent="Magento_Sales::sales_operation" action="sales/invoice" resource="Magento_Sales::sales_invoice"/> diff --git a/app/code/Magento/Sales/etc/frontend/events.xml b/app/code/Magento/Sales/etc/frontend/events.xml index e3ab3a47502..25f15396e8c 100644 --- a/app/code/Magento/Sales/etc/frontend/events.xml +++ b/app/code/Magento/Sales/etc/frontend/events.xml @@ -25,7 +25,7 @@ --> <config> <event name="sales_quote_address_collect_totals_before"> - <observer name="sales_customer_validate_vat_number" instance="Magento\Sales\Model\Observer" method="changeQuoteCustomerGroupId" /> + <observer name="sales_customer_validate_vat_number" instance="Magento\Sales\Model\Observer\Frontend\Quote\Address\CollectTotals" method="dispatch" /> </event> <event name="sales_quote_address_collect_totals_after"> <observer name="sales_customer_validate_vat_number" instance="Magento\Sales\Model\Observer" method="restoreQuoteCustomerGroupId" /> diff --git a/app/code/Magento/Sales/etc/module.xml b/app/code/Magento/Sales/etc/module.xml index ed993f0c31c..bc071ade3f9 100755 --- a/app/code/Magento/Sales/etc/module.xml +++ b/app/code/Magento/Sales/etc/module.xml @@ -37,7 +37,7 @@ <module name="Magento_Payment"/> <module name="Magento_Core"/> <module name="Magento_Checkout"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> <module name="Magento_Adminhtml"/> <module name="Magento_SalesRule"/> <module name="Magento_Backend"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml index 15387546d38..538befb4e7a 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_index.xml @@ -31,33 +31,33 @@ </action> </referenceBlock> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-sales-order-create-scripts-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-sales-order-create-scripts-js"> <arguments> <argument name="file" xsi:type="string">Magento_Sales::order/create/scripts.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-sales-order-create-giftmessage-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-sales-order-create-giftmessage-js"> <arguments> <argument name="file" xsi:type="string">Magento_Sales::order/create/giftmessage.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-catalog-product-composite-configure-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-catalog-product-composite-configure-js"> <arguments> <argument name="file" xsi:type="string">Magento_Catalog::catalog/product/composite/configure.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="varien-configurable-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="varien-configurable-js"> <arguments> <argument name="file" xsi:type="string">varien/configurable.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-sales-order-giftoptions-tooltip-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-sales-order-giftoptions-tooltip-js"> <arguments> <argument name="file" xsi:type="string">Magento_Sales::order/giftoptions_tooltip.js</argument> </arguments> </block> <block class="Magento\Backend\Block\Template" name="optional_zip_countries" as="optional_zip_countries" template="Magento_Directory::js/optional_zip_countries.phtml"/> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> <arguments> <argument name="file" xsi:type="string">Magento_Core::prototype/magento.css</argument> </arguments> @@ -111,7 +111,7 @@ <block class="Magento\Backend\Block\Template" name="gift_options" template="Magento_Sales::order/giftoptions.phtml"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Giftmessage" template="order/create/giftmessage.phtml" name="giftmessage"/> </block> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> </block> </block> </block> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml index 98a29816a8d..dd6eea76e35 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_data.xml @@ -62,7 +62,7 @@ <block class="Magento\Backend\Block\Template" name="gift_options" template="Magento_Sales::order/giftoptions.phtml"> <block class="Magento\Sales\Block\Adminhtml\Order\Create\Giftmessage" template="order/create/giftmessage.phtml" name="giftmessage"/> </block> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> </block> </referenceContainer> </layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml index 48ba2ab37f3..f088b672e78 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_create_load_block_items.xml @@ -32,6 +32,6 @@ </block> </block> </block> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml index 7f1d7025dc5..2140a093e6f 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_new.xml @@ -34,7 +34,7 @@ <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="items/column/name.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="items/column/name.phtml" group="column"/> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> <block class="Magento\Sales\Block\Adminhtml\Order\Totalbar" name="order_totalbar" template="order/totalbar.phtml"/> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Totals" name="creditmemo_totals" template="order/totals.phtml"> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Adjustments" name="adjustments" template="order/creditmemo/create/totals/adjustments.phtml"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml index 9ea4985b568..6a5a7298ea6 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_updateqty.xml @@ -29,7 +29,7 @@ <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="items/column/name.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="items/column/name.phtml" group="column"/> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> <block class="Magento\Sales\Block\Adminhtml\Order\Totalbar" name="order_totalbar" template="order/totalbar.phtml"/> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Totals" name="creditmemo_totals" template="order/totals.phtml"> <block class="Magento\Sales\Block\Adminhtml\Order\Creditmemo\Create\Adjustments" name="adjustments" template="order/creditmemo/create/totals/adjustments.phtml"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml index 00bcfbd0837..0891cbfa902 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_creditmemo_view.xml @@ -34,7 +34,7 @@ <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="items/column/name.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="items/column/name.phtml" group="column"/> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> </block> <block class="Magento\Sales\Block\Adminhtml\Order\Comments\View" name="order_comments" template="order/comments/view.phtml"> <action method="setParentType"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml index ab9d01d5f65..9531f49521e 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_new.xml @@ -34,7 +34,7 @@ <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="items/column/name.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="items/column/name.phtml" group="column"/> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> <block class="Magento\Sales\Block\Adminhtml\Order\Totalbar" name="order_totalbar" template="order/totalbar.phtml"/> <block class="Magento\Sales\Block\Adminhtml\Order\Invoice\Totals" name="invoice_totals" template="order/totals.phtml"> <block class="Magento\Sales\Block\Adminhtml\Order\Totals\Tax" name="tax" template="order/totals/tax.phtml"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml index bb65f6231a0..7f189cd4372 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_updateqty.xml @@ -29,7 +29,7 @@ <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="items/column/name.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="items/column/name.phtml" group="column"/> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> <block class="Magento\Sales\Block\Adminhtml\Order\Totalbar" name="order_totalbar" template="order/totalbar.phtml"/> <block class="Magento\Sales\Block\Adminhtml\Order\Invoice\Totals" name="invoice_totals" template="order/totals.phtml"> <block class="Magento\Sales\Block\Adminhtml\Order\Totals\Tax" name="tax" template="order/totals/tax.phtml"/> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml index ce540e07842..084c848c244 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_invoice_view.xml @@ -34,7 +34,7 @@ <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="items/column/name.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="items/column/name.phtml" group="column"/> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> </block> <block class="Magento\Sales\Block\Adminhtml\Order\Comments\View" name="order_comments" template="order/comments/view.phtml"> <action method="setParentType"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_new.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_new.xml index c27ac017764..c1675a3b7e6 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_new.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_new.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-sales-order-shipment-packaging-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-sales-order-shipment-packaging-js"> <arguments> <argument name="file" xsi:type="string">Magento_Sales::order/shipment/packaging.js</argument> </arguments> @@ -41,7 +41,7 @@ <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="default" template="order/shipment/create/items/renderer/default.phtml"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="items/column/name.phtml" group="column"/> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> </block> <block class="Magento\Sales\Block\Adminhtml\Order\Shipment\Packaging" name="shipment_packaging" template="order/shipment/packaging/popup.phtml"/> </block> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_view.xml index a53d752e8ee..1a7c4e66360 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_shipment_view.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-sales-order-shipment-packaging-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-sales-order-shipment-packaging-js"> <arguments> <argument name="file" xsi:type="string">Magento_Sales::order/shipment/packaging.js</argument> </arguments> @@ -41,7 +41,7 @@ <block class="Magento\Sales\Block\Adminhtml\Items\Renderer\DefaultRenderer" as="default" template="order/shipment/view/items/renderer/default.phtml"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="items/column/name.phtml" group="column"/> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> </block> <block class="Magento\Sales\Block\Adminhtml\Order\Invoice\Create\Tracking" name="invoice_tracking" template="order/shipment/create/tracking.phtml"/> <block class="Magento\Sales\Block\Adminhtml\Order\Comments\View" name="order_comments" template="order/comments/view.phtml"> diff --git a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml index 2d4c4618e1a..9207b7456e1 100644 --- a/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml +++ b/app/code/Magento/Sales/view/adminhtml/layout/sales_order_view.xml @@ -25,12 +25,12 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-sales-order-create-giftmessage-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-sales-order-create-giftmessage-js"> <arguments> <argument name="file" xsi:type="string">Magento_Sales::order/create/giftmessage.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-sales-order-giftoptions-tooltip-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-sales-order-giftoptions-tooltip-js"> <arguments> <argument name="file" xsi:type="string">Magento_Sales::order/giftoptions_tooltip.js</argument> </arguments> @@ -49,7 +49,7 @@ <block class="Magento\Sales\Block\Adminhtml\Items\Column\Qty" name="column_qty" template="items/column/qty.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name" name="column_name" template="items/column/name.phtml" group="column"/> <block class="Magento\Sales\Block\Adminhtml\Items\Column\Name\Grouped" name="column_name_grouped" template="items/column/name.phtml" group="column"/> - <block class="Magento\View\Block\Text\ListText" name="order_item_extra_info"/> + <block class="Magento\View\Element\Text\ListText" name="order_item_extra_info"/> </block> <block class="Magento\Sales\Block\Adminhtml\Order\Payment" name="order_payment"/> <block class="Magento\Sales\Block\Adminhtml\Order\View\History" name="order_history" template="order/view/history.phtml"/> diff --git a/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.phtml b/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.phtml index 7ecb78fd668..897494ca255 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/create/giftmessage.phtml @@ -26,19 +26,17 @@ ?> <?php if ($this->helper('Magento\GiftMessage\Helper\Message')->getIsMessagesAvailable('main', $this->getQuote(), $this->getStoreId())): ?> <?php $_items = $this->getItems(); ?> -<div id="order-giftmessage"> - <div class="giftmessage-order-create box-left"> - <fieldset> - <legend><?php echo __('Gift Message for the Entire Order') ?></legend> - <br /> - <?php if($this->helper('Magento\GiftMessage\Helper\Message')->getIsMessagesAvailable('main', $this->getQuote(), $this->getStoreId())): ?> - <div class="giftmessage-entire-order"> - <p><?php echo __('If you don\'t want to leave a gift message for the entire order, leave this box blank.') ?></p> - <?php echo $this->getFormHtml($this->getQuote(), 'main') ?> - </div> - <?php endif; ?> - </fieldset> - </div> +<div id="order-giftmessage" class="giftmessage-order-create box-left"> + <fieldset> + <legend><?php echo __('Gift Message for the Entire Order') ?></legend> + <br /> + <?php if($this->helper('Magento\GiftMessage\Helper\Message')->getIsMessagesAvailable('main', $this->getQuote(), $this->getStoreId())): ?> + <div class="giftmessage-entire-order"> + <p><?php echo __('If you don\'t want to leave a gift message for the entire order, leave this box blank.') ?></p> + <?php echo $this->getFormHtml($this->getQuote(), 'main') ?> + </div> + <?php endif; ?> + </fieldset> <script type="text/javascript"> order.giftmessageFieldsBind('order-giftmessage'); </script> diff --git a/app/code/Magento/Sales/view/adminhtml/order/giftoptions.phtml b/app/code/Magento/Sales/view/adminhtml/order/giftoptions.phtml index 84238d8b408..d7703a65aac 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/giftoptions.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/giftoptions.phtml @@ -25,8 +25,8 @@ */ ?> <?php if ($this->getChildHtml()): ?> -<div class="fieldset-wrapper order-gift-options"> +<div class="fieldset-wrapper order-gift-options clearfix"> <div class="fieldset-wrapper-title"><span class="title"><?php echo __('Gift Options') ?></span></div> - <?php echo $this->getChildHtml() ?> + <?php echo $this->getChildHtml() ?> </div> <?php endif ?> diff --git a/app/code/Magento/Sales/view/adminhtml/order/view/giftmessage.phtml b/app/code/Magento/Sales/view/adminhtml/order/view/giftmessage.phtml index b3ff75ebf87..64b5f959ae7 100644 --- a/app/code/Magento/Sales/view/adminhtml/order/view/giftmessage.phtml +++ b/app/code/Magento/Sales/view/adminhtml/order/view/giftmessage.phtml @@ -27,33 +27,38 @@ <?php if($this->canDisplayGiftmessage()): ?> <?php $_required = $this->getMessage()->getMessage() != ''?> <div id="<?php echo $this->getHtmlId() ?>" class="box-left giftmessage-whole-order-container"> - <div class="entry-edit"> - <div><?php echo __('Gift Message for the Entire Order') ?></div><br /> - <form id="<?php echo $this->getFieldId('form') ?>" action="<?php echo $this->getSaveUrl() ?>"> - <fieldset> - <input type="hidden" id="<?php echo $this->getFieldId('type') ?>" name="<?php echo $this->getFieldName('type') ?>" value="order" /> - <table width="100%" cellspacing="0"> - <tbody> - <tr> - <td class="label"><label><?php echo __('From Name') ?><?php echo $_required ? ' <span class="required">*</span>' : ''?></label></td> - <td class="input-ele"><input class="input-text" type="text" id="<?php echo $this->getFieldId('sender') ?>" name="<?php echo $this->getFieldName('sender') ?>" value="<?php echo $this->escapeHtml($this->getMessage()->getSender()) ?>" /></td> - <td> </td> - <td class="label"><label><?php echo __('To Name') ?><?php echo $_required ? ' <span class="required">*</span>' : ''?></label></td> - <td class="input-ele"><input class="input-text" type="text" id="<?php echo $this->getFieldId('recipient') ?>" name="<?php echo $this->getFieldName('recipient') ?>" value="<?php echo $this->escapeHtml($this->getMessage()->getRecipient()) ?>" /></td> - </tr> - <tr> - <td class="label" colspan="6"><label for="<?php echo $this->getFieldId('message') ?>"><?php echo __('Gift Message') ?></label></td> - </tr> - <tr> - <td colspan="5"><textarea style="height:8em;" id="<?php echo $this->getFieldId('message') ?>" name="<?php echo $this->getFieldName('message') ?>" rows="2" cols="15"><?php echo $this->escapeHtml($this->getMessage()->getMessage()) ?></textarea></td> - </tr> - <tr> - <td colspan="5" class="a-right" style="padding-top:5px;"><?php echo $this->getSaveButtonHtml(); ?></td> - </tr> - </tbody> - </table> - </fieldset> - </form> - </div> + <form class="entry-edit form-inline" id="<?php echo $this->getFieldId('form') ?>" action="<?php echo $this->getSaveUrl() ?>"> + <fieldset> + <legend class="legend"><span><?php echo __('Gift Message for the Entire Order'); ?></span></legend> + <br /> + + <input type="hidden" id="<?php echo $this->getFieldId('type'); ?>" name="<?php echo $this->getFieldName('type'); ?>" value="order" /> + + <div class="field field-from-name <?php echo $_required ? 'required' : ''; ?>"> + <label class="label" for="<?php echo $this->getFieldId('sender'); ?>"><span><?php echo __('From Name'); ?></span></label> + <div class="control"> + <input class="input-text <?php echo $_required ? 'required-entry' : ''; ?>" type="text" id="<?php echo $this->getFieldId('sender'); ?>" name="<?php echo $this->getFieldName('sender'); ?>" value="<?php echo $this->escapeHtml($this->getMessage()->getSender()); ?>" /> + </div> + </div> + + <div class="field field-to-name <?php echo $_required ? 'required' : ''; ?>"> + <label class="label" for="<?php echo $this->getFieldId('recipient'); ?>"><span><?php echo __('To Name'); ?></span></label> + <div class="control"> + <input class="input-text <?php echo $_required ? 'required-entry' : ''; ?>" type="text" id="<?php echo $this->getFieldId('recipient'); ?>" name="<?php echo $this->getFieldName('recipient'); ?>" value="<?php echo $this->escapeHtml($this->getMessage()->getRecipient()); ?>" /> + </div> + </div> + + <div class="field field-gift-message"> + <label class="label" for="<?php echo $this->getFieldId('message'); ?>"><span><?php echo __('Gift Message'); ?></span></label> + <div class="control"> + <textarea id="<?php echo $this->getFieldId('message'); ?>" name="<?php echo $this->getFieldName('message') ?>" rows="2" cols="15"><?php echo $this->escapeHtml($this->getMessage()->getMessage()); ?></textarea> + </div> + </div> + + <div class="actions"> + <?php echo $this->getSaveButtonHtml(); ?> + </div> + </fieldset> + </form> </div> <?php endif ?> diff --git a/app/code/Magento/Sales/view/email/shipment_new.html b/app/code/Magento/Sales/view/email/shipment_new.html index 7516bff4297..ecbe06b92a6 100644 --- a/app/code/Magento/Sales/view/email/shipment_new.html +++ b/app/code/Magento/Sales/view/email/shipment_new.html @@ -13,7 +13,7 @@ "var order.shipping_address.format('html')":"Shipping Address", "var order.shipping_description":"Shipping Description", "layout handle=\"sales_email_order_shipment_items\" shipment=$shipment order=$order":"Shipment Items Grid", -"block type='Magento\View\Block\Template' area='frontend' template='email/shipment/track.phtml' shipment=$shipment order=$order":"Shipment Track Details", +"block type='Magento\View\Element\Template' area='frontend' template='email/shipment/track.phtml' shipment=$shipment order=$order":"Shipment Track Details", "var comment":"Shipment Comment"} @--> <!--@styles @@ -96,7 +96,7 @@ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; </table> <br/> {{layout handle="sales_email_order_shipment_items" shipment=$shipment order=$order}} - {{block type='Magento\View\Block\Template' area='frontend' template='Magento_Sales::email/shipment/track.phtml' shipment=$shipment order=$order}} + {{block type='Magento\View\Element\Template' area='frontend' template='Magento_Sales::email/shipment/track.phtml' shipment=$shipment order=$order}} <p style="font-size:12px; margin:0 10px 10px 0">{{var comment}}</p> </td> </tr> diff --git a/app/code/Magento/Sales/view/email/shipment_new_guest.html b/app/code/Magento/Sales/view/email/shipment_new_guest.html index c9744c4f556..7ac86422816 100644 --- a/app/code/Magento/Sales/view/email/shipment_new_guest.html +++ b/app/code/Magento/Sales/view/email/shipment_new_guest.html @@ -12,7 +12,7 @@ "var order.shipping_address.format('html')":"Shipping Address", "var order.shipping_description":"Shipping Description", "layout handle=\"sales_email_order_shipment_items\" shipment=$shipment order=$order":"Shipment Items Grid", -"block type='Magento\View\Block\Template' area='frontend' template='email/shipment/track.phtml' shipment=$shipment order=$order":"Shipment Track Details", +"block type='Magento\View\Element\Template' area='frontend' template='email/shipment/track.phtml' shipment=$shipment order=$order":"Shipment Track Details", "var comment":"Shipment Comment"} @--> <!--@styles @@ -94,7 +94,7 @@ body,td { color:#2f2f2f; font:11px/1.35em Verdana, Arial, Helvetica, sans-serif; </table> <br/> {{layout handle="sales_email_order_shipment_items" shipment=$shipment order=$order}} - {{block type='Magento\View\Block\Template' area='frontend' template='Magento_Sales::email/shipment/track.phtml' shipment=$shipment order=$order}} + {{block type='Magento\View\Element\Template' area='frontend' template='Magento_Sales::email/shipment/track.phtml' shipment=$shipment order=$order}} <p style="font-size:12px; margin:0 10px 10px 0">{{var comment}}</p> </td> </tr> diff --git a/app/code/Magento/Sales/view/frontend/layout/customer_account.xml b/app/code/Magento/Sales/view/frontend/layout/customer_account.xml index 75eef0fe596..6ae6d8b41db 100644 --- a/app/code/Magento/Sales/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Sales/view/frontend/layout/customer_account.xml @@ -25,19 +25,19 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="customer_account_navigation"> - <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-billing-agreements-link"> + <block class="Magento\View\Element\Html\Link\Current" name="customer-account-navigation-billing-agreements-link"> <arguments> <argument name="path" xsi:type="string">sales/billing_agreement</argument> <argument name="label" xsi:type="string">Billing Agreements</argument> </arguments> </block> - <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-orders-link"> + <block class="Magento\View\Element\Html\Link\Current" name="customer-account-navigation-orders-link"> <arguments> <argument name="path" xsi:type="string">sales/order/history</argument> <argument name="label" xsi:type="string">My Orders</argument> </arguments> </block> - <block class="Magento\Page\Block\Link\Current" name="customer-account-navigation-recurring-profiles-link"> + <block class="Magento\View\Element\Html\Link\Current" name="customer-account-navigation-recurring-profiles-link"> <arguments> <argument name="path" xsi:type="string">sales/recurring_profile</argument> <argument name="label" xsi:type="string">Recurring Profiles</argument> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml index 56dab0aeb58..21034a95bb1 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_creditmemo_items.xml @@ -35,5 +35,5 @@ <block class="Magento\Tax\Block\Sales\Order\Tax" name="tax" template="order/tax.phtml"/> </block> </block> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml index f4b71a1e02a..2eeab00ab07 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_invoice_items.xml @@ -35,5 +35,5 @@ <block class="Magento\Tax\Block\Sales\Order\Tax" name="tax" template="order/tax.phtml"/> </block> </block> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml index d9319b2aa69..e48839ce4da 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_items.xml @@ -39,5 +39,5 @@ </block> </block> </block> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml index 65af8bae6d3..7c3c5af2ef5 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_email_order_shipment_items.xml @@ -27,5 +27,5 @@ <block class="Magento\Sales\Block\Order\Email\Shipment\Items" name="items" template="email/shipment/items.phtml"> <block class="Magento\Sales\Block\Order\Email\Items\DefaultItems" as="default" template="email/items/shipment/default.phtml"/> </block> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml index 9e3b76ec779..58f57546682 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_creditmemo.xml @@ -45,5 +45,5 @@ </block> </referenceContainer> <update handle="sales_order_info_links"/> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml index 670254ed398..0b22020b159 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_guest_info_links.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="sales.order.info"> - <block class="Magento\Page\Block\Links" as="links" name="sales.order.info.links"> + <block class="Magento\View\Element\Html\Links" as="links" name="sales.order.info.links"> <arguments> <argument name="css_class" xsi:type="string">items</argument> </arguments> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml index 20aa47ee1d7..acc588c0537 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_info_links.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="sales.order.info"> - <block class="Magento\Page\Block\Links" as="links" name="sales.order.info.links"> + <block class="Magento\View\Element\Html\Links" as="links" name="sales.order.info.links"> <arguments> <argument name="css_class" xsi:type="string">items</argument> </arguments> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml index 2a043a9834c..c978a28a119 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_invoice.xml @@ -45,5 +45,5 @@ </block> </referenceContainer> <update handle="sales_order_info_links"/> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml index 4a7d0a4b1c0..3b8df2bea12 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_print.xml @@ -41,5 +41,5 @@ </block> </block> </referenceContainer> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml index fc90247dbe2..bb716fc45bf 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printcreditmemo.xml @@ -37,5 +37,5 @@ </block> </block> </referenceContainer> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml index 242df26c379..0f983ef0d34 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printinvoice.xml @@ -37,5 +37,5 @@ </block> </block> </referenceContainer> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml index e99fb03cb3a..75e48a98c1c 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_printshipment.xml @@ -29,5 +29,5 @@ <block class="Magento\Sales\Block\Order\Item\Renderer\DefaultRenderer" as="default" template="order/shipment/items/renderer/default.phtml"/> </block> </referenceContainer> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml index aa77b807dc9..68540102277 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_shipment.xml @@ -37,5 +37,5 @@ </block> </referenceContainer> <update handle="sales_order_info_links"/> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml b/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml index 128fbaa9601..8f0fbd3ba3b 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_order_view.xml @@ -44,5 +44,5 @@ </block> </referenceContainer> <update handle="sales_order_info_links"/> - <block class="Magento\View\Block\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> + <block class="Magento\View\Element\Template" name="additional.product.info" template="Magento_Core::template.phtml"/> </layout> diff --git a/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view__tabs.xml b/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view__tabs.xml index c733d4f48f7..8b7d7054a41 100644 --- a/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view__tabs.xml +++ b/app/code/Magento/Sales/view/frontend/layout/sales_recurring_profile_view__tabs.xml @@ -34,7 +34,7 @@ <action method="setShouldPrepareInfoTabs"> <argument name="value" xsi:type="string">1</argument> </action> - <block class="Magento\View\Block\Text" as="profile_info" name="sales.recurring.profile.view.tab.profile" group="info_tabs"> + <block class="Magento\View\Element\Text" as="profile_info" name="sales.recurring.profile.view.tab.profile" group="info_tabs"> <action method="setViewLabel"> <argument translate="true" name="value" xsi:type="string">Profile Information</argument> </action> @@ -43,7 +43,7 @@ </action> </block> <!-- not implemented - <block class="Magento\View\Block\Text" as="history" name="sales.recurring.profile.view.tab.history"> + <block class="Magento\View\Element\Text" as="history" name="sales.recurring.profile.view.tab.history"> <action method="addToParentGroup"> <argument name="value" xsi:type="string">info_tabs</argument> </action> @@ -55,7 +55,7 @@ </action> </block> --> - <block class="Magento\View\Block\Text" as="related_orders" name="sales.recurring.profile.view.tab.orders" group="info_tabs"> + <block class="Magento\View\Element\Text" as="related_orders" name="sales.recurring.profile.view.tab.orders" group="info_tabs"> <action method="setViewLabel"> <argument translate="true" name="value" xsi:type="string">Related Orders</argument> </action> @@ -64,7 +64,7 @@ </action> </block> <!-- not implemented - <block class="Magento\View\Block\Text" as="vendor_info" name="sales.recurring.profile.view.tab.vendor"> + <block class="Magento\View\Element\Text" as="vendor_info" name="sales.recurring.profile.view.tab.vendor"> <action method="addToParentGroup"> <argument name="value" xsi:type="string">info_tabs</argument> </action> diff --git a/app/code/Magento/Sales/view/frontend/recurring/grid.phtml b/app/code/Magento/Sales/view/frontend/recurring/grid.phtml index e3dc07b9509..643f19da04d 100644 --- a/app/code/Magento/Sales/view/frontend/recurring/grid.phtml +++ b/app/code/Magento/Sales/view/frontend/recurring/grid.phtml @@ -24,7 +24,7 @@ */ ?> -<?php /* @var $this \Magento\View\Block\Template */ ?> +<?php /* @var $this \Magento\View\Element\Template */ ?> <div <?php echo $this->getGridHtmlClass() ? ' class="' . $this->getGridHtmlClass() . '"' : '' ?><?php echo $this->getGridHtmlCss() ? ' style="' . $this->getGridHtmlCss() . '"' : '' ?>> <?php if ($caption = $this->getGridCaption()): ?> diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit.php index 448a9a6bf63..aa98feffc2b 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit.php @@ -39,20 +39,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php index bfe2ff3655b..172e1a8514e 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Actions.php @@ -47,30 +47,28 @@ class Actions */ protected $_sourceYesno; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Backend\Model\Config\Source\Yesno $sourceYesno - * @param \Magento\Rule\Block\Actions $ruleActions - * @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Backend\Model\Config\Source\Yesno $sourceYesno + * @param \Magento\Rule\Block\Actions $ruleActions + * @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Backend\Model\Config\Source\Yesno $sourceYesno, - \Magento\Rule\Block\Actions $ruleActions, - \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Backend\Model\Config\Source\Yesno $sourceYesno, + \Magento\Rule\Block\Actions $ruleActions, + \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset, + array $data = array() + ) { $this->_rendererFieldset = $rendererFieldset; $this->_ruleActions = $ruleActions; $this->_sourceYesno = $sourceYesno; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php index d098332594b..148a8c81b2b 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Conditions.php @@ -42,27 +42,25 @@ class Conditions */ protected $_conditions; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Rule\Block\Conditions $conditions - * @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Rule\Block\Conditions $conditions + * @param \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Rule\Block\Conditions $conditions, - \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Rule\Block\Conditions $conditions, + \Magento\Backend\Block\Widget\Form\Renderer\Fieldset $rendererFieldset, + array $data = array() + ) { $this->_rendererFieldset = $rendererFieldset; $this->_conditions = $conditions; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php index 129c35fe533..fa494fe850c 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons.php @@ -46,11 +46,11 @@ class Coupons /** * @param \Magento\Core\Model\Registry $registry - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Form.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Form.php index dd44dee5bae..1cb87a9ccbd 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Form.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Form.php @@ -44,24 +44,22 @@ class Form */ protected $_salesRuleCoupon = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\SalesRule\Helper\Coupon $salesRuleCoupon - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\SalesRule\Helper\Coupon $salesRuleCoupon + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\SalesRule\Helper\Coupon $salesRuleCoupon, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\SalesRule\Helper\Coupon $salesRuleCoupon, + array $data = array() + ) { $this->_salesRuleCoupon = $salesRuleCoupon; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php index 8914ddee440..41f63e6d800 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Coupons/Grid.php @@ -48,25 +48,23 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_salesRuleCoupon; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\SalesRule\Model\Resource\Coupon\CollectionFactory $salesRuleCoupon - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\SalesRule\Model\Resource\Coupon\CollectionFactory $salesRuleCoupon + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\SalesRule\Model\Resource\Coupon\CollectionFactory $salesRuleCoupon, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\SalesRule\Model\Resource\Coupon\CollectionFactory $salesRuleCoupon, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { $this->_coreRegistry = $coreRegistry; $this->_salesRuleCoupon = $salesRuleCoupon; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Labels.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Labels.php index 711950c7a96..7fb5048757b 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Labels.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Labels.php @@ -32,7 +32,6 @@ class Labels { /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Registry $coreRegistry @@ -40,13 +39,12 @@ class Labels */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Registry $coreRegistry, array $data = array() ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Main.php b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Main.php index 7cb3453463c..ccf44447722 100644 --- a/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Main.php +++ b/app/code/Magento/SalesRule/Block/Adminhtml/Promo/Quote/Edit/Tab/Main.php @@ -54,7 +54,6 @@ class Main /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\SalesRule\Model\RuleFactory $salesRule @@ -64,7 +63,6 @@ class Main */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\SalesRule\Model\RuleFactory $salesRule, @@ -75,7 +73,7 @@ class Main $this->_systemStore = $systemStore; $this->_customerGroup = $customerGroup; $this->_salesRule = $salesRule; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/SalesRule/Model/Coupon/Massgenerator.php b/app/code/Magento/SalesRule/Model/Coupon/Massgenerator.php index 62b1e861aea..355511c9fe7 100644 --- a/app/code/Magento/SalesRule/Model/Coupon/Massgenerator.php +++ b/app/code/Magento/SalesRule/Model/Coupon/Massgenerator.php @@ -74,9 +74,9 @@ class Massgenerator extends \Magento\Core\Model\AbstractModel protected $dateTime; /** - * @param \Magento\SalesRule\Helper\Coupon $salesRuleCoupon * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\SalesRule\Helper\Coupon $salesRuleCoupon * @param \Magento\SalesRule\Model\CouponFactory $couponFactory * @param \Magento\Core\Model\Date $date * @param \Magento\Stdlib\DateTime $dateTime @@ -85,9 +85,9 @@ class Massgenerator extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\SalesRule\Helper\Coupon $salesRuleCoupon, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\SalesRule\Helper\Coupon $salesRuleCoupon, \Magento\SalesRule\Model\CouponFactory $couponFactory, \Magento\Core\Model\Date $date, \Magento\Stdlib\DateTime $dateTime, diff --git a/app/code/Magento/SalesRule/Model/Resource/Report/Collection.php b/app/code/Magento/SalesRule/Model/Resource/Report/Collection.php index 95e51f2d5f7..e0e8c8b4783 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Report/Collection.php +++ b/app/code/Magento/SalesRule/Model/Resource/Report/Collection.php @@ -65,24 +65,26 @@ class Collection extends \Magento\Sales\Model\Resource\Report\Collection\Abstrac protected $_rulesIdsFilter; /** - * @param \Magento\SalesRule\Model\Resource\Report\RuleFactory $ruleFactory - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param \Magento\SalesRule\Model\Resource\Report\RuleFactory $ruleFactory + * @param mixed $connection */ public function __construct( - \Magento\SalesRule\Model\Resource\Report\RuleFactory $ruleFactory, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + \Magento\SalesRule\Model\Resource\Report\RuleFactory $ruleFactory, + $connection = null ) { $this->_ruleFactory = $ruleFactory; $resource->init($this->_aggregationTable); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $resource, $connection); } /** diff --git a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php index 446ac6af551..6205eae75dd 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php +++ b/app/code/Magento/SalesRule/Model/Resource/Report/Rule.php @@ -47,24 +47,24 @@ class Rule extends \Magento\Reports\Model\Resource\Report\AbstractReport protected $_updatedatFactory; /** - * @param \Magento\Logger $logger * @param \Magento\App\Resource $resource + * @param \Magento\Logger $logger * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Stdlib\DateTime $dateTime - * @param Rule\CreatedatFactory $createdatFactory - * @param Rule\UpdatedatFactory $updatedatFactory + * @param \Magento\SalesRule\Model\Resource\Report\Rule\CreatedatFactory $createdatFactory + * @param \Magento\SalesRule\Model\Resource\Report\Rule\UpdatedatFactory $updatedatFactory */ public function __construct( - \Magento\Logger $logger, \Magento\App\Resource $resource, + \Magento\Logger $logger, \Magento\Core\Model\LocaleInterface $locale, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Stdlib\DateTime $dateTime, \Magento\SalesRule\Model\Resource\Report\Rule\CreatedatFactory $createdatFactory, \Magento\SalesRule\Model\Resource\Report\Rule\UpdatedatFactory $updatedatFactory ) { - parent::__construct($logger, $resource, $locale, $reportsFlagFactory, $dateTime); + parent::__construct($resource, $logger, $locale, $reportsFlagFactory, $dateTime); $this->_createdatFactory = $createdatFactory; $this->_updatedatFactory = $updatedatFactory; } diff --git a/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php b/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php index 9349188efe8..00820b7b8d7 100644 --- a/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php +++ b/app/code/Magento/SalesRule/Model/Resource/Rule/Collection.php @@ -60,22 +60,24 @@ class Collection extends \Magento\Rule\Model\Resource\Rule\Collection\AbstractCo protected $_date; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Core\Model\Date $date + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Core\Model\Date $date, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger,$fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_date = $date; } diff --git a/app/code/Magento/SalesRule/Model/Rule.php b/app/code/Magento/SalesRule/Model/Rule.php index 357fce529ad..aa08ab56aaf 100644 --- a/app/code/Magento/SalesRule/Model/Rule.php +++ b/app/code/Magento/SalesRule/Model/Rule.php @@ -208,31 +208,31 @@ class Rule extends \Magento\Rule\Model\AbstractModel protected $_storeManager; /** - * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\SalesRule\Model\CouponFactory $couponFactory * @param \Magento\SalesRule\Model\Coupon\CodegeneratorFactory $codegenFactory * @param \Magento\SalesRule\Model\Rule\Condition\CombineFactory $condCombineFactory * @param \Magento\SalesRule\Model\Rule\Condition\Product\CombineFactory $condProdCombineF * @param \Magento\SalesRule\Model\Resource\Coupon\Collection $couponCollection * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\LocaleInterface $locale, \Magento\SalesRule\Model\CouponFactory $couponFactory, \Magento\SalesRule\Model\Coupon\CodegeneratorFactory $codegenFactory, \Magento\SalesRule\Model\Rule\Condition\CombineFactory $condCombineFactory, \Magento\SalesRule\Model\Rule\Condition\Product\CombineFactory $condProdCombineF, \Magento\SalesRule\Model\Resource\Coupon\Collection $couponCollection, \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\Core\Model\LocaleInterface $locale, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() @@ -243,7 +243,7 @@ class Rule extends \Magento\Rule\Model\AbstractModel $this->_condProdCombineF = $condProdCombineF; $this->_couponCollection = $couponCollection; $this->_storeManager = $storeManager; - parent::__construct($formFactory, $context, $registry, $locale, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $formFactory, $locale, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/SalesRule/Model/Validator.php b/app/code/Magento/SalesRule/Model/Validator.php index 73d6478997e..0892c661ed6 100644 --- a/app/code/Magento/SalesRule/Model/Validator.php +++ b/app/code/Magento/SalesRule/Model/Validator.php @@ -104,11 +104,11 @@ class Validator extends \Magento\Core\Model\AbstractModel protected $_customerFactory; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\SalesRule\Model\Resource\Coupon\UsageFactory $usageFactory * @param \Magento\SalesRule\Model\Resource\Rule\CollectionFactory $collectionFactory * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\SalesRule\Model\CouponFactory $couponFactory * @param \Magento\SalesRule\Model\Rule\CustomerFactory $customerFactory * @param \Magento\Core\Model\Resource\AbstractResource $resource @@ -116,11 +116,11 @@ class Validator extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\SalesRule\Model\Resource\Coupon\UsageFactory $usageFactory, \Magento\SalesRule\Model\Resource\Rule\CollectionFactory $collectionFactory, \Magento\Tax\Helper\Data $taxData, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\SalesRule\Model\CouponFactory $couponFactory, \Magento\SalesRule\Model\Rule\CustomerFactory $customerFactory, \Magento\Core\Model\Resource\AbstractResource $resource = null, diff --git a/app/code/Magento/Sendfriend/Block/Send.php b/app/code/Magento/Sendfriend/Block/Send.php index e643eba74d5..a2b7c0b3bad 100644 --- a/app/code/Magento/Sendfriend/Block/Send.php +++ b/app/code/Magento/Sendfriend/Block/Send.php @@ -34,7 +34,7 @@ */ namespace Magento\Sendfriend\Block; -class Send extends \Magento\View\Block\Template +class Send extends \Magento\View\Element\Template { /** * Sendfriend data @@ -56,16 +56,14 @@ class Send extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Sendfriend\Helper\Data $sendfriendData * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, \Magento\Sendfriend\Helper\Data $sendfriendData, \Magento\Core\Model\Registry $registry, @@ -74,7 +72,7 @@ class Send extends \Magento\View\Block\Template $this->_customerSession = $customerSession; $this->_coreRegistry = $registry; $this->_sendfriendData = $sendfriendData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sendfriend/Controller/Product.php b/app/code/Magento/Sendfriend/Controller/Product.php index 3e8047fefd1..e3686855ab2 100644 --- a/app/code/Magento/Sendfriend/Controller/Product.php +++ b/app/code/Magento/Sendfriend/Controller/Product.php @@ -130,8 +130,8 @@ class Product extends \Magento\App\Action\Action /** @var \Magento\HTTP\PhpEnvironment\RemoteAddress $remoteAddress */ $remoteAddress = $this->_objectManager->get('Magento\HTTP\PhpEnvironment\RemoteAddress'); - /** @var \Magento\Core\Model\Cookie $cookie */ - $cookie = $this->_objectManager->get('Magento\Core\Model\Cookie'); + /** @var \Magento\Stdlib\Cookie $cookie */ + $cookie = $this->_objectManager->get('Magento\Stdlib\Cookie'); /** @var \Magento\Core\Model\StoreManagerInterface $store */ $store = $this->_objectManager->get('Magento\Core\Model\StoreManagerInterface'); diff --git a/app/code/Magento/Sendfriend/Model/Sendfriend.php b/app/code/Magento/Sendfriend/Model/Sendfriend.php index 705600f5b4f..9e4d0366be8 100644 --- a/app/code/Magento/Sendfriend/Model/Sendfriend.php +++ b/app/code/Magento/Sendfriend/Model/Sendfriend.php @@ -114,26 +114,26 @@ class Sendfriend extends \Magento\Core\Model\AbstractModel protected $_escaper; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Email\Model\TemplateFactory $templateFactory * @param \Magento\Core\Model\Translate $translate * @param \Magento\Catalog\Helper\Image $catalogImage * @param \Magento\Sendfriend\Helper\Data $sendfriendData - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Escaper $escaper * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Email\Model\TemplateFactory $templateFactory, \Magento\Core\Model\Translate $translate, \Magento\Catalog\Helper\Image $catalogImage, \Magento\Sendfriend\Helper\Data $sendfriendData, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\Escaper $escaper, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, @@ -271,7 +271,7 @@ class Sendfriend extends \Magento\Core\Model\AbstractModel /** * Set cookie instance * - * @param \Magento\Core\Model\Cookie $product + * @param \Magento\Stdlib\Cookie $cookie * @return \Magento\Sendfriend\Model\Sendfriend */ public function setCookie($cookie) @@ -283,12 +283,12 @@ class Sendfriend extends \Magento\Core\Model\AbstractModel * Retrieve Cookie instance * * @throws \Magento\Core\Exception - * @return \Magento\Core\Model\Cookie + * @return \Magento\Stdlib\Cookie */ public function getCookie() { $cookie = $this->_getData('_cookie'); - if (!$cookie instanceof \Magento\Core\Model\Cookie) { + if (!$cookie instanceof \Magento\Stdlib\Cookie) { throw new \Magento\Core\Exception(__('Please define a correct Cookie instance.')); } return $cookie; diff --git a/app/code/Magento/Sendfriend/etc/module.xml b/app/code/Magento/Sendfriend/etc/module.xml index 2b541225b87..2eb50d934a2 100755 --- a/app/code/Magento/Sendfriend/etc/module.xml +++ b/app/code/Magento/Sendfriend/etc/module.xml @@ -32,7 +32,6 @@ <module name="Magento_Catalog"/> <module name="Magento_Core"/> <module name="Magento_Customer"/> - <module name="Magento_Page" type="soft"/> </depends> </module> </config> diff --git a/app/code/Magento/Sendfriend/view/frontend/send.phtml b/app/code/Magento/Sendfriend/view/frontend/send.phtml index 6ef0ffc2d20..c581b33bd41 100644 --- a/app/code/Magento/Sendfriend/view/frontend/send.phtml +++ b/app/code/Magento/Sendfriend/view/frontend/send.phtml @@ -112,7 +112,7 @@ "<?php echo $this->getViewFileUrl('jquery/jquery.metadata.js')?>", "<?php echo $this->getViewFileUrl('mage/validation.js')?>", "<?php echo $this->getViewFileUrl('mage/validation/validation.js')?>", - "<?php echo $this->getViewFileUrl('Magento_Page::js/row-builder.js')?>", function() { + "<?php echo $this->getViewFileUrl('Magento_Theme::js/row-builder.js')?>", function() { $('#product-sendtofriend-form').rowBuilder({ rowTemplate: '#add-recipient-tmpl', rowContainer: '#recipients-options', diff --git a/app/code/Magento/Shipping/Block/Adminhtml/Carrier/Tablerate/Grid.php b/app/code/Magento/Shipping/Block/Adminhtml/Carrier/Tablerate/Grid.php index be1c1dda571..eb157f296f0 100644 --- a/app/code/Magento/Shipping/Block/Adminhtml/Carrier/Tablerate/Grid.php +++ b/app/code/Magento/Shipping/Block/Adminhtml/Carrier/Tablerate/Grid.php @@ -60,25 +60,23 @@ class Grid extends \Magento\Adminhtml\Block\Widget\Grid */ protected $_collectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Shipping\Model\Resource\Carrier\Tablerate\CollectionFactory $collectionFactory - * @param \Magento\Shipping\Model\Carrier\Tablerate $tablerate - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Shipping\Model\Resource\Carrier\Tablerate\CollectionFactory $collectionFactory + * @param \Magento\Shipping\Model\Carrier\Tablerate $tablerate + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Shipping\Model\Resource\Carrier\Tablerate\CollectionFactory $collectionFactory, - \Magento\Shipping\Model\Carrier\Tablerate $tablerate, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Shipping\Model\Resource\Carrier\Tablerate\CollectionFactory $collectionFactory, + \Magento\Shipping\Model\Carrier\Tablerate $tablerate, + array $data = array() + ) { $this->_collectionFactory = $collectionFactory; $this->_tablerate = $tablerate; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } /** diff --git a/app/code/Magento/Shipping/Block/Tracking/Ajax.php b/app/code/Magento/Shipping/Block/Tracking/Ajax.php index 1e077be4cfe..6523675d583 100644 --- a/app/code/Magento/Shipping/Block/Tracking/Ajax.php +++ b/app/code/Magento/Shipping/Block/Tracking/Ajax.php @@ -26,7 +26,7 @@ namespace Magento\Shipping\Block\Tracking; -class Ajax extends \Magento\View\Block\Template +class Ajax extends \Magento\View\Element\Template { } diff --git a/app/code/Magento/Shipping/Block/Tracking/Popup.php b/app/code/Magento/Shipping/Block/Tracking/Popup.php index 768f21fcea8..bcd60af5a8b 100644 --- a/app/code/Magento/Shipping/Block/Tracking/Popup.php +++ b/app/code/Magento/Shipping/Block/Tracking/Popup.php @@ -26,7 +26,7 @@ namespace Magento\Shipping\Block\Tracking; -class Popup extends \Magento\View\Block\Template +class Popup extends \Magento\View\Element\Template { /** * Core registry @@ -36,19 +36,17 @@ class Popup extends \Magento\View\Block\Template protected $_registry; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_registry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Shipping/Controller/Tracking.php b/app/code/Magento/Shipping/Controller/Tracking.php index 7f867f318de..a2f561645ed 100644 --- a/app/code/Magento/Shipping/Controller/Tracking.php +++ b/app/code/Magento/Shipping/Controller/Tracking.php @@ -87,8 +87,8 @@ class Tracking extends \Magento\App\Action\Action $response = ''; $tracks = $order->getTracksCollection(); - $block = $this->_objectManager->create('Magento\View\Block\Template'); - $block->setType('Magento\View\Block\Template') + $block = $this->_objectManager->create('Magento\View\Element\Template'); + $block->setType('Magento\View\Element\Template') ->setTemplate('order/trackinginfo.phtml'); foreach ($tracks as $track) { diff --git a/app/code/Magento/Shipping/Helper/Data.php b/app/code/Magento/Shipping/Helper/Data.php index a66382ed643..8efeb839fa6 100644 --- a/app/code/Magento/Shipping/Helper/Data.php +++ b/app/code/Magento/Shipping/Helper/Data.php @@ -58,14 +58,14 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_storeManager; /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\App\Helper\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManagerInterface $storeManager ) { diff --git a/app/code/Magento/Shipping/Model/Resource/Carrier/Tablerate.php b/app/code/Magento/Shipping/Model/Resource/Carrier/Tablerate.php index e7da13e0cb7..b0cb9f2bfaa 100644 --- a/app/code/Magento/Shipping/Model/Resource/Carrier/Tablerate.php +++ b/app/code/Magento/Shipping/Model/Resource/Carrier/Tablerate.php @@ -131,8 +131,8 @@ class Tablerate extends \Magento\Core\Model\Resource\Db\AbstractDb /** - * @param \Magento\Logger $logger * @param \Magento\App\Resource $resource + * @param \Magento\Logger $logger * @param \Magento\Core\Model\Config $coreConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Shipping\Model\Carrier\Tablerate $carrierTablerate @@ -140,8 +140,8 @@ class Tablerate extends \Magento\Core\Model\Resource\Db\AbstractDb * @param \Magento\Directory\Model\Resource\Region\CollectionFactory $regionCollFactory */ public function __construct( - \Magento\Logger $logger, \Magento\App\Resource $resource, + \Magento\Logger $logger, \Magento\Core\Model\Config $coreConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Shipping\Model\Carrier\Tablerate $carrierTablerate, diff --git a/app/code/Magento/Sitemap/Block/Adminhtml/Edit.php b/app/code/Magento/Sitemap/Block/Adminhtml/Edit.php index 88be189127e..2284967977c 100644 --- a/app/code/Magento/Sitemap/Block/Adminhtml/Edit.php +++ b/app/code/Magento/Sitemap/Block/Adminhtml/Edit.php @@ -42,20 +42,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php b/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php index d79872cb9ba..6e212c8d2ee 100644 --- a/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php +++ b/app/code/Magento/Sitemap/Block/Adminhtml/Edit/Form.php @@ -40,24 +40,22 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_systemStore; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\System\Store $systemStore - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\System\Store $systemStore + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\System\Store $systemStore, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\System\Store $systemStore, + array $data = array() + ) { $this->_systemStore = $systemStore; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php b/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php index b6bdada067f..5f4a69c698a 100644 --- a/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php +++ b/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Link.php @@ -44,18 +44,18 @@ class Link extends \Magento\Adminhtml\Block\Widget\Grid\Column\Renderer\Abstract */ protected $_sitemapFactory; - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Sitemap\Model\SitemapFactory $sitemapFactory - * @param \Magento\Filesystem $filesystem - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Sitemap\Model\SitemapFactory $sitemapFactory + * @param \Magento\Filesystem $filesystem + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Sitemap\Model\SitemapFactory $sitemapFactory, - \Magento\Filesystem $filesystem, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Sitemap\Model\SitemapFactory $sitemapFactory, + \Magento\Filesystem $filesystem, + array $data = array() + ) { $this->_sitemapFactory = $sitemapFactory; $this->_filesystem = $filesystem; parent::__construct($context, $data); diff --git a/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Time.php b/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Time.php index afbb63daa66..c92d0bd57f2 100644 --- a/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Time.php +++ b/app/code/Magento/Sitemap/Block/Adminhtml/Grid/Renderer/Time.php @@ -39,16 +39,16 @@ class Time extends \Magento\Adminhtml\Block\Widget\Grid\Column\Renderer\Abstract */ protected $_date; - /** - * @param \Magento\Backend\Block\Context $context - * @param \Magento\Core\Model\Date $date - * @param array $data + /** + * @param \Magento\Backend\Block\Context $context + * @param \Magento\Core\Model\Date $date + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Context $context, - \Magento\Core\Model\Date $date, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Context $context, + \Magento\Core\Model\Date $date, + array $data = array() + ) { $this->_date = $date; parent::__construct($context, $data); } diff --git a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php index e7b3c4cfad2..28e2d2a3450 100644 --- a/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php +++ b/app/code/Magento/Sitemap/Model/Resource/Catalog/Product.php @@ -104,8 +104,8 @@ class Product extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_mediaConfig; public function __construct( - \Magento\Sitemap\Helper\Data $sitemapData, \Magento\App\Resource $resource, + \Magento\Sitemap\Helper\Data $sitemapData, \Magento\Catalog\Model\Resource\Product $productResource, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\Product\Visibility $productVisibility, diff --git a/app/code/Magento/Sitemap/Model/Sitemap.php b/app/code/Magento/Sitemap/Model/Sitemap.php index 26108921026..2fef4b339d7 100644 --- a/app/code/Magento/Sitemap/Model/Sitemap.php +++ b/app/code/Magento/Sitemap/Model/Sitemap.php @@ -164,11 +164,11 @@ class Sitemap extends \Magento\Core\Model\AbstractModel protected $dateTime; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Escaper $escaper * @param \Magento\Sitemap\Helper\Data $sitemapData - * @param \Magento\Core\Model\Context $context * @param \Magento\Filesystem $filesystem - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Sitemap\Model\Resource\Catalog\CategoryFactory $categoryFactory * @param \Magento\Sitemap\Model\Resource\Catalog\ProductFactory $productFactory * @param \Magento\Sitemap\Model\Resource\Cms\PageFactory $cmsFactory @@ -182,11 +182,11 @@ class Sitemap extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Escaper $escaper, \Magento\Sitemap\Helper\Data $sitemapData, - \Magento\Core\Model\Context $context, \Magento\Filesystem $filesystem, - \Magento\Core\Model\Registry $registry, \Magento\Sitemap\Model\Resource\Catalog\CategoryFactory $categoryFactory, \Magento\Sitemap\Model\Resource\Catalog\ProductFactory $productFactory, \Magento\Sitemap\Model\Resource\Cms\PageFactory $cmsFactory, diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php b/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php index 02954e3541b..8b4247db720 100644 --- a/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php +++ b/app/code/Magento/Tax/Block/Adminhtml/Rate/Form.php @@ -74,39 +74,37 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_regionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Directory\Model\RegionFactory $regionFactory - * @param \Magento\Directory\Model\Config\Source\Country $country - * @param \Magento\Tax\Block\Adminhtml\Rate\Title\Fieldset $fieldset - * @param \Magento\Tax\Model\Calculation\RateFactory $rateFactory - * @param \Magento\Tax\Model\Calculation\Rate $rate - * @param \Magento\Tax\Helper\Data $taxData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Directory\Model\RegionFactory $regionFactory + * @param \Magento\Directory\Model\Config\Source\Country $country + * @param \Magento\Tax\Block\Adminhtml\Rate\Title\Fieldset $fieldset + * @param \Magento\Tax\Model\Calculation\RateFactory $rateFactory + * @param \Magento\Tax\Model\Calculation\Rate $rate + * @param \Magento\Tax\Helper\Data $taxData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Directory\Model\RegionFactory $regionFactory, - \Magento\Directory\Model\Config\Source\Country $country, - \Magento\Tax\Block\Adminhtml\Rate\Title\Fieldset $fieldset, - \Magento\Tax\Model\Calculation\RateFactory $rateFactory, - \Magento\Tax\Model\Calculation\Rate $rate, - \Magento\Tax\Helper\Data $taxData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Directory\Model\RegionFactory $regionFactory, + \Magento\Directory\Model\Config\Source\Country $country, + \Magento\Tax\Block\Adminhtml\Rate\Title\Fieldset $fieldset, + \Magento\Tax\Model\Calculation\RateFactory $rateFactory, + \Magento\Tax\Model\Calculation\Rate $rate, + \Magento\Tax\Helper\Data $taxData, + array $data = array() + ) { $this->_regionFactory = $regionFactory; $this->_country = $country; $this->_fieldset = $fieldset; $this->_rateFactory = $rateFactory; $this->_rate = $rate; $this->_taxData = $taxData; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } protected function _construct() @@ -243,7 +241,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic $this->setChild( 'form_after', - $this->getLayout()->createBlock('Magento\View\Block\Template') + $this->getLayout()->createBlock('Magento\View\Element\Template') ->setTemplate('Magento_Tax::rate/js.phtml') ); diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rate/ImportExport.php b/app/code/Magento/Tax/Block/Adminhtml/Rate/ImportExport.php index 1b24e930122..49684dfc545 100644 --- a/app/code/Magento/Tax/Block/Adminhtml/Rate/ImportExport.php +++ b/app/code/Magento/Tax/Block/Adminhtml/Rate/ImportExport.php @@ -31,17 +31,15 @@ class ImportExport extends \Magento\Adminhtml\Block\Widget { protected $_template = 'importExport.phtml'; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + array $data = array() + ) { + parent::__construct($context, $data); $this->setUseContainer(true); } } diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rate/Title.php b/app/code/Magento/Tax/Block/Adminhtml/Rate/Title.php index 3771a3a5598..3bd22eb63e0 100644 --- a/app/code/Magento/Tax/Block/Adminhtml/Rate/Title.php +++ b/app/code/Magento/Tax/Block/Adminhtml/Rate/Title.php @@ -32,7 +32,7 @@ */ namespace Magento\Tax\Block\Adminhtml\Rate; -class Title extends \Magento\View\Block\Template +class Title extends \Magento\View\Element\Template { protected $_titles; @@ -49,22 +49,20 @@ class Title extends \Magento\View\Block\Template protected $_storeFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\StoreFactory $storeFactory * @param \Magento\Tax\Model\Calculation\Rate $rate * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\StoreFactory $storeFactory, \Magento\Tax\Model\Calculation\Rate $rate, array $data = array() ) { $this->_rate = $rate; $this->_storeFactory = $storeFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getTitles() diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit.php b/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit.php index 9b9040739b9..687bc09bc49 100644 --- a/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit.php +++ b/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit.php @@ -39,20 +39,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php b/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php index 45a94a4b1be..1c8123db9a9 100644 --- a/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php +++ b/app/code/Magento/Tax/Block/Adminhtml/Rule/Edit/Form.php @@ -36,24 +36,28 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_rateFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Tax\Model\Calculation\RateFactory $rateFactory - * @param array $data + /** + * @var \Magento\Data\Form\FormKey + */ + protected $formKey; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Tax\Model\Calculation\RateFactory $rateFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Tax\Model\Calculation\RateFactory $rateFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Tax\Model\Calculation\RateFactory $rateFactory, + array $data = array() + ) { $this->_rateFactory = $rateFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + $this->formKey = $context->getFormKey(); + parent::__construct($context, $registry, $formFactory, $data); } /** @@ -225,7 +229,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic 'add_button_caption' => __('Add New Tax Class'), 'submit_data' => array( 'class_type' => $classType, - 'form_key' => $this->_session->getFormKey(), + 'form_key' => $this->formKey->getFormKey(), ), 'entity_id_name' => 'class_id', 'entity_value_name' => 'class_name', diff --git a/app/code/Magento/Tax/Block/Checkout/Discount.php b/app/code/Magento/Tax/Block/Checkout/Discount.php index d3dd5589a8b..9049ef27082 100644 --- a/app/code/Magento/Tax/Block/Checkout/Discount.php +++ b/app/code/Magento/Tax/Block/Checkout/Discount.php @@ -37,8 +37,7 @@ class Discount extends \Magento\Checkout\Block\Total\DefaultTotal protected $_taxConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession @@ -47,8 +46,7 @@ class Discount extends \Magento\Checkout\Block\Total\DefaultTotal * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, @@ -57,7 +55,7 @@ class Discount extends \Magento\Checkout\Block\Total\DefaultTotal array $data = array() ) { $this->_taxConfig = $taxConfig; - parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $salesConfig, $data); + parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $salesConfig, $data); } /** diff --git a/app/code/Magento/Tax/Block/Checkout/Grandtotal.php b/app/code/Magento/Tax/Block/Checkout/Grandtotal.php index 5cfe55c58e2..6914d632309 100644 --- a/app/code/Magento/Tax/Block/Checkout/Grandtotal.php +++ b/app/code/Magento/Tax/Block/Checkout/Grandtotal.php @@ -44,8 +44,7 @@ class Grandtotal extends \Magento\Checkout\Block\Total\DefaultTotal protected $_taxConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession @@ -54,8 +53,7 @@ class Grandtotal extends \Magento\Checkout\Block\Total\DefaultTotal * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, @@ -64,7 +62,7 @@ class Grandtotal extends \Magento\Checkout\Block\Total\DefaultTotal array $data = array() ) { $this->_taxConfig = $taxConfig; - parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $salesConfig, $data); + parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $salesConfig, $data); } /** diff --git a/app/code/Magento/Tax/Block/Checkout/Shipping.php b/app/code/Magento/Tax/Block/Checkout/Shipping.php index 8dca7525714..0ad2a06454a 100644 --- a/app/code/Magento/Tax/Block/Checkout/Shipping.php +++ b/app/code/Magento/Tax/Block/Checkout/Shipping.php @@ -44,8 +44,7 @@ class Shipping extends \Magento\Checkout\Block\Total\DefaultTotal protected $_taxConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession @@ -54,8 +53,7 @@ class Shipping extends \Magento\Checkout\Block\Total\DefaultTotal * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, @@ -64,7 +62,7 @@ class Shipping extends \Magento\Checkout\Block\Total\DefaultTotal array $data = array() ) { $this->_taxConfig = $taxConfig; - parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $salesConfig, $data); + parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $salesConfig, $data); } /** diff --git a/app/code/Magento/Tax/Block/Checkout/Subtotal.php b/app/code/Magento/Tax/Block/Checkout/Subtotal.php index d2889222c43..5a73230ca2d 100644 --- a/app/code/Magento/Tax/Block/Checkout/Subtotal.php +++ b/app/code/Magento/Tax/Block/Checkout/Subtotal.php @@ -44,8 +44,7 @@ class Subtotal extends \Magento\Checkout\Block\Total\DefaultTotal protected $_taxConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Helper\Data $catalogData * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Checkout\Model\Session $checkoutSession @@ -54,8 +53,7 @@ class Subtotal extends \Magento\Checkout\Block\Total\DefaultTotal * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Helper\Data $catalogData, \Magento\Customer\Model\Session $customerSession, \Magento\Checkout\Model\Session $checkoutSession, @@ -64,7 +62,7 @@ class Subtotal extends \Magento\Checkout\Block\Total\DefaultTotal array $data = array() ) { $this->_taxConfig = $taxConfig; - parent::__construct($context, $coreData, $catalogData, $customerSession, $checkoutSession, $salesConfig, $data); + parent::__construct($context, $catalogData, $customerSession, $checkoutSession, $salesConfig, $data); } /** diff --git a/app/code/Magento/Tax/Block/Sales/Order/Tax.php b/app/code/Magento/Tax/Block/Sales/Order/Tax.php index 37af06d6740..bed2f9b99f1 100644 --- a/app/code/Magento/Tax/Block/Sales/Order/Tax.php +++ b/app/code/Magento/Tax/Block/Sales/Order/Tax.php @@ -29,7 +29,7 @@ */ namespace Magento\Tax\Block\Sales\Order; -class Tax extends \Magento\View\Block\Template +class Tax extends \Magento\View\Element\Template { /** * Tax configuration model @@ -41,19 +41,17 @@ class Tax extends \Magento\View\Block\Template protected $_source; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Tax\Model\Config $taxConfig * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Tax\Model\Config $taxConfig, array $data = array() ) { $this->_config = $taxConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Tax/Helper/Data.php b/app/code/Magento/Tax/Helper/Data.php index ffb56b0c1e8..1d62c7e5bab 100644 --- a/app/code/Magento/Tax/Helper/Data.php +++ b/app/code/Magento/Tax/Helper/Data.php @@ -107,8 +107,8 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_taxItemFactory; /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Tax\Model\Config $taxConfig @@ -119,8 +119,8 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param \Magento\Tax\Model\Resource\Sales\Order\Tax\ItemFactory $taxItemFactory */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\App\Helper\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $coreRegistry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Tax\Model\Config $taxConfig, diff --git a/app/code/Magento/Tax/Model/Calculation.php b/app/code/Magento/Tax/Model/Calculation.php index fa8d1755eb7..e294a45f61e 100644 --- a/app/code/Magento/Tax/Model/Calculation.php +++ b/app/code/Magento/Tax/Model/Calculation.php @@ -94,9 +94,9 @@ class Calculation extends \Magento\Core\Model\AbstractModel protected $_classesFactory; /** - * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Customer\Helper\Data $customerData * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Customer\Model\GroupFactory $groupFactory @@ -108,9 +108,9 @@ class Calculation extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Customer\Helper\Data $customerData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Customer\Helper\Data $customerData, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Customer\Model\GroupFactory $groupFactory, diff --git a/app/code/Magento/Tax/Model/Resource/Calculation.php b/app/code/Magento/Tax/Model/Resource/Calculation.php index d158480e2f5..fdf72c839da 100644 --- a/app/code/Magento/Tax/Model/Resource/Calculation.php +++ b/app/code/Magento/Tax/Model/Resource/Calculation.php @@ -59,16 +59,14 @@ class Calculation extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * Class constructor - * + * @param \Magento\App\Resource $resource * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Core\Model\StoreManagerInterface $storeManager - * @param \Magento\App\Resource $resource */ public function __construct( + \Magento\App\Resource $resource, \Magento\Tax\Helper\Data $taxData, - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\App\Resource $resource + \Magento\Core\Model\StoreManagerInterface $storeManager ) { $this->_taxData = $taxData; $this->_storeManager = $storeManager; diff --git a/app/code/Magento/Tax/Model/Resource/Calculation/Rate/Collection.php b/app/code/Magento/Tax/Model/Resource/Calculation/Rate/Collection.php index b027c1d2239..808d014f7ca 100644 --- a/app/code/Magento/Tax/Model/Resource/Calculation/Rate/Collection.php +++ b/app/code/Magento/Tax/Model/Resource/Calculation/Rate/Collection.php @@ -38,23 +38,25 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_storeManager; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\StoreManagerInterface $storeManager + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, - \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\StoreManagerInterface $storeManager, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { $this->_storeManager = $storeManager; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Tax/Model/Resource/Report/Collection.php b/app/code/Magento/Tax/Model/Resource/Report/Collection.php index 24953e6543b..9af01cd571e 100644 --- a/app/code/Magento/Tax/Model/Resource/Report/Collection.php +++ b/app/code/Magento/Tax/Model/Resource/Report/Collection.php @@ -54,21 +54,23 @@ class Collection extends \Magento\Sales\Model\Resource\Report\Collection\Abstrac protected $_selectedColumns = array(); /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Sales\Model\Resource\Report $resource + * @param mixed $connection */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, - \Magento\Sales\Model\Resource\Report $resource + \Magento\Event\ManagerInterface $eventManager, + \Magento\Sales\Model\Resource\Report $resource, + $connection = null ) { $resource->init($this->_aggregationTable); - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $resource, $connection); } /** diff --git a/app/code/Magento/Tax/Model/Resource/Report/Tax.php b/app/code/Magento/Tax/Model/Resource/Report/Tax.php index 80dbdc669f5..d505e14c065 100644 --- a/app/code/Magento/Tax/Model/Resource/Report/Tax.php +++ b/app/code/Magento/Tax/Model/Resource/Report/Tax.php @@ -42,17 +42,17 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport protected $_updatedAtFactory; /** - * @param \Magento\Logger $logger * @param \Magento\App\Resource $resource + * @param \Magento\Logger $logger * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\Reports\Model\FlagFactory $reportsFlagFactory * @param \Magento\Stdlib\DateTime $dateTime - * @param Tax\CreatedatFactory $createdAtFactory - * @param Tax\UpdatedatFactory $updatedAtFactory + * @param \Magento\Tax\Model\Resource\Report\Tax\CreatedatFactory $createdAtFactory + * @param \Magento\Tax\Model\Resource\Report\Tax\UpdatedatFactory $updatedAtFactory */ public function __construct( - \Magento\Logger $logger, \Magento\App\Resource $resource, + \Magento\Logger $logger, \Magento\Core\Model\LocaleInterface $locale, \Magento\Reports\Model\FlagFactory $reportsFlagFactory, \Magento\Stdlib\DateTime $dateTime, @@ -61,7 +61,7 @@ class Tax extends \Magento\Reports\Model\Resource\Report\AbstractReport ) { $this->_createdAtFactory = $createdAtFactory; $this->_updatedAtFactory = $updatedAtFactory; - parent::__construct($logger, $resource, $locale, $reportsFlagFactory, $dateTime); + parent::__construct($resource, $logger, $locale, $reportsFlagFactory, $dateTime); } /** diff --git a/app/code/Magento/Tax/Model/Resource/Setup.php b/app/code/Magento/Tax/Model/Resource/Setup.php index 32c0ca9fb2a..6f19bf05293 100644 --- a/app/code/Magento/Tax/Model/Resource/Setup.php +++ b/app/code/Magento/Tax/Model/Resource/Setup.php @@ -38,28 +38,26 @@ class Setup extends \Magento\Sales\Model\Resource\Setup /** * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param string $resourceName * @param \Magento\App\CacheInterface $cache * @param \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory * @param \Magento\Core\Model\Config $config * @param \Magento\Catalog\Model\Resource\SetupFactory $setupFactory - * @param string $resourceName * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, \Magento\App\CacheInterface $cache, \Magento\Eav\Model\Resource\Entity\Attribute\Group\CollectionFactory $attrGrCollFactory, \Magento\Core\Model\Config $config, \Magento\Catalog\Model\Resource\SetupFactory $setupFactory, - $resourceName, $moduleName = 'Magento_Tax', $connectionName = '' ) { $this->_setupFactory = $setupFactory; - parent::__construct( - $context, $cache, $attrGrCollFactory, $config, $resourceName, $moduleName, $connectionName - ); + parent::__construct($context, $resourceName, $cache, $attrGrCollFactory, $config, $moduleName, $connectionName); } /** diff --git a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml index 0916b3dd6f6..eb6fb5aedf0 100644 --- a/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml +++ b/app/code/Magento/Tax/view/adminhtml/layout/tax_rule_edit.xml @@ -25,27 +25,27 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-editablemultiselect-js-jquery-editable-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-editablemultiselect-js-jquery-editable-js"> <arguments> <argument name="file" xsi:type="string">jquery/editableMultiselect/js/jquery.editable.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-editablemultiselect-js-jquery-multiselect-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-editablemultiselect-js-jquery-multiselect-js"> <arguments> <argument name="file" xsi:type="string">jquery/editableMultiselect/js/jquery.multiselect.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-backend-editablemultiselect-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-backend-editablemultiselect-js"> <arguments> <argument name="file" xsi:type="string">mage/backend/editablemultiselect.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="jquery-editablemultiselect-css-jquery-multiselect-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-editablemultiselect-css-jquery-multiselect-css"> <arguments> <argument name="file" xsi:type="string">jquery/editableMultiselect/css/jquery.multiselect.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> <arguments> <argument name="file" xsi:type="string">Magento_Core::prototype/magento.css</argument> </arguments> diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit.php index 6be1972ad42..76cc7da4dcb 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit.php @@ -38,26 +38,24 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** * Prepare layout * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php index 01565c5b467..25c944e26d8 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/AbstractTab.php @@ -48,23 +48,21 @@ abstract class AbstractTab */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\ObjectManager $objectManager - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\ObjectManager $objectManager + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\ObjectManager $objectManager, - array $data = array() - ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\ObjectManager $objectManager, + array $data = array() + ) { + parent::__construct($context, $registry, $formFactory, $data); $this->_objectManager = $objectManager; } diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php index 0b1ec6e8af5..3153b3a3f8d 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/Css.php @@ -52,25 +52,23 @@ class Css */ protected $_customCssFile; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\ObjectManager $objectManager - * @param \Magento\Theme\Model\Uploader\Service $uploaderService - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\ObjectManager $objectManager + * @param \Magento\Theme\Model\Uploader\Service $uploaderService + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\ObjectManager $objectManager, - \Magento\Theme\Model\Uploader\Service $uploaderService, - array $data = array() - ) { - parent::__construct($context, $coreData, $registry, $formFactory, $objectManager, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\ObjectManager $objectManager, + \Magento\Theme\Model\Uploader\Service $uploaderService, + array $data = array() + ) { + parent::__construct($context, $registry, $formFactory, $objectManager, $data); $this->_uploaderService = $uploaderService; } diff --git a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php index 793bdd26693..3aaaf796b61 100644 --- a/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php +++ b/app/code/Magento/Theme/Block/Adminhtml/System/Design/Theme/Edit/Tab/General.php @@ -51,29 +51,27 @@ class General */ protected $_fileSize; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\ObjectManager $objectManager - * @param \Magento\View\Design\Theme\Image\PathInterface $themeImagePath - * @param \Magento\File\Size $fileSize - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\ObjectManager $objectManager + * @param \Magento\View\Design\Theme\Image\PathInterface $themeImagePath + * @param \Magento\File\Size $fileSize + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\ObjectManager $objectManager, - \Magento\View\Design\Theme\Image\PathInterface $themeImagePath, - \Magento\File\Size $fileSize, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\ObjectManager $objectManager, + \Magento\View\Design\Theme\Image\PathInterface $themeImagePath, + \Magento\File\Size $fileSize, + array $data = array() + ) { $this->_themeImagePath = $themeImagePath; $this->_fileSize = $fileSize; - parent::__construct($context, $coreData, $registry, $formFactory, $objectManager, $data); + parent::__construct($context, $registry, $formFactory, $objectManager, $data); } /** diff --git a/app/code/Magento/Page/Block/Html.php b/app/code/Magento/Theme/Block/Html.php similarity index 70% rename from app/code/Magento/Page/Block/Html.php rename to app/code/Magento/Theme/Block/Html.php index 3c0f942ab26..d471d35fdb4 100644 --- a/app/code/Magento/Page/Block/Html.php +++ b/app/code/Magento/Theme/Block/Html.php @@ -18,26 +18,32 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Theme\Block; + /** * Html page block - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Page\Block; - -class Html extends \Magento\View\Block\Template +class Html extends \Magento\View\Element\Template { + /** + * The list of available URLs + * + * @var array + */ protected $_urls = array(); + + /** + * @var string + */ protected $_title = ''; + /** + * Add block data + */ protected function _construct() { parent::_construct(); @@ -50,30 +56,47 @@ class Html extends \Magento\View\Block\Template $this->addBodyClass($this->_request->getFullActionName('-')); - $this->_beforeCacheUrl(); + if ($this->_cacheState->isEnabled(self::CACHE_GROUP)) { + $this->_app->setUseSessionVar(true); + } } + /** + * Retrieve base URL + * + * @return string + */ public function getBaseUrl() { return $this->_urls['base']; } + /** + * Retrieve base secure URL + * + * @return mixed + */ public function getBaseSecureUrl() { return $this->_urls['baseSecure']; } + /** + * Retrieve current URL + * + * @return mixed + */ public function getCurrentUrl() { return $this->_urls['current']; } /** - * Print Logo URL (Conf -> Sales -> Invoice and Packing Slip Design) + * Print Logo URL (Conf -> Sales -> Invoice and Packing Slip Design) * - * @return string + * @return string */ - public function getPrintLogoUrl () + public function getPrintLogoUrl() { // load html logo $logo = $this->_storeConfig->getConfig('sales/identity/logo_html'); @@ -88,8 +111,7 @@ class Html extends \Magento\View\Block\Template // prevent tiff format displaying in html if (strtolower(substr($logo, -5)) === '.tiff' || strtolower(substr($logo, -4)) === '.tif') { $logo = ''; - } - else { + } else { $logo = 'sales/store/logo/' . $logo; } } @@ -98,25 +120,40 @@ class Html extends \Magento\View\Block\Template // buld url if (!empty($logo)) { $logo = $this->_urlBuilder->getBaseUrl(array('_type' => \Magento\Core\Model\Store::URL_TYPE_MEDIA)) . $logo; - } - else { + } else { $logo = ''; } return $logo; } + /** + * Retrieve logo text for print page + * + * @return string + */ public function getPrintLogoText() { return $this->_storeConfig->getConfig('sales/identity/address'); } + /** + * Set header title + * + * @param string $title + * @return \Magento\Theme\Block\Html + */ public function setHeaderTitle($title) { $this->_title = $title; return $this; } + /** + * Retrieve header title + * + * @return string + */ public function getHeaderTitle() { return $this->_title; @@ -126,7 +163,7 @@ class Html extends \Magento\View\Block\Template * Add CSS class to page body tag * * @param string $className - * @return \Magento\Page\Block\Html + * @return \Magento\Theme\Block\Html */ public function addBodyClass($className) { @@ -135,6 +172,11 @@ class Html extends \Magento\View\Block\Template return $this; } + /** + * Retrieve base language + * + * @return string + */ public function getLang() { if (!$this->hasData('lang')) { @@ -143,11 +185,21 @@ class Html extends \Magento\View\Block\Template return $this->getData('lang'); } + /** + * Retrieve body class + * + * @return string + */ public function getBodyClass() { return $this->_getData('body_class'); } + /** + * Retrieve absolute footer html + * + * @return string + */ public function getAbsoluteFooter() { return $this->_storeConfig->getConfig('design/footer/absolute_footer'); @@ -161,6 +213,12 @@ class Html extends \Magento\View\Block\Template */ protected function _afterToHtml($html) { - return $this->_afterCacheUrl($html); + if ($this->_cacheState->isEnabled(self::CACHE_GROUP)) { + $this->_app->setUseSessionVar(false); + \Magento\Profiler::start('CACHE_URL'); + $html = $this->_urlBuilder->sessionUrlVar($html); + \Magento\Profiler::stop('CACHE_URL'); + } + return $html; } } diff --git a/app/code/Magento/Page/Block/Html/Breadcrumbs.php b/app/code/Magento/Theme/Block/Html/Breadcrumbs.php similarity index 73% rename from app/code/Magento/Page/Block/Html/Breadcrumbs.php rename to app/code/Magento/Theme/Block/Html/Breadcrumbs.php index ae7def360bb..a7e2d6ff78b 100644 --- a/app/code/Magento/Page/Block/Html/Breadcrumbs.php +++ b/app/code/Magento/Theme/Block/Html/Breadcrumbs.php @@ -18,72 +18,77 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Theme\Block\Html; + /** - * Html page block - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> + * Html page breadcrumbs block */ -namespace Magento\Page\Block\Html; - -class Breadcrumbs extends \Magento\View\Block\Template +class Breadcrumbs extends \Magento\View\Element\Template { /** - * Array of breadcrumbs + * Current template name * - * array( - * [$index] => array( - * ['label'] - * ['title'] - * ['link'] - * ['first'] - * ['last'] - * ) - * ) + * @var string + */ + protected $_template = 'html/breadcrumbs.phtml'; + + /** + * List of available breadcrumb properties * * @var array */ - protected $_crumbs = null; + protected $_properties = array( + 'label', + 'title', + 'link', + 'first', + 'last', + 'readonly', + ); + + /** + * List of breadcrumbs + * + * @var array + */ + protected $_crumbs; /** * Cache key info * * @var null|array */ - protected $_cacheKeyInfo = null; - - protected $_template = 'html/breadcrumbs.phtml'; + protected $_cacheKeyInfo; /** * Add crumb * * @param string $crumbName * @param array $crumbInfo - * @return \Magento\Page\Block\Html\Breadcrumbs + * @return \Magento\Theme\Block\Html\Breadcrumbs */ public function addCrumb($crumbName, $crumbInfo) { - $properties = array('label', 'title', 'link', 'first', 'last', 'readonly'); - foreach ($properties as $key) { + foreach ($this->_properties as $key) { if (!isset($crumbInfo[$key])) { $crumbInfo[$key] = null; } } + if ((!isset($this->_crumbs[$crumbName])) || (!$this->_crumbs[$crumbName]['readonly'])) { - $this->_crumbs[$crumbName] = $crumbInfo; + $this->_crumbs[$crumbName] = $crumbInfo; } + return $this; } /** * Get cache key informative items + * * Provide string array key to share specific info item with FPC placeholder * * @return array @@ -93,10 +98,9 @@ class Breadcrumbs extends \Magento\View\Block\Template if (is_null($this->_cacheKeyInfo)) { $this->_cacheKeyInfo = parent::getCacheKeyInfo() + array( 'crumbs' => base64_encode(serialize($this->_crumbs)), - 'name' => $this->getNameInLayout() + 'name' => $this->getNameInLayout(), ); } - return $this->_cacheKeyInfo; } @@ -114,6 +118,7 @@ class Breadcrumbs extends \Magento\View\Block\Template $this->_crumbs[key($this->_crumbs)]['last'] = true; } $this->assign('crumbs', $this->_crumbs); + return parent::_toHtml(); } } diff --git a/app/code/Magento/Page/Block/Html/Footer.php b/app/code/Magento/Theme/Block/Html/Footer.php similarity index 71% rename from app/code/Magento/Page/Block/Html/Footer.php rename to app/code/Magento/Theme/Block/Html/Footer.php index 189065b06f2..be4a45a1772 100644 --- a/app/code/Magento/Page/Block/Html/Footer.php +++ b/app/code/Magento/Theme/Block/Html/Footer.php @@ -18,24 +18,22 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Theme\Block\Html; + /** - * Html page block - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> + * Html page footer block */ -namespace Magento\Page\Block\Html; - -class Footer extends \Magento\View\Block\Template +class Footer extends \Magento\View\Element\Template { - + /** + * Copyright information + * + * @var string + */ protected $_copyright; /** @@ -44,26 +42,30 @@ class Footer extends \Magento\View\Block\Template protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } + /** + * Set footer data + */ protected function _construct() { $this->addData(array( 'cache_lifetime'=> false, - 'cache_tags' => array(\Magento\Core\Model\Store::CACHE_TAG, \Magento\Cms\Model\Block::CACHE_TAG) + 'cache_tags' => array( + \Magento\Core\Model\Store::CACHE_TAG, + \Magento\Cms\Model\Block::CACHE_TAG, + ) )); } @@ -79,22 +81,20 @@ class Footer extends \Magento\View\Block\Template $this->_storeManager->getStore()->getId(), (int)$this->_storeManager->getStore()->isCurrentlySecure(), $this->_design->getDesignTheme()->getId(), - $this->_customerSession->isLoggedIn() + $this->_customerSession->isLoggedIn(), ); } - public function setCopyright($copyright) - { - $this->_copyright = $copyright; - return $this; - } - + /** + * Retrieve copyright information + * + * @return string + */ public function getCopyright() { if (!$this->_copyright) { $this->_copyright = $this->_storeConfig->getConfig('design/footer/copyright'); } - return $this->_copyright; } } diff --git a/app/code/Magento/Page/Block/Html/Head.php b/app/code/Magento/Theme/Block/Html/Head.php similarity index 80% rename from app/code/Magento/Page/Block/Html/Head.php rename to app/code/Magento/Theme/Block/Html/Head.php index 4e47cdef773..8fd9b508f3f 100644 --- a/app/code/Magento/Page/Block/Html/Head.php +++ b/app/code/Magento/Theme/Block/Html/Head.php @@ -18,26 +18,19 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Theme\Block\Html; /** - * Html page block - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> + * Html page head block */ -namespace Magento\Page\Block\Html; - -class Head extends \Magento\View\Block\Template +class Head extends \Magento\View\Element\Template { /** - * Block template + * Current template name * * @var string */ @@ -63,17 +56,17 @@ class Head extends \Magento\View\Block\Template protected $_objectManager; /** - * @var \Magento\Core\Model\Page\Asset\MergeService + * @var \Magento\View\Asset\MergeService */ private $_assetMergeService; /** - * @var \Magento\Core\Model\Page\Asset\MinifyService + * @var \Magento\View\Asset\MinifyService */ private $_assetMinifyService; /** - * @var \Magento\Page\Model\Asset\GroupedCollection + * @var \Magento\View\Asset\GroupedCollection */ private $_pageAssets; @@ -82,34 +75,32 @@ class Head extends \Magento\View\Block\Template * * @var \Magento\Core\Helper\File\Storage\Database */ - protected $_fileStorageDatabase = null; + protected $_fileStorageDatabase; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Helper\File\Storage\Database $fileStorageDatabase * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\Page $page - * @param \Magento\Core\Model\Page\Asset\MergeService $assetMergeService - * @param \Magento\Core\Model\Page\Asset\MinifyService $assetMinifyService + * @param \Magento\View\Asset\GroupedCollection $assets + * @param \Magento\View\Asset\MergeService $assetMergeService + * @param \Magento\View\Asset\MinifyService $assetMinifyService * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Helper\File\Storage\Database $fileStorageDatabase, \Magento\ObjectManager $objectManager, - \Magento\Core\Model\Page $page, - \Magento\Core\Model\Page\Asset\MergeService $assetMergeService, - \Magento\Core\Model\Page\Asset\MinifyService $assetMinifyService, + \Magento\View\Asset\GroupedCollection $assets, + \Magento\View\Asset\MergeService $assetMergeService, + \Magento\View\Asset\MinifyService $assetMinifyService, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_fileStorageDatabase = $fileStorageDatabase; $this->_objectManager = $objectManager; $this->_assetMergeService = $assetMergeService; $this->_assetMinifyService = $assetMinifyService; - $this->_pageAssets = $page->getAssets(); + $this->_pageAssets = $assets; } /** @@ -117,19 +108,25 @@ class Head extends \Magento\View\Block\Template * * @param string $title * @param string $href - * @return \Magento\Page\Block\Html\Head + * @return \Magento\Theme\Block\Html\Head */ public function addRss($title, $href) { - $attributes = 'rel="alternate" type="application/rss+xml" title="' . $title . '"'; $asset = $this->_objectManager->create( - 'Magento\Core\Model\Page\Asset\Remote', array('url' => (string)$href) + 'Magento\View\Asset\Remote', array('url' => (string)$href) ); - $this->_pageAssets->add("link/$href", $asset, array('attributes' => $attributes)); + + $this->_pageAssets->add("link/$href", $asset, array( + 'attributes' => 'rel="alternate" type="application/rss+xml" title="' . $title . '"', + )); + return $this; } /** + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + * * Render HTML for the added head items * * @return string @@ -137,23 +134,19 @@ class Head extends \Magento\View\Block\Template public function getCssJsHtml() { foreach ($this->getLayout()->getChildBlocks($this->getNameInLayout()) as $block) { - /** @var $block \Magento\View\Block\AbstractBlock */ - if ($block instanceof \Magento\Page\Block\Html\Head\AssetBlock) { - /** @var \Magento\Core\Model\Page\Asset\AssetInterface $asset */ + /** @var $block \Magento\View\Element\AbstractBlock */ + if ($block instanceof \Magento\Theme\Block\Html\Head\AssetBlockInterface) { + /** @var \Magento\View\Asset\AssetInterface $asset */ $asset = $block->getAsset(); - $this->_pageAssets->add( - $block->getNameInLayout(), - $asset, - (array)$block->getProperties() - ); + $this->_pageAssets->add($block->getNameInLayout(), $asset, (array)$block->getProperties()); } } $result = ''; - /** @var $group \Magento\Page\Model\Asset\PropertyGroup */ + /** @var $group \Magento\View\Asset\PropertyGroup */ foreach ($this->_pageAssets->getGroups() as $group) { - $contentType = $group->getProperty(\Magento\Page\Model\Asset\GroupedCollection::PROPERTY_CONTENT_TYPE); - $canMerge = $group->getProperty(\Magento\Page\Model\Asset\GroupedCollection::PROPERTY_CAN_MERGE); + $contentType = $group->getProperty(\Magento\View\Asset\GroupedCollection::PROPERTY_CONTENT_TYPE); + $canMerge = $group->getProperty(\Magento\View\Asset\GroupedCollection::PROPERTY_CAN_MERGE); $attributes = $group->getProperty('attributes'); $ieCondition = $group->getProperty('ie_condition'); $flagName = $group->getProperty('flag_name'); @@ -204,14 +197,14 @@ class Head extends \Magento\View\Block\Template * Render HTML tags referencing corresponding URLs * * @param string $template - * @param array|Iterator $assets + * @param array $assets * @return string */ protected function _renderHtml($template, $assets) { $result = ''; try { - /** @var $asset \Magento\Core\Model\Page\Asset\AssetInterface */ + /** @var $asset \Magento\View\Asset\AssetInterface */ foreach ($assets as $asset) { $result .= sprintf($template, $asset->getUrl()); } @@ -264,7 +257,7 @@ class Head extends \Magento\View\Block\Template * Set title element text * * @param string|array $title - * @return \Magento\Page\Block\Html\Head + * @return \Magento\Theme\Block\Html\Head */ public function setTitle($title) { @@ -274,8 +267,11 @@ class Head extends \Magento\View\Block\Template } else { $this->_pureTitle = $title; } - $this->_data['title'] = $this->_storeConfig->getConfig('design/head/title_prefix') . ' ' . $title + + $this->_data['title'] = $this->_storeConfig->getConfig('design/head/title_prefix') + . ' ' . $title . ' ' . $this->_storeConfig->getConfig('design/head/title_suffix'); + return $this; } @@ -396,7 +392,7 @@ class Head extends \Magento\View\Block\Template if (!is_null($storeConfig) && $this->_isFile($absolutePath)) { $url = $faviconFile; } else { - $url = $this->getViewFileUrl('Magento_Page::favicon.ico'); + $url = $this->getViewFileUrl('Magento_Theme::favicon.ico'); } return $url; } diff --git a/app/code/Magento/Page/Block/Html/Head/AssetBlock.php b/app/code/Magento/Theme/Block/Html/Head/AssetBlockInterface.php similarity index 85% rename from app/code/Magento/Page/Block/Html/Head/AssetBlock.php rename to app/code/Magento/Theme/Block/Html/Head/AssetBlockInterface.php index 49d790123b7..b440c35194d 100644 --- a/app/code/Magento/Page/Block/Html/Head/AssetBlock.php +++ b/app/code/Magento/Theme/Block/Html/Head/AssetBlockInterface.php @@ -18,22 +18,21 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Html\Head; +namespace Magento\Theme\Block\Html\Head; /** * Asset block interface */ -interface AssetBlock +interface AssetBlockInterface { /** * Get block asset - * @return \Magento\Core\Model\Page\Asset\AssetInterface + * + * @return \Magento\View\Asset\AssetInterface */ public function getAsset(); } diff --git a/app/code/Magento/Page/Block/Html/Head/Css.php b/app/code/Magento/Theme/Block/Html/Head/Css.php similarity index 72% rename from app/code/Magento/Page/Block/Html/Head/Css.php rename to app/code/Magento/Theme/Block/Html/Head/Css.php index 9c17ed16d9b..5f09faa0d7d 100644 --- a/app/code/Magento/Page/Block/Html/Head/Css.php +++ b/app/code/Magento/Theme/Block/Html/Head/Css.php @@ -18,30 +18,25 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Html\Head; +namespace Magento\Theme\Block\Html\Head; /** * Css page block */ -class Css extends \Magento\View\Block\AbstractBlock - implements \Magento\Page\Block\Html\Head\AssetBlock +class Css extends \Magento\View\Element\AbstractBlock implements AssetBlockInterface { /** - * Contructor - * - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Model\Page\Asset\ViewFileFactory $viewFileFactory + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\View\Asset\ViewFileFactory $viewFileFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Model\Page\Asset\ViewFileFactory $viewFileFactory, + \Magento\View\Element\Template\Context $context, + \Magento\View\Asset\ViewFileFactory $viewFileFactory, array $data = array() ) { parent::__construct($context, $data); @@ -57,7 +52,7 @@ class Css extends \Magento\View\Block\AbstractBlock /** * Get block asset * - * @return \Magento\Core\Model\Page\Asset\AssetInterface + * @return \Magento\View\Asset\AssetInterface */ public function getAsset() { diff --git a/app/code/Magento/Page/Block/Html/Head/Link.php b/app/code/Magento/Theme/Block/Html/Head/Link.php similarity index 68% rename from app/code/Magento/Page/Block/Html/Head/Link.php rename to app/code/Magento/Theme/Block/Html/Head/Link.php index 74c8935314a..6a5597639b7 100644 --- a/app/code/Magento/Page/Block/Html/Head/Link.php +++ b/app/code/Magento/Theme/Block/Html/Head/Link.php @@ -18,35 +18,33 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Html\Head; +namespace Magento\Theme\Block\Html\Head; /** * Link page block */ -class Link extends \Magento\View\Block\Template - implements \Magento\Page\Block\Html\Head\AssetBlock +class Link extends \Magento\View\Element\Template implements AssetBlockInterface { + /** + * Virtual content type + */ const VIRTUAL_CONTENT_TYPE = 'link'; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Page\Asset\RemoteFactory $remoteFactory + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\View\Asset\RemoteFactory $remoteFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Page\Asset\RemoteFactory $remoteFactory, + \Magento\View\Element\Template\Context $context, + \Magento\View\Asset\RemoteFactory $remoteFactory, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->setAsset( $remoteFactory->create(array( 'url' => (string)$this->getData('url'), @@ -58,7 +56,7 @@ class Link extends \Magento\View\Block\Template /** * Get block asset * - * @return \Magento\Core\Model\Page\Asset\AssetInterface + * @return \Magento\View\Asset\AssetInterface */ public function getAsset() { diff --git a/app/code/Magento/Page/Block/Html/Head/Script.php b/app/code/Magento/Theme/Block/Html/Head/Script.php similarity index 72% rename from app/code/Magento/Page/Block/Html/Head/Script.php rename to app/code/Magento/Theme/Block/Html/Head/Script.php index 43e54b42fa4..2d94ba22959 100644 --- a/app/code/Magento/Page/Block/Html/Head/Script.php +++ b/app/code/Magento/Theme/Block/Html/Head/Script.php @@ -18,30 +18,26 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Html\Head; +namespace Magento\Theme\Block\Html\Head; +use Magento\Theme\Block\Html\Head\AssetBlockInterface; /** * Script page block */ -class Script extends \Magento\View\Block\AbstractBlock - implements \Magento\Page\Block\Html\Head\AssetBlock +class Script extends \Magento\View\Element\AbstractBlock implements AssetBlockInterface { /** - * Contructor - * - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Model\Page\Asset\ViewFileFactory $viewFileFactory + * @param \Magento\View\Element\Template\Context $context + * @param \Magento\View\Asset\ViewFileFactory $viewFileFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Model\Page\Asset\ViewFileFactory $viewFileFactory, + \Magento\View\Element\Template\Context $context, + \Magento\View\Asset\ViewFileFactory $viewFileFactory, array $data = array() ) { parent::__construct($context, $data); @@ -56,7 +52,7 @@ class Script extends \Magento\View\Block\AbstractBlock /** * Get block asset * - * @return \Magento\Core\Model\Page\Asset\AssetInterface + * @return \Magento\View\Asset\AssetInterface */ public function getAsset() { diff --git a/app/code/Magento/Page/Block/Html/Header.php b/app/code/Magento/Theme/Block/Html/Header.php similarity index 79% rename from app/code/Magento/Page/Block/Html/Header.php rename to app/code/Magento/Theme/Block/Html/Header.php index 8a55b5178bf..ba263345778 100644 --- a/app/code/Magento/Page/Block/Html/Header.php +++ b/app/code/Magento/Theme/Block/Html/Header.php @@ -18,47 +18,41 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Theme\Block\Html; + /** - * Html page block - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> + * Html page header block */ -namespace Magento\Page\Block\Html; - -class Header extends \Magento\View\Block\Template +class Header extends \Magento\View\Element\Template { + /** + * Current template name + * + * @var string + */ + protected $_template = 'html/header.phtml'; + /** * @var \Magento\Customer\Model\Session */ protected $_customerSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Customer\Model\Session $customerSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Customer\Model\Session $customerSession, array $data = array() ) { $this->_customerSession = $customerSession; - parent::__construct($context, $coreData, $data); - } - - public function _construct() - { - $this->setTemplate('html/header.phtml'); + parent::__construct($context, $data); } /** @@ -66,7 +60,7 @@ class Header extends \Magento\View\Block\Template * * @return bool */ - public function getIsHomePage() + public function isHomePage() { return $this->getUrl('', array('_current' => true)) == $this->getUrl( '*/*/*', @@ -74,13 +68,6 @@ class Header extends \Magento\View\Block\Template ); } - public function setLogo($logo_src, $logo_alt) - { - $this->setLogoSrc($logo_src); - $this->setLogoAlt($logo_alt); - return $this; - } - /** * Get logo image URL * @@ -94,6 +81,11 @@ class Header extends \Magento\View\Block\Template return $this->_data['logo_src']; } + /** + * Retrieve logo text + * + * @return string + */ public function getLogoAlt() { if (empty($this->_data['logo_alt'])) { @@ -102,16 +94,21 @@ class Header extends \Magento\View\Block\Template return $this->_data['logo_alt']; } + /** + * Retrieve welcome text + * + * @return string + */ public function getWelcome() { if (empty($this->_data['welcome'])) { if ($this->_appState->isInstalled() && $this->_customerSession->isLoggedIn()) { - $this->_data['welcome'] = __('Welcome, %1!', $this->escapeHtml($this->_customerSession->getCustomer()->getName())); + $this->_data['welcome'] = __('Welcome, %1!', + $this->escapeHtml($this->_customerSession->getCustomer()->getName())); } else { $this->_data['welcome'] = $this->_storeConfig->getConfig('design/header/welcome'); } } - return $this->_data['welcome']; } @@ -134,7 +131,6 @@ class Header extends \Magento\View\Block\Template } else { $url = $this->getViewFileUrl('images/logo.gif'); } - return $url; } diff --git a/app/code/Magento/Page/Block/Html/Notices.php b/app/code/Magento/Theme/Block/Html/Notices.php similarity index 78% rename from app/code/Magento/Page/Block/Html/Notices.php rename to app/code/Magento/Theme/Block/Html/Notices.php index e24dd186ed3..6891bbb6ca1 100644 --- a/app/code/Magento/Page/Block/Html/Notices.php +++ b/app/code/Magento/Theme/Block/Html/Notices.php @@ -18,22 +18,16 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Theme\Block\Html; + /** - * Html notices block - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> + * Html page notices block */ -namespace Magento\Page\Block\Html; - -class Notices extends \Magento\View\Block\Template +class Notices extends \Magento\View\Element\Template { /** * @var \Magento\Core\Model\Url @@ -41,19 +35,17 @@ class Notices extends \Magento\View\Block\Template protected $_urlModel; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Url $urlModel * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Url $urlModel, array $data = array() ) { $this->_urlModel = $urlModel; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Page/Block/Html/Pager.php b/app/code/Magento/Theme/Block/Html/Pager.php similarity index 74% rename from app/code/Magento/Page/Block/Html/Pager.php rename to app/code/Magento/Theme/Block/Html/Pager.php index 42c0009aa5e..57171ff5563 100644 --- a/app/code/Magento/Page/Block/Html/Pager.php +++ b/app/code/Magento/Theme/Block/Html/Pager.php @@ -18,73 +18,114 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Theme\Block\Html; + /** - * Html page block - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> - * - * @todo separate order, mode and pager + * Html pager block + * @SuppressWarnings(PHPMD.ExcessivePublicCount) */ -namespace Magento\Page\Block\Html; - -class Pager extends \Magento\View\Block\Template +class Pager extends \Magento\View\Element\Template { - protected $_collection = null; - protected $_pageVarName = 'p'; - protected $_limitVarName = 'limit'; - protected $_availableLimit = array(10=>10,20=>20,50=>50); - protected $_dispersion = 3; - protected $_displayPages = 5; - protected $_showPerPage = true; - protected $_limit = null; + /** + * Current template name + * + * @var string + */ + protected $_template = 'Magento_Theme::html/pager.phtml'; + + /** + * @var \Magento\Data\Collection + */ + protected $_collection; + + /** + * @var string + */ + protected $_pageVarName = 'p'; + + /** + * @var string + */ + protected $_limitVarName = 'limit'; + + /** + * The list of available pager limits + * + * @var array + */ + protected $_availableLimit = array( + 10 => 10, + 20 => 20, + 50 => 50, + ); + + /** + * @var int + */ + protected $_displayPages = 5; + + /** + * @var bool + */ + protected $_showPerPage = true; + + /** + * @var null + */ + protected $_limit; + + /** + * @var bool + */ protected $_outputRequired = true; /** * Pages quantity per frame + * * @var int */ protected $_frameLength = 5; /** * Next/previous page position relatively to the current frame + * * @var int */ protected $_jump = 5; /** * Frame initialization flag + * * @var bool */ protected $_frameInitialized = false; /** * Start page position in frame + * * @var int */ protected $_frameStart; /** * Finish page position in frame + * * @var int */ protected $_frameEnd; - protected $_template = 'Magento_Page::html/pager.phtml'; - + /** + * Set pager data + */ protected function _construct() { parent::_construct(); $this->setData('show_amounts', true); $this->setData('use_container', true); - } /** @@ -110,12 +151,14 @@ class Pager extends \Magento\View\Block\Template if ($this->_limit !== null) { return $this->_limit; } + $limits = $this->getAvailableLimit(); if ($limit = $this->getRequest()->getParam($this->getLimitVarName())) { if (isset($limits[$limit])) { return $limit; } } + $limits = array_keys($limits); return $limits[0]; } @@ -124,7 +167,7 @@ class Pager extends \Magento\View\Block\Template * Setter for limit items per page * * @param int $limit - * @return \Magento\Page\Block\Html\Pager + * @return \Magento\Theme\Block\Html\Pager */ public function setLimit($limit) { @@ -136,12 +179,11 @@ class Pager extends \Magento\View\Block\Template * Set collection for pagination * * @param \Magento\Data\Collection $collection - * @return \Magento\Page\Block\Html\Pager + * @return \Magento\Theme\Block\Html\Pager */ public function setCollection($collection) { - $this->_collection = $collection - ->setCurPage($this->getCurrentPage()); + $this->_collection = $collection->setCurPage($this->getCurrentPage()); // If not int - then not limit if ((int) $this->getLimit()) { $this->_collection->setPageSize($this->getLimit()); @@ -153,168 +195,268 @@ class Pager extends \Magento\View\Block\Template } /** - * @return \Magento\Core\Model\Resource\Db\Collection\AbstractCollection + * @return \Magento\Data\Collection */ public function getCollection() { return $this->_collection; } + /** + * @param string $varName + * @return \Magento\Theme\Block\Html\Pager + */ public function setPageVarName($varName) { $this->_pageVarName = $varName; return $this; } + /** + * @return string + */ public function getPageVarName() { return $this->_pageVarName; } + /** + * @param bool $varName + * @return \Magento\Theme\Block\Html\Pager + */ public function setShowPerPage($varName) { - $this->_showPerPage=$varName; + $this->_showPerPage = $varName; return $this; } - public function getShowPerPage() + /** + * @return bool + */ + public function isShowPerPage() { - if(sizeof($this->getAvailableLimit())<=1) { + if (sizeof($this->getAvailableLimit()) <= 1) { return false; } return $this->_showPerPage; } + /** + * Set the name for pager limit data + * + * @param string $varName + * @return \Magento\Theme\Block\Html\Pager + */ public function setLimitVarName($varName) { $this->_limitVarName = $varName; return $this; } + /** + * Retrieve name for pager limit data + * + * @return string + */ public function getLimitVarName() { return $this->_limitVarName; } + /** + * Set pager limit + * + * @param array $limits + */ public function setAvailableLimit(array $limits) { $this->_availableLimit = $limits; } + /** + * Retrieve pager limit + * + * @return array + */ public function getAvailableLimit() { return $this->_availableLimit; } + /** + * @return int + */ public function getFirstNum() { $collection = $this->getCollection(); - return $collection->getPageSize()*($collection->getCurPage()-1)+1; + return $collection->getPageSize() * ($collection->getCurPage() - 1) + 1; } + /** + * @return int + */ public function getLastNum() { $collection = $this->getCollection(); - return $collection->getPageSize()*($collection->getCurPage()-1)+$collection->count(); + return $collection->getPageSize() * ($collection->getCurPage() - 1) + $collection->count(); } + /** + * Retrieve total number of pages + * + * @return int + */ public function getTotalNum() { return $this->getCollection()->getSize(); } + /** + * Check if current page is a first page in collection + * + * @return bool + */ public function isFirstPage() { return $this->getCollection()->getCurPage() == 1; } + /** + * Retrieve number of last page + * + * @return int + */ public function getLastPageNum() { return $this->getCollection()->getLastPageNumber(); } + /** + * Check if current page is a last page in collection + * + * @return bool + */ public function isLastPage() { return $this->getCollection()->getCurPage() >= $this->getLastPageNum(); } + /** + * @param int $limit + * @return bool + */ public function isLimitCurrent($limit) { return $limit == $this->getLimit(); } + /** + * @param int $page + * @return bool + */ public function isPageCurrent($page) { return $page == $this->getCurrentPage(); } + /** + * @return array + */ public function getPages() { $collection = $this->getCollection(); - - $pages = array(); if ($collection->getLastPageNumber() <= $this->_displayPages) { - $pages = range(1, $collection->getLastPageNumber()); - } - else { + return range(1, $collection->getLastPageNumber()); + } else { $half = ceil($this->_displayPages / 2); if ($collection->getCurPage() >= $half && $collection->getCurPage() <= $collection->getLastPageNumber() - $half ) { $start = ($collection->getCurPage() - $half) + 1; $finish = ($start + $this->_displayPages) - 1; - } - elseif ($collection->getCurPage() < $half) { + } elseif ($collection->getCurPage() < $half) { $start = 1; $finish = $this->_displayPages; - } - elseif ($collection->getCurPage() > ($collection->getLastPageNumber() - $half)) { + } elseif ($collection->getCurPage() > ($collection->getLastPageNumber() - $half)) { $finish = $collection->getLastPageNumber(); $start = $finish - $this->_displayPages + 1; } - - $pages = range($start, $finish); + return range($start, $finish); } - return $pages; } + /** + * @return string + */ public function getFirstPageUrl() { return $this->getPageUrl(1); } + /** + * Retrieve previous page URL + * + * @return string + */ public function getPreviousPageUrl() { return $this->getPageUrl($this->getCollection()->getCurPage(-1)); } + /** + * Retrieve next page URL + * + * @return string + */ public function getNextPageUrl() { return $this->getPageUrl($this->getCollection()->getCurPage(+1)); } + /** + * Retrieve last page URL + * + * @return string + */ public function getLastPageUrl() { return $this->getPageUrl($this->getCollection()->getLastPageNumber()); } + /** + * Retrieve page URL + * + * @param string $page + * @return string + */ public function getPageUrl($page) { - return $this->getPagerUrl(array($this->getPageVarName()=>$page)); + return $this->getPagerUrl(array($this->getPageVarName() => $page)); } + /** + * @param int $limit + * @return string + */ public function getLimitUrl($limit) { - return $this->getPagerUrl(array($this->getLimitVarName()=>$limit)); + return $this->getPagerUrl(array($this->getLimitVarName() => $limit)); } - public function getPagerUrl($params=array()) + /** + * Retrieve page URL by defined parameters + * + * @param array $params + * @return string + */ + public function getPagerUrl($params = array()) { $urlParams = array(); - $urlParams['_current'] = true; - $urlParams['_escape'] = true; - $urlParams['_use_rewrite'] = true; - $urlParams['_query'] = $params; + $urlParams['_current'] = true; + $urlParams['_escape'] = true; + $urlParams['_use_rewrite'] = true; + $urlParams['_query'] = $params; + return $this->getUrl('*/*/*', $urlParams); } @@ -362,6 +504,7 @@ class Pager extends \Magento\View\Block\Template if (!$this->getJump()) { return null; } + $frameStart = $this->getFrameStart(); if ($frameStart - 1 > 1) { return max(2, $frameStart - $this->getJump()); @@ -390,6 +533,7 @@ class Pager extends \Magento\View\Block\Template if (!$this->getJump()) { return null; } + $frameEnd = $this->getFrameEnd(); if ($this->getLastPageNum() - $frameEnd > 1) { return min($this->getLastPageNum() - 1, $frameEnd + $this->getJump()); @@ -432,7 +576,7 @@ class Pager extends \Magento\View\Block\Template * Setter for $_frameLength * * @param int $frame - * @return \Magento\Page\Block\Html\Pager + * @return \Magento\Theme\Block\Html\Pager */ public function setFrameLength($frame) { @@ -452,7 +596,7 @@ class Pager extends \Magento\View\Block\Template * Setter for $_jump * * @param int $jump - * @return \Magento\Page\Block\Html\Pager + * @return \Magento\Theme\Block\Html\Pager */ public function setJump($jump) { @@ -508,7 +652,7 @@ class Pager extends \Magento\View\Block\Template /** * Initialize frame data, such as frame start, frame start etc. * - * @return \Magento\Page\Block\Html\Pager + * @return \Magento\Theme\Block\Html\Pager */ protected function _initFrame() { @@ -520,20 +664,17 @@ class Pager extends \Magento\View\Block\Template if ($collection->getLastPageNumber() <= $this->getFrameLength()) { $start = 1; $end = $collection->getLastPageNumber(); - } - else { + } else { $half = ceil($this->getFrameLength() / 2); if ($collection->getCurPage() >= $half && $collection->getCurPage() <= $collection->getLastPageNumber() - $half ) { $start = ($collection->getCurPage() - $half) + 1; $end = ($start + $this->getFrameLength()) - 1; - } - elseif ($collection->getCurPage() < $half) { + } elseif ($collection->getCurPage() < $half) { $start = 1; $end = $this->getFrameLength(); - } - elseif ($collection->getCurPage() > ($collection->getLastPageNumber() - $half)) { + } elseif ($collection->getCurPage() > ($collection->getLastPageNumber() - $half)) { $end = $collection->getLastPageNumber(); $start = $end - $this->getFrameLength() + 1; } @@ -551,7 +692,7 @@ class Pager extends \Magento\View\Block\Template * Setter for flag _frameInitialized * * @param bool $flag - * @return \Magento\Page\Block\Html\Pager + * @return \Magento\Theme\Block\Html\Pager */ protected function _setFrameInitialized($flag) { @@ -562,7 +703,7 @@ class Pager extends \Magento\View\Block\Template /** * Check if frame data was initialized * - * @return \Magento\Page\Block\Html\Pager + * @return \Magento\Theme\Block\Html\Pager */ public function isFrameInitialized() { @@ -593,7 +734,7 @@ class Pager extends \Magento\View\Block\Template * Set whether output of the pager is mandatory * * @param bool $isRequired - * @return \Magento\Page\Block\Html\Pager + * @return \Magento\Theme\Block\Html\Pager */ public function setIsOutputRequired($isRequired) { diff --git a/app/code/Magento/Page/Block/Html/Title.php b/app/code/Magento/Theme/Block/Html/Title.php similarity index 85% rename from app/code/Magento/Page/Block/Html/Title.php rename to app/code/Magento/Theme/Block/Html/Title.php index ce8d97e9bfd..8558dda2ff0 100644 --- a/app/code/Magento/Page/Block/Html/Title.php +++ b/app/code/Magento/Theme/Block/Html/Title.php @@ -18,21 +18,16 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Theme\Block\Html; /** - * Template title block - * - * @author Magento Core Team <core@magentocommerce.com> + * Html page title block */ -namespace Magento\Page\Block\Html; - -class Title extends \Magento\View\Block\Template +class Title extends \Magento\View\Element\Template { /** * Own page title to display on the page @@ -57,7 +52,7 @@ class Title extends \Magento\View\Block\Template /** * Set own page title * - * @param $pageTitle + * @param string $pageTitle */ public function setPageTitle($pageTitle) { diff --git a/app/code/Magento/Page/Block/Html/Topmenu.php b/app/code/Magento/Theme/Block/Html/Topmenu.php similarity index 91% rename from app/code/Magento/Page/Block/Html/Topmenu.php rename to app/code/Magento/Theme/Block/Html/Topmenu.php index f72d6391623..e320d337f00 100644 --- a/app/code/Magento/Page/Block/Html/Topmenu.php +++ b/app/code/Magento/Theme/Block/Html/Topmenu.php @@ -18,22 +18,16 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\Theme\Block\Html; + /** - * Top menu block - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> + * Html page top menu block */ -namespace Magento\Page\Block\Html; - -class Topmenu extends \Magento\View\Block\Template +class Topmenu extends \Magento\View\Element\Template { /** * Top menu data tree @@ -55,12 +49,13 @@ class Topmenu extends \Magento\View\Block\Template * * @param string $outermostClass * @param string $childrenWrapClass + * @param int $limit * @return string */ public function getHtml($outermostClass = '', $childrenWrapClass = '', $limit = 0) { $this->_eventManager->dispatch('page_block_html_topmenu_gethtml_before', array( - 'menu' => $this->_menu + 'menu' => $this->_menu, )); $this->_menu->setOutermostClass($outermostClass); @@ -70,7 +65,7 @@ class Topmenu extends \Magento\View\Block\Template $transportObject = new \Magento\Object(array('html' => $html)); $this->_eventManager->dispatch('page_block_html_topmenu_gethtml_after', array( - 'menu' => $this->_menu, + 'menu' => $this->_menu, 'transportObject' => $transportObject, )); @@ -101,25 +96,28 @@ class Topmenu extends \Magento\View\Block\Template * @param \Magento\Backend\Model\Menu $items * @param int $limit * @return array + * * @todo: Add Depth Level limit, and better logic for columns */ protected function _columnBrake($items, $limit) { $total = $this->_countItems($items); - if ($total <= $limit) { return; } + $result[] = array( - 'total' => $total, - 'max' => (int)ceil($total / ceil($total / $limit)) - ); + 'total' => $total, + 'max' => (int)ceil($total / ceil($total / $limit)), + ); $count = 0; $firstCol = true; + foreach ($items as $item) { $place = $this->_countItems($item->getChildren()) + 1; $count += $place; + if ($place >= $limit) { $colbrake = !$firstCol; $count = 0; @@ -129,21 +127,25 @@ class Topmenu extends \Magento\View\Block\Template } else { $colbrake = false; } + $result[] = array( 'place' => $place, - 'colbrake' => $colbrake + 'colbrake' => $colbrake, ); + $firstCol = false; } + return $result; } /** * Add sub menu HTML code for current menu item * - * @param $menuItem \Magento\Backend\Model\Menu\Item - * @param $level int - * @param $limit int + * @param \Magento\Data\Tree\Node $child + * @param string $childLevel + * @param string $childrenWrapClass + * @param int $limit * @return string HTML code */ protected function _addSubMenu($child, $childLevel, $childrenWrapClass, $limit) @@ -152,13 +154,16 @@ class Topmenu extends \Magento\View\Block\Template if (!$child->hasChildren()) { return $html; } + if (!empty($childrenWrapClass)) { $html .= '<div class="' . $childrenWrapClass . '">'; } + $colStops = null; if ($childLevel == 0 && $limit) { $colStops = $this->_columnBrake($child->getChildren(), $limit); } + $html .= '<ul class="level' . $childLevel . '">'; $html .= $this->_getHtml($child, $childrenWrapClass, $limit, $colStops); $html .= '</ul>'; @@ -166,15 +171,20 @@ class Topmenu extends \Magento\View\Block\Template if (!empty($childrenWrapClass)) { $html .= '</div>'; } + return $html; } - /** * Recursively generates top menu html from data that is specified in $menuTree * + * @SuppressWarnings(PHPMD.CyclomaticComplexity) + * @SuppressWarnings(PHPMD.NPathComplexity) + * * @param \Magento\Data\Tree\Node $menuTree * @param string $childrenWrapClass + * @param int $limit + * @param array $colBrakes * @return string */ protected function _getHtml(\Magento\Data\Tree\Node $menuTree, $childrenWrapClass, $limit, $colBrakes = array()) @@ -193,7 +203,6 @@ class Topmenu extends \Magento\View\Block\Template $itemPositionClassPrefix = $parentPositionClass ? $parentPositionClass . '-' : 'nav-'; foreach ($children as $child) { - $child->setLevel($childLevel); $child->setIsFirst($counter == 1); $child->setIsLast($counter == $childrenCount); @@ -237,11 +246,9 @@ class Topmenu extends \Magento\View\Block\Template { $html = ''; $attributes = $this->_getMenuItemAttributes($item); - foreach ($attributes as $attributeName => $attributeValue) { $html .= ' ' . $attributeName . '="' . str_replace('"', '\"', $attributeValue) . '"'; } - return $html; } @@ -254,11 +261,7 @@ class Topmenu extends \Magento\View\Block\Template protected function _getMenuItemAttributes(\Magento\Data\Tree\Node $item) { $menuItemClasses = $this->_getMenuItemClasses($item); - $attributes = array( - 'class' => implode(' ', $menuItemClasses) - ); - - return $attributes; + return array('class' => implode(' ', $menuItemClasses)); } /** diff --git a/app/code/Magento/Theme/Block/Html/Welcome.php b/app/code/Magento/Theme/Block/Html/Welcome.php new file mode 100644 index 00000000000..19c9308fcd2 --- /dev/null +++ b/app/code/Magento/Theme/Block/Html/Welcome.php @@ -0,0 +1,41 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Theme\Block\Html; + +/** + * Html page welcome block + */ +class Welcome extends \Magento\View\Element\Template +{ + /** + * Get block message + * + * @return string + */ + protected function _toHtml() + { + return $this->_layout->getBlock('header')->getWelcome(); + } +} diff --git a/app/code/Magento/Page/Helper/Layout.php b/app/code/Magento/Theme/Helper/Layout.php similarity index 86% rename from app/code/Magento/Page/Helper/Layout.php rename to app/code/Magento/Theme/Helper/Layout.php index 680c21a624c..46b1396f4d9 100644 --- a/app/code/Magento/Page/Helper/Layout.php +++ b/app/code/Magento/Theme/Helper/Layout.php @@ -18,20 +18,11 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** - * Page layout helper - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Page\Helper; +namespace Magento\Theme\Helper; class Layout extends \Magento\App\Helper\AbstractHelper { @@ -41,30 +32,30 @@ class Layout extends \Magento\App\Helper\AbstractHelper protected $_layout; /** - * @var \Magento\Page\Model\Config + * @var \Magento\Theme\Model\Layout\Config */ protected $_config; /** - * @param \Magento\Page\Model\Config $config - * @param \Magento\View\LayoutInterface $layout * @param \Magento\App\Helper\Context $context + * @param \Magento\Theme\Model\Layout\Config $config + * @param \Magento\View\LayoutInterface $layout */ public function __construct( - \Magento\Page\Model\Config $config, - \Magento\View\LayoutInterface $layout, - \Magento\App\Helper\Context $context + \Magento\App\Helper\Context $context, + \Magento\Theme\Model\Layout\Config $config, + \Magento\View\LayoutInterface $layout ) { - parent::__construct($context); $this->_layout = $layout; $this->_config = $config; + parent::__construct($context); } /** * Apply page layout handle * * @param string $pageLayout - * @return \Magento\Page\Helper\Layout + * @return \Magento\Theme\Helper\Layout */ public function applyHandle($pageLayout) { @@ -85,7 +76,7 @@ class Layout extends \Magento\App\Helper\AbstractHelper * (for old design packages) * * @param string $pageLayout - * @return \Magento\Page\Helper\Layout + * @return \Magento\Theme\Helper\Layout */ public function applyTemplate($pageLayout = null) { diff --git a/app/code/Magento/Theme/Helper/Storage.php b/app/code/Magento/Theme/Helper/Storage.php index ffd0e16b388..aaf39aba2d8 100644 --- a/app/code/Magento/Theme/Helper/Storage.php +++ b/app/code/Magento/Theme/Helper/Storage.php @@ -98,16 +98,16 @@ class Storage extends \Magento\App\Helper\AbstractHelper protected $_themeFactory; /** + * @param \Magento\App\Helper\Context $context * @param \Magento\Filesystem $filesystem * @param \Magento\Backend\Model\Session $session * @param \Magento\View\Design\Theme\FlyweightFactory $themeFactory - * @param \Magento\App\Helper\Context $context */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Filesystem $filesystem, \Magento\Backend\Model\Session $session, - \Magento\View\Design\Theme\FlyweightFactory $themeFactory, - \Magento\App\Helper\Context $context + \Magento\View\Design\Theme\FlyweightFactory $themeFactory ) { parent::__construct($context); $this->_filesystem = $filesystem; diff --git a/app/code/Magento/Page/Model/Config.php b/app/code/Magento/Theme/Model/Layout/Config.php similarity index 94% rename from app/code/Magento/Page/Model/Config.php rename to app/code/Magento/Theme/Model/Layout/Config.php index 41844f090c6..36fcc1252ba 100644 --- a/app/code/Magento/Page/Model/Config.php +++ b/app/code/Magento/Theme/Model/Layout/Config.php @@ -20,12 +20,10 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Model; +namespace Magento\Theme\Model\Layout; class Config { @@ -53,7 +51,7 @@ class Config /** * Initialize page layouts list * - * @return \Magento\Page\Model\Config + * @return \Magento\Theme\Model\Layout\Config */ protected function _initPageLayouts() { @@ -70,7 +68,7 @@ class Config /** * Retrieve available page layouts * - * @return array \Magento\Object[] + * @return \Magento\Object[] */ public function getPageLayouts() { diff --git a/app/code/Magento/Page/Model/Config/Converter.php b/app/code/Magento/Theme/Model/Layout/Config/Converter.php similarity index 97% rename from app/code/Magento/Page/Model/Config/Converter.php rename to app/code/Magento/Theme/Model/Layout/Config/Converter.php index faeaa251526..af20023a892 100644 --- a/app/code/Magento/Page/Model/Config/Converter.php +++ b/app/code/Magento/Theme/Model/Layout/Config/Converter.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Model\Config; +namespace Magento\Theme\Model\Layout\Config; class Converter implements \Magento\Config\ConverterInterface { diff --git a/app/code/Magento/Page/Model/Config/Reader.php b/app/code/Magento/Theme/Model/Layout/Config/Reader.php similarity index 96% rename from app/code/Magento/Page/Model/Config/Reader.php rename to app/code/Magento/Theme/Model/Layout/Config/Reader.php index e50e66cc6c2..6645e981503 100644 --- a/app/code/Magento/Page/Model/Config/Reader.php +++ b/app/code/Magento/Theme/Model/Layout/Config/Reader.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Model\Config; +namespace Magento\Theme\Model\Layout\Config; class Reader extends \Magento\Config\Reader\Filesystem { diff --git a/app/code/Magento/Page/Model/Config/SchemaLocator.php b/app/code/Magento/Theme/Model/Layout/Config/SchemaLocator.php similarity index 93% rename from app/code/Magento/Page/Model/Config/SchemaLocator.php rename to app/code/Magento/Theme/Model/Layout/Config/SchemaLocator.php index cd17bdabf20..64b6d8cd4af 100644 --- a/app/code/Magento/Page/Model/Config/SchemaLocator.php +++ b/app/code/Magento/Theme/Model/Layout/Config/SchemaLocator.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Model\Config; +namespace Magento\Theme\Model\Layout\Config; class SchemaLocator implements \Magento\Config\SchemaLocatorInterface { @@ -46,8 +46,8 @@ class SchemaLocator implements \Magento\Config\SchemaLocatorInterface */ public function __construct(\Magento\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Page') . '/page_layouts.xsd'; - $this->_perFileSchema = $moduleReader->getModuleDir('etc', 'Magento_Page') . '/page_layouts_file.xsd'; + $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Theme') . '/page_layouts.xsd'; + $this->_perFileSchema = $moduleReader->getModuleDir('etc', 'Magento_Theme') . '/page_layouts_file.xsd'; } /** diff --git a/app/code/Magento/Page/Model/Source/Layout.php b/app/code/Magento/Theme/Model/Layout/Source/Layout.php similarity index 87% rename from app/code/Magento/Page/Model/Source/Layout.php rename to app/code/Magento/Theme/Model/Layout/Source/Layout.php index dbb534d0bda..4f35ddc45bf 100644 --- a/app/code/Magento/Page/Model/Source/Layout.php +++ b/app/code/Magento/Theme/Model/Layout/Source/Layout.php @@ -18,33 +18,23 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * Page layouts source - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Page\Model\Source; +namespace Magento\Theme\Model\Layout\Source; class Layout implements \Magento\Core\Model\Option\ArrayInterface { /** - * @var \Magento\Page\Model\Config + * @var \Magento\Theme\Model\Layout\Config */ protected $_config; /** - * @param \Magento\Page\Model\Config $config + * @param \Magento\Theme\Model\Layout\Config $config */ public function __construct( - \Magento\Page\Model\Config $config + \Magento\Theme\Model\Layout\Config $config ) { $this->_config = $config; } @@ -85,6 +75,7 @@ class Layout implements \Magento\Core\Model\Option\ArrayInterface /** * Retrieve page layout options array * + * @param bool $withEmpty * @return array */ public function toOptionArray($withEmpty = false) diff --git a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php index a6cebc9def5..3003b9c164d 100644 --- a/app/code/Magento/Theme/Model/Wysiwyg/Storage.php +++ b/app/code/Magento/Theme/Model/Wysiwyg/Storage.php @@ -129,7 +129,7 @@ class Storage ); $result['cookie'] = array( - 'name' => $this->_helper->getSession()->getSessionName(), + 'name' => $this->_helper->getSession()->getName(), 'value' => $this->_helper->getSession()->getSessionId(), 'lifetime' => $this->_helper->getSession()->getCookieLifetime(), 'path' => $this->_helper->getSession()->getCookiePath(), diff --git a/app/code/Magento/Page/etc/adminhtml/system.xml b/app/code/Magento/Theme/etc/adminhtml/system.xml similarity index 99% rename from app/code/Magento/Page/etc/adminhtml/system.xml rename to app/code/Magento/Theme/etc/adminhtml/system.xml index 2f45806cae3..06baf8efc7a 100644 --- a/app/code/Magento/Page/etc/adminhtml/system.xml +++ b/app/code/Magento/Theme/etc/adminhtml/system.xml @@ -19,8 +19,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ diff --git a/app/code/Magento/Theme/etc/config.xml b/app/code/Magento/Theme/etc/config.xml index 707f1780a8f..0eb1ed6fe06 100644 --- a/app/code/Magento/Theme/etc/config.xml +++ b/app/code/Magento/Theme/etc/config.xml @@ -27,10 +27,59 @@ --> <config> <default> + <design> + <head translate="default_description"> + <default_title>Magento Commerce</default_title> + <default_description>Default Description</default_description> + <default_keywords>Magento, Varien, E-commerce</default_keywords> + <default_media_type>text/html</default_media_type> + <default_charset>utf-8</default_charset> + </head> + <search_engine_robots> + <default_robots>INDEX,FOLLOW</default_robots> + <default_custom_instructions> + <![CDATA[ +User-agent: * +Disallow: /index.php/ +Disallow: /*? +Disallow: /*.js$ +Disallow: /*.css$ +Disallow: /checkout/ +Disallow: /app/ +Disallow: /downloader/ +Disallow: /js/ +Disallow: /lib/ +Disallow: /*.php$ +Disallow: /pkginfo/ +Disallow: /report/ +Disallow: /var/ +Disallow: /catalog/ +Disallow: /customer/ +Disallow: /sendfriend/ +Disallow: /review/ +Disallow: /*SID= + ]]> + </default_custom_instructions> + </search_engine_robots> + <header translate="welcome"> + <logo_alt>Magento Commerce</logo_alt> + <welcome>Default welcome msg!</welcome> + </header> + <footer translate="copyright"> + <copyright>&copy; 2013 Magento Demo Store. All Rights Reserved.</copyright> + </footer> + </design> <theme> <customization> <custom_css>Magento\Theme\Model\Theme\Customization\File\CustomCss</custom_css> </customization> </theme> + <system> + <media_storage_configuration> + <allowed_resources> + <site_favicons>favicon</site_favicons> + </allowed_resources> + </media_storage_configuration> + </system> </default> </config> diff --git a/app/code/Magento/Theme/etc/di.xml b/app/code/Magento/Theme/etc/di.xml index e0d6c92995b..133b456dedc 100644 --- a/app/code/Magento/Theme/etc/di.xml +++ b/app/code/Magento/Theme/etc/di.xml @@ -40,4 +40,28 @@ </value> </param> </type> + <type name="Magento\Theme\Model\Layout\Config\Reader"> + <param name="fileName"> + <value>page_layouts.xml</value> + </param> + <param name="converter"> + <instance type="Magento\Theme\Model\Layout\Config\Converter" /> + </param> + <param name="schemaLocator"> + <instance type="Magento\Theme\Model\Layout\Config\SchemaLocator" /> + </param> + </type> + <virtualType name="Magento\Theme\Model\Layout\Config\Data" type="Magento\Config\Data"> + <param name='reader'> + <instance type="Magento\Theme\Model\Layout\Config\Reader" /> + </param> + <param name="cacheId"> + <value>page_layouts_config</value> + </param> + </virtualType> + <type name="Magento\Theme\Model\Layout\Config"> + <param name="dataStorage"> + <instance type="Magento\Theme\Model\Layout\Config\Data" /> + </param> + </type> </config> diff --git a/app/code/Magento/Theme/etc/module.xml b/app/code/Magento/Theme/etc/module.xml index 1078e7550e8..dda559740ee 100755 --- a/app/code/Magento/Theme/etc/module.xml +++ b/app/code/Magento/Theme/etc/module.xml @@ -25,11 +25,15 @@ --> <config> <module name="Magento_Theme" version="1.6.0.0" active="true"> + <sequence> + <module name="Magento_Core"/> + </sequence> <depends> <module name="Magento_Adminhtml"/> <module name="Magento_Core"/> + <module name="Magento_Customer"/> <module name="Magento_Backend"/> - <module name="Magento_Page"/> + <module name="Magento_Cms"/> </depends> </module> </config> diff --git a/app/code/Magento/Page/etc/page_layouts.xml b/app/code/Magento/Theme/etc/page_layouts.xml similarity index 100% rename from app/code/Magento/Page/etc/page_layouts.xml rename to app/code/Magento/Theme/etc/page_layouts.xml diff --git a/app/code/Magento/Page/etc/page_layouts.xsd b/app/code/Magento/Theme/etc/page_layouts.xsd similarity index 100% rename from app/code/Magento/Page/etc/page_layouts.xsd rename to app/code/Magento/Theme/etc/page_layouts.xsd diff --git a/app/code/Magento/Page/etc/page_layouts_file.xsd b/app/code/Magento/Theme/etc/page_layouts_file.xsd similarity index 100% rename from app/code/Magento/Page/etc/page_layouts_file.xsd rename to app/code/Magento/Theme/etc/page_layouts_file.xsd diff --git a/app/code/Magento/Page/i18n/de_DE.csv b/app/code/Magento/Theme/i18n/de_DE.csv similarity index 100% rename from app/code/Magento/Page/i18n/de_DE.csv rename to app/code/Magento/Theme/i18n/de_DE.csv diff --git a/app/code/Magento/Page/i18n/en_US.csv b/app/code/Magento/Theme/i18n/en_US.csv similarity index 100% rename from app/code/Magento/Page/i18n/en_US.csv rename to app/code/Magento/Theme/i18n/en_US.csv diff --git a/app/code/Magento/Page/i18n/es_ES.csv b/app/code/Magento/Theme/i18n/es_ES.csv similarity index 100% rename from app/code/Magento/Page/i18n/es_ES.csv rename to app/code/Magento/Theme/i18n/es_ES.csv diff --git a/app/code/Magento/Page/i18n/fr_FR.csv b/app/code/Magento/Theme/i18n/fr_FR.csv similarity index 100% rename from app/code/Magento/Page/i18n/fr_FR.csv rename to app/code/Magento/Theme/i18n/fr_FR.csv diff --git a/app/code/Magento/Page/i18n/nl_NL.csv b/app/code/Magento/Theme/i18n/nl_NL.csv similarity index 100% rename from app/code/Magento/Page/i18n/nl_NL.csv rename to app/code/Magento/Theme/i18n/nl_NL.csv diff --git a/app/code/Magento/Page/i18n/pt_BR.csv b/app/code/Magento/Theme/i18n/pt_BR.csv similarity index 100% rename from app/code/Magento/Page/i18n/pt_BR.csv rename to app/code/Magento/Theme/i18n/pt_BR.csv diff --git a/app/code/Magento/Page/i18n/zh_CN.csv b/app/code/Magento/Theme/i18n/zh_CN.csv similarity index 100% rename from app/code/Magento/Page/i18n/zh_CN.csv rename to app/code/Magento/Theme/i18n/zh_CN.csv diff --git a/app/code/Magento/Page/view/adminhtml/empty.phtml b/app/code/Magento/Theme/view/adminhtml/empty.phtml similarity index 100% rename from app/code/Magento/Page/view/adminhtml/empty.phtml rename to app/code/Magento/Theme/view/adminhtml/empty.phtml diff --git a/app/code/Magento/Page/view/adminhtml/favicon.ico b/app/code/Magento/Theme/view/adminhtml/favicon.ico similarity index 100% rename from app/code/Magento/Page/view/adminhtml/favicon.ico rename to app/code/Magento/Theme/view/adminhtml/favicon.ico diff --git a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml index 98dcbb5ded4..aa713d5164a 100644 --- a/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml +++ b/app/code/Magento/Theme/view/adminhtml/layout/adminhtml_system_design_theme_edit.xml @@ -31,72 +31,72 @@ <action method="setCanLoadTinyMce"> <argument name="flag" xsi:type="string">1</argument> </action> - <block class="Magento\Page\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-fileuploader-css-jquery-fileupload-ui-css"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/css/jquery.fileupload-ui.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-iframe-transport-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.iframe-transport.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-load-image-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/load-image.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-canvas-to-blob-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/canvas-to-blob.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-fp-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload-fp.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-theme-js-custom-js-list-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-theme-js-custom-js-list-js"> <arguments> <argument name="file" xsi:type="string">Magento_Theme::js/custom-js-list.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-browser-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-browser-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/browser.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-ui-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-fileuploader-jquery-fileupload-ui-js"> <arguments> <argument name="file" xsi:type="string">jquery/fileUploader/jquery.fileupload-ui.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-theme-js-form-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-theme-js-form-js"> <arguments> <argument name="file" xsi:type="string">Magento_Theme::js/form.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-theme-js-sortable-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-theme-js-sortable-js"> <arguments> <argument name="file" xsi:type="string">Magento_Theme::js/sortable.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-theme-css-theme-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-theme-css-theme-css"> <arguments> <argument name="file" xsi:type="string">Magento_Theme::css/theme.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="prototype-windows-themes-default-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="prototype-windows-themes-default-css"> <arguments> <argument name="file" xsi:type="string">prototype/windows/themes/default.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> <arguments> <argument name="file" xsi:type="string">Magento_Core::prototype/magento.css</argument> </arguments> diff --git a/app/code/Magento/Page/view/adminhtml/title.phtml b/app/code/Magento/Theme/view/adminhtml/title.phtml similarity index 97% rename from app/code/Magento/Page/view/adminhtml/title.phtml rename to app/code/Magento/Theme/view/adminhtml/title.phtml index 2f01dabfb78..2d77a73116a 100644 --- a/app/code/Magento/Page/view/adminhtml/title.phtml +++ b/app/code/Magento/Theme/view/adminhtml/title.phtml @@ -25,7 +25,7 @@ */ /** - * @var $this \Magento\Page\Block\Html\Title + * @var $this \Magento\Theme\Block\Html\Title */ $titleId = ($this->getTitleId()) ? ' id="' . $this->getTitleId() . '"' : ''; $titleClass = ($this->getTitleClass()) ? ' ' . $this->getTitleClass() : ''; diff --git a/app/code/Magento/Page/view/frontend/1column.phtml b/app/code/Magento/Theme/view/frontend/1column.phtml similarity index 98% rename from app/code/Magento/Page/view/frontend/1column.phtml rename to app/code/Magento/Theme/view/frontend/1column.phtml index da0e81c630b..59049a49719 100644 --- a/app/code/Magento/Page/view/frontend/1column.phtml +++ b/app/code/Magento/Theme/view/frontend/1column.phtml @@ -25,7 +25,7 @@ ?> <?php /** - * Template for \Magento\Page\Block\Html + * Template for \Magento\Theme\Block\Html */ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; ?> diff --git a/app/code/Magento/Page/view/frontend/2columns-left.phtml b/app/code/Magento/Theme/view/frontend/2columns-left.phtml similarity index 98% rename from app/code/Magento/Page/view/frontend/2columns-left.phtml rename to app/code/Magento/Theme/view/frontend/2columns-left.phtml index 6af17516b68..eb2c28279c9 100644 --- a/app/code/Magento/Page/view/frontend/2columns-left.phtml +++ b/app/code/Magento/Theme/view/frontend/2columns-left.phtml @@ -25,7 +25,7 @@ ?> <?php /** - * Template for \Magento\Page\Block\Html + * Template for \Magento\Theme\Block\Html */ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; ?> diff --git a/app/code/Magento/Page/view/frontend/2columns-right.phtml b/app/code/Magento/Theme/view/frontend/2columns-right.phtml similarity index 98% rename from app/code/Magento/Page/view/frontend/2columns-right.phtml rename to app/code/Magento/Theme/view/frontend/2columns-right.phtml index 7b5aae3b2b8..e15b815a18a 100644 --- a/app/code/Magento/Page/view/frontend/2columns-right.phtml +++ b/app/code/Magento/Theme/view/frontend/2columns-right.phtml @@ -25,7 +25,7 @@ ?> <?php /** - * Template for \Magento\Page\Block\Html + * Template for \Magento\Theme\Block\Html */ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; ?> diff --git a/app/code/Magento/Page/view/frontend/3columns.phtml b/app/code/Magento/Theme/view/frontend/3columns.phtml similarity index 98% rename from app/code/Magento/Page/view/frontend/3columns.phtml rename to app/code/Magento/Theme/view/frontend/3columns.phtml index 565563d3fa9..1af951676bd 100644 --- a/app/code/Magento/Page/view/frontend/3columns.phtml +++ b/app/code/Magento/Theme/view/frontend/3columns.phtml @@ -25,7 +25,7 @@ ?> <?php /** - * Template for \Magento\Page\Block\Html + * Template for \Magento\Theme\Block\Html */ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; ?> diff --git a/app/code/Magento/Page/view/frontend/blank.phtml b/app/code/Magento/Theme/view/frontend/blank.phtml similarity index 95% rename from app/code/Magento/Page/view/frontend/blank.phtml rename to app/code/Magento/Theme/view/frontend/blank.phtml index 947fc6c18a9..587f0b3c067 100644 --- a/app/code/Magento/Page/view/frontend/blank.phtml +++ b/app/code/Magento/Theme/view/frontend/blank.phtml @@ -25,7 +25,7 @@ ?> <?php /** - * Blank page Template for \Magento\Page\Block\Html + * Blank page Template for \Magento\Theme\Block\Html */ ?> <?php echo $this->getChildHtml('content'); ?> diff --git a/app/code/Magento/Page/view/frontend/callouts/left_col.phtml b/app/code/Magento/Theme/view/frontend/callouts/left_col.phtml similarity index 100% rename from app/code/Magento/Page/view/frontend/callouts/left_col.phtml rename to app/code/Magento/Theme/view/frontend/callouts/left_col.phtml diff --git a/app/code/Magento/Page/view/frontend/callouts/right_col.phtml b/app/code/Magento/Theme/view/frontend/callouts/right_col.phtml similarity index 100% rename from app/code/Magento/Page/view/frontend/callouts/right_col.phtml rename to app/code/Magento/Theme/view/frontend/callouts/right_col.phtml diff --git a/app/code/Magento/Page/view/frontend/css/tabs.css b/app/code/Magento/Theme/view/frontend/css/tabs.css similarity index 100% rename from app/code/Magento/Page/view/frontend/css/tabs.css rename to app/code/Magento/Theme/view/frontend/css/tabs.css diff --git a/app/code/Magento/Page/view/frontend/css/validate.css b/app/code/Magento/Theme/view/frontend/css/validate.css similarity index 100% rename from app/code/Magento/Page/view/frontend/css/validate.css rename to app/code/Magento/Theme/view/frontend/css/validate.css diff --git a/app/code/Magento/Page/view/frontend/empty.phtml b/app/code/Magento/Theme/view/frontend/empty.phtml similarity index 98% rename from app/code/Magento/Page/view/frontend/empty.phtml rename to app/code/Magento/Theme/view/frontend/empty.phtml index ccdcbfcd6b0..cdf95a051c5 100644 --- a/app/code/Magento/Page/view/frontend/empty.phtml +++ b/app/code/Magento/Theme/view/frontend/empty.phtml @@ -25,7 +25,7 @@ ?> <?php /** - * Template for \Magento\Page\Block\Html + * Template for \Magento\Theme\Block\Html */ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; ?> diff --git a/app/code/Magento/Page/view/frontend/favicon.ico b/app/code/Magento/Theme/view/frontend/favicon.ico similarity index 100% rename from app/code/Magento/Page/view/frontend/favicon.ico rename to app/code/Magento/Theme/view/frontend/favicon.ico diff --git a/app/code/Magento/Page/view/frontend/html/block.phtml b/app/code/Magento/Theme/view/frontend/html/block.phtml similarity index 100% rename from app/code/Magento/Page/view/frontend/html/block.phtml rename to app/code/Magento/Theme/view/frontend/html/block.phtml diff --git a/app/code/Magento/Page/view/frontend/html/breadcrumbs.phtml b/app/code/Magento/Theme/view/frontend/html/breadcrumbs.phtml similarity index 100% rename from app/code/Magento/Page/view/frontend/html/breadcrumbs.phtml rename to app/code/Magento/Theme/view/frontend/html/breadcrumbs.phtml diff --git a/app/code/Magento/Page/view/frontend/html/bugreport.phtml b/app/code/Magento/Theme/view/frontend/html/bugreport.phtml similarity index 100% rename from app/code/Magento/Page/view/frontend/html/bugreport.phtml rename to app/code/Magento/Theme/view/frontend/html/bugreport.phtml diff --git a/app/code/Magento/Page/view/frontend/html/copyright.phtml b/app/code/Magento/Theme/view/frontend/html/copyright.phtml similarity index 100% rename from app/code/Magento/Page/view/frontend/html/copyright.phtml rename to app/code/Magento/Theme/view/frontend/html/copyright.phtml diff --git a/app/code/Magento/Page/view/frontend/html/footer.phtml b/app/code/Magento/Theme/view/frontend/html/footer.phtml similarity index 100% rename from app/code/Magento/Page/view/frontend/html/footer.phtml rename to app/code/Magento/Theme/view/frontend/html/footer.phtml diff --git a/app/code/Magento/Page/view/frontend/html/head.phtml b/app/code/Magento/Theme/view/frontend/html/head.phtml similarity index 100% rename from app/code/Magento/Page/view/frontend/html/head.phtml rename to app/code/Magento/Theme/view/frontend/html/head.phtml diff --git a/app/code/Magento/Page/view/frontend/html/header.phtml b/app/code/Magento/Theme/view/frontend/html/header.phtml similarity index 95% rename from app/code/Magento/Page/view/frontend/html/header.phtml rename to app/code/Magento/Theme/view/frontend/html/header.phtml index d7747717eee..d4cf4564380 100644 --- a/app/code/Magento/Page/view/frontend/html/header.phtml +++ b/app/code/Magento/Theme/view/frontend/html/header.phtml @@ -23,14 +23,14 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** - * @var \Magento\Page\Block\Html\Header $this + * @var \Magento\Theme\Block\Html\Header $this */ ?> <?php switch($this->getShowPart()): case 'logo': ?> <?php $storeName = $this->getThemeName() ? $this->getThemeName() : $this->getLogoAlt();?> - <?php if ($this->getIsHomePage()):?> + <?php if ($this->isHomePage()):?> <strong class="logo"> <img src="<?php echo $this->getLogoSrc() ?>" alt="<?php echo $this->getLogoAlt() ?>" /> </strong> diff --git a/app/code/Magento/Page/view/frontend/html/notices.phtml b/app/code/Magento/Theme/view/frontend/html/notices.phtml similarity index 96% rename from app/code/Magento/Page/view/frontend/html/notices.phtml rename to app/code/Magento/Theme/view/frontend/html/notices.phtml index 7814e18e1c7..ccd407388ab 100644 --- a/app/code/Magento/Page/view/frontend/html/notices.phtml +++ b/app/code/Magento/Theme/view/frontend/html/notices.phtml @@ -25,7 +25,7 @@ ?> <?php /** - * @var $this \Magento\Page\Block\Html\Notices + * @var $this \Magento\Theme\Block\Html\Notices */ ?> <?php if ($this->displayNoscriptNotice()): ?> @@ -57,7 +57,7 @@ // <![CDATA[ (function($) { head.js("<?php echo $this->getViewFileUrl('mage/cookies.js')?>", - "<?php echo $this->getViewFileUrl('Magento_Page::js/notices.js')?>", function() { + "<?php echo $this->getViewFileUrl('Magento_Theme::js/notices.js')?>", function() { $('#notice-cookie-block').cookieBlock({ cookieAllowButtonSelector: '#btn-cookie-allow', cookieName: '<?php echo \Magento\Core\Helper\Cookie::IS_USER_ALLOWED_SAVE_COOKIE ?>', diff --git a/app/code/Magento/Page/view/frontend/html/pager.phtml b/app/code/Magento/Theme/view/frontend/html/pager.phtml similarity index 98% rename from app/code/Magento/Page/view/frontend/html/pager.phtml rename to app/code/Magento/Theme/view/frontend/html/pager.phtml index 689cd83158f..d4cf5ebc570 100644 --- a/app/code/Magento/Page/view/frontend/html/pager.phtml +++ b/app/code/Magento/Theme/view/frontend/html/pager.phtml @@ -27,7 +27,7 @@ /** * Pager template * - * @see \Magento\Page\Block\Html\Pager + * @see \Magento\Theme\Block\Html\Pager */ ?> <?php if($this->getCollection()->getSize()): ?> @@ -48,7 +48,7 @@ </p> <?php endif ?> - <?php if($this->getShowPerPage()): ?> + <?php if($this->isShowPerPage()): ?> <div class="limiter"> <strong class="label"><?php echo __('Show') ?></strong> <select id="limiter" data-mage-redirect="{'event':'change'}"> diff --git a/app/code/Magento/Page/view/frontend/html/title.phtml b/app/code/Magento/Theme/view/frontend/html/title.phtml similarity index 97% rename from app/code/Magento/Page/view/frontend/html/title.phtml rename to app/code/Magento/Theme/view/frontend/html/title.phtml index f0bb0228b0a..f41b6a64961 100644 --- a/app/code/Magento/Page/view/frontend/html/title.phtml +++ b/app/code/Magento/Theme/view/frontend/html/title.phtml @@ -24,7 +24,7 @@ */ /** - * @var $this \Magento\Page\Block\Html\Title + * @var $this \Magento\Theme\Block\Html\Title */ $cssClass = $this->getCssClass() ? ' ' . $this->getCssClass() : ''; $prefix = $this->getPrefix() ? '<span class="prefix">' . $this->getPrefix() . '</span>' : ''; diff --git a/app/code/Magento/Page/view/frontend/html/topmenu.phtml b/app/code/Magento/Theme/view/frontend/html/topmenu.phtml similarity index 92% rename from app/code/Magento/Page/view/frontend/html/topmenu.phtml rename to app/code/Magento/Theme/view/frontend/html/topmenu.phtml index 98335cf91d3..f22e58fa13e 100644 --- a/app/code/Magento/Page/view/frontend/html/topmenu.phtml +++ b/app/code/Magento/Theme/view/frontend/html/topmenu.phtml @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category design - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ @@ -28,7 +26,7 @@ /** * Top menu for store * - * @see \Magento\Page\Block\Html\Topmenu + * @see \Magento\Theme\Block\Html\Topmenu */ ?> <?php $columnsLimit = $this->getColumnsLimit() ? : 0; ?> diff --git a/app/code/Magento/Page/view/frontend/images/validation_advice_bg.gif b/app/code/Magento/Theme/view/frontend/images/validation_advice_bg.gif similarity index 100% rename from app/code/Magento/Page/view/frontend/images/validation_advice_bg.gif rename to app/code/Magento/Theme/view/frontend/images/validation_advice_bg.gif diff --git a/app/code/Magento/Page/view/frontend/js/calendar.phtml b/app/code/Magento/Theme/view/frontend/js/calendar.phtml similarity index 98% rename from app/code/Magento/Page/view/frontend/js/calendar.phtml rename to app/code/Magento/Theme/view/frontend/js/calendar.phtml index 60228433b46..1f8b3003f6e 100644 --- a/app/code/Magento/Page/view/frontend/js/calendar.phtml +++ b/app/code/Magento/Theme/view/frontend/js/calendar.phtml @@ -28,7 +28,7 @@ /** * Calendar localization script. Should be put into page header. * - * @see \Magento\View\Block\Html\Calendar + * @see \Magento\View\Element\Html\Calendar */ ?> diff --git a/app/code/Magento/Page/view/frontend/js/components.phtml b/app/code/Magento/Theme/view/frontend/js/components.phtml similarity index 100% rename from app/code/Magento/Page/view/frontend/js/components.phtml rename to app/code/Magento/Theme/view/frontend/js/components.phtml diff --git a/app/code/Magento/Page/view/frontend/js/cookie.phtml b/app/code/Magento/Theme/view/frontend/js/cookie.phtml similarity index 97% rename from app/code/Magento/Page/view/frontend/js/cookie.phtml rename to app/code/Magento/Theme/view/frontend/js/cookie.phtml index a9608cdec6b..bd4ac1b93e0 100644 --- a/app/code/Magento/Page/view/frontend/js/cookie.phtml +++ b/app/code/Magento/Theme/view/frontend/js/cookie.phtml @@ -28,7 +28,7 @@ /** * Cookie settings initialization script * - * @see \Magento\Page\Block\Js\Cookie + * @see \Magento\View\Element\Js\Cookie */ ?> diff --git a/app/code/Magento/Page/view/frontend/js/notices.js b/app/code/Magento/Theme/view/frontend/js/notices.js similarity index 100% rename from app/code/Magento/Page/view/frontend/js/notices.js rename to app/code/Magento/Theme/view/frontend/js/notices.js diff --git a/app/code/Magento/Page/view/frontend/js/row-builder.js b/app/code/Magento/Theme/view/frontend/js/row-builder.js similarity index 100% rename from app/code/Magento/Page/view/frontend/js/row-builder.js rename to app/code/Magento/Theme/view/frontend/js/row-builder.js diff --git a/app/code/Magento/Page/view/frontend/js/truncate.js b/app/code/Magento/Theme/view/frontend/js/truncate.js similarity index 100% rename from app/code/Magento/Page/view/frontend/js/truncate.js rename to app/code/Magento/Theme/view/frontend/js/truncate.js diff --git a/app/code/Magento/Page/view/frontend/layout/default.xml b/app/code/Magento/Theme/view/frontend/layout/default.xml similarity index 68% rename from app/code/Magento/Page/view/frontend/layout/default.xml rename to app/code/Magento/Theme/view/frontend/layout/default.xml index f1fa0ada26f..351dc08899e 100644 --- a/app/code/Magento/Page/view/frontend/layout/default.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default.xml @@ -24,28 +24,28 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\Page\Block\Html" name="root" output="1" template="3columns.phtml"> - <block class="Magento\Page\Block\Html\Head" name="head" as="head"> - <block class="Magento\Page\Block\Js\Cookie" name="js_cookies" template="js/cookie.phtml"/> + <block class="Magento\Theme\Block\Html" name="root" output="1" template="3columns.phtml"> + <block class="Magento\Theme\Block\Html\Head" name="head" as="head"> + <block class="Magento\View\Element\Js\Cookie" name="js_cookies" template="Magento_Theme:js/cookie.phtml"/> </block> <container name="after_body_start" as="after_body_start" label="Page Top"/> <container name="header-container" label="Page Header Container" as="header-container" htmlTag="header" htmlClass="header"> <container name="header.panel" label="Page Header Panel" htmlTag="div" htmlClass="panel"> - <block class="Magento\Page\Block\Switcher" name="store_language" as="store_language" template="switch/languages.phtml"/> + <block class="Magento\Core\Block\Switcher" name="store_language" as="store_language" template="switch/languages.phtml"/> </container> <container name="header" label="Page Header" as="header" htmlTag="div" htmlClass="content"> - <block class="Magento\Page\Block\Html\Header" name="logo"> + <block class="Magento\Theme\Block\Html\Header" name="logo"> <arguments> <argument name="show_part" xsi:type="string">logo</argument> </arguments> </block> - <block class="Magento\Page\Block\Links" name="top.links"/> + <block class="Magento\View\Element\Html\Links" name="top.links"/> </container> </container> <container name="page_top" as="page_top" label="After Page Header"> - <block class="Magento\Page\Block\Html\Topmenu" name="catalog.topnav" template="html/topmenu.phtml"/> + <block class="Magento\Theme\Block\Html\Topmenu" name="catalog.topnav" template="html/topmenu.phtml"/> <container name="top.container" as="topContainer" label="After Page Header Top" htmlTag="div" htmlClass="top-container"/> - <block class="Magento\Page\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> + <block class="Magento\Theme\Block\Html\Breadcrumbs" name="breadcrumbs" as="breadcrumbs"/> </container> <!-- <container name="page_main" as="page_main" label="Page main" htmlTag="div" htmlClass="columns"> @@ -58,10 +58,10 @@ </container> --> <container name="columns.top" label="Before Main Columns" as="columns_top"> - <block class="Magento\Page\Block\Html\Title" name="page.main.title" template="html/title.phtml"/> + <block class="Magento\Theme\Block\Html\Title" name="page.main.title" template="html/title.phtml"/> <container name="page.messages" label="invisible" htmlTag="div" htmlClass="page messages"> - <block class="Magento\View\Block\Messages" name="global_messages" as="global_messages"/> - <block class="Magento\View\Block\Messages" name="messages" as="messages"/> + <block class="Magento\View\Element\Messages" name="global_messages" as="global_messages"/> + <block class="Magento\View\Element\Messages" name="messages" as="messages"/> </container> </container> <container name="main" as="main" label="Main Content Container" htmlTag="div" htmlClass="column main"> @@ -77,93 +77,93 @@ </container> <container name="footer-container" as="footer" label="Page Footer Container" htmlTag="footer" htmlClass="footer"> <container name="footer" as="footer" label="Page Footer" htmlTag="div" htmlClass="content"> - <block class="Magento\Page\Block\Switcher" name="store_switcher" as="store_switcher" template="switch/stores.phtml"/> - <block class="Magento\Page\Block\Links" name="footer_links"/> - <block class="Magento\Page\Block\Html\Footer" name="copyright" template="html/copyright.phtml"/> - <block class="Magento\View\Block\Template" name="report.bugs" template="Magento_Page::html/bugreport.phtml" /> + <block class="Magento\Core\Block\Switcher" name="store_switcher" as="store_switcher" template="switch/stores.phtml"/> + <block class="Magento\View\Element\Html\Links" name="footer_links"/> + <block class="Magento\Theme\Block\Html\Footer" name="copyright" template="html/copyright.phtml"/> + <block class="Magento\View\Element\Template" name="report.bugs" template="Magento_Theme::html/bugreport.phtml" /> </container> </container> <container name="before_body_end" as="before_body_end" label="Page Bottom"> - <block class="Magento\Page\Block\Html\Notices" name="global_notices" template="html/notices.phtml"/> + <block class="Magento\Theme\Block\Html\Notices" name="global_notices" template="html/notices.phtml"/> </container> </block> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="mage-calendar-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mage-calendar-css"> <arguments> <argument name="file" xsi:type="string">mage/calendar.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-jquery-no-conflict-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-jquery-no-conflict-js"> <arguments> <argument name="file" xsi:type="string">mage/jquery-no-conflict.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="head-load-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="head-load-min-js"> <arguments> <argument name="file" xsi:type="string">head.load.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-mage-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-mage-js"> <arguments> <argument name="file" xsi:type="string">mage/mage.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-decorate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-decorate-js"> <arguments> <argument name="file" xsi:type="string">mage/decorate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-translate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-translate-js"> <arguments> <argument name="file" xsi:type="string">mage/translate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-cookies-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-cookies-js"> <arguments> <argument name="file" xsi:type="string">mage/cookies.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-ui-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-ui-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery-ui.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-tmpl-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-tmpl-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.tmpl.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-bootstrap-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-bootstrap-js"> <arguments> <argument name="file" xsi:type="string">mage/bootstrap.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-page-js-truncate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-page-js-truncate-js"> <arguments> - <argument name="file" xsi:type="string">Magento_Page::js/truncate.js</argument> + <argument name="file" xsi:type="string">Magento_Theme::js/truncate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-common-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-common-js"> <arguments> <argument name="file" xsi:type="string">mage/common.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-toggle-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-toggle-js"> <arguments> <argument name="file" xsi:type="string">mage/toggle.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-popup-window-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-popup-window-js"> <arguments> <argument name="file" xsi:type="string">mage/popup-window.js</argument> </arguments> </block> - <block class="Magento\View\Block\Template" name="head.components" as="components" template="Magento_Page::js/components.phtml"/> + <block class="Magento\View\Element\Template" name="head.components" as="components" template="Magento_Theme::js/components.phtml"/> </referenceBlock> <update handle="default_head_blocks"/> </layout> diff --git a/app/code/Magento/Page/view/frontend/layout/default_head_blocks.xml b/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml similarity index 69% rename from app/code/Magento/Page/view/frontend/layout/default_head_blocks.xml rename to app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml index 3e826235e57..256b3256ab0 100644 --- a/app/code/Magento/Page/view/frontend/layout/default_head_blocks.xml +++ b/app/code/Magento/Theme/view/frontend/layout/default_head_blocks.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-calendar-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-calendar-css"> <arguments> <argument name="file" xsi:type="string">mage/calendar.css</argument> <argument name="properties" xsi:type="array"> @@ -33,90 +33,90 @@ </argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-jquery-no-conflict-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-jquery-no-conflict-js"> <arguments> <argument name="file" xsi:type="string">mage/jquery-no-conflict.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="head-load-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="head-load-min-js"> <arguments> <argument name="file" xsi:type="string">head.load.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-magento-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-magento-js"> <arguments> <argument name="file" xsi:type="string">mage/mage.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-decorate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-decorate-js"> <arguments> <argument name="file" xsi:type="string">mage/decorate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-translate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-translate-js"> <arguments> <argument name="file" xsi:type="string">mage/translate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-cookies-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-cookies-js"> <arguments> <argument name="file" xsi:type="string">mage/cookies.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-ui-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-ui-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery-ui.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-tmpl-min-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-tmpl-min-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.tmpl.min.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-bootstrap-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-bootstrap-js"> <arguments> <argument name="file" xsi:type="string">mage/bootstrap.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-page-js-truncate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-page-js-truncate-js"> <arguments> - <argument name="file" xsi:type="string">Magento_Page::js/truncate.js</argument> + <argument name="file" xsi:type="string">Magento_Theme::js/truncate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-common-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-common-js"> <arguments> <argument name="file" xsi:type="string">mage/common.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-toggle-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-toggle-js"> <arguments> <argument name="file" xsi:type="string">mage/toggle.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-popup-window-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-popup-window-js"> <arguments> <argument name="file" xsi:type="string">mage/popup-window.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-page-css-tabs-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-page-css-tabs-css"> <arguments> - <argument name="file" xsi:type="string">Magento_Page::css/tabs.css</argument> + <argument name="file" xsi:type="string">Magento_Theme::css/tabs.css</argument> <argument name="properties" xsi:type="array"> <item name="attributes" xsi:type="string"/> </argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-loader-js"> <arguments> <argument name="file" xsi:type="string">mage/loader.js</argument> </arguments> </block> <!-- Preload resources for widgets --> - <block class="Magento\Page\Block\Js\Components" name="head.components" as="components" template="Magento_Page::js/components.phtml"/> + <block class="Magento\View\Element\Js\Components" name="head.components" as="components" template="Magento_Theme::js/components.phtml"/> </referenceBlock> </layout> diff --git a/app/code/Magento/Page/view/frontend/layout/page_calendar.xml b/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml similarity index 81% rename from app/code/Magento/Page/view/frontend/layout/page_calendar.xml rename to app/code/Magento/Theme/view/frontend/layout/page_calendar.xml index 3ce05b304eb..6309276d037 100644 --- a/app/code/Magento/Page/view/frontend/layout/page_calendar.xml +++ b/app/code/Magento/Theme/view/frontend/layout/page_calendar.xml @@ -25,18 +25,18 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-ui-timepicker-addon-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-ui-timepicker-addon-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery-ui-timepicker-addon.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-calendar-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-calendar-js"> <arguments> <argument name="file" xsi:type="string">mage/calendar.js</argument> </arguments> </block> </referenceBlock> <referenceContainer name="content"> - <block class="Magento\View\Block\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Page::js/calendar.phtml"/> + <block class="Magento\View\Element\Html\Calendar" name="html_calendar" as="html_calendar" template="Magento_Theme::js/calendar.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Page/view/frontend/layout/page_empty.xml b/app/code/Magento/Theme/view/frontend/layout/page_empty.xml similarity index 100% rename from app/code/Magento/Page/view/frontend/layout/page_empty.xml rename to app/code/Magento/Theme/view/frontend/layout/page_empty.xml diff --git a/app/code/Magento/Page/view/frontend/layout/page_one_column.xml b/app/code/Magento/Theme/view/frontend/layout/page_one_column.xml similarity index 100% rename from app/code/Magento/Page/view/frontend/layout/page_one_column.xml rename to app/code/Magento/Theme/view/frontend/layout/page_one_column.xml diff --git a/app/code/Magento/Page/view/frontend/layout/page_three_columns.xml b/app/code/Magento/Theme/view/frontend/layout/page_three_columns.xml similarity index 100% rename from app/code/Magento/Page/view/frontend/layout/page_three_columns.xml rename to app/code/Magento/Theme/view/frontend/layout/page_three_columns.xml diff --git a/app/code/Magento/Page/view/frontend/layout/page_two_columns_left.xml b/app/code/Magento/Theme/view/frontend/layout/page_two_columns_left.xml similarity index 100% rename from app/code/Magento/Page/view/frontend/layout/page_two_columns_left.xml rename to app/code/Magento/Theme/view/frontend/layout/page_two_columns_left.xml diff --git a/app/code/Magento/Page/view/frontend/layout/page_two_columns_right.xml b/app/code/Magento/Theme/view/frontend/layout/page_two_columns_right.xml similarity index 100% rename from app/code/Magento/Page/view/frontend/layout/page_two_columns_right.xml rename to app/code/Magento/Theme/view/frontend/layout/page_two_columns_right.xml diff --git a/app/code/Magento/Page/view/frontend/layout/print.xml b/app/code/Magento/Theme/view/frontend/layout/print.xml similarity index 85% rename from app/code/Magento/Page/view/frontend/layout/print.xml rename to app/code/Magento/Theme/view/frontend/layout/print.xml index 80491f76177..9ca3634da5d 100644 --- a/app/code/Magento/Page/view/frontend/layout/print.xml +++ b/app/code/Magento/Theme/view/frontend/layout/print.xml @@ -24,14 +24,14 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\Page\Block\Html" name="root" output="1" template="print.phtml"> - <block class="Magento\Page\Block\Html\Head" name="head" as="head"/> + <block class="Magento\Theme\Block\Html" name="root" output="1" template="print.phtml"> + <block class="Magento\Theme\Block\Html\Head" name="head" as="head"/> <container name="after_body_start" as="after_body_start" label="Page Top"/> <container name="content" as="content" label="Main Content Area"/> </block> <update handle="default_head_blocks"/> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="css-print-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="css-print-css"> <arguments> <argument name="file" xsi:type="string">css/print.css</argument> </arguments> diff --git a/app/code/Magento/Page/view/frontend/link.phtml b/app/code/Magento/Theme/view/frontend/link.phtml similarity index 96% rename from app/code/Magento/Page/view/frontend/link.phtml rename to app/code/Magento/Theme/view/frontend/link.phtml index 80df79fcd12..793bb875c7e 100644 --- a/app/code/Magento/Page/view/frontend/link.phtml +++ b/app/code/Magento/Theme/view/frontend/link.phtml @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ /** - * @var $this \Magento\Page\Block\Link + * @var $this \Magento\View\Element\Html\Link */ ?> <li> diff --git a/app/code/Magento/Page/view/frontend/menu.js b/app/code/Magento/Theme/view/frontend/menu.js similarity index 100% rename from app/code/Magento/Page/view/frontend/menu.js rename to app/code/Magento/Theme/view/frontend/menu.js diff --git a/app/code/Magento/Page/view/frontend/page.phtml b/app/code/Magento/Theme/view/frontend/page.phtml similarity index 98% rename from app/code/Magento/Page/view/frontend/page.phtml rename to app/code/Magento/Theme/view/frontend/page.phtml index bea91f0711d..031b34fbbde 100644 --- a/app/code/Magento/Page/view/frontend/page.phtml +++ b/app/code/Magento/Theme/view/frontend/page.phtml @@ -25,7 +25,7 @@ ?> <?php /** - * Template for \Magento\Page\Block\Html + * Template for \Magento\Theme\Block\Html */ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; ?> diff --git a/app/code/Magento/Page/view/frontend/popup.phtml b/app/code/Magento/Theme/view/frontend/popup.phtml similarity index 97% rename from app/code/Magento/Page/view/frontend/popup.phtml rename to app/code/Magento/Theme/view/frontend/popup.phtml index fcf6f9c669a..04702e6856d 100644 --- a/app/code/Magento/Page/view/frontend/popup.phtml +++ b/app/code/Magento/Theme/view/frontend/popup.phtml @@ -25,7 +25,7 @@ ?> <?php /** - * Template for \Magento\Page\Block\Html + * Template for \Magento\Theme\Block\Html */ $bodyCss = $this->getBodyClass() ? $this->getBodyClass() : ''; ?> diff --git a/app/code/Magento/Page/view/frontend/print.phtml b/app/code/Magento/Theme/view/frontend/print.phtml similarity index 98% rename from app/code/Magento/Page/view/frontend/print.phtml rename to app/code/Magento/Theme/view/frontend/print.phtml index 157e58e456e..e6f0aba0709 100644 --- a/app/code/Magento/Page/view/frontend/print.phtml +++ b/app/code/Magento/Theme/view/frontend/print.phtml @@ -26,7 +26,7 @@ ?> <?php /** - * Template for \Magento\Page\Block\Html + * Template for \Magento\Theme\Block\Html */ ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> diff --git a/app/code/Magento/Page/view/install/favicon.ico b/app/code/Magento/Theme/view/install/favicon.ico similarity index 100% rename from app/code/Magento/Page/view/install/favicon.ico rename to app/code/Magento/Theme/view/install/favicon.ico diff --git a/app/code/Magento/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php b/app/code/Magento/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php index b4f4d87c19f..44abf13d724 100644 --- a/app/code/Magento/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php +++ b/app/code/Magento/Usa/Block/Adminhtml/Dhl/Unitofmeasure.php @@ -48,23 +48,21 @@ class Unitofmeasure extends \Magento\Backend\Block\System\Config\Form\Field */ protected $_shippingDhl; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Usa\Model\Shipping\Carrier\Dhl\International $shippingDhl - * @param \Magento\Usa\Helper\Data $usaData - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Usa\Model\Shipping\Carrier\Dhl\International $shippingDhl + * @param \Magento\Usa\Helper\Data $usaData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Usa\Model\Shipping\Carrier\Dhl\International $shippingDhl, - \Magento\Usa\Helper\Data $usaData, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Usa\Model\Shipping\Carrier\Dhl\International $shippingDhl, + \Magento\Usa\Helper\Data $usaData, + array $data = array() + ) { $this->_shippingDhl = $shippingDhl; $this->_usaData = $usaData; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Usa/Helper/Data.php b/app/code/Magento/Usa/Helper/Data.php index 34c9dcfe0e7..b4e58f212c9 100644 --- a/app/code/Magento/Usa/Helper/Data.php +++ b/app/code/Magento/Usa/Helper/Data.php @@ -39,13 +39,11 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_locale; /** - * @param \Magento\Core\Model\LocaleInterface $locale * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Model\LocaleInterface $locale */ - public function __construct( - \Magento\Core\Model\LocaleInterface $locale, - \Magento\App\Helper\Context $context - ) { + public function __construct(\Magento\App\Helper\Context $context, \Magento\Core\Model\LocaleInterface $locale) + { $this->_locale = $locale; parent::__construct($context); } diff --git a/app/code/Magento/User/Block/Buttons.php b/app/code/Magento/User/Block/Buttons.php index 623c6903065..511d10f6075 100644 --- a/app/code/Magento/User/Block/Buttons.php +++ b/app/code/Magento/User/Block/Buttons.php @@ -36,20 +36,18 @@ class Buttons extends \Magento\Backend\Block\Template */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _prepareLayout() diff --git a/app/code/Magento/User/Block/Role/Edit.php b/app/code/Magento/User/Block/Role/Edit.php index 61b886e6002..8fee642cb5d 100644 --- a/app/code/Magento/User/Block/Role/Edit.php +++ b/app/code/Magento/User/Block/Role/Edit.php @@ -35,22 +35,22 @@ class Edit extends \Magento\Backend\Block\Widget\Tabs */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $authSession, $data); + parent::__construct($context, $jsonEncoder, $authSession, $data); } protected function _construct() diff --git a/app/code/Magento/User/Block/Role/Grid/User.php b/app/code/Magento/User/Block/Role/Grid/User.php index fff67ba887e..7977db72380 100644 --- a/app/code/Magento/User/Block/Role/Grid/User.php +++ b/app/code/Magento/User/Block/Role/Grid/User.php @@ -43,23 +43,29 @@ class User extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_roleFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\Core\Model\Registry $coreRegistry - * @param \Magento\User\Model\RoleFactory $roleFactory - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\User\Model\RoleFactory $roleFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\Core\Model\Registry $coreRegistry, - \Magento\User\Model\RoleFactory $roleFactory, - array $data = array() - ) { - parent::__construct($context, $coreData, $urlModel, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Core\Model\Registry $coreRegistry, + \Magento\User\Model\RoleFactory $roleFactory, + array $data = array() + ) { + parent::__construct($context, $urlModel, $data); + $this->_jsonEncoder = $jsonEncoder; $this->_coreRegistry = $coreRegistry; $this->_roleFactory = $roleFactory; } @@ -200,7 +206,7 @@ class User extends \Magento\Backend\Block\Widget\Grid\Extended foreach ($users as $usrid) { $jsonUsers[$usrid] = 0; } - return $this->_coreData->jsonEncode((object)$jsonUsers); + return $this->_jsonEncoder->encode((object)$jsonUsers); } else { return array_values($users); } diff --git a/app/code/Magento/User/Block/Role/Tab/Edit.php b/app/code/Magento/User/Block/Role/Tab/Edit.php index e4ed31ddd88..3b0cd726a47 100644 --- a/app/code/Magento/User/Block/Role/Tab/Edit.php +++ b/app/code/Magento/User/Block/Role/Tab/Edit.php @@ -25,7 +25,7 @@ namespace Magento\User\Block\Role\Tab; /** - * Rolesedit Tab Display Block + * Rolesedit Tab Display Block. * * @SuppressWarnings(PHPMD.LongVariable) */ @@ -63,29 +63,33 @@ class Edit extends \Magento\Backend\Block\Widget\Form */ protected $_aclResourceProvider; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Acl\RootResource $rootResource - * @param \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollectionFactory - * @param \Magento\Acl\Builder $aclBuilder - * @param \Magento\Acl\Resource\ProviderInterface $aclResourceProvider - * @param array $data + /** @var \Magento\Integration\Helper\Data */ + protected $_integrationData; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Acl\RootResource $rootResource + * @param \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollectionFactory + * @param \Magento\Acl\Builder $aclBuilder + * @param \Magento\Acl\Resource\ProviderInterface $aclResourceProvider + * @param \Magento\Integration\Helper\Data $integrationData + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Acl\RootResource $rootResource, - \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollectionFactory, - \Magento\Acl\Builder $aclBuilder, - \Magento\Acl\Resource\ProviderInterface $aclResourceProvider, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Acl\RootResource $rootResource, + \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollectionFactory, + \Magento\Acl\Builder $aclBuilder, + \Magento\Acl\Resource\ProviderInterface $aclResourceProvider, + \Magento\Integration\Helper\Data $integrationData, + array $data = array() + ) { $this->_aclBuilder = $aclBuilder; $this->_rootResource = $rootResource; $this->_rulesCollectionFactory = $rulesCollectionFactory; $this->_aclResourceProvider = $aclResourceProvider; - parent::__construct($context, $coreData, $data); + $this->_integrationData = $integrationData; + parent::__construct($context, $data); } /** @@ -170,32 +174,9 @@ class Edit extends \Magento\Backend\Block\Widget\Form public function getTree() { $resources = $this->_aclResourceProvider->getAclResources(); - $rootArray = $this->_mapResources( + $rootArray = $this->_integrationData->mapResources( isset($resources[1]['children']) ? $resources[1]['children'] : array() ); return $rootArray; } - - /** - * Map resources - * - * @param array $resources - * @return array - */ - protected function _mapResources(array $resources) - { - $output = array(); - foreach ($resources as $resource) { - $item = array(); - $item['attr']['data-id'] = $resource['id']; - $item['data'] = __($resource['title']); - $item['children'] = array(); - if (isset($resource['children'])) { - $item['state'] = 'open'; - $item['children'] = $this->_mapResources($resource['children']); - } - $output[] = $item; - } - return $output; - } } diff --git a/app/code/Magento/User/Block/Role/Tab/Users.php b/app/code/Magento/User/Block/Role/Tab/Users.php index 0949a65ef70..07d70ed3f07 100644 --- a/app/code/Magento/User/Block/Role/Tab/Users.php +++ b/app/code/Magento/User/Block/Role/Tab/Users.php @@ -38,23 +38,23 @@ class Users extends \Magento\Backend\Block\Widget\Tabs */ protected $_userCollectionFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param \Magento\User\Model\Resource\User\CollectionFactory $userCollectionFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param \Magento\User\Model\Resource\User\CollectionFactory $userCollectionFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Backend\Model\Auth\Session $authSession, - \Magento\User\Model\Resource\User\CollectionFactory $userCollectionFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Backend\Model\Auth\Session $authSession, + \Magento\User\Model\Resource\User\CollectionFactory $userCollectionFactory, + array $data = array() + ) { // _userCollectionFactory is used in parent::__construct $this->_userCollectionFactory = $userCollectionFactory; - parent::__construct($context, $coreData, $authSession, $data); + parent::__construct($context, $jsonEncoder, $authSession, $data); } protected function _construct() diff --git a/app/code/Magento/User/Block/User.php b/app/code/Magento/User/Block/User.php index 487dd734bd6..a52ff36e843 100644 --- a/app/code/Magento/User/Block/User.php +++ b/app/code/Magento/User/Block/User.php @@ -40,19 +40,17 @@ class User extends \Magento\Backend\Block\Widget\Grid\Container */ protected $_resourceModel; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\User\Model\Resource\User $resourceModel - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\User\Model\Resource\User $resourceModel + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\User\Model\Resource\User $resourceModel, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\User\Model\Resource\User $resourceModel, + array $data = array() + ) { + parent::__construct($context, $data); $this->_resourceModel = $resourceModel; } diff --git a/app/code/Magento/User/Block/User/Edit.php b/app/code/Magento/User/Block/User/Edit.php index d86ccca1e51..a2fb1363bb7 100644 --- a/app/code/Magento/User/Block/User/Edit.php +++ b/app/code/Magento/User/Block/User/Edit.php @@ -42,20 +42,18 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } protected function _construct() diff --git a/app/code/Magento/User/Block/User/Edit/Tab/Main.php b/app/code/Magento/User/Block/User/Edit/Tab/Main.php index 6d772e05bed..7231a26380a 100644 --- a/app/code/Magento/User/Block/User/Edit/Tab/Main.php +++ b/app/code/Magento/User/Block/User/Edit/Tab/Main.php @@ -36,24 +36,22 @@ class Main extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_authSession; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Backend\Model\Auth\Session $authSession - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Backend\Model\Auth\Session $authSession + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Backend\Model\Auth\Session $authSession, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Backend\Model\Auth\Session $authSession, + array $data = array() + ) { $this->_authSession = $authSession; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/User/Block/User/Edit/Tab/Roles.php b/app/code/Magento/User/Block/User/Edit/Tab/Roles.php index f9c44c6e275..590c5a5d4c8 100644 --- a/app/code/Magento/User/Block/User/Edit/Tab/Roles.php +++ b/app/code/Magento/User/Block/User/Edit/Tab/Roles.php @@ -41,25 +41,31 @@ class Roles extends \Magento\Backend\Block\Widget\Grid\Extended */ protected $_userRolesFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Url $urlModel - * @param \Magento\User\Model\Resource\Role\CollectionFactory $userRolesFactory - * @param \Magento\Core\Model\Registry $coreRegistry - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Core\Model\Url $urlModel + * @param \Magento\User\Model\Resource\Role\CollectionFactory $userRolesFactory + * @param \Magento\Core\Model\Registry $coreRegistry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Url $urlModel, - \Magento\User\Model\Resource\Role\CollectionFactory $userRolesFactory, - \Magento\Core\Model\Registry $coreRegistry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Url $urlModel, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\User\Model\Resource\Role\CollectionFactory $userRolesFactory, + \Magento\Core\Model\Registry $coreRegistry, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_userRolesFactory = $userRolesFactory; $this->_coreRegistry = $coreRegistry; - parent::__construct($context, $coreData, $urlModel, $data); + parent::__construct($context, $urlModel, $data); } protected function _construct() @@ -147,7 +153,7 @@ class Roles extends \Magento\Backend\Block\Widget\Grid\Extended foreach ($uRoles as $urid) { $jsonRoles[$urid] = 0; } - return $this->_coreData->jsonEncode((object)$jsonRoles); + return $this->_jsonEncoder->encode((object)$jsonRoles); } else { return $uRoles; } diff --git a/app/code/Magento/User/Controller/Adminhtml/User/Role.php b/app/code/Magento/User/Controller/Adminhtml/User/Role.php index 513459cf01c..8340c121e89 100644 --- a/app/code/Magento/User/Controller/Adminhtml/User/Role.php +++ b/app/code/Magento/User/Controller/Adminhtml/User/Role.php @@ -22,14 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** - * \Magento\User roles controller - */ namespace Magento\User\Controller\Adminhtml\User; +use Magento\User\Model\Acl\Role\Group as RoleGroup; + class Role extends \Magento\Backend\App\AbstractAction { - /** * Core registry * @@ -92,7 +90,7 @@ class Role extends \Magento\Backend\App\AbstractAction /** * Preparing layout for output * - * @return \Magento\User\Controller\Adminhtml\User\Role + * @return Role */ protected function _initAction() { @@ -116,7 +114,7 @@ class Role extends \Magento\Backend\App\AbstractAction $role = $this->_roleFactory->create()->load($this->getRequest()->getParam($requestVariable)); // preventing edit of relation role - if ($role->getId() && $role->getRoleType() != 'G') { + if ($role->getId() && $role->getRoleType() != RoleGroup::ROLE_TYPE) { $role->unsetData($role->getIdFieldName()); } @@ -242,7 +240,7 @@ class Role extends \Magento\Backend\App\AbstractAction $role->setName($roleName) ->setPid($this->getRequest()->getParam('parent_id', false)) - ->setRoleType('G'); + ->setRoleType(RoleGroup::ROLE_TYPE); $this->_eventManager->dispatch( 'admin_permissions_role_prepare_save', array('object' => $role, 'request' => $this->getRequest()) @@ -291,6 +289,7 @@ class Role extends \Magento\Backend\App\AbstractAction * @param int $userId * @param int $roleId * @return bool + * @throws \Exception */ protected function _deleteUserFromRole($userId, $roleId) { @@ -301,7 +300,6 @@ class Role extends \Magento\Backend\App\AbstractAction ->deleteFromRole(); } catch (\Exception $e) { throw $e; - return false; } return true; } diff --git a/app/code/Magento/User/Model/Acl/Loader/Role.php b/app/code/Magento/User/Model/Acl/Loader/Role.php index 2c41a9960bc..85c3c5fdf14 100644 --- a/app/code/Magento/User/Model/Acl/Loader/Role.php +++ b/app/code/Magento/User/Model/Acl/Loader/Role.php @@ -18,13 +18,15 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_User * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\User\Model\Acl\Loader; +use Magento\User\Model\Acl\Role\Group as RoleGroup; +use Magento\User\Model\Acl\Role\User as RoleUser; + class Role implements \Magento\Acl\LoaderInterface { /** @@ -72,26 +74,23 @@ class Role implements \Magento\Acl\LoaderInterface ->order('tree_level'); foreach ($adapter->fetchAll($select) as $role) { - $parent = ($role['parent_id'] > 0) ? - \Magento\User\Model\Acl\Role\Group::ROLE_TYPE . $role['parent_id'] : null; + $parent = ($role['parent_id'] > 0) ? $role['parent_id'] : null; switch ($role['role_type']) { - case \Magento\User\Model\Acl\Role\Group::ROLE_TYPE: - $roleId = $role['role_type'] . $role['role_id']; + case RoleGroup::ROLE_TYPE: $acl->addRole( - $this->_groupFactory->create(array('roleId' => $roleId)), + $this->_groupFactory->create(array('roleId' => $role['role_id'])), $parent ); break; - case \Magento\User\Model\Acl\Role\User::ROLE_TYPE: - $roleId = $role['role_type'] . $role['user_id']; - if (!$acl->hasRole($roleId)) { + case RoleUser::ROLE_TYPE: + if (!$acl->hasRole($role['role_id'])) { $acl->addRole( - $this->_roleFactory->create(array('roleId' => $roleId)), + $this->_roleFactory->create(array('roleId' => $role['role_id'])), $parent ); } else { - $acl->addRoleParent($roleId, $parent); + $acl->addRoleParent($role['role_id'], $parent); } break; } diff --git a/app/code/Magento/User/Model/Acl/Loader/Rule.php b/app/code/Magento/User/Model/Acl/Loader/Rule.php index 7bcae660016..9b4526d61a4 100644 --- a/app/code/Magento/User/Model/Acl/Loader/Rule.php +++ b/app/code/Magento/User/Model/Acl/Loader/Rule.php @@ -18,8 +18,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_User * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ @@ -65,7 +63,7 @@ class Rule implements \Magento\Acl\LoaderInterface $rulesArr = $adapter->fetchAll($select); foreach ($rulesArr as $rule) { - $role = $rule['role_type'] . $rule['role_id']; + $role = $rule['role_id']; $resource = $rule['resource_id']; $privileges = !empty($rule['privileges']) ? explode(',', $rule['privileges']) : null; diff --git a/app/code/Magento/User/Model/Resource/Role.php b/app/code/Magento/User/Model/Resource/Role.php index 67d4dd740ab..37a27d0582d 100644 --- a/app/code/Magento/User/Model/Resource/Role.php +++ b/app/code/Magento/User/Model/Resource/Role.php @@ -22,11 +22,13 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\User\Model\Resource; + +use Magento\User\Model\Acl\Role\User as RoleUser; + /** * Admin role resource model */ -namespace Magento\User\Model\Resource; - class Role extends \Magento\Core\Model\Resource\Db\AbstractDb { /** @@ -177,7 +179,7 @@ class Role extends \Magento\Core\Model\Resource\Db\AbstractDb $binds = array( 'role_id' => $role->getId(), - 'role_type' => 'U' + 'role_type' => RoleUser::ROLE_TYPE ); $select = $read->select() diff --git a/app/code/Magento/User/Model/Resource/Role/Collection.php b/app/code/Magento/User/Model/Resource/Role/Collection.php index 35736c3b6d1..7785b37e670 100644 --- a/app/code/Magento/User/Model/Resource/Role/Collection.php +++ b/app/code/Magento/User/Model/Resource/Role/Collection.php @@ -18,22 +18,17 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_User * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\User\Model\Resource\Role; + +use Magento\User\Model\Acl\Role\Group as RoleGroup; /** * Admin role collection - * - * @category Magento - * @package Magento_User - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\User\Model\Resource\Role; - class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractCollection { /** @@ -49,12 +44,13 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl * Add user filter * * @param int $userId + * @param string $userType * @return \Magento\User\Model\Resource\Role\Collection */ - public function setUserFilter($userId) + public function setUserFilter($userId, $userType) { $this->addFieldToFilter('user_id', $userId); - $this->addFieldToFilter('role_type', 'G'); + $this->addFieldToFilter('user_type', $userType); return $this; } @@ -65,7 +61,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl */ public function setRolesFilter() { - $this->addFieldToFilter('role_type', 'G'); + $this->addFieldToFilter('role_type', RoleGroup::ROLE_TYPE); return $this; } diff --git a/app/code/Magento/User/Model/Resource/Role/Grid/Collection.php b/app/code/Magento/User/Model/Resource/Role/Grid/Collection.php index f5315765b96..73007e392b2 100644 --- a/app/code/Magento/User/Model/Resource/Role/Grid/Collection.php +++ b/app/code/Magento/User/Model/Resource/Role/Grid/Collection.php @@ -18,22 +18,17 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_User * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\User\Model\Resource\Role\Grid; + +use Magento\User\Model\Acl\Role\Group as RoleGroup; /** * Admin role data grid collection - * - * @category Magento - * @package Magento_User - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\User\Model\Resource\Role\Grid; - class Collection extends \Magento\User\Model\Resource\Role\Collection { /** @@ -42,7 +37,7 @@ class Collection extends \Magento\User\Model\Resource\Role\Collection protected function _initSelect() { parent::_initSelect(); - $this->addFieldToFilter('role_type', 'G'); + $this->addFieldToFilter('role_type', RoleGroup::ROLE_TYPE); return $this; } } diff --git a/app/code/Magento/User/Model/Resource/Rules.php b/app/code/Magento/User/Model/Resource/Rules.php index 2169c87f0f7..122eac7432a 100644 --- a/app/code/Magento/User/Model/Resource/Rules.php +++ b/app/code/Magento/User/Model/Resource/Rules.php @@ -18,22 +18,15 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_User * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\User\Model\Resource; /** * Admin rule resource model - * - * @category Magento - * @package Magento_User - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\User\Model\Resource; - class Rules extends \Magento\Core\Model\Resource\Db\AbstractDb { /** @@ -61,16 +54,16 @@ class Rules extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_logger; /** + * @param \Magento\App\Resource $resource * @param \Magento\Acl\Builder $aclBuilder * @param \Magento\Logger $logger - * @param \Magento\App\Resource $resource * @param \Magento\Core\Model\Acl\RootResource $rootResource * @param \Magento\Acl\CacheInterface $aclCache */ public function __construct( + \Magento\App\Resource $resource, \Magento\Acl\Builder $aclBuilder, \Magento\Logger $logger, - \Magento\App\Resource $resource, \Magento\Core\Model\Acl\RootResource $rootResource, \Magento\Acl\CacheInterface $aclCache ) { @@ -112,7 +105,6 @@ class Rules extends \Magento\Core\Model\Resource\Db\AbstractDb $postedResources = $rule->getResources(); if ($postedResources) { $row = array( - 'role_type' => 'G', 'resource_id' => $this->_rootResource->getId(), 'privileges' => '', // not used yet 'role_id' => $roleId, diff --git a/app/code/Magento/User/Model/Resource/Setup.php b/app/code/Magento/User/Model/Resource/Setup.php index 49ae7d447df..4accaba2a56 100644 --- a/app/code/Magento/User/Model/Resource/Setup.php +++ b/app/code/Magento/User/Model/Resource/Setup.php @@ -62,21 +62,21 @@ class Setup extends \Magento\Core\Model\Resource\Setup /** * @param \Magento\Core\Model\Resource\Setup\Context $context + * @param string $resourceName * @param \Magento\User\Model\Resource\Role\CollectionFactory $roleCollectionFactory * @param \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollectionFactory * @param \Magento\User\Model\RoleFactory $roleFactory * @param \Magento\User\Model\RulesFactory $rulesFactory - * @param $resourceName * @param string $moduleName * @param string $connectionName */ public function __construct( \Magento\Core\Model\Resource\Setup\Context $context, + $resourceName, \Magento\User\Model\Resource\Role\CollectionFactory $roleCollectionFactory, \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollectionFactory, \Magento\User\Model\RoleFactory $roleFactory, \Magento\User\Model\RulesFactory $rulesFactory, - $resourceName, $moduleName = 'Magento_User', $connectionName = '' ) { diff --git a/app/code/Magento/User/Model/Resource/User.php b/app/code/Magento/User/Model/Resource/User.php index 3c7b8bf1d25..0745aab561a 100644 --- a/app/code/Magento/User/Model/Resource/User.php +++ b/app/code/Magento/User/Model/Resource/User.php @@ -24,6 +24,9 @@ namespace Magento\User\Model\Resource; +use \Magento\User\Model\Acl\Role\Group as RoleGroup; +use \Magento\User\Model\Acl\Role\User as RoleUser; + /** * ACL user resource */ @@ -241,7 +244,7 @@ class User extends \Magento\Core\Model\Resource\Db\AbstractDb 'parent_id' => $parentRole->getId(), 'tree_level' => $parentRole->getTreeLevel() + 1, 'sort_order' => 0, - 'role_type' => 'U', + 'role_type' => RoleUser::ROLE_TYPE, 'user_id' => $user->getId(), 'role_name' => $user->getFirstname() )); @@ -318,7 +321,7 @@ class User extends \Magento\Core\Model\Resource\Db\AbstractDb ->from($table, array()) ->joinLeft( array('ar' => $table), - "(ar.role_id = {$table}.parent_id and ar.role_type = 'G')", + "(ar.role_id = {$table}.parent_id and ar.role_type = '" . RoleGroup::ROLE_TYPE ."')", array('role_id')) ->where("{$table}.user_id = :user_id"); diff --git a/app/code/Magento/User/Model/Role.php b/app/code/Magento/User/Model/Role.php index e85b6503e40..4eb482b360a 100644 --- a/app/code/Magento/User/Model/Role.php +++ b/app/code/Magento/User/Model/Role.php @@ -18,12 +18,12 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_User * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\User\Model; + /** * Admin Role Model * @@ -39,35 +39,30 @@ * @method \Magento\User\Model\Role setRoleType(string $value) * @method int getUserId() * @method \Magento\User\Model\Role setUserId(int $value) + * @method string getUserType() + * @method \Magento\User\Model\Role setUserType(string $value) * @method string getRoleName() * @method \Magento\User\Model\Role setRoleName(string $value) - * - * @category Magento - * @package Magento_User - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\User\Model; - class Role extends \Magento\Core\Model\AbstractModel { - /** * @var \Magento\User\Model\Resource\Role\User\CollectionFactory */ protected $_userRolesFactory; /** - * @param \Magento\User\Model\Resource\Role\User\CollectionFactory $userRolesFactory * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\User\Model\Resource\Role\User\CollectionFactory $userRolesFactory * @param \Magento\User\Model\Resource\Role $resource * @param \Magento\User\Model\Resource\Role\Collection $resourceCollection * @param array $data */ public function __construct( - \Magento\User\Model\Resource\Role\User\CollectionFactory $userRolesFactory, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\User\Model\Resource\Role\User\CollectionFactory $userRolesFactory, \Magento\User\Model\Resource\Role $resource, \Magento\User\Model\Resource\Role\Collection $resourceCollection, array $data = array() diff --git a/app/code/Magento/User/Model/Rules.php b/app/code/Magento/User/Model/Rules.php index 95165292da8..f1538a73e23 100644 --- a/app/code/Magento/User/Model/Rules.php +++ b/app/code/Magento/User/Model/Rules.php @@ -18,12 +18,12 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_User * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\User\Model; + /** * Admin Rules Model * @@ -37,17 +37,9 @@ * @method \Magento\User\Model\Rules setPrivileges(string $value) * @method int getAssertId() * @method \Magento\User\Model\Rules setAssertId(int $value) - * @method string getRoleType() - * @method \Magento\User\Model\Rules setRoleType(string $value) * @method string getPermission() * @method \Magento\User\Model\Rules setPermission(string $value) - * - * @category Magento - * @package Magento_User - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\User\Model; - class Rules extends \Magento\Core\Model\AbstractModel { public function __construct( diff --git a/app/code/Magento/User/Model/User.php b/app/code/Magento/User/Model/User.php index b7ab9dd27a7..62fc1ed6c98 100644 --- a/app/code/Magento/User/Model/User.php +++ b/app/code/Magento/User/Model/User.php @@ -53,7 +53,6 @@ namespace Magento\User\Model; * @method \Magento\User\Model\User setIsActive(int $value) * @method string getExtra() * @method \Magento\User\Model\User setExtra(string $value) - * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) * @SuppressWarnings(PHPMD.LongVariable) */ @@ -518,7 +517,7 @@ class User */ public function getAclRole() { - return 'U' . $this->getUserId(); + return $this->getRole()->getId(); } /** diff --git a/app/code/Magento/User/data/user_setup/data-install-1.6.0.0.php b/app/code/Magento/User/data/user_setup/data-install-1.6.0.0.php index e35e2c558f6..27ceeef491d 100644 --- a/app/code/Magento/User/data/user_setup/data-install-1.6.0.0.php +++ b/app/code/Magento/User/data/user_setup/data-install-1.6.0.0.php @@ -22,6 +22,8 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +use Magento\User\Model\Acl\Role\Group as RoleGroup; + /** * Save administrators group role and rules */ @@ -31,7 +33,7 @@ $roleCollection = $this->createRoleCollection() ->addFieldToFilter('parent_id', 0) ->addFieldToFilter('tree_level', 1) - ->addFieldToFilter('role_type', 'G') + ->addFieldToFilter('role_type', RoleGroup::ROLE_TYPE) ->addFieldToFilter('user_id', 0) ->addFieldToFilter('role_name', 'Administrators'); @@ -40,7 +42,7 @@ if ($roleCollection->count() == 0) { 'parent_id' => 0, 'tree_level' => 1, 'sort_order' => 1, - 'role_type' => 'G', + 'role_type' => RoleGroup::ROLE_TYPE, 'user_id' => 0, 'role_name' => 'Administrators' )) @@ -54,15 +56,13 @@ if ($roleCollection->count() == 0) { $rulesCollection = $this->createRulesCollection() ->addFieldToFilter('role_id', $admGroupRole->getId()) - ->addFieldToFilter('resource_id', 'all') - ->addFieldToFilter('role_type', 'G'); + ->addFieldToFilter('resource_id', 'all'); if ($rulesCollection->count() == 0) { $this->createRules()->setData(array( 'role_id' => $admGroupRole->getId(), 'resource_id' => 'Magento_Adminhtml::all', 'privileges' => null, - 'role_type' => 'G', 'permission' => 'allow' )) ->save(); diff --git a/app/code/Magento/User/etc/adminhtml/di.xml b/app/code/Magento/User/etc/adminhtml/di.xml index 3e4b2790284..931ce7a9fe7 100644 --- a/app/code/Magento/User/etc/adminhtml/di.xml +++ b/app/code/Magento/User/etc/adminhtml/di.xml @@ -25,12 +25,4 @@ --> <config> <preference for="Magento\Backend\Model\Auth\Credential\StorageInterface" type="Magento\User\Model\User" /> - <type name="Magento\Acl\Builder"> - <param name="ruleLoader"> - <instance type="Magento\User\Model\Acl\Loader\Rule" /> - </param> - <param name="roleLoader"> - <instance type="Magento\User\Model\Acl\Loader\Role" /> - </param> - </type> </config> diff --git a/app/code/Magento/User/etc/di.xml b/app/code/Magento/User/etc/di.xml index 24e0ff001b4..9e72a27cffe 100644 --- a/app/code/Magento/User/etc/di.xml +++ b/app/code/Magento/User/etc/di.xml @@ -25,6 +25,7 @@ --> <config> <type name="Magento\User\Model\Role" shared="false" /> + <preference for="Magento\Backend\App\ConfigInterface" type="Magento\Backend\App\Config" /> <type name="Magento\User\Model\Resource\Rules"> <param name="rootResource"> <instance type="Magento\Core\Model\Acl\RootResource\Proxy" /> @@ -45,4 +46,12 @@ </value> </param> </type> + <type name="Magento\Acl\Builder"> + <param name="ruleLoader"> + <instance type="Magento\User\Model\Acl\Loader\Rule" /> + </param> + <param name="roleLoader"> + <instance type="Magento\User\Model\Acl\Loader\Role" /> + </param> + </type> </config> diff --git a/app/code/Magento/User/etc/module.xml b/app/code/Magento/User/etc/module.xml index 99ad2b98d25..ea7df742f66 100755 --- a/app/code/Magento/User/etc/module.xml +++ b/app/code/Magento/User/etc/module.xml @@ -51,6 +51,7 @@ <module name="Magento_GoogleShopping"/> <module name="Magento_ImportExport"/> <module name="Magento_Index"/> + <module name="Magento_Integration"/> <module name="Magento_PageCache"/> <module name="Magento_Payment"/> <module name="Magento_Paypal"/> @@ -65,7 +66,6 @@ <module name="Magento_Tax"/> <module name="Magento_Widget"/> <module name="Magento_Wishlist"/> - <module name="Magento_Page" type="soft"/> </depends> </module> </config> diff --git a/app/code/Magento/User/sql/user_setup/upgrade-1.6.1.4-1.6.1.5.php b/app/code/Magento/User/sql/user_setup/upgrade-1.6.1.4-1.6.1.5.php new file mode 100644 index 00000000000..ca115054c97 --- /dev/null +++ b/app/code/Magento/User/sql/user_setup/upgrade-1.6.1.4-1.6.1.5.php @@ -0,0 +1,37 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/* @var $installer \Magento\Core\Model\Resource\Setup */ +$installer = $this; + +$installer->startSetup(); +$connection = $installer->getConnection(); +$connection->addColumn($installer->getTable('admin_role'), 'user_type', array( + 'type' => \Magento\DB\Ddl\Table::TYPE_TEXT, + 'length' => 16, + 'nullable' => true, + 'comment' => 'User type' +)); +$connection->dropColumn($installer->getTable('admin_rule'), 'role_type'); +$installer->endSetup(); diff --git a/app/code/Magento/User/view/adminhtml/admin/forgotpassword.phtml b/app/code/Magento/User/view/adminhtml/admin/forgotpassword.phtml index 85307bd6f95..7d6370fb09e 100644 --- a/app/code/Magento/User/view/adminhtml/admin/forgotpassword.phtml +++ b/app/code/Magento/User/view/adminhtml/admin/forgotpassword.phtml @@ -30,8 +30,8 @@ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo __('Log into Magento Admin Page'); ?></title> - <link rel="icon" href="<?php echo $this->getViewFileUrl('Magento_Page::favicon.ico'); ?>" type="image/x-icon" /> - <link rel="shortcut icon" href="<?php echo $this->getViewFileUrl('Magento_Page::favicon.ico'); ?>" type="image/x-icon" /> + <link rel="icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico'); ?>" type="image/x-icon" /> + <link rel="shortcut icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico'); ?>" type="image/x-icon" /> <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/reset.css') ?>" media="all" /> <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/base.css') ?>" media="all" /> @@ -65,7 +65,7 @@ <div class="logo" title="<?php echo __('Magento Admin Panel') ?>"><span><?php echo __('Magento Admin Panel') ?></span></div> </header> <div id="messages"> - <?php echo $this->getMessagesBlock()->getGroupedHtml(); ?> + <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml(); ?> </div> <form method="post" action="" id="login-form"> <fieldset class="fieldset"> diff --git a/app/code/Magento/User/view/adminhtml/admin/resetforgottenpassword.phtml b/app/code/Magento/User/view/adminhtml/admin/resetforgottenpassword.phtml index ab77e50eb53..40a179e431f 100644 --- a/app/code/Magento/User/view/adminhtml/admin/resetforgottenpassword.phtml +++ b/app/code/Magento/User/view/adminhtml/admin/resetforgottenpassword.phtml @@ -29,8 +29,8 @@ <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title><?php echo __('Reset a Password'); ?></title> - <link rel="icon" href="<?php echo $this->getViewFileUrl('Magento_Page::favicon.ico'); ?>" type="image/x-icon" /> - <link rel="shortcut icon" href="<?php echo $this->getViewFileUrl('Magento_Page::favicon.ico'); ?>" type="image/x-icon" /> + <link rel="icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico'); ?>" type="image/x-icon" /> + <link rel="shortcut icon" href="<?php echo $this->getViewFileUrl('Magento_Theme::favicon.ico'); ?>" type="image/x-icon" /> <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/reset.css') ?>" media="all" /> <link rel="stylesheet" href="<?php echo $this->getViewFileUrl('mui/base.css') ?>" media="all" /> @@ -63,7 +63,7 @@ <div class="logo" title="<?php echo __('Magento Admin Panel') ?>"><span><?php echo __('Magento Admin Panel') ?></span></div> </header> <div id="messages"> - <?php echo $this->getMessagesBlock()->getGroupedHtml(); ?> + <?php echo $this->getLayout()->getMessagesBlock()->getGroupedHtml(); ?> </div> <form method="post" action="<?php echo $this->getUrl('*/auth/resetpasswordpost', array('_query' => array('id' => $this->getUserId(), 'token' => $this->getResetPasswordLinkToken()))); ?>" id="reset-password-form"> <fieldset class="fieldset"> diff --git a/app/code/Magento/User/view/adminhtml/js/roles-tree.js b/app/code/Magento/User/view/adminhtml/js/roles-tree.js index 49b96a1f4b7..1dfe69de69b 100644 --- a/app/code/Magento/User/view/adminhtml/js/roles-tree.js +++ b/app/code/Magento/User/view/adminhtml/js/roles-tree.js @@ -43,6 +43,14 @@ jQuery(function($) { hotkeys: { space: this._changeState, 'return': this._changeState + }, + types: { + 'types': { + 'disabled': { + 'check_node': false, + 'uncheck_node': false + } + } } }); this._bind(); diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webapi.php b/app/code/Magento/Webapi/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webapi.php new file mode 100644 index 00000000000..8db34a69465 --- /dev/null +++ b/app/code/Magento/Webapi/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webapi.php @@ -0,0 +1,180 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Webapi\Block\Adminhtml\Integration\Activate\Permissions\Tab; + +use Magento\Backend\Block\Widget\Tab\TabInterface; +use Magento\View\Element\Template; +use Magento\Acl\Resource\ProviderInterface; +use Magento\Core\Helper\Data as CoreHelper; +use Magento\Core\Model\Acl\RootResource; +use Magento\View\Element\Template\Context; +use Magento\Integration\Helper\Data as IntegrationHelper; +use Magento\Webapi\Helper\Data as WebapiHelper; + +/** + * API permissions tab for integration activation dialog. + */ +class Webapi extends Template implements TabInterface +{ + /** @var string[] */ + protected $_selectedResources; + + /** @var RootResource */ + protected $_rootResource; + + /** @var ProviderInterface */ + protected $_resourceProvider; + + /** @var IntegrationHelper */ + protected $_integrationData; + + /** @var WebapiHelper */ + protected $_webapiHelper; + + /** + * Initialize dependencies. + * + * @param Context $context + * @param RootResource $rootResource + * @param ProviderInterface $resourceProvider + * @param IntegrationHelper $integrationData + * @param WebapiHelper $webapiData + * @param array $data + */ + public function __construct( + Context $context, + RootResource $rootResource, + ProviderInterface $resourceProvider, + IntegrationHelper $integrationData, + WebapiHelper $webapiData, + array $data = array() + ) { + $this->_rootResource = $rootResource; + $this->_webapiHelper = $webapiData; + $this->_resourceProvider = $resourceProvider; + $this->_integrationData = $integrationData; + parent::__construct($context, $data); + } + + /** + * Set the selected resources, which is an array of resource ids. If everything is allowed, the + * array will contain just the root resource id, which is "Magento_Adminhtml::all". + */ + protected function _construct() + { + parent::_construct(); + $this->_selectedResources = $this->_webapiHelper->getSelectedResources(); + } + + /** + * {@inheritDoc} + */ + public function canShowTab() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getTabLabel() + { + return __('API'); + } + + /** + * {@inheritDoc} + */ + public function getTabTitle() + { + return __('API'); + } + + /** + * {@inheritDoc} + */ + public function isHidden() + { + return false; + } + + /** + * Check if everything is allowed. + * + * @return bool + */ + public function isEverythingAllowed() + { + return in_array($this->_rootResource->getId(), $this->_selectedResources); + } + + /** + * Get requested permissions tree. + * + * @return string + */ + public function getResourcesTreeJson() + { + $resources = $this->_resourceProvider->getAclResources(); + $aclResourcesTree = $this->_integrationData->mapResources($resources[1]['children']); + + return $this->_coreData->jsonEncode($aclResourcesTree); + } + + /** + * Return an array of selected resource ids. If everything is allowed then iterate through all + * available resources to generate a comprehensive array of all resource ids, rather than just + * returning "Magento_Adminhtml::all". + * + * @return string + */ + public function getSelectedResourcesJson() + { + $selectedResources = $this->_selectedResources; + if ($this->isEverythingAllowed()) { + $resources = $this->_resourceProvider->getAclResources(); + $selectedResources = $this->_getAllResourceIds($resources[1]['children']); + } + return $this->_coreData->jsonEncode($selectedResources); + } + + /** + * Return an array of all resource Ids. + * + * @param array $resources + * @return string[] + */ + protected function _getAllResourceIds(array $resources) + { + $resourceIds = array(); + foreach ($resources as $resource) { + $resourceIds[] = $resource['id']; + if (isset($resource['children'])) { + $resourceIds = array_merge($resourceIds, $this->_getAllResourceIds($resource['children'])); + } + } + return $resourceIds; + } +} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Integration/Edit/Tab/Webapi.php b/app/code/Magento/Webapi/Block/Adminhtml/Integration/Edit/Tab/Webapi.php new file mode 100644 index 00000000000..41c41975ca4 --- /dev/null +++ b/app/code/Magento/Webapi/Block/Adminhtml/Integration/Edit/Tab/Webapi.php @@ -0,0 +1,162 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Webapi\Block\Adminhtml\Integration\Edit\Tab; + +use Magento\Integration\Controller\Adminhtml\Integration as IntegrationController; + +/** + * Class for handling API section within integration. + */ +class Webapi extends \Magento\Backend\Block\Widget\Form + implements \Magento\Backend\Block\Widget\Tab\TabInterface +{ + /** + * Root ACL Resource + * + * @var \Magento\Core\Model\Acl\RootResource + */ + protected $_rootResource; + + /** + * Rules collection factory + * + * @var \Magento\User\Model\Resource\Rules\CollectionFactory + */ + protected $_rulesCollFactory; + + /** + * Acl resource provider + * + * @var \Magento\Acl\Resource\ProviderInterface + */ + protected $_aclResourceProvider; + + /** @var \Magento\Integration\Helper\Data */ + protected $_integrationData; + + /** @var \Magento\Webapi\Helper\Data */ + protected $_webapiData; + + /** + * Construct + * + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Acl\RootResource $rootResource + * @param \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollFactory + * @param \Magento\Acl\Resource\ProviderInterface $aclResourceProvider + * @param \Magento\Webapi\Helper\Data $webapiData + * @param \Magento\Integration\Helper\Data $integrationData + * @param array $data + */ + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Acl\RootResource $rootResource, + \Magento\User\Model\Resource\Rules\CollectionFactory $rulesCollFactory, + \Magento\Acl\Resource\ProviderInterface $aclResourceProvider, + \Magento\Webapi\Helper\Data $webapiData, + \Magento\Integration\Helper\Data $integrationData, + array $data = array() + ) { + $this->_rootResource = $rootResource; + $this->_rulesCollFactory = $rulesCollFactory; + $this->_aclResourceProvider = $aclResourceProvider; + $this->_webapiData = $webapiData; + $this->_integrationData = $integrationData; + parent::__construct($context, $data); + } + + /** + * Get tab label + * + * @return string + */ + public function getTabLabel() + { + return __('API'); + } + + /** + * Get tab title + * + * @return string + */ + public function getTabTitle() + { + return $this->getTabLabel(); + } + + /** + * Whether tab is available + * + * @return bool + */ + public function canShowTab() + { + return true; + } + + /** + * Whether tab is visible + * + * @return bool + */ + public function isHidden() + { + return false; + } + + /** + * Class constructor + */ + protected function _construct() + { + parent::_construct(); + $this->setSelectedResources($this->_webapiData->getSelectedResources()); + } + + /** + * Check if everything is allowed + * + * @return boolean + */ + public function isEverythingAllowed() + { + return in_array($this->_rootResource->getId(), $this->getSelectedResources()); + } + + /** + * Get Json Representation of Resource Tree + * + * @return array + */ + public function getTree() + { + $resources = $this->_aclResourceProvider->getAclResources(); + $rootArray = $this->_integrationData->mapResources( + isset($resources[1]['children']) ? $resources[1]['children'] : array() + ); + return $rootArray; + } +} diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/Resource.php b/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/Resource.php index 11018a016d5..21ba797846a 100644 --- a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/Resource.php +++ b/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tab/Resource.php @@ -64,23 +64,21 @@ class Resource extends \Magento\Backend\Block\Widget\Form */ protected $_rootResource; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Acl\Resource\ProviderInterface $resourceProvider - * @param \Magento\Webapi\Model\Resource\Acl\Rule $ruleResource - * @param \Magento\Core\Model\Acl\RootResource $rootResource - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Acl\Resource\ProviderInterface $resourceProvider + * @param \Magento\Webapi\Model\Resource\Acl\Rule $ruleResource + * @param \Magento\Core\Model\Acl\RootResource $rootResource + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Acl\Resource\ProviderInterface $resourceProvider, - \Magento\Webapi\Model\Resource\Acl\Rule $ruleResource, - \Magento\Core\Model\Acl\RootResource $rootResource, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Acl\Resource\ProviderInterface $resourceProvider, + \Magento\Webapi\Model\Resource\Acl\Rule $ruleResource, + \Magento\Core\Model\Acl\RootResource $rootResource, + array $data = array() + ) { + parent::__construct($context, $data); $this->_resourceProvider = $resourceProvider; $this->_ruleResource = $ruleResource; $this->_rootResource = $rootResource; diff --git a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tabs.php b/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tabs.php index fef002d182f..3751f76b55c 100644 --- a/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tabs.php +++ b/app/code/Magento/Webapi/Block/Adminhtml/Role/Edit/Tabs.php @@ -45,7 +45,7 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs /** * Prepare child blocks. * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Tabs.php b/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Tabs.php index 3a271902425..8188dd1af99 100644 --- a/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Tabs.php +++ b/app/code/Magento/Webapi/Block/Adminhtml/User/Edit/Tabs.php @@ -45,7 +45,7 @@ class Tabs extends \Magento\Backend\Block\Widget\Tabs /** * Before to HTML. * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Webapi/Helper/Data.php b/app/code/Magento/Webapi/Helper/Data.php index bfbc2bab766..cf81d440d42 100644 --- a/app/code/Magento/Webapi/Helper/Data.php +++ b/app/code/Magento/Webapi/Helper/Data.php @@ -21,9 +21,33 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ + namespace Magento\Webapi\Helper; +use Magento\Integration\Controller\Adminhtml\Integration as IntegrationController; + class Data extends \Magento\App\Helper\AbstractHelper { + /** @var \Magento\Core\Model\Registry */ + protected $_registry; + + public function __construct( + \Magento\App\Helper\Context $context, + \Magento\Core\Model\Registry $registry + ) { + $this->_registry = $registry; + parent::__construct($context); + } + public function getSelectedResources() + { + $selectedResourceIds = array(); + $currentIntegration = $this->_registry->registry(IntegrationController::REGISTRY_KEY_CURRENT_INTEGRATION); + if ($currentIntegration + && isset($currentIntegration['resource']) && is_array($currentIntegration['resource']) + ) { + $selectedResourceIds = $currentIntegration['resource']; + } + return $selectedResourceIds; + } } diff --git a/app/code/Magento/Webapi/Model/Cache/TypeIntegration.php b/app/code/Magento/Webapi/Model/Cache/TypeIntegration.php new file mode 100644 index 00000000000..cb578e84153 --- /dev/null +++ b/app/code/Magento/Webapi/Model/Cache/TypeIntegration.php @@ -0,0 +1,51 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Webapi\Model\Cache; + +/** + * System / Cache Management / Cache type "Integration Api Configuration" + */ +class TypeIntegration extends \Magento\Cache\Frontend\Decorator\TagScope +{ + /** + * Cache type code unique among all cache types + */ + const TYPE_IDENTIFIER = 'config_integration_api'; + + /** + * Cache tag used to distinguish the cache type from all other cache + */ + const CACHE_TAG = 'INTEGRATION_API_CONFIG'; + + /** + * @param \Magento\App\Cache\Type\FrontendPool $cacheFrontendPool + */ + public function __construct(\Magento\App\Cache\Type\FrontendPool $cacheFrontendPool) + { + parent::__construct($cacheFrontendPool->get(self::TYPE_IDENTIFIER), self::CACHE_TAG); + } +} diff --git a/app/code/Magento/Integration/Model/Config/Api/Converter.php b/app/code/Magento/Webapi/Model/Config/Integration/Converter.php similarity index 86% rename from app/code/Magento/Integration/Model/Config/Api/Converter.php rename to app/code/Magento/Webapi/Model/Config/Integration/Converter.php index a3aa892069a..dfec4d062c4 100644 --- a/app/code/Magento/Integration/Model/Config/Api/Converter.php +++ b/app/code/Magento/Webapi/Model/Config/Integration/Converter.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Integration\Model\Config\Api; +namespace Magento\Webapi\Model\Config\Integration; /** * Converter of api.xml content into array format. @@ -48,9 +48,9 @@ class Converter implements \Magento\Config\ConverterInterface if ($integration->nodeType != XML_ELEMENT_NODE) { continue; } - $integrationId = $integration->attributes->getNamedItem('id')->nodeValue; - $result[$integrationId] = array(); - $result[$integrationId][self::API_RESOURCES] = array(); + $integrationName = $integration->attributes->getNamedItem('name')->nodeValue; + $result[$integrationName] = array(); + $result[$integrationName][self::API_RESOURCES] = array(); /** @var \DOMNodeList $resources */ $resources = $integration->getElementsByTagName('resource'); /** @var \DOMElement $resource */ @@ -59,7 +59,7 @@ class Converter implements \Magento\Config\ConverterInterface continue; } $resource = $resource->attributes->getNamedItem('name')->nodeValue; - $result[$integrationId][self::API_RESOURCES][] = $resource; + $result[$integrationName][self::API_RESOURCES][] = $resource; } } return $result; diff --git a/app/code/Magento/Integration/Model/Config/Api/Reader.php b/app/code/Magento/Webapi/Model/Config/Integration/Reader.php similarity index 77% rename from app/code/Magento/Integration/Model/Config/Api/Reader.php rename to app/code/Magento/Webapi/Model/Config/Integration/Reader.php index 1e23f8f579a..8464c16404f 100644 --- a/app/code/Magento/Integration/Model/Config/Api/Reader.php +++ b/app/code/Magento/Webapi/Model/Config/Integration/Reader.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Integration\Model\Config\Api; +namespace Magento\Webapi\Model\Config\Integration; /** * Service config data reader. @@ -34,21 +34,21 @@ class Reader extends \Magento\Config\Reader\Filesystem * @var array */ protected $_idAttributes = array( - '/config/service' => 'class', - '/config/service/rest-route' => 'method', + '/integrations/integration' => 'name', + '/integrations/integration/resources/resource' => 'name' ); /** * @param \Magento\Config\FileResolverInterface $fileResolver - * @param \Magento\Integration\Model\Config\Api\Converter $converter - * @param \Magento\Integration\Model\Config\Api\SchemaLocator $schemeLocator + * @param \Magento\Webapi\Model\Config\Integration\Converter $converter + * @param \Magento\Webapi\Model\Config\Integration\SchemaLocator $schemeLocator * @param \Magento\Config\ValidationStateInterface $validationState * @param string $fileName */ public function __construct( \Magento\Config\FileResolverInterface $fileResolver, - \Magento\Integration\Model\Config\Api\Converter $converter, - \Magento\Integration\Model\Config\Api\SchemaLocator $schemeLocator, + \Magento\Webapi\Model\Config\Integration\Converter $converter, + \Magento\Webapi\Model\Config\Integration\SchemaLocator $schemeLocator, \Magento\Config\ValidationStateInterface $validationState, $fileName = 'integration\api.xml' ) { diff --git a/app/code/Magento/Integration/Model/Config/Api/SchemaLocator.php b/app/code/Magento/Webapi/Model/Config/Integration/SchemaLocator.php similarity index 95% rename from app/code/Magento/Integration/Model/Config/Api/SchemaLocator.php rename to app/code/Magento/Webapi/Model/Config/Integration/SchemaLocator.php index 4c20b5f22cb..18ca710d22e 100644 --- a/app/code/Magento/Integration/Model/Config/Api/SchemaLocator.php +++ b/app/code/Magento/Webapi/Model/Config/Integration/SchemaLocator.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Integration\Model\Config\Api; +namespace Magento\Webapi\Model\Config\Integration; /** * Integration config schema locator. @@ -47,7 +47,7 @@ class SchemaLocator implements \Magento\Config\SchemaLocatorInterface */ public function __construct(\Magento\Module\Dir\Reader $moduleReader) { - $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Integration') . DIRECTORY_SEPARATOR . + $this->_schema = $moduleReader->getModuleDir('etc', 'Magento_Webapi') . DIRECTORY_SEPARATOR . DIRECTORY_SEPARATOR . 'integration' . DIRECTORY_SEPARATOR . 'api.xsd'; } diff --git a/app/code/Magento/Webapi/Model/IntegrationConfig.php b/app/code/Magento/Webapi/Model/IntegrationConfig.php new file mode 100644 index 00000000000..cb3a5fd8dee --- /dev/null +++ b/app/code/Magento/Webapi/Model/IntegrationConfig.php @@ -0,0 +1,91 @@ +<?php + +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Webapi\Model; + +use \Magento\Webapi\Model\Cache\TypeIntegration; + +/** + * Integration Api Config Model. + * + * This is a parent class for storing information about Integrations. + */ +class IntegrationConfig +{ + const CACHE_ID = 'integration-api'; + + /** + * @var \Magento\App\Cache\Type\Config + */ + protected $_configCacheType; + + /** + * @var \Magento\Webapi\Model\Config\Integration\Reader + */ + protected $_configReader; + + /** + * Array of integrations with resource permissions from api config + * + * @var array + */ + protected $_integrations; + + + /** + * @param Cache\TypeIntegration $configCacheType + * @param Config\Integration\Reader $configReader + */ + public function __construct( + Cache\TypeIntegration $configCacheType, + Config\Integration\Reader $configReader + ) { + $this->_configCacheType = $configCacheType; + $this->_configReader = $configReader; + } + + /** + * Return integrations loaded from cache if enabled or from files merged previously + * + * @return array + */ + public function getIntegrations() + { + if (null === $this->_integrations) { + $integrations = $this->_configCacheType->load(self::CACHE_ID); + if ($integrations && is_string($integrations)) { + $this->_integrations = unserialize($integrations); + } else { + $this->_integrations = $this->_configReader->read(); + $this->_configCacheType->save( + serialize($this->_integrations), + self::CACHE_ID, + array(TypeIntegration::CACHE_TAG) + ); + } + } + return $this->_integrations; + } +} diff --git a/app/code/Magento/Webapi/Model/Plugin/Setup.php b/app/code/Magento/Webapi/Model/Plugin/Setup.php new file mode 100644 index 00000000000..cd58f6141dc --- /dev/null +++ b/app/code/Magento/Webapi/Model/Plugin/Setup.php @@ -0,0 +1,114 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Webapi\Model\Plugin; + +use Magento\Authz\Model\UserIdentifier; +use Magento\Integration\Model\Integration; + +/** + * Plugin for Magento\Core\Model\Resource\Setup model to manage resource permissions of + * integration installed from config file + */ +class Setup +{ + /** + * API Integration config + * + * @var Config + */ + protected $_integrationConfig; + + /** + * Integration service + * + * @var \Magento\Integration\Service\IntegrationV1Interface + */ + protected $_integrationService; + + /** + * Authorization service + * + * @var \Magento\Authz\Service\AuthorizationV1 + */ + protected $_authzService; + + /** + * Factory to create UserIdentifier + * + * @var \Magento\Authz\Model\UserIdentifier\Factory + */ + protected $_userIdentifierFactory; + + + /** + * Construct Setup plugin instance + * + * @param \Magento\Webapi\Model\IntegrationConfig $integrationConfig + * @param \Magento\Integration\Service\IntegrationV1Interface $integrationService + * @param \Magento\Authz\Service\AuthorizationV1 $authzService + * @param \Magento\Authz\Model\UserIdentifier\Factory $userIdentifierFactory + */ + public function __construct( + \Magento\Webapi\Model\IntegrationConfig $integrationConfig, + \Magento\Authz\Service\AuthorizationV1 $authzService, + \Magento\Integration\Service\IntegrationV1Interface $integrationService, + \Magento\Authz\Model\UserIdentifier\Factory $userIdentifierFactory + ) { + $this->_integrationConfig = $integrationConfig; + $this->_authzService = $authzService; + $this->_integrationService = $integrationService; + $this->_userIdentifierFactory = $userIdentifierFactory; + } + + /** + * Process integration resource permissions after the integration is created + * + * @param array $integrationNames Name of integrations passed as array from the invocation chain + * @return array + */ + public function afterInitIntegrationProcessing($integrationNames) + { + if (empty($integrationNames)) { + return array(); + } + /** @var array $integrations */ + $integrations = $this->_integrationConfig->getIntegrations(); + foreach ($integrationNames as $name) { + if (isset($integrations[$name])) { + $integrationData = $this->_integrationService->findByName($name); + if (isset($integrationData[Integration::ID])) { + $userIdentifier = $this->_userIdentifierFactory->create( + UserIdentifier::USER_TYPE_INTEGRATION, + (int)$integrationData[Integration::ID] + ); + $this->_authzService->grantPermissions( + $userIdentifier, + $integrations[$name]['resources'] + ); + } + } + } + return $integrationNames; + } +} \ No newline at end of file diff --git a/app/code/Magento/Webapi/etc/adminhtml/routes.xml b/app/code/Magento/Webapi/etc/adminhtml/routes.xml index f869a8e023e..1e67b3e7da1 100644 --- a/app/code/Magento/Webapi/etc/adminhtml/routes.xml +++ b/app/code/Magento/Webapi/etc/adminhtml/routes.xml @@ -29,4 +29,4 @@ <module name="Magento_Webapi_Adminhtml" before="Magento_Backend" /> </route> </router> -</config> \ No newline at end of file +</config> diff --git a/app/code/Magento/Webapi/etc/cache.xml b/app/code/Magento/Webapi/etc/cache.xml index 0f985d23be6..caafe2e9615 100644 --- a/app/code/Magento/Webapi/etc/cache.xml +++ b/app/code/Magento/Webapi/etc/cache.xml @@ -28,4 +28,8 @@ <label>Web Services Configuration</label> <description>REST and SOAP configurations, generated WSDL file.</description> </type> + <type name="config_integration_api" translate="label,description" instance="Magento\Webapi\Model\Cache\TypeIntegration"> + <label>Integrations API Configuration</label> + <description>Integrations API configuration file.</description> + </type> </config> diff --git a/app/code/Magento/Webapi/etc/di.xml b/app/code/Magento/Webapi/etc/di.xml index 51b4048d2ac..4e87c64decd 100644 --- a/app/code/Magento/Webapi/etc/di.xml +++ b/app/code/Magento/Webapi/etc/di.xml @@ -24,117 +24,6 @@ */ --> <config> - <preference for="Magento\Authorization\Policy" type="Magento\Authorization\Policy\Acl" /> - <preference for="Magento\Authorization\RoleLocator" type="Magento\Webapi\Model\Authorization\RoleLocator" /> - <preference for="Magento\Webapi\Model\Acl\Resource\ProviderInterface" type="Magento\Webapi\Model\Acl\Resource\Provider"/> - <type name="Magento\Acl\Builder"> - <param name="resourceLoader"> - <instance type="Magento\Webapi\Model\Authorization\Loader\Resource" /> - </param> - <param name="roleLoader"> - <instance type="Magento\Webapi\Model\Authorization\Loader\Role" /> - </param> - <param name="ruleLoader"> - <instance type="Magento\Webapi\Model\Authorization\Loader\Rule" /> - </param> - </type> - <type name="Magento\Webapi\Model\Acl\Builder"> - <param name="cache"> - <instance type="Magento\Webapi\Model\Acl\Cache" /> - </param> - <param name="resourceLoader"> - <instance type="Magento\Webapi\Model\Authorization\Loader\Resource" /> - </param> - <param name="roleLoader"> - <instance type="Magento\Webapi\Model\Authorization\Loader\Role" /> - </param> - <param name="ruleLoader"> - <instance type="Magento\Webapi\Model\Authorization\Loader\Rule" /> - </param> - </type> - <type name="Magento\Webapi\Model\Authorization\Policy\Acl"> - <param name="aclBuilder"> - <instance type="Magento\Webapi\Model\Acl\Builder" /> - </param> - </type> - <type name="Magento\Webapi\Model\Acl\Cache"> - <param name="cacheKey"> - <value>api_acl_resources</value> - </param> - </type> - <type name="Magento\Core\Model\Acl\RootResource"> - <param name="identifier"> - <value>Magento_Webapi</value> - </param> - </type> - <type name="Magento\Webapi\Controller\Rest\Router\Route" shared="false" /> - <type name="Magento\Xml\Generator" shared="false" /> - <type name="Magento\Xml\Parser" shared="false" /> - <type name="Magento\Code\Scanner\DirectoryScanner" shared="false" /> - <type name="Magento\Server\Reflection" shared="false" /> - <type name="Magento\Webapi\Model\Authorization\Loader\Resource"> - <param name="resourceProvider"> - <instance type="Magento\Webapi\Model\Acl\Resource\Provider" /> - </param> - </type> - <type name="Magento\Webapi\Model\Acl\Resource\Provider"> - <param name="configReader"> - <instance type="Magento\Webapi\Model\Acl\Resource\Config\Reader\Filesystem" /> - </param> - </type> - <type name="Magento\Webapi\Model\Acl\Resource\Config\Reader\Filesystem"> - <param name="converter"> - <instance type="Magento\Webapi\Model\Acl\Resource\Config\Converter\Dom" /> - </param> - </type> - <type name="Magento\Webapi\Controller\Rest\Request\Deserializer\Factory"> - <param name="deserializers"> - <value> - <application_json> - <type>application/json</type> - <model>Magento\Webapi\Controller\Rest\Request\Deserializer\Json</model> - </application_json> - <application_xml> - <type>application/xml</type> - <model>Magento\Webapi\Controller\Rest\Request\Deserializer\Xml</model> - </application_xml> - <application_xhtml_xml> - <type>application/xhtml+xml</type> - <model>Magento\Webapi\Controller\Rest\Request\Deserializer\Xml</model> - </application_xhtml_xml> - <text_xml> - <type>text/xml</type> - <model>Magento\Webapi\Controller\Rest\Request\Deserializer\Xml</model> - </text_xml> - </value> - </param> - </type> - <type name="Magento\Webapi\Controller\Rest\Response\Renderer\Factory"> - <param name="renders"> - <value> - <default> - <type>*/*</type> - <model>Magento\Webapi\Controller\Rest\Response\Renderer\Json</model> - </default> - <application_json> - <type>application/json</type> - <model>Magento\Webapi\Controller\Rest\Response\Renderer\Json</model> - </application_json> - <text_xml> - <type>text/xml</type> - <model>Magento\Webapi\Controller\Rest\Response\Renderer\Xml</model> - </text_xml> - <application_xml> - <type>application/xml</type> - <model>Magento\Webapi\Controller\Rest\Response\Renderer\Xml</model> - </application_xml> - <application_xhtml_xml> - <type>application/xhtml+xml</type> - <model>Magento\Webapi\Controller\Rest\Response\Renderer\Xml</model> - </application_xhtml_xml> - </value> - </param> - </type> <type name="Magento\App\AreaList"> <param name="areas"> <value> @@ -147,26 +36,4 @@ </value> </param> </type> - <type name="Magento\Webapi\Controller\Rest"> - <param name="request"> - <instance type="Magento\Webapi\Controller\Rest\Request\Proxy"/> - </param> - <param name="response"> - <instance type="Magento\Webapi\Controller\Rest\Response\Proxy"/> - </param> - <param name="router"> - <instance type="Magento\Webapi\Controller\Rest\Router\Proxy"/> - </param> - <param name="oauthHelper"> - <instance type="Magento\Oauth\Helper\Request\Proxy"/> - </param> - </type> - <type name="Magento\Webapi\Controller\Soap"> - <param name="soapServer"> - <instance type="Magento\Webapi\Model\Soap\Server\Proxy"/> - </param> - <param name="errorProcessor"> - <instance type="Magento\Webapi\Controller\ErrorProcessor\Proxy"/> - </param> - </type> </config> diff --git a/app/code/Magento/Webapi/etc/frontend/di.xml b/app/code/Magento/Webapi/etc/frontend/di.xml new file mode 100644 index 00000000000..1cef2941f5c --- /dev/null +++ b/app/code/Magento/Webapi/etc/frontend/di.xml @@ -0,0 +1,31 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> + <!-- Temporarily moved to etc/frontend due to bug in Plugin framework --> +<config> + <type name="Magento\Integration\Model\Resource\Setup"> + <plugin name="webapiSetup" type="Magento\Webapi\Model\Plugin\Setup" /> + </type> +</config> diff --git a/app/code/Magento/Integration/etc/integration/api.xsd b/app/code/Magento/Webapi/etc/integration/api.xsd similarity index 94% rename from app/code/Magento/Integration/etc/integration/api.xsd rename to app/code/Magento/Webapi/etc/integration/api.xsd index 4ebf914fc08..aed190eb184 100644 --- a/app/code/Magento/Integration/etc/integration/api.xsd +++ b/app/code/Magento/Webapi/etc/integration/api.xsd @@ -36,7 +36,7 @@ <xs:sequence> <xs:element name="resources" type="resourcesType"/> </xs:sequence> - <xs:attribute name="id" type="integrationIdType" use="required"/> + <xs:attribute name="name" type="integrationNameType" use="required"/> </xs:complexType> <xs:complexType name="resourcesType"> <xs:sequence> @@ -55,7 +55,7 @@ <xs:pattern value=".+_.+::.+"/> </xs:restriction> </xs:simpleType> - <xs:simpleType name="integrationIdType"> + <xs:simpleType name="integrationNameType"> <xs:restriction base="xs:string"> <xs:minLength value="2"/> </xs:restriction> diff --git a/app/code/Magento/Webapi/etc/module.xml b/app/code/Magento/Webapi/etc/module.xml index 570c2f364ad..c1f25d2ac17 100755 --- a/app/code/Magento/Webapi/etc/module.xml +++ b/app/code/Magento/Webapi/etc/module.xml @@ -36,6 +36,7 @@ <module name="Magento_Integration"/> <module name="Magento_Service"/> <module name="Magento_Backend"/> + <module name="Magento_User"/> </depends> </module> </config> diff --git a/app/code/Magento/Webapi/etc/webapi.xsd b/app/code/Magento/Webapi/etc/webapi.xsd index 23a46959412..25017998aa7 100644 --- a/app/code/Magento/Webapi/etc/webapi.xsd +++ b/app/code/Magento/Webapi/etc/webapi.xsd @@ -53,7 +53,7 @@ </xs:simpleType> </xs:attribute> <xs:attribute type="xs:string" name="method"/> - <xs:attribute type="xs:boolean" name="secure" default="false"/> + <xs:attribute type="xs:boolean" name="isSecure" default="false"/> </xs:extension> </xs:simpleContent> </xs:complexType> diff --git a/app/code/Magento/Webapi/etc/webapi_rest/di.xml b/app/code/Magento/Webapi/etc/webapi_rest/di.xml index 82ddb2984fc..e09556f0e5c 100644 --- a/app/code/Magento/Webapi/etc/webapi_rest/di.xml +++ b/app/code/Magento/Webapi/etc/webapi_rest/di.xml @@ -25,4 +25,129 @@ --> <config> <preference for="Magento\App\FrontControllerInterface" type="Magento\Webapi\Controller\Rest" /> + <preference for="Magento\Authorization\Policy" type="Magento\Authorization\Policy\Acl" /> + <preference for="Magento\Authorization\RoleLocator" type="Magento\Webapi\Model\Authorization\RoleLocator" /> + <preference for="Magento\Webapi\Model\Acl\Resource\ProviderInterface" type="Magento\Webapi\Model\Acl\Resource\Provider"/> + <type name="Magento\Acl\Builder"> + <param name="resourceLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Resource" /> + </param> + <param name="roleLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Role" /> + </param> + <param name="ruleLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Rule" /> + </param> + </type> + <type name="Magento\Webapi\Model\Acl\Builder"> + <param name="cache"> + <instance type="Magento\Webapi\Model\Acl\Cache" /> + </param> + <param name="resourceLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Resource" /> + </param> + <param name="roleLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Role" /> + </param> + <param name="ruleLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Rule" /> + </param> + </type> + <type name="Magento\Webapi\Model\Authorization\Policy\Acl"> + <param name="aclBuilder"> + <instance type="Magento\Webapi\Model\Acl\Builder" /> + </param> + </type> + <type name="Magento\Webapi\Model\Acl\Cache"> + <param name="cacheKey"> + <value>api_acl_resources</value> + </param> + </type> + <type name="Magento\Core\Model\Acl\RootResource"> + <param name="identifier"> + <value>Magento_Webapi</value> + </param> + </type> + <type name="Magento\Webapi\Controller\Rest\Router\Route" shared="false" /> + <type name="Magento\Xml\Generator" shared="false" /> + <type name="Magento\Xml\Parser" shared="false" /> + <type name="Magento\Code\Scanner\DirectoryScanner" shared="false" /> + <type name="Magento\Server\Reflection" shared="false" /> + <type name="Magento\Webapi\Model\Authorization\Loader\Resource"> + <param name="resourceProvider"> + <instance type="Magento\Webapi\Model\Acl\Resource\Provider" /> + </param> + </type> + <type name="Magento\Webapi\Model\Acl\Resource\Provider"> + <param name="configReader"> + <instance type="Magento\Webapi\Model\Acl\Resource\Config\Reader\Filesystem" /> + </param> + </type> + <type name="Magento\Webapi\Model\Acl\Resource\Config\Reader\Filesystem"> + <param name="converter"> + <instance type="Magento\Webapi\Model\Acl\Resource\Config\Converter\Dom" /> + </param> + </type> + <type name="Magento\Webapi\Controller\Rest\Request\Deserializer\Factory"> + <param name="deserializers"> + <value> + <application_json> + <type>application/json</type> + <model>Magento\Webapi\Controller\Rest\Request\Deserializer\Json</model> + </application_json> + <application_xml> + <type>application/xml</type> + <model>Magento\Webapi\Controller\Rest\Request\Deserializer\Xml</model> + </application_xml> + <application_xhtml_xml> + <type>application/xhtml+xml</type> + <model>Magento\Webapi\Controller\Rest\Request\Deserializer\Xml</model> + </application_xhtml_xml> + <text_xml> + <type>text/xml</type> + <model>Magento\Webapi\Controller\Rest\Request\Deserializer\Xml</model> + </text_xml> + </value> + </param> + </type> + <type name="Magento\Webapi\Controller\Rest\Response\Renderer\Factory"> + <param name="renders"> + <value> + <default> + <type>*/*</type> + <model>Magento\Webapi\Controller\Rest\Response\Renderer\Json</model> + </default> + <application_json> + <type>application/json</type> + <model>Magento\Webapi\Controller\Rest\Response\Renderer\Json</model> + </application_json> + <text_xml> + <type>text/xml</type> + <model>Magento\Webapi\Controller\Rest\Response\Renderer\Xml</model> + </text_xml> + <application_xml> + <type>application/xml</type> + <model>Magento\Webapi\Controller\Rest\Response\Renderer\Xml</model> + </application_xml> + <application_xhtml_xml> + <type>application/xhtml+xml</type> + <model>Magento\Webapi\Controller\Rest\Response\Renderer\Xml</model> + </application_xhtml_xml> + </value> + </param> + </type> + <type name="Magento\Webapi\Controller\Rest"> + <param name="request"> + <instance type="Magento\Webapi\Controller\Rest\Request\Proxy"/> + </param> + <param name="response"> + <instance type="Magento\Webapi\Controller\Rest\Response\Proxy"/> + </param> + <param name="router"> + <instance type="Magento\Webapi\Controller\Rest\Router\Proxy"/> + </param> + <param name="oauthHelper"> + <instance type="Magento\Oauth\Helper\Request\Proxy"/> + </param> + </type> </config> diff --git a/app/code/Magento/Webapi/etc/webapi_soap/di.xml b/app/code/Magento/Webapi/etc/webapi_soap/di.xml index 1173aa145ee..d701f2aa35b 100644 --- a/app/code/Magento/Webapi/etc/webapi_soap/di.xml +++ b/app/code/Magento/Webapi/etc/webapi_soap/di.xml @@ -25,4 +25,75 @@ --> <config> <preference for="Magento\App\FrontControllerInterface" type="Magento\Webapi\Controller\Soap" /> + <preference for="Magento\Authorization\Policy" type="Magento\Authorization\Policy\Acl" /> + <preference for="Magento\Authorization\RoleLocator" type="Magento\Webapi\Model\Authorization\RoleLocator" /> + <preference for="Magento\Webapi\Model\Acl\Resource\ProviderInterface" type="Magento\Webapi\Model\Acl\Resource\Provider"/> + <type name="Magento\Acl\Builder"> + <param name="resourceLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Resource" /> + </param> + <param name="roleLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Role" /> + </param> + <param name="ruleLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Rule" /> + </param> + </type> + <type name="Magento\Webapi\Model\Acl\Builder"> + <param name="cache"> + <instance type="Magento\Webapi\Model\Acl\Cache" /> + </param> + <param name="resourceLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Resource" /> + </param> + <param name="roleLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Role" /> + </param> + <param name="ruleLoader"> + <instance type="Magento\Webapi\Model\Authorization\Loader\Rule" /> + </param> + </type> + <type name="Magento\Webapi\Model\Authorization\Policy\Acl"> + <param name="aclBuilder"> + <instance type="Magento\Webapi\Model\Acl\Builder" /> + </param> + </type> + <type name="Magento\Webapi\Model\Acl\Cache"> + <param name="cacheKey"> + <value>api_acl_resources</value> + </param> + </type> + <type name="Magento\Core\Model\Acl\RootResource"> + <param name="identifier"> + <value>Magento_Webapi</value> + </param> + </type> + <type name="Magento\Webapi\Controller\Rest\Router\Route" shared="false" /> + <type name="Magento\Xml\Generator" shared="false" /> + <type name="Magento\Xml\Parser" shared="false" /> + <type name="Magento\Code\Scanner\DirectoryScanner" shared="false" /> + <type name="Magento\Server\Reflection" shared="false" /> + <type name="Magento\Webapi\Model\Authorization\Loader\Resource"> + <param name="resourceProvider"> + <instance type="Magento\Webapi\Model\Acl\Resource\Provider" /> + </param> + </type> + <type name="Magento\Webapi\Model\Acl\Resource\Provider"> + <param name="configReader"> + <instance type="Magento\Webapi\Model\Acl\Resource\Config\Reader\Filesystem" /> + </param> + </type> + <type name="Magento\Webapi\Model\Acl\Resource\Config\Reader\Filesystem"> + <param name="converter"> + <instance type="Magento\Webapi\Model\Acl\Resource\Config\Converter\Dom" /> + </param> + </type> + <type name="Magento\Webapi\Controller\Soap"> + <param name="soapServer"> + <instance type="Magento\Webapi\Model\Soap\Server\Proxy"/> + </param> + <param name="errorProcessor"> + <instance type="Magento\Webapi\Controller\ErrorProcessor\Proxy"/> + </param> + </type> </config> diff --git a/app/code/Magento/Webapi/view/adminhtml/integration/activate/permissions/tab/webapi.phtml b/app/code/Magento/Webapi/view/adminhtml/integration/activate/permissions/tab/webapi.phtml new file mode 100644 index 00000000000..ca5af566554 --- /dev/null +++ b/app/code/Magento/Webapi/view/adminhtml/integration/activate/permissions/tab/webapi.phtml @@ -0,0 +1,55 @@ +<?php +/** + * API permissions tab template for integration activation dialog. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + * + * @var \Magento\Webapi\Block\Adminhtml\Integration\Activate\Permissions\Tab\Webapi $this + */ +?> +<fieldset class="fieldset form-inline entry-edit"> + <div class="field" data-role="tree-resources-container"> + <div class="control"> + <div id="resource-tree" class="tree x-tree" data-role="resource-tree"></div> + </div> + </div> +</fieldset> +<script type="text/javascript"> +jQuery(function($) { + head.js('<?php echo $this->getViewFileUrl('jquery/jstree/jquery.hotkeys.js')?>', + '<?php echo $this->getViewFileUrl('jquery/jstree/jquery.jstree.js')?>', + '<?php echo $this->getViewFileUrl('Magento_User::js/roles-tree.js')?>', function() { + $.widget('mage.rolesTree', $.mage.rolesTree, { + _checkNode: function(event) {}, + _checkNodes: function() { + this._super(); + this.element.jstree('disable_hotkeys').jstree('hide_checkboxes') + .find('li.jstree-unchecked').hide().end().find('li.jstree-checked').attr('rel', 'disabled'); + } + }); + $('[data-role="resource-tree"]').rolesTree({ + 'treeInitData': <?php echo $this->getResourcesTreeJson() ?>, + 'treeInitSelectedData': <?php echo $this->getSelectedResourcesJson() ?> + }); + }); +}); +</script> diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_activate_permissions_webapi.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_activate_permissions_webapi.xml new file mode 100644 index 00000000000..3fdd0e0ce96 --- /dev/null +++ b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_activate_permissions_webapi.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<!-- +/** + * Tab for integration activation permissions popup. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="integration.activate.permissions.tabs"> + <block class="Magento\Webapi\Block\Adminhtml\Integration\Activate\Permissions\Tab\Webapi" name="integration_activate_permissions_tabs_webapi" template="integration/activate/permissions/tab/webapi.phtml"/> + <action method="addTab"> + <argument name="name" xsi:type="string">integration_activate_permissions_tabs_webapi</argument> + <argument name="block" xsi:type="string">integration_activate_permissions_tabs_webapi</argument> + </action> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml new file mode 100644 index 00000000000..a034a0812f2 --- /dev/null +++ b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_integration_edit.xml @@ -0,0 +1,39 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <update handle="editor"/> + <referenceBlock name="integration_edit_tabs"> + <block class="Magento\Webapi\Block\Adminhtml\Integration\Edit\Tab\Webapi" name="integration_edit_tab_webapi" template="Magento_Webapi::resourcetree.phtml"/> + <action method="addTabAfter"> + <argument name="name" xsi:type="string">api_section</argument> + <argument name="block" xsi:type="string">integration_edit_tab_webapi</argument> + <argument name="after" xsi:type="string">info_section</argument> + </action> + </referenceBlock> + <referenceContainer name="js"> + <block class="Magento\Backend\Block\Template" name="adminhtml.integration.webapi.tree.js" template="Magento_User::user/roles_grid_js.phtml"/> + </referenceContainer> +</layout> diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_edit.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_edit.xml index b1983999653..148849bdee8 100644 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_edit.xml +++ b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_role_edit.xml @@ -41,6 +41,6 @@ </action> </referenceBlock> <referenceContainer name="js"> - <block class="Magento\View\Block\Template" template="Magento_Webapi::rolesusersgridjs.phtml"/> + <block class="Magento\View\Element\Template" template="Magento_Webapi::rolesusersgridjs.phtml"/> </referenceContainer> </layout> diff --git a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_edit_tab_roles_grid_block.xml b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_edit_tab_roles_grid_block.xml index c6031032e7c..3097b6eb3af 100644 --- a/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_edit_tab_roles_grid_block.xml +++ b/app/code/Magento/Webapi/view/adminhtml/layout/adminhtml_webapi_user_edit_tab_roles_grid_block.xml @@ -57,6 +57,7 @@ <argument name="required" xsi:type="string">0</argument> <argument name="value" xsi:type="string"> <updater>Magento\Webapi\Model\Acl\User\RoleUpdater</updater> + <value/> </argument> </arguments> </block> diff --git a/app/code/Magento/Webapi/view/adminhtml/resourcetree.phtml b/app/code/Magento/Webapi/view/adminhtml/resourcetree.phtml new file mode 100644 index 00000000000..fb815b14ba3 --- /dev/null +++ b/app/code/Magento/Webapi/view/adminhtml/resourcetree.phtml @@ -0,0 +1,62 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +?> + +<?php +/** @var $this \Magento\Webapi\Block\Adminhtml\Integration\Edit\Tab\Webapi */ +?> + +<?php echo $this->getChildHtml(); ?> + +<fieldset class="fieldset form-inline entry-edit"> + <legend class="legend"> + <span><?php echo __('Available APIs') ?></span> + </legend><br /> + + <div class="field"> + <label class="label" for="all_resources"><span><?php echo __('Resource Access') ?></span></label> + + <div class="control"> + <select id="all_resources" name="all_resources" onchange="jQuery('[data-role=tree-resources-container]').toggle()" class="select"> + <option value="0" <?php echo ($this->isEverythingAllowed()?'':'selected="selected"'); ?>><?php echo __('Custom') ?></option> + <option value="1" <?php echo ($this->isEverythingAllowed()?'selected="selected"':''); ?>><?php echo __('All') ?></option> + </select> + </div> + </div> + + <div class="field<?php if($this->isEverythingAllowed()):?> no-display<?php endif?>" data-role="tree-resources-container"> + <label class="label"><span><?php echo __('Resources') ?></span></label> + + <div class="control"> + <div class="tree x-tree" data-role="resource-tree" data-mage-init="<?php + echo $this->escapeHtml($this->helper('Magento\Core\Helper\Data')->jsonEncode(array( + "rolesTree" => array( + "treeInitData" => $this->getTree(), + "treeInitSelectedData" => $this->getSelectedResources(), + ) + ))); + ?>"></div> + </div> + </div> +</fieldset> diff --git a/app/code/Magento/Webapi/view/adminhtml/rolesusersgridjs.phtml b/app/code/Magento/Webapi/view/adminhtml/rolesusersgridjs.phtml index 8207b80348c..3399d3e9e0d 100644 --- a/app/code/Magento/Webapi/view/adminhtml/rolesusersgridjs.phtml +++ b/app/code/Magento/Webapi/view/adminhtml/rolesusersgridjs.phtml @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * - * @var \Magento\View\Block\Template $this + * @var \Magento\View\Element\Template $this */ ?> <?php $usersGridBlock = $this->getLayout()->getBlock('webapi.role.edit.tab.users.grid'); ?> diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webhook.php b/app/code/Magento/Webhook/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webhook.php new file mode 100644 index 00000000000..3b71bab910f --- /dev/null +++ b/app/code/Magento/Webhook/Block/Adminhtml/Integration/Activate/Permissions/Tab/Webhook.php @@ -0,0 +1,64 @@ +<?php +/** + * Webhook permissions tab for integration activation dialog. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Webhook\Block\Adminhtml\Integration\Activate\Permissions\Tab; + +use Magento\Backend\Block\Widget\Tab\TabInterface; +use Magento\View\Element\Template; + +class Webhook extends Template implements TabInterface +{ + /** + * {@inheritDoc} + */ + public function canShowTab() + { + return true; + } + + /** + * {@inheritDoc} + */ + public function getTabLabel() + { + return __('Webhook'); + } + + /** + * {@inheritDoc} + */ + public function getTabTitle() + { + return __('Webhook'); + } + + /** + * {@inheritDoc} + */ + public function isHidden() + { + return false; + } +} diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Registration/Activate.php b/app/code/Magento/Webhook/Block/Adminhtml/Registration/Activate.php index 72580132e88..934bb556406 100644 --- a/app/code/Magento/Webhook/Block/Adminhtml/Registration/Activate.php +++ b/app/code/Magento/Webhook/Block/Adminhtml/Registration/Activate.php @@ -40,19 +40,17 @@ class Activate extends \Magento\Backend\Block\Template /** @var array */ protected $_subscriptionData; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + parent::__construct($context, $data); $this->_subscriptionData = $registry->registry(self::REGISTRY_KEY_CURRENT_SUBSCRIPTION); } diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Registration/Create/Form/Container.php b/app/code/Magento/Webhook/Block/Adminhtml/Registration/Create/Form/Container.php index ebfc1ffb0a2..bac3dfadbab 100644 --- a/app/code/Magento/Webhook/Block/Adminhtml/Registration/Create/Form/Container.php +++ b/app/code/Magento/Webhook/Block/Adminhtml/Registration/Create/Form/Container.php @@ -39,19 +39,17 @@ class Container extends \Magento\Backend\Block\Template /** @var array */ protected $_subscriptionData; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + parent::__construct($context, $data); $this->_subscriptionData = $registry->registry(self::REGISTRY_KEY_CURRENT_SUBSCRIPTION);; } diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit.php b/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit.php index 0ace3ac2736..fb57603916a 100644 --- a/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit.php +++ b/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit.php @@ -38,19 +38,17 @@ class Edit extends \Magento\Backend\Block\Widget\Form\Container /** @var array $_subscriptionData */ protected $_subscriptionData; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { + parent::__construct($context, $data); $this->_objectId = 'id'; $this->_blockGroup = 'Magento_Webhook'; diff --git a/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit/Form.php b/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit/Form.php index 19dbf98d2d4..53585d4d4bd 100644 --- a/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit/Form.php +++ b/app/code/Magento/Webhook/Block/Adminhtml/Subscription/Edit/Form.php @@ -49,27 +49,25 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic /** @var \Magento\Webhook\Model\Source\Hook $_hook */ protected $_hook; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Webhook\Model\Source\Format $format - * @param \Magento\Webhook\Model\Source\Authentication $authentication - * @param \Magento\Webhook\Model\Source\Hook $hook - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Webhook\Model\Source\Format $format + * @param \Magento\Webhook\Model\Source\Authentication $authentication + * @param \Magento\Webhook\Model\Source\Hook $hook + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Webhook\Model\Source\Format $format, - \Magento\Webhook\Model\Source\Authentication $authentication, - \Magento\Webhook\Model\Source\Hook $hook, - array $data = array() - ) { - parent::__construct($context, $coreData, $registry, $formFactory, $data); + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Webhook\Model\Source\Format $format, + \Magento\Webhook\Model\Source\Authentication $authentication, + \Magento\Webhook\Model\Source\Hook $hook, + array $data = array() + ) { + parent::__construct($context, $registry, $formFactory, $data); $this->_formFactory = $formFactory; $this->_registry = $registry; $this->_format = $format; diff --git a/app/code/Magento/Webhook/Model/Job.php b/app/code/Magento/Webhook/Model/Job.php index d313a0bbfd1..aa31958ff8e 100644 --- a/app/code/Magento/Webhook/Model/Job.php +++ b/app/code/Magento/Webhook/Model/Job.php @@ -67,20 +67,20 @@ class Job extends \Magento\Core\Model\AbstractModel implements \Magento\PubSub\J ); /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Webhook\Model\Event\Factory $eventFactory * @param \Magento\Webhook\Model\Subscription\Factory $subscriptionFactory - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Webhook\Model\Event\Factory $eventFactory, \Magento\Webhook\Model\Subscription\Factory $subscriptionFactory, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $coreRegistry, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, @@ -89,7 +89,7 @@ class Job extends \Magento\Core\Model\AbstractModel implements \Magento\PubSub\J $this->_eventFactory = $eventFactory; $this->_subscriptionFactory = $subscriptionFactory; $this->_dateTime = $dateTime; - parent::__construct($context, $coreRegistry, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $resource, $resourceCollection, $data); } /** diff --git a/app/code/Magento/Webhook/Model/Resource/Event/Collection.php b/app/code/Magento/Webhook/Model/Resource/Event/Collection.php index 81df66dec32..1acca1484ad 100644 --- a/app/code/Magento/Webhook/Model/Resource/Event/Collection.php +++ b/app/code/Magento/Webhook/Model/Resource/Event/Collection.php @@ -50,25 +50,27 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_dateTime; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Stdlib\DateTime $dateTime + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource - * @param null $timeoutIdling + * @param mixed $timeoutIdling */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Stdlib\DateTime $dateTime, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null, $timeoutIdling = null ) { $this->_dateTime = $dateTime; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_timeoutIdling = is_null($timeoutIdling) ? self::DEFAULT_TIMEOUT_IDLING_EVENTS : $timeoutIdling; } diff --git a/app/code/Magento/Webhook/Model/Resource/Job/Collection.php b/app/code/Magento/Webhook/Model/Resource/Job/Collection.php index b8129754f59..56d6bb022ff 100644 --- a/app/code/Magento/Webhook/Model/Resource/Job/Collection.php +++ b/app/code/Magento/Webhook/Model/Resource/Job/Collection.php @@ -43,25 +43,27 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_timeoutIdling; /** - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager * @param \Magento\Stdlib\DateTime $dateTime + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource - * @param null $timeoutIdling + * @param mixed $timeoutIdling */ public function __construct( - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, \Magento\Stdlib\DateTime $dateTime, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null, $timeoutIdling = null ) { $this->dateTime = $dateTime; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_timeoutIdling = is_null($timeoutIdling) ? self::DEFAULT_TIMEOUT_IDLING_JOBS : $timeoutIdling; } diff --git a/app/code/Magento/Webhook/Model/Resource/Subscription/Collection.php b/app/code/Magento/Webhook/Model/Resource/Subscription/Collection.php index 9b1ce3657fc..77165d8b8e6 100644 --- a/app/code/Magento/Webhook/Model/Resource/Subscription/Collection.php +++ b/app/code/Magento/Webhook/Model/Resource/Subscription/Collection.php @@ -37,22 +37,24 @@ class Collection protected $_endpointResource; /** - * @param \Magento\Webhook\Model\Resource\Endpoint $endpointResource - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Webhook\Model\Resource\Endpoint $endpointResource + * @param mixed $connection * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Webhook\Model\Resource\Endpoint $endpointResource, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Webhook\Model\Resource\Endpoint $endpointResource, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); $this->_endpointResource = $endpointResource; } diff --git a/app/code/Magento/Webhook/Model/Resource/Subscription/Grid/Collection.php b/app/code/Magento/Webhook/Model/Resource/Subscription/Grid/Collection.php index 2d6c06e4cf1..445f890b54d 100644 --- a/app/code/Magento/Webhook/Model/Resource/Subscription/Grid/Collection.php +++ b/app/code/Magento/Webhook/Model/Resource/Subscription/Grid/Collection.php @@ -31,24 +31,34 @@ class Collection extends \Magento\Webhook\Model\Resource\Subscription\Collection { /** - * @param \Magento\Webhook\Model\Subscription\Config $subscriptionConfig - * @param \Magento\Webhook\Model\Resource\Endpoint $endpointResource - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory - * @param \Magento\Core\Model\Resource\Db\Abstract $resource + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Webhook\Model\Resource\Endpoint $endpointResource + * @param \Magento\Webhook\Model\Subscription\Config $subscriptionConfig + * @param mixed $connection + * @param \Magento\Core\Model\Resource\Db\AbstractDb $resource */ public function __construct( - \Magento\Webhook\Model\Subscription\Config $subscriptionConfig, - \Magento\Webhook\Model\Resource\Endpoint $endpointResource, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\Webhook\Model\Resource\Endpoint $endpointResource, + \Magento\Webhook\Model\Subscription\Config $subscriptionConfig, + $connection = null, \Magento\Core\Model\Resource\Db\AbstractDb $resource = null ) { - parent::__construct($endpointResource, $eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $endpointResource, + $connection, + $resource + ); $subscriptionConfig->updateSubscriptionCollection(); } } diff --git a/app/code/Magento/Webhook/Model/Subscription.php b/app/code/Magento/Webhook/Model/Subscription.php index 04969789786..577a752b8bd 100644 --- a/app/code/Magento/Webhook/Model/Subscription.php +++ b/app/code/Magento/Webhook/Model/Subscription.php @@ -79,18 +79,18 @@ class Subscription private $_endpointLoaded = false; /** - * @param \Magento\Webhook\Model\Endpoint $endpoint * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $coreRegistry + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Webhook\Model\Endpoint $endpoint * @param \Magento\Stdlib\DateTime $dateTime * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( - \Magento\Webhook\Model\Endpoint $endpoint, \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $coreRegistry, + \Magento\Core\Model\Registry $registry, + \Magento\Webhook\Model\Endpoint $endpoint, \Magento\Stdlib\DateTime $dateTime, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, @@ -100,7 +100,7 @@ class Subscription if (!isset($data['status'])) { $data['status'] = \Magento\PubSub\SubscriptionInterface::STATUS_INACTIVE; } - parent::__construct($context, $coreRegistry, $resource, $resourceCollection, $data); + parent::__construct($context, $registry, $resource, $resourceCollection, $data); $this->_dateTime = $dateTime; $this->_endpoint = $endpoint; } diff --git a/app/code/Magento/Webhook/etc/module.xml b/app/code/Magento/Webhook/etc/module.xml index dea459d8455..b18c83866ff 100755 --- a/app/code/Magento/Webhook/etc/module.xml +++ b/app/code/Magento/Webhook/etc/module.xml @@ -33,7 +33,7 @@ <module name="Magento_Core"/> <module name="Magento_Webapi"/> <module name="Magento_Backend"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/Webhook/etc/webapi.xml b/app/code/Magento/Webhook/etc/webapi.xml index f02d0789330..91337f8f30d 100644 --- a/app/code/Magento/Webhook/etc/webapi.xml +++ b/app/code/Magento/Webhook/etc/webapi.xml @@ -27,10 +27,10 @@ --> <config> <service class="Magento\Webhook\Service\SubscriptionV1Interface" baseUrl="/V1/subscriptions"> - <rest-route httpMethod="GET" method="getAll" secure="true"/> - <rest-route httpMethod="POST" method="create" secure="true"/> - <rest-route httpMethod="PUT" method="update" secure="true">/:subscriptionId</rest-route> - <rest-route httpMethod="GET" method="get" secure="true">/:subscriptionId</rest-route> - <rest-route httpMethod="DELETE" method="delete" secure="true">/:subscriptionId</rest-route> + <rest-route httpMethod="GET" method="getAll" isSecure="true"/> + <rest-route httpMethod="POST" method="create" isSecure="true"/> + <rest-route httpMethod="PUT" method="update" isSecure="true">/:subscriptionId</rest-route> + <rest-route httpMethod="GET" method="get" isSecure="true">/:subscriptionId</rest-route> + <rest-route httpMethod="DELETE" method="delete" isSecure="true">/:subscriptionId</rest-route> </service> </config> diff --git a/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_integration_activate_permissions_webhook.xml b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_integration_activate_permissions_webhook.xml new file mode 100644 index 00000000000..aa1363b0862 --- /dev/null +++ b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_integration_activate_permissions_webhook.xml @@ -0,0 +1,36 @@ +<?xml version="1.0"?> +<!-- +/** + * Tab for integration activation permissions popup. + * + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <referenceBlock name="integration.activate.permissions.tabs"> + <block class="Magento\Webhook\Block\Adminhtml\Integration\Activate\Permissions\Tab\Webhook" name="integration_activate_permissions_tabs_webhook"/> + <action method="addTab"> + <argument name="name" xsi:type="string">integration_activate_permissions_tabs_webhook</argument> + <argument name="block" xsi:type="string">integration_activate_permissions_tabs_webhook</argument> + </action> + </referenceBlock> +</layout> diff --git a/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_activate.xml b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_activate.xml index 955fa494779..1a1f6c161aa 100644 --- a/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_activate.xml +++ b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_activate.xml @@ -24,39 +24,39 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\Page\Block\Html" name="root" output="1" template="empty.phtml"> + <block class="Magento\Theme\Block\Html" name="root" output="1" template="empty.phtml"> <block class="Magento\Backend\Block\Page\Head" name="head" as="head" template="page/head.phtml"> - <block class="Magento\Page\Block\Html\Head\Css" name="mui-reset-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mui-reset-css"> <arguments> <argument name="file" xsi:type="string">mui/reset.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-webhook-css-boxes-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-webhook-css-boxes-css"> <arguments> <argument name="file" xsi:type="string">Magento_Webhook::css/boxes.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-webhook-css-webhook-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-webhook-css-webhook-css"> <arguments> <argument name="file" xsi:type="string">Magento_Webhook::css/webhook.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-prototype-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-prototype-js"> <arguments> <argument name="file" xsi:type="string">prototype/prototype.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-translate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-translate-js"> <arguments> <argument name="file" xsi:type="string">mage/translate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/tools.js</argument> </arguments> diff --git a/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_failed.xml b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_failed.xml index 9fe59844735..22f174b3596 100644 --- a/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_failed.xml +++ b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_failed.xml @@ -24,34 +24,34 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\Page\Block\Html" name="root" output="1" template="empty.phtml"> + <block class="Magento\Theme\Block\Html" name="root" output="1" template="empty.phtml"> <block class="Magento\Backend\Block\Page\Head" name="head" as="head" template="page/head.phtml"> - <block class="Magento\Page\Block\Html\Head\Css" name="mui-reset-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mui-reset-css"> <arguments> <argument name="file" xsi:type="string">mui/reset.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-webhook-css-boxes-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-webhook-css-boxes-css"> <arguments> <argument name="file" xsi:type="string">Magento_Webhook::css/boxes.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-webhook-css-webhook-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-webhook-css-webhook-css"> <arguments> <argument name="file" xsi:type="string">Magento_Webhook::css/webhook.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-prototype-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-prototype-js"> <arguments> <argument name="file" xsi:type="string">prototype/prototype.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-translate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-translate-js"> <arguments> <argument name="file" xsi:type="string">mage/translate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/tools.js</argument> </arguments> diff --git a/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_succeeded.xml b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_succeeded.xml index 6fc417e3d68..0b5f63b08e1 100644 --- a/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_succeeded.xml +++ b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_succeeded.xml @@ -24,39 +24,39 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\Page\Block\Html" name="root" output="1" template="empty.phtml"> + <block class="Magento\Theme\Block\Html" name="root" output="1" template="empty.phtml"> <block class="Magento\Backend\Block\Page\Head" name="head" as="head" template="page/head.phtml"> - <block class="Magento\Page\Block\Html\Head\Css" name="mui-reset-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mui-reset-css"> <arguments> <argument name="file" xsi:type="string">mui/reset.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-webhook-css-boxes-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-webhook-css-boxes-css"> <arguments> <argument name="file" xsi:type="string">Magento_Webhook::css/boxes.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-webhook-css-webhook-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-webhook-css-webhook-css"> <arguments> <argument name="file" xsi:type="string">Magento_Webhook::css/webhook.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-prototype-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-prototype-js"> <arguments> <argument name="file" xsi:type="string">prototype/prototype.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-translate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-translate-js"> <arguments> <argument name="file" xsi:type="string">mage/translate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/tools.js</argument> </arguments> diff --git a/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_user.xml b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_user.xml index b97b78f07b8..a31415ba405 100644 --- a/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_user.xml +++ b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_registration_user.xml @@ -24,49 +24,49 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\Page\Block\Html" name="root" output="1" template="empty.phtml"> + <block class="Magento\Theme\Block\Html" name="root" output="1" template="empty.phtml"> <block class="Magento\Backend\Block\Page\Head" name="head" as="head" template="page/head.phtml"> - <block class="Magento\Page\Block\Html\Head\Css" name="mui-reset-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mui-reset-css"> <arguments> <argument name="file" xsi:type="string">mui/reset.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-webhook-css-boxes-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-webhook-css-boxes-css"> <arguments> <argument name="file" xsi:type="string">Magento_Webhook::css/boxes.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-webhook-css-webhook-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-webhook-css-webhook-css"> <arguments> <argument name="file" xsi:type="string">Magento_Webhook::css/webhook.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-validate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-validate-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.validate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-webhook-js-validate-form-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-webhook-js-validate-form-js"> <arguments> <argument name="file" xsi:type="string">Magento_Webhook::js/validate_form.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-prototype-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-prototype-js"> <arguments> <argument name="file" xsi:type="string">prototype/prototype.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-translate-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-translate-js"> <arguments> <argument name="file" xsi:type="string">mage/translate.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-tools-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/tools.js</argument> </arguments> diff --git a/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_subscription_index.xml b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_subscription_index.xml index 014dba75e46..2ff17af732f 100644 --- a/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_subscription_index.xml +++ b/app/code/Magento/Webhook/view/adminhtml/layout/adminhtml_webhook_subscription_index.xml @@ -25,12 +25,12 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-webhook-css-modal-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-webhook-css-modal-css"> <arguments> <argument name="file" xsi:type="string">Magento_Webhook::css/modal.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-webhook-js-webhook-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-webhook-js-webhook-js"> <arguments> <argument name="file" xsi:type="string">Magento_Webhook::js/webhook.js</argument> </arguments> diff --git a/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php b/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php index 1fbf1565c8b..4bb315a10bc 100644 --- a/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php +++ b/app/code/Magento/Weee/Block/Renderer/Weee/Tax.php @@ -61,7 +61,6 @@ class Tax /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Directory\Model\Config\Source\Country $sourceCountry * @param \Magento\Directory\Helper\Data $directoryHelper * @param \Magento\Core\Model\Registry $registry @@ -69,7 +68,6 @@ class Tax */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Directory\Model\Config\Source\Country $sourceCountry, \Magento\Directory\Helper\Data $directoryHelper, \Magento\Core\Model\Registry $registry, @@ -78,7 +76,7 @@ class Tax $this->_sourceCountry = $sourceCountry; $this->_directoryHelper = $directoryHelper; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } public function getProduct() diff --git a/app/code/Magento/Weee/Helper/Data.php b/app/code/Magento/Weee/Helper/Data.php index 910af37a16e..5d1b8ede61c 100644 --- a/app/code/Magento/Weee/Helper/Data.php +++ b/app/code/Magento/Weee/Helper/Data.php @@ -72,18 +72,18 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_storeManager; /** + * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Weee\Model\Tax $weeeTax * @param \Magento\Tax\Helper\Data $taxData - * @param \Magento\App\Helper\Context $context * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig */ public function __construct( + \Magento\App\Helper\Context $context, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Weee\Model\Tax $weeeTax, \Magento\Tax\Helper\Data $taxData, - \Magento\App\Helper\Context $context, \Magento\Core\Model\Registry $coreRegistry, \Magento\Core\Model\Store\ConfigInterface $coreStoreConfig ) { diff --git a/app/code/Magento/Weee/Model/Observer.php b/app/code/Magento/Weee/Model/Observer.php index bc5b7a1543d..5b578fb7509 100644 --- a/app/code/Magento/Weee/Model/Observer.php +++ b/app/code/Magento/Weee/Model/Observer.php @@ -51,22 +51,22 @@ class Observer extends \Magento\Core\Model\AbstractModel protected $_layout; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\View\LayoutInterface $layout * @param \Magento\Weee\Model\Tax $weeeTax * @param \Magento\Weee\Helper\Data $weeeData - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Catalog\Model\Product\Type $productType * @param \Magento\Core\Model\Resource\AbstractResource $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\View\LayoutInterface $layout, \Magento\Weee\Model\Tax $weeeTax, \Magento\Weee\Helper\Data $weeeData, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\Catalog\Model\Product\Type $productType, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, diff --git a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php index c24d91ff8d6..6b46ab9fb58 100644 --- a/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php +++ b/app/code/Magento/Weee/Model/Resource/Attribute/Backend/Weee/Tax.php @@ -42,12 +42,12 @@ class Tax extends \Magento\Core\Model\Resource\Db\AbstractDb protected $_storeManager; /** - * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\App\Resource $resource + * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Core\Model\StoreManagerInterface $storeManager, - \Magento\App\Resource $resource + \Magento\App\Resource $resource, + \Magento\Core\Model\StoreManagerInterface $storeManager ) { $this->_storeManager = $storeManager; parent::__construct($resource); diff --git a/app/code/Magento/Weee/Model/Tax.php b/app/code/Magento/Weee/Model/Tax.php index b6d37d38d9b..f2dfff70c2d 100644 --- a/app/code/Magento/Weee/Model/Tax.php +++ b/app/code/Magento/Weee/Model/Tax.php @@ -83,29 +83,27 @@ class Tax extends \Magento\Core\Model\AbstractModel protected $_customerSession; /** + * @param \Magento\Core\Model\Context $context + * @param \Magento\Core\Model\Registry $registry * @param \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Tax\Model\CalculationFactory $calculationFactory * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Tax\Helper\Data $taxData * @param \Magento\Weee\Helper\Data $weeeData - * @param \Magento\Core\Model\Context $context - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Weee\Model\Resource\Tax $resource * @param \Magento\Data\Collection\Db $resourceCollection * @param array $data - * - * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( + \Magento\Core\Model\Context $context, + \Magento\Core\Model\Registry $registry, \Magento\Eav\Model\Entity\AttributeFactory $attributeFactory, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Tax\Model\CalculationFactory $calculationFactory, \Magento\Customer\Model\Session $customerSession, \Magento\Tax\Helper\Data $taxData, \Magento\Weee\Helper\Data $weeeData, - \Magento\Core\Model\Context $context, - \Magento\Core\Model\Registry $registry, \Magento\Weee\Model\Resource\Tax $resource, \Magento\Data\Collection\Db $resourceCollection = null, array $data = array() diff --git a/app/code/Magento/Weee/etc/module.xml b/app/code/Magento/Weee/etc/module.xml index 1d8ed69830e..03689c4dfdf 100644 --- a/app/code/Magento/Weee/etc/module.xml +++ b/app/code/Magento/Weee/etc/module.xml @@ -41,7 +41,7 @@ <module name="Magento_Eav"/> <module name="Magento_Customer"/> <module name="Magento_Bundle"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/Weee/view/adminhtml/layout/catalog_product_new.xml b/app/code/Magento/Weee/view/adminhtml/layout/catalog_product_new.xml index 67e03446f33..49e11783bf4 100644 --- a/app/code/Magento/Weee/view/adminhtml/layout/catalog_product_new.xml +++ b/app/code/Magento/Weee/view/adminhtml/layout/catalog_product_new.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="mage-weee-js-fpt-attribute-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="mage-weee-js-fpt-attribute-js"> <arguments> <argument name="file" xsi:type="string">Magento_Weee::js/fpt-attribute.js</argument> </arguments> diff --git a/app/code/Magento/Weee/view/frontend/layout/default.xml b/app/code/Magento/Weee/view/frontend/layout/default.xml index 26fdf1e9b57..2bbac368204 100644 --- a/app/code/Magento/Weee/view/frontend/layout/default.xml +++ b/app/code/Magento/Weee/view/frontend/layout/default.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-weee-tax-toggle-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-weee-tax-toggle-js"> <arguments> <argument name="file" xsi:type="string">Magento_Weee::tax-toggle.js</argument> </arguments> diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Chooser.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Chooser.php index ad6391b69c1..27535e6c3f1 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Chooser.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Chooser.php @@ -41,20 +41,26 @@ class Chooser extends \Magento\Backend\Block\Template */ protected $_elementFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Data\Form\Element\Factory $elementFactory - * @param array $data + /** + * @var \Magento\Json\EncoderInterface + */ + protected $_jsonEncoder; + + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Json\EncoderInterface $jsonEncoder + * @param \Magento\Data\Form\Element\Factory $elementFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Data\Form\Element\Factory $elementFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Json\EncoderInterface $jsonEncoder, + \Magento\Data\Form\Element\Factory $elementFactory, + array $data = array() + ) { + $this->_jsonEncoder = $jsonEncoder; $this->_elementFactory = $elementFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -185,7 +191,7 @@ class Chooser extends \Magento\Backend\Block\Template $chooser->setData('after_element_html', $hiddenHtml . $chooseButton->toHtml()); // render label and chooser scripts - $configJson = $this->_coreData->jsonEncode($config->getData()); + $configJson = $this->_jsonEncoder->encode($config->getData()); return ' <label class="widget-option-label" id="' . $chooserId . 'label">' . ($this->getLabel() ? $this->getLabel() : __('Not Selected')) . '</label> diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Form.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Form.php index 6010890677e..78ec59d665b 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Form.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Form.php @@ -41,24 +41,22 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_widgetFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Widget\Model\WidgetFactory $widgetFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Widget\Model\WidgetFactory $widgetFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Widget\Model\WidgetFactory $widgetFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Widget\Model\WidgetFactory $widgetFactory, + array $data = array() + ) { $this->_widgetFactory = $widgetFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** @@ -78,6 +76,7 @@ class Form extends \Magento\Backend\Block\Widget\Form\Generic 'title' => __('Widget Type'), 'name' => 'widget_type', 'required' => true, + 'onchange' => "wWidget.validateField()", 'options' => $this->_getWidgetSelectOptions(), 'after_element_html' => $this->_getWidgetSelectAfterHtml(), )); diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit.php index 9356107cd9b..877923015ac 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit.php @@ -42,20 +42,18 @@ class Edit extends \Magento\Adminhtml\Block\Widget\Form\Container */ protected $_coreRegistry = null; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + array $data = array() + ) { $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php index 1af83ccfba3..9be04df32d3 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Container.php @@ -34,7 +34,7 @@ */ namespace Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser; -class Container extends \Magento\View\Block\Html\Select +class Container extends \Magento\View\Element\Html\Select { /** * @var \Magento\View\Layout\ProcessorFactory @@ -47,14 +47,14 @@ class Container extends \Magento\View\Block\Html\Select protected $_themesFactory; /** - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory * @param \Magento\Core\Model\Resource\Theme\CollectionFactory $themesFactory * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory, \Magento\Core\Model\Resource\Theme\CollectionFactory $themesFactory, array $data = array() @@ -78,7 +78,7 @@ class Container extends \Magento\View\Block\Html\Select /** * Add necessary options * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php index bef7ba3202a..2424951442a 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstraction.php @@ -32,7 +32,7 @@ namespace Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser; * @method getArea() * @method getTheme() */ -class DesignAbstraction extends \Magento\View\Block\Html\Select +class DesignAbstraction extends \Magento\View\Element\Html\Select { /** * @var \Magento\View\Layout\ProcessorFactory @@ -50,14 +50,14 @@ class DesignAbstraction extends \Magento\View\Block\Html\Select protected $_appState; /** - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory * @param \Magento\Core\Model\Resource\Theme\CollectionFactory $themesFactory * @param \Magento\App\State $appState * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\View\Layout\ProcessorFactory $layoutProcessorFactory, \Magento\Core\Model\Resource\Theme\CollectionFactory $themesFactory, \Magento\App\State $appState, @@ -72,7 +72,7 @@ class DesignAbstraction extends \Magento\View\Block\Html\Select /** * Add necessary options * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php index 93cef5b4c0c..0ed066fb3c6 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Layout.php @@ -32,7 +32,7 @@ namespace Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser; * @method getArea() * @method getTheme() */ -class Layout extends \Magento\View\Block\Html\Select +class Layout extends \Magento\View\Element\Html\Select { /** * @var \Magento\Core\Model\Layout\PageType\Config @@ -40,12 +40,12 @@ class Layout extends \Magento\View\Block\Html\Select protected $_config; /** - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param \Magento\Core\Model\Layout\PageType\Config $config * @param array $data */ public function __construct( - \Magento\View\Block\Context $context, + \Magento\View\Element\Context $context, \Magento\Core\Model\Layout\PageType\Config $config, array $data = array() ) { @@ -56,7 +56,7 @@ class Layout extends \Magento\View\Block\Html\Select /** * Add necessary options * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php index 9c8c9c07be5..5f72c4dbdad 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/Template.php @@ -50,7 +50,7 @@ class Template $html = '<input type="hidden" name="template" value="' . $widgetTemplate['value'] . '" />'; $html .= $widgetTemplate['label']; } else { - $html = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $html = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName('template') ->setClass('select') ->setOptions($this->getWidgetTemplates()) diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php index d3fd95318f6..552c946c98f 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main.php @@ -49,7 +49,6 @@ class Main /** * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $registry * @param \Magento\Data\FormFactory $formFactory * @param \Magento\Core\Model\System\Store $store @@ -58,7 +57,6 @@ class Main */ public function __construct( \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $registry, \Magento\Data\FormFactory $formFactory, \Magento\Core\Model\System\Store $store, @@ -67,7 +65,7 @@ class Main ) { $this->_store = $store; $this->_themeLabelFactory = $themeLabelFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php index 26352ca9a7c..b4e41518926 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Main/Layout.php @@ -46,20 +46,18 @@ class Layout */ protected $_productType; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Catalog\Model\Product\Type $productType - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Catalog\Model\Product\Type $productType + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Catalog\Model\Product\Type $productType, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Catalog\Model\Product\Type $productType, + array $data = array() + ) { $this->_productType = $productType; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** @@ -142,7 +140,7 @@ class Layout */ public function getDisplayOnSelectHtml() { - $selectBlock = $this->getLayout()->createBlock('Magento\View\Block\Html\Select') + $selectBlock = $this->getLayout()->createBlock('Magento\View\Element\Html\Select') ->setName('widget_instance[{{id}}][page_group]') ->setId('widget_instance[{{id}}][page_group]') ->setClass('required-entry page_group_select select') diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php index e0e25c71735..83122797394 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Tab/Settings.php @@ -49,24 +49,22 @@ class Settings */ protected $_themeLabelFactory; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\Theme\LabelFactory $themeLabelFactory - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\Theme\LabelFactory $themeLabelFactory + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\Theme\LabelFactory $themeLabelFactory, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\Theme\LabelFactory $themeLabelFactory, + array $data = array() + ) { $this->_themeLabelFactory = $themeLabelFactory; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } protected function _construct() diff --git a/app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php b/app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php index 522462d4879..06a23fef50c 100644 --- a/app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php +++ b/app/code/Magento/Widget/Block/Adminhtml/Widget/Options.php @@ -53,27 +53,25 @@ class Options extends \Magento\Backend\Block\Widget\Form\Generic */ protected $_sourceModelPool; - /** - * @param \Magento\Backend\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Data\FormFactory $formFactory - * @param \Magento\Core\Model\Option\ArrayPool $sourceModelPool - * @param \Magento\Widget\Model\Widget $widget - * @param array $data + /** + * @param \Magento\Backend\Block\Template\Context $context + * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Data\FormFactory $formFactory + * @param \Magento\Core\Model\Option\ArrayPool $sourceModelPool + * @param \Magento\Widget\Model\Widget $widget + * @param array $data */ - public function __construct( - \Magento\Backend\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Registry $registry, - \Magento\Data\FormFactory $formFactory, - \Magento\Core\Model\Option\ArrayPool $sourceModelPool, - \Magento\Widget\Model\Widget $widget, - array $data = array() - ) { + public function __construct( + \Magento\Backend\Block\Template\Context $context, + \Magento\Core\Model\Registry $registry, + \Magento\Data\FormFactory $formFactory, + \Magento\Core\Model\Option\ArrayPool $sourceModelPool, + \Magento\Widget\Model\Widget $widget, + array $data = array() + ) { $this->_sourceModelPool = $sourceModelPool; $this->_widget = $widget; - parent::__construct($context, $coreData, $registry, $formFactory, $data); + parent::__construct($context, $registry, $formFactory, $data); } /** diff --git a/app/code/Magento/Widget/Model/Widget/Instance.php b/app/code/Magento/Widget/Model/Widget/Instance.php index 4ebacd8f1b4..b1d1f08122a 100644 --- a/app/code/Magento/Widget/Model/Widget/Instance.php +++ b/app/code/Magento/Widget/Model/Widget/Instance.php @@ -108,9 +108,9 @@ class Instance extends \Magento\Core\Model\AbstractModel protected $mathRandom; /** - * @param \Magento\Escaper $escaper * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Escaper $escaper * @param \Magento\View\FileSystem $viewFileSystem * @param \Magento\App\Cache\TypeListInterface $cacheTypeList * @param \Magento\Catalog\Model\Product\Type $productType @@ -124,16 +124,16 @@ class Instance extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Escaper $escaper, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Escaper $escaper, \Magento\View\FileSystem $viewFileSystem, \Magento\App\Cache\TypeListInterface $cacheTypeList, \Magento\Catalog\Model\Product\Type $productType, \Magento\Widget\Model\Config\Reader $reader, \Magento\Widget\Model\Widget $widgetModel, \Magento\Widget\Model\NamespaceResolver $namespaceResolver, - \Magento\Math\Random $mathRandom, + \Magento\Math\Random $mathRandom, \Magento\Core\Model\Resource\AbstractResource $resource = null, \Magento\Data\Collection\Db $resourceCollection = null, array $relatedCacheTypes = array(), @@ -525,7 +525,7 @@ class Instance extends \Magento\Core\Model\AbstractModel $templateFilename = $this->_viewFileSystem->getFilename($templatePath, array( 'area' => $this->getArea(), 'themeId' => $this->getThemeId(), - 'module' => \Magento\View\Block\AbstractBlock::extractModuleName($this->getType()), + 'module' => \Magento\View\Element\AbstractBlock::extractModuleName($this->getType()), )); if (!$this->getId() && !$this->isCompleteToCreate() || ($templatePath && !is_readable($templateFilename))) { return ''; diff --git a/app/code/Magento/Widget/etc/module.xml b/app/code/Magento/Widget/etc/module.xml index 9122cc76028..6ff15cc90dc 100755 --- a/app/code/Magento/Widget/etc/module.xml +++ b/app/code/Magento/Widget/etc/module.xml @@ -34,7 +34,7 @@ <module name="Magento_Core"/> <module name="Magento_Backend"/> <module name="Magento_Catalog"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> </depends> </module> </config> diff --git a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml index 0e60abfb1be..4b70635ef0c 100644 --- a/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml +++ b/app/code/Magento/Widget/view/adminhtml/layout/adminhtml_widget_instance_edit.xml @@ -28,22 +28,22 @@ <action method="setCanLoadExtJs"> <argument name="flag" xsi:type="string">1</argument> </action> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-adminhtml-wysiwyg-widget-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-adminhtml-wysiwyg-widget-js"> <arguments> <argument name="file" xsi:type="string">mage/adminhtml/wysiwyg/widget.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-window-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-window-js"> <arguments> <argument name="file" xsi:type="string">prototype/window.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="prototype-windows-themes-default-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="prototype-windows-themes-default-css"> <arguments> <argument name="file" xsi:type="string">prototype/windows/themes/default.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> <arguments> <argument name="file" xsi:type="string">Magento_Core::prototype/magento.css</argument> </arguments> diff --git a/app/code/Magento/Wishlist/Block/AbstractBlock.php b/app/code/Magento/Wishlist/Block/AbstractBlock.php index 579097edb94..8a33aa02f36 100644 --- a/app/code/Magento/Wishlist/Block/AbstractBlock.php +++ b/app/code/Magento/Wishlist/Block/AbstractBlock.php @@ -82,8 +82,7 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd protected $_productFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -95,8 +94,7 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -110,7 +108,7 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd $this->_wishlistData = $wishlistData; $this->_customerSession = $customerSession; $this->_productFactory = $productFactory; - parent::__construct($context, $coreData, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); + parent::__construct($context, $catalogConfig, $registry, $taxData, $catalogData, $mathRandom, $data); } /** @@ -376,7 +374,7 @@ abstract class AbstractBlock extends \Magento\Catalog\Block\Product\AbstractProd * Returns block to render item with some product type * * @param string $productType - * @return \Magento\View\Block\Template + * @return \Magento\View\Element\Template */ protected function _getItemPriceBlock($productType) { diff --git a/app/code/Magento/Wishlist/Block/Customer/Sharing.php b/app/code/Magento/Wishlist/Block/Customer/Sharing.php index e32f00a8035..ff3d5249cc6 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Sharing.php +++ b/app/code/Magento/Wishlist/Block/Customer/Sharing.php @@ -34,7 +34,7 @@ */ namespace Magento\Wishlist\Block\Customer; -class Sharing extends \Magento\View\Block\Template +class Sharing extends \Magento\View\Element\Template { /** * Entered Data cache @@ -56,22 +56,20 @@ class Sharing extends \Magento\View\Block\Template protected $_wishlistSession; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Wishlist\Model\Config $wishlistConfig * @param \Magento\Core\Model\Session\Generic $wishlistSession * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Wishlist\Model\Config $wishlistConfig, \Magento\Core\Model\Session\Generic $wishlistSession, array $data = array() ) { $this->_wishlistConfig = $wishlistConfig; $this->_wishlistSession = $wishlistSession; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist.php index cb1550a9af9..9b7d8ceb487 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Wishlist.php +++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist.php @@ -42,8 +42,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock protected $_helperPool; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -56,8 +55,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -72,7 +70,6 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock $this->_helperPool = $helperPool; parent::__construct( $context, - $coreData, $catalogConfig, $registry, $taxData, diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Button.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Button.php index 302551bf318..2ea5230065b 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Button.php +++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Button.php @@ -33,7 +33,7 @@ */ namespace Magento\Wishlist\Block\Customer\Wishlist; -class Button extends \Magento\View\Block\Template +class Button extends \Magento\View\Element\Template { /** * Wishlist config @@ -50,22 +50,20 @@ class Button extends \Magento\View\Block\Template protected $_wishlistData = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Wishlist\Helper\Data $wishlistData * @param \Magento\Wishlist\Model\Config $wishlistConfig * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Wishlist\Model\Config $wishlistConfig, array $data = array() ) { $this->_wishlistData = $wishlistData; $this->_wishlistConfig = $wishlistConfig; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php index 4f930c5d455..7fb2ba4217c 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php +++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Item/Options.php @@ -41,8 +41,7 @@ class Options extends \Magento\Wishlist\Block\AbstractBlock protected $_helperPool; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -55,8 +54,7 @@ class Options extends \Magento\Wishlist\Block\AbstractBlock * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -71,7 +69,6 @@ class Options extends \Magento\Wishlist\Block\AbstractBlock $this->_helperPool = $helperPool; parent::__construct( $context, - $coreData, $catalogConfig, $registry, $taxData, diff --git a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Items.php b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Items.php index 6414151dd89..ba564048139 100644 --- a/app/code/Magento/Wishlist/Block/Customer/Wishlist/Items.php +++ b/app/code/Magento/Wishlist/Block/Customer/Wishlist/Items.php @@ -33,7 +33,7 @@ */ namespace Magento\Wishlist\Block\Customer\Wishlist; -class Items extends \Magento\View\Block\Template +class Items extends \Magento\View\Element\Template { /** * Retrieve table column object list diff --git a/app/code/Magento/Wishlist/Block/Item/Configure.php b/app/code/Magento/Wishlist/Block/Item/Configure.php index 3562deab31b..a74efd66176 100644 --- a/app/code/Magento/Wishlist/Block/Item/Configure.php +++ b/app/code/Magento/Wishlist/Block/Item/Configure.php @@ -34,7 +34,7 @@ */ namespace Magento\Wishlist\Block\Item; -class Configure extends \Magento\View\Block\Template +class Configure extends \Magento\View\Element\Template { /** * Wishlist data @@ -51,22 +51,20 @@ class Configure extends \Magento\View\Block\Template protected $_coreRegistry = null; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Wishlist\Helper\Data $wishlistData * @param \Magento\Core\Model\Registry $registry * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Core\Model\Registry $registry, array $data = array() ) { $this->_wishlistData = $wishlistData; $this->_coreRegistry = $registry; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** diff --git a/app/code/Magento/Wishlist/Block/Link.php b/app/code/Magento/Wishlist/Block/Link.php index d5e0e115d3c..5cfc742ca61 100644 --- a/app/code/Magento/Wishlist/Block/Link.php +++ b/app/code/Magento/Wishlist/Block/Link.php @@ -27,7 +27,7 @@ */ namespace Magento\Wishlist\Block; -class Link extends \Magento\Page\Block\Link +class Link extends \Magento\View\Element\Html\Link { /** * @return string diff --git a/app/code/Magento/Wishlist/Block/Render/Item/Price.php b/app/code/Magento/Wishlist/Block/Render/Item/Price.php index 511814fb9c9..44d494bff43 100644 --- a/app/code/Magento/Wishlist/Block/Render/Item/Price.php +++ b/app/code/Magento/Wishlist/Block/Render/Item/Price.php @@ -33,7 +33,7 @@ */ namespace Magento\Wishlist\Block\Render\Item; -class Price extends \Magento\View\Block\Template +class Price extends \Magento\View\Element\Template { /** * Returns html for rendering non-configured product diff --git a/app/code/Magento/Wishlist/Block/Share/Email/Rss.php b/app/code/Magento/Wishlist/Block/Share/Email/Rss.php index a27d74e79fe..11b29c3b9af 100644 --- a/app/code/Magento/Wishlist/Block/Share/Email/Rss.php +++ b/app/code/Magento/Wishlist/Block/Share/Email/Rss.php @@ -34,7 +34,7 @@ */ namespace Magento\Wishlist\Block\Share\Email; -class Rss extends \Magento\View\Block\Template +class Rss extends \Magento\View\Element\Template { protected $_template = 'email/rss.phtml'; diff --git a/app/code/Magento/Wishlist/Block/Share/Wishlist.php b/app/code/Magento/Wishlist/Block/Share/Wishlist.php index 8675bd1f62f..568496ab822 100644 --- a/app/code/Magento/Wishlist/Block/Share/Wishlist.php +++ b/app/code/Magento/Wishlist/Block/Share/Wishlist.php @@ -49,8 +49,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock protected $_customerFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Catalog\Model\Config $catalogConfig * @param \Magento\Core\Model\Registry $registry * @param \Magento\Tax\Helper\Data $taxData @@ -63,8 +62,7 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Catalog\Model\Config $catalogConfig, \Magento\Core\Model\Registry $registry, \Magento\Tax\Helper\Data $taxData, @@ -79,7 +77,6 @@ class Wishlist extends \Magento\Wishlist\Block\AbstractBlock $this->_customerFactory = $customerFactory; parent::__construct( $context, - $coreData, $catalogConfig, $registry, $taxData, diff --git a/app/code/Magento/Wishlist/Helper/Data.php b/app/code/Magento/Wishlist/Helper/Data.php index e31029d6475..7b23d60ddc7 100644 --- a/app/code/Magento/Wishlist/Helper/Data.php +++ b/app/code/Magento/Wishlist/Helper/Data.php @@ -111,8 +111,8 @@ class Data extends \Magento\App\Helper\AbstractHelper protected $_storeManager; /** - * @param \Magento\Core\Helper\Data $coreData * @param \Magento\App\Helper\Context $context + * @param \Magento\Core\Helper\Data $coreData * @param \Magento\Core\Model\Registry $coreRegistry * @param \Magento\Core\Model\Store\Config $coreStoreConfig * @param \Magento\Customer\Model\Session $customerSession @@ -120,8 +120,8 @@ class Data extends \Magento\App\Helper\AbstractHelper * @param \Magento\Core\Model\StoreManagerInterface $storeManager */ public function __construct( - \Magento\Core\Helper\Data $coreData, \Magento\App\Helper\Context $context, + \Magento\Core\Helper\Data $coreData, \Magento\Core\Model\Registry $coreRegistry, \Magento\Core\Model\Store\Config $coreStoreConfig, \Magento\Customer\Model\Session $customerSession, diff --git a/app/code/Magento/Wishlist/Model/Observer.php b/app/code/Magento/Wishlist/Model/Observer.php index dde9b205034..e0cf923465e 100644 --- a/app/code/Magento/Wishlist/Model/Observer.php +++ b/app/code/Magento/Wishlist/Model/Observer.php @@ -56,9 +56,9 @@ class Observer extends \Magento\Core\Model\AbstractModel protected $_wishlistFactory; /** - * @param \Magento\Wishlist\Helper\Data $wishlistData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry + * @param \Magento\Wishlist\Helper\Data $wishlistData * @param \Magento\Checkout\Model\Session $checkoutSession * @param \Magento\Customer\Model\Session $customerSession * @param \Magento\Wishlist\Model\WishlistFactory $wishlistFactory @@ -67,9 +67,9 @@ class Observer extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Checkout\Model\Session $checkoutSession, \Magento\Customer\Model\Session $customerSession, \Magento\Wishlist\Model\WishlistFactory $wishlistFactory, diff --git a/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php b/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php index ea27f3a4f2b..63dde55fced 100644 --- a/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php +++ b/app/code/Magento/Wishlist/Model/Resource/Item/Collection.php @@ -157,12 +157,12 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl protected $_appState; /** - * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData - * @param \Magento\Sales\Helper\Admin $adminhtmlSales - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData + * @param \Magento\Sales\Helper\Admin $adminhtmlSales * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Date $date * @param \Magento\Wishlist\Model\Config $wishlistConfig @@ -174,14 +174,17 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl * @param \Magento\Catalog\Model\Entity\AttributeFactory $catalogAttrFactory * @param \Magento\Wishlist\Model\Resource\Item $resource * @param \Magento\App\State $appState + * @param mixed $connection + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\CatalogInventory\Helper\Data $catalogInventoryData, - \Magento\Sales\Helper\Admin $adminhtmlSales, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\CatalogInventory\Helper\Data $catalogInventoryData, + \Magento\Sales\Helper\Admin $adminhtmlSales, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Date $date, \Magento\Wishlist\Model\Config $wishlistConfig, @@ -192,7 +195,8 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl \Magento\Catalog\Model\Resource\ConfigFactory $catalogConfFactory, \Magento\Catalog\Model\Entity\AttributeFactory $catalogAttrFactory, \Magento\Wishlist\Model\Resource\Item $resource, - \Magento\App\State $appState + \Magento\App\State $appState, + $connection = null ) { $this->_inventoryData = $catalogInventoryData; $this->_adminhtmlSales = $adminhtmlSales; @@ -206,7 +210,7 @@ class Collection extends \Magento\Core\Model\Resource\Db\Collection\AbstractColl $this->_catalogConfFactory = $catalogConfFactory; $this->_catalogAttrFactory = $catalogAttrFactory; $this->_appState = $appState; - parent::__construct($eventManager, $logger, $fetchStrategy, $entityFactory, $resource); + parent::__construct($entityFactory, $logger, $fetchStrategy, $eventManager, $connection, $resource); } /** diff --git a/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php b/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php index 424c18bf647..0d94baede9c 100644 --- a/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php +++ b/app/code/Magento/Wishlist/Model/Resource/Item/Collection/Grid.php @@ -37,12 +37,12 @@ class Grid extends \Magento\Wishlist\Model\Resource\Item\Collection protected $_registryManager; /** - * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData - * @param \Magento\Sales\Helper\Admin $adminhtmlSales - * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\Core\Model\EntityFactory $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Core\Model\EntityFactory $entityFactory + * @param \Magento\Event\ManagerInterface $eventManager + * @param \Magento\CatalogInventory\Helper\Data $catalogInventoryData + * @param \Magento\Sales\Helper\Admin $adminhtmlSales * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Date $date * @param \Magento\Wishlist\Model\Config $wishlistConfig @@ -52,17 +52,20 @@ class Grid extends \Magento\Wishlist\Model\Resource\Item\Collection * @param \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory * @param \Magento\Catalog\Model\Resource\ConfigFactory $catalogConfFactory * @param \Magento\Catalog\Model\Entity\AttributeFactory $catalogAttrFactory - * @param \Magento\Core\Model\Registry $registry * @param \Magento\Wishlist\Model\Resource\Item $resource * @param \Magento\App\State $appState + * @param \Magento\Core\Model\Registry $registry + * @param mixed $connection + * + * @SuppressWarnings(PHPMD.ExcessiveParameterList) */ public function __construct( - \Magento\CatalogInventory\Helper\Data $catalogInventoryData, - \Magento\Sales\Helper\Admin $adminhtmlSales, - \Magento\Event\ManagerInterface $eventManager, + \Magento\Core\Model\EntityFactory $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Core\Model\EntityFactory $entityFactory, + \Magento\Event\ManagerInterface $eventManager, + \Magento\CatalogInventory\Helper\Data $catalogInventoryData, + \Magento\Sales\Helper\Admin $adminhtmlSales, \Magento\Core\Model\StoreManagerInterface $storeManager, \Magento\Core\Model\Date $date, \Magento\Wishlist\Model\Config $wishlistConfig, @@ -72,14 +75,32 @@ class Grid extends \Magento\Wishlist\Model\Resource\Item\Collection \Magento\Catalog\Model\Resource\Product\CollectionFactory $productCollFactory, \Magento\Catalog\Model\Resource\ConfigFactory $catalogConfFactory, \Magento\Catalog\Model\Entity\AttributeFactory $catalogAttrFactory, - \Magento\Core\Model\Registry $registry, \Magento\Wishlist\Model\Resource\Item $resource, - \Magento\App\State $appState + \Magento\App\State $appState, + \Magento\Core\Model\Registry $registry, + $connection = null ) { $this->_registryManager = $registry; - parent::__construct($catalogInventoryData, $adminhtmlSales, $eventManager, $logger, $fetchStrategy, - $entityFactory, $storeManager, $date, $wishlistConfig, $productVisibility, $coreResource, - $optionCollFactory, $productCollFactory, $catalogConfFactory, $catalogAttrFactory, $resource, $appState); + parent::__construct( + $entityFactory, + $logger, + $fetchStrategy, + $eventManager, + $catalogInventoryData, + $adminhtmlSales, + $storeManager, + $date, + $wishlistConfig, + $productVisibility, + $coreResource, + $optionCollFactory, + $productCollFactory, + $catalogConfFactory, + $catalogAttrFactory, + $resource, + $appState, + $connection + ); } /** diff --git a/app/code/Magento/Wishlist/Model/Wishlist.php b/app/code/Magento/Wishlist/Model/Wishlist.php index b8ec3dcfaeb..c1e735617d5 100644 --- a/app/code/Magento/Wishlist/Model/Wishlist.php +++ b/app/code/Magento/Wishlist/Model/Wishlist.php @@ -122,16 +122,16 @@ class Wishlist extends \Magento\Core\Model\AbstractModel protected $_useCurrentWebsite; /** - * @param \Magento\Catalog\Helper\Product $catalogProduct - * @param \Magento\Wishlist\Helper\Data $wishlistData * @param \Magento\Core\Model\Context $context * @param \Magento\Core\Model\Registry $registry - * @param \Magento\Wishlist\Model\Resource\Wishlist $resource - * @param \Magento\Wishlist\Model\Resource\Wishlist\Collection $resourceCollection + * @param \Magento\Catalog\Helper\Product $catalogProduct + * @param \Magento\Wishlist\Helper\Data $wishlistData + * @param Resource\Wishlist $resource + * @param Resource\Wishlist\Collection $resourceCollection * @param \Magento\Core\Model\StoreManagerInterface $storeManager * @param \Magento\Core\Model\Date $date - * @param \Magento\Wishlist\Model\ItemFactory $wishlistItemFactory - * @param \Magento\Wishlist\Model\Resource\Item\CollectionFactory $wishlistCollFactory + * @param ItemFactory $wishlistItemFactory + * @param Resource\Item\CollectionFactory $wishlistCollFactory * @param \Magento\Catalog\Model\ProductFactory $productFactory * @param \Magento\Math\Random $mathRandom * @param \Magento\Stdlib\DateTime $dateTime @@ -139,10 +139,10 @@ class Wishlist extends \Magento\Core\Model\AbstractModel * @param array $data */ public function __construct( - \Magento\Catalog\Helper\Product $catalogProduct, - \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Core\Model\Context $context, \Magento\Core\Model\Registry $registry, + \Magento\Catalog\Helper\Product $catalogProduct, + \Magento\Wishlist\Helper\Data $wishlistData, \Magento\Wishlist\Model\Resource\Wishlist $resource, \Magento\Wishlist\Model\Resource\Wishlist\Collection $resourceCollection, \Magento\Core\Model\StoreManagerInterface $storeManager, diff --git a/app/code/Magento/Wishlist/etc/module.xml b/app/code/Magento/Wishlist/etc/module.xml index 9cc2b1f2db5..8c41c6fad7a 100755 --- a/app/code/Magento/Wishlist/etc/module.xml +++ b/app/code/Magento/Wishlist/etc/module.xml @@ -34,7 +34,7 @@ <module name="Magento_Catalog"/> <module name="Magento_Core"/> <module name="Magento_Checkout"/> - <module name="Magento_Page"/> + <module name="Magento_Theme"/> <module name="Magento_CatalogInventory"/> <module name="Magento_Tax"/> <module name="Magento_Backend"/> diff --git a/app/code/Magento/Wishlist/view/adminhtml/customer/edit/tab/wishlist.phtml b/app/code/Magento/Wishlist/view/adminhtml/customer/edit/tab/wishlist.phtml index d09393e45db..0ec5b11b768 100644 --- a/app/code/Magento/Wishlist/view/adminhtml/customer/edit/tab/wishlist.phtml +++ b/app/code/Magento/Wishlist/view/adminhtml/customer/edit/tab/wishlist.phtml @@ -25,7 +25,7 @@ */ /** - * @var $this \Magento\View\Block\Template + * @var $this \Magento\View\Element\Template */ ?> <script type="text/javascript"> diff --git a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml index ee4f5b8caee..0cf4740f201 100644 --- a/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml +++ b/app/code/Magento/Wishlist/view/adminhtml/layout/customer_index_wishlist.xml @@ -120,7 +120,7 @@ </arguments> </block> </block> - <block class="Magento\View\Block\Template" as="grid.js"> + <block class="Magento\View\Element\Template" as="grid.js"> <arguments> <argument name="js_object_name" xsi:type="string">wishlistGridJsObject</argument> <argument name="template" xsi:type="string">Magento_Wishlist::customer/edit/tab/wishlist.phtml</argument> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml b/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml index ab700d3e318..48914728a3a 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/customer_account.xml @@ -25,7 +25,7 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="customer_account_navigation"> - <block class="Magento\Page\Block\Link\Current" ifconfig="wishlist/general/active" name="customer-account-navigation-wish-list-link"> + <block class="Magento\View\Element\Html\Link\Current" ifconfig="wishlist/general/active" name="customer-account-navigation-wish-list-link"> <arguments> <argument name="path" xsi:type="string">wishlist</argument> <argument name="label" xsi:type="string">My Wish List</argument> diff --git a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml index 7965073a56f..66855df7c3d 100644 --- a/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml +++ b/app/code/Magento/Wishlist/view/frontend/layout/wishlist_index_configure_type_bundle.xml @@ -25,12 +25,12 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-bundle-bundle-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-bundle-bundle-js"> <arguments> <argument name="file" xsi:type="string">Magento_Bundle::bundle.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-bundle-js-product-summary-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-bundle-js-product-summary-js"> <arguments> <argument name="file" xsi:type="string">Magento_Bundle::js/product-summary.js</argument> </arguments> diff --git a/app/design/adminhtml/magento_backend/Magento_Adminhtml/layout/default.xml b/app/design/adminhtml/magento_backend/Magento_Adminhtml/layout/default.xml index 51f6344bc3e..e45a7578a27 100644 --- a/app/design/adminhtml/magento_backend/Magento_Adminhtml/layout/default.xml +++ b/app/design/adminhtml/magento_backend/Magento_Adminhtml/layout/default.xml @@ -25,53 +25,53 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="mui-reset-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mui-reset-css"> <arguments> <argument name="file" xsi:type="string">mui/reset.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="mui-base-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mui-base-css"> <arguments> <argument name="file" xsi:type="string">mui/base.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="mui-elements-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mui-elements-css"> <arguments> <argument name="file" xsi:type="string">mui/elements.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="mui-form-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mui-form-css"> <arguments> <argument name="file" xsi:type="string">mui/form.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="mui-components-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mui-components-css"> <arguments> <argument name="file" xsi:type="string">mui/components.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="css-styles-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="css-styles-css"> <arguments> <argument name="file" xsi:type="string">css/styles.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="jquery-farbtastic-css-farbtastic-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="jquery-farbtastic-css-farbtastic-css"> <arguments> <argument name="file" xsi:type="string">jquery/farbtastic/css/farbtastic.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="mui-utils-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mui-utils-css"> <arguments> <argument name="file" xsi:type="string">mui/utils.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-core-prototype-magento-css"> <arguments> <argument name="file" xsi:type="string">Magento_Core::prototype/magento.css</argument> </arguments> </block> <!-- temporary to debug --> - <block class="Magento\Page\Block\Html\Head\Css" name="mui-print-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="mui-print-css"> <arguments> <argument name="file" xsi:type="string">mui/print.css</argument> <argument name="properties" xsi:type="array"> @@ -79,37 +79,37 @@ </argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="lib-modernizr-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="lib-modernizr-js"> <arguments> <argument name="file" xsi:type="string">lib/modernizr.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="js-head-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="js-head-js"> <arguments> <argument name="file" xsi:type="string">js/head.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="magento-dropdown-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="magento-dropdown-js"> <arguments> <argument name="file" xsi:type="string">mage/dropdown.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-jquery-tabs-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-jquery-tabs-js"> <arguments> <argument name="file" xsi:type="string">jquery/jquery.tabs.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="jquery-farbtastic-jquery-farbtastic-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="jquery-farbtastic-jquery-farbtastic-js"> <arguments> <argument name="file" xsi:type="string">jquery/farbtastic/jquery.farbtastic.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="js-theme-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="js-theme-js"> <arguments> <argument name="file" xsi:type="string">js/theme.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="js-jquery-details-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="js-jquery-details-js"> <arguments> <argument name="file" xsi:type="string">js/jquery.details.js</argument> </arguments> diff --git a/app/design/adminhtml/magento_backend/css/styles.css b/app/design/adminhtml/magento_backend/css/styles.css index 09afe07811f..a3d6613096f 100644 --- a/app/design/adminhtml/magento_backend/css/styles.css +++ b/app/design/adminhtml/magento_backend/css/styles.css @@ -3280,8 +3280,8 @@ input.mage-error ~ .addafter { box-shadow: 0 0 8px rgba(82, 168, 236, 0.6); } .addon input ~ .addafter strong { + display: inline-block; background: #fff; - display: block; line-height: 24px; margin: 0 3px 0 -2px; padding-left: 4px; @@ -5486,9 +5486,15 @@ table tbody tr:nth-child(odd):hover th { } .grid-actions .required:after { content: '*'; - color: red; + color: #f00; +} +[class^=" reports-report-"] .grid-actions .required:after { + content: ''; +} +[class^=" reports-report-"] .grid-actions .required .label span:after { + content: '*'; + color: #f00; } -/* TODO: remove styles for images when images will be replaced by font icons */ .grid-actions img { vertical-align: middle; height: 22px; @@ -5498,7 +5504,6 @@ table tbody tr:nth-child(odd):hover th { width: auto; height: auto; } -/* TODO: refactor validation fields styles after approved design comes */ .grid-actions .validation-advice { background: #f3dcd8; border: 1px solid #963535; @@ -5527,6 +5532,10 @@ table tbody tr:nth-child(odd):hover th { .grid-actions .link-feed { white-space: nowrap; } +.grid-actions input[type="text"].validation-failed { + border-color: #fa7973; + box-shadow: 0 0 8px rgba(250, 121, 115, 0.6); +} /* Grid - Headings -------------------------------------- */ @@ -6070,6 +6079,7 @@ table .col-draggable .draggable-handle { .order-information .data-table tbody tr th, .order-account-information .data-table tbody tr th, .adminhtml-rma-new .data-table tbody tr th, +.adminhtml-logging-details .log-details .data-table th, [class^=" sales-transactions-"] .data-table tbody tr th, [class^=" sales-"] .order-payment-method .data-table tbody tr th, [class^=" sales-billing-agreement-"] .log-details .data-table tbody tr th { @@ -6081,6 +6091,8 @@ table .col-draggable .draggable-handle { .order-information .data-table tbody tr th, .order-account-information .data-table tbody tr td, .order-account-information .data-table tbody tr th, +.adminhtml-logging-details .log-details .data-table td, +.adminhtml-logging-details .log-details .data-table th, [class^=" adminhtml-rma-"] .data-table tbody tr td, [class^=" adminhtml-rma-"] .data-table tbody tr th, [class^=" sales-transactions-"] .data-table tbody tr th, @@ -6101,6 +6113,8 @@ table .col-draggable .draggable-handle { .order-information .data-table tbody tr:nth-child(2n+1) th, .order-account-information .data-table tbody tr:nth-child(2n+1) td, .order-account-information .data-table tbody tr:nth-child(2n+1) th, +.adminhtml-logging-details .log-details .data-table tr:nth-child(odd) td, +.adminhtml-logging-details .log-details .data-table tr:nth-child(odd) th, [class^=" adminhtml-rma-"] .data-table tbody tr:nth-child(2n+1) td, [class^=" adminhtml-rma-"] .data-table tbody tr:nth-child(2n+1) th, [class^=" sales-transactions-"] .data-table tbody tr:nth-child(2n+1) th, @@ -7833,6 +7847,10 @@ table .col-draggable .draggable-handle { #allow_open_amount { margin-top: 8px; } +.catalog-product-new .user-defined.type-select select, +.catalog-product-edit .user-defined.type-select select { + width: 100%; +} /* Customer ---------------------------------------*/ @@ -8088,6 +8106,38 @@ table .col-draggable .draggable-handle { .cms-manage-content-actions textarea { width: 100%; } +/* + System -> Action Log -> Report +-------------------------------------- */ +.adminhtml-logging-details .log-details-grid table th { + border: 1px solid #c9c2b8; + border-width: 0 0 1px; + padding: 6px 10px 7px; + background: #fff; + color: #676056; + font-size: 13px; + font-weight: 600; +} +.adminhtml-logging-details .log-details-grid table th span { + border: 0; + padding: 0; +} +.adminhtml-logging-details .log-details-grid table td { + border: none; + padding: 6px 10px 7px; + background: #fff; +} +.adminhtml-logging-details .log-details-grid table tr:last-child td { + border: 1px solid #eae8e4; + border-width: 0 0 1px; +} +.adminhtml-logging-details .log-details-grid table tr.on-mouse { + cursor: inherit; +} +.adminhtml-logging-details .log-details-grid table tr:nth-child(odd) td, +.adminhtml-logging-details .log-details-grid table tr.on-mouse:nth-child(odd):hover td { + background: #fbfaf6; +} /* System -> Export -------------------------------------- */ @@ -8162,122 +8212,122 @@ table .col-draggable .draggable-handle { /* Reports - Customer Reviews -------------------------------------- */ -.adminhtml-report-review-customer .col-qty, -.adminhtml-report-review-customer .col-actions { +.reports-report-review-customer .col-qty, +.reports-report-review-customer .col-actions { width: 85px; } /* Reports - Product Reviews -------------------------------------- */ -.adminhtml-report-review-product .col-id { +.reports-report-review-product .col-id { width: 35px; } -.adminhtml-report-review-product .col-qty, -.adminhtml-report-review-product .col-rating, -.adminhtml-report-review-product .col-avg-rating, -.adminhtml-report-review-product .col-actions { +.reports-report-review-product .col-qty, +.reports-report-review-product .col-rating, +.reports-report-review-product .col-avg-rating, +.reports-report-review-product .col-actions { text-align: right; width: 85px; } -.adminhtml-report-review-product .col-date { +.reports-report-review-product .col-date { width: 140px; } -.adminhtml-report-review-product .col-rating { +.reports-report-review-product .col-rating { width: 104px; } /* Reports - New Accounts -------------------------------------- */ -.adminhtml-report-customer-accounts .col-period { +.reports-report-customer-accounts .col-period { white-space: nowrap; width: 70px; } /* Reports - Refresh Statistics -------------------------------------- */ -.adminhtml-report-statistics-index .col-period { +.reports-report-statistics-index .col-period { white-space: nowrap; width: 140px; } -.adminhtml-report-statistics-index .col-select { +.reports-report-statistics-index .col-select { width: 25px; } /* Reports - Products Ordered -------------------------------------- */ -.adminhtml-report-product-sold .col-period { +.reports-report-product-sold .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-product-sold .col-qty { +.reports-report-product-sold .col-qty { width: 110px; } /* Reports - Customers by Orders Total -------------------------------------- */ -.adminhtml-report-customer-totals .col-period { +.reports-report-customer-totals .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-customer-totals .col-qty { +.reports-report-customer-totals .col-qty { width: 65px; } -.adminhtml-report-customer-totals .col-rating { +.reports-report-customer-totals .col-rating { width: 100px; } /* Reports - Tag by popular -------------------------------------- */ -.adminhtml-report-tag-popular .col-qty, -.adminhtml-report-tag-popular .col-actions { +.reports-report-tag-popular .col-qty, +.reports-report-tag-popular .col-actions { width: 80px; } /* Reports - Tag by customer -------------------------------------- */ -.adminhtml-report-tag-customer .col-id { +.reports-report-tag-customer .col-id { width: 35px; } -.adminhtml-report-tag-customer .col-qty, -.adminhtml-report-tag-customer .col-actions { +.reports-report-tag-customer .col-qty, +.reports-report-tag-customer .col-actions { width: 80px; } /* Reports - Tag by product -------------------------------------- */ -.adminhtml-report-tag-product .col-id { +.reports-report-tag-product .col-id { width: 35px; } -.adminhtml-report-tag-product .col-actions { +.reports-report-tag-product .col-actions { width: 70px; } -.adminhtml-report-tag-product .col-unique-numbers, -.adminhtml-report-tag-product .col-total-numbers { +.reports-report-tag-product .col-unique-numbers, +.reports-report-tag-product .col-total-numbers { text-align: right; width: 95px; } /* Reports - Customers by Number of Orders -------------------------------------- */ -.adminhtml-report-customer-orders .col-period { +.reports-report-customer-orders .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-customer-orders .col-qty, -.adminhtml-report-customer-orders .col-average, -.adminhtml-report-customer-orders .col-total { +.reports-report-customer-orders .col-qty, +.reports-report-customer-orders .col-average, +.reports-report-customer-orders .col-total { width: 105px; } /* Reports - Customers by Orders Total -------------------------------------- */ -.adminhtml-report-customer-totals .col-period { +.reports-report-customer-totals .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-customer-totals .col-qty, -.adminhtml-report-customer-totals .col-average, -.adminhtml-report-customer-totals .col-total { +.reports-report-customer-totals .col-qty, +.reports-report-customer-totals .col-average, +.reports-report-customer-totals .col-total { width: 105px; } /* @@ -8298,151 +8348,151 @@ table .col-draggable .draggable-handle { /* Reports - Most Viewed -------------------------------------- */ -.adminhtml-report-product-viewed .col-period { +.reports-report-product-viewed .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-product-viewed .col-qty, -.adminhtml-report-product-viewed .col-price { +.reports-report-product-viewed .col-qty, +.reports-report-product-viewed .col-price { white-space: nowrap; width: 80px; } /* Reports - Search Terms -------------------------------------- */ -.adminhtml-report-search .col-id { +.reports-index-search .col-id { width: 35px; } -.adminhtml-report-search th.col-results, -.adminhtml-report-search th.col-hits { +.reports-index-search th.col-results, +.reports-index-search th.col-hits { text-align: left; width: 117px; } -.adminhtml-report-search td.col-results, -.adminhtml-report-search td.col-hits { +.reports-index-search td.col-results, +.reports-index-search td.col-hits { text-align: right; width: 117px; } -.adminhtml-report-search .col-results .range-line:first-child, -.adminhtml-report-search .col-hits .range-line:first-child { +.reports-index-search .col-results .range-line:first-child, +.reports-index-search .col-hits .range-line:first-child { float: left; margin-right: 3px; } /* Reports - Bestsellers -------------------------------------- */ -.adminhtml-report-sales-bestsellers .col-period { +.reports-report-sales-bestsellers .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-sales-bestsellers .col-qty, -.adminhtml-report-sales-bestsellers .col-price { +.reports-report-sales-bestsellers .col-qty, +.reports-report-sales-bestsellers .col-price { width: 80px; } /* Reports - Downloads -------------------------------------- */ -.adminhtml-report-product-downloads .col-qty, -.adminhtml-report-product-downloads .col-price { +.reports-report-product-downloads .col-qty, +.reports-report-product-downloads .col-price { width: 80px; } /* Reports - Abandoned Carts -------------------------------------- */ -.adminhtml-report-shopcart-abandoned .col-ip, -.adminhtml-report-shopcart-abandoned .col-subtotal, -.adminhtml-report-shopcart-abandoned .col-number, -.adminhtml-report-shopcart-abandoned .col-coupon { +.reports-report-shopcart-abandoned .col-ip, +.reports-report-shopcart-abandoned .col-subtotal, +.reports-report-shopcart-abandoned .col-number, +.reports-report-shopcart-abandoned .col-coupon { text-align: right; } -.adminhtml-report-shopcart-abandoned .col-ip { +.reports-report-shopcart-abandoned .col-ip { width: 105px; } -.adminhtml-report-shopcart-abandoned .col-subtotal { +.reports-report-shopcart-abandoned .col-subtotal { width: 65px; } /* Reports - Products in Carts -------------------------------------- */ -.adminhtml-report-shopcart-product .col-id { +.reports-report-shopcart-product .col-id { width: 35px; } -.adminhtml-report-shopcart-product .col-carts, -.adminhtml-report-shopcart-product .col-qty, -.adminhtml-report-shopcart-product .col-price { +.reports-report-shopcart-product .col-carts, +.reports-report-shopcart-product .col-qty, +.reports-report-shopcart-product .col-price { text-align: right; width: 80px; } /* Reports - Refunds -------------------------------------- */ -.adminhtml-report-sales-refunded .col-period { +.reports-report-sales-refunded .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-sales-refunded .col-ref-total, -.adminhtml-report-sales-refunded .col-ref-online, -.adminhtml-report-sales-refunded .col-ref-offline { +.reports-report-sales-refunded .col-ref-total, +.reports-report-sales-refunded .col-ref-online, +.reports-report-sales-refunded .col-ref-offline { text-align: right; width: 23%; } /* Reports - Shipping -------------------------------------- */ -.adminhtml-report-sales-shipping .col-period { +.reports-report-sales-shipping .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-sales-shipping .col-qty, -.adminhtml-report-sales-shipping .col-total-sales-shipping, -.adminhtml-report-sales-shipping .col-total-shipping { +.reports-report-sales-shipping .col-qty, +.reports-report-sales-shipping .col-total-sales-shipping, +.reports-report-sales-shipping .col-total-shipping { text-align: right; width: 115px; } /* Reports - Invoiced -------------------------------------- */ -.adminhtml-report-sales-invoiced .col-period { +.reports-report-sales-invoiced .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-sales-invoiced .col-qty, -.adminhtml-report-sales-invoiced .col-invoiced, -.adminhtml-report-sales-invoiced .col-total-invoiced, -.adminhtml-report-sales-invoiced .col-total-invoiced-paid, -.adminhtml-report-sales-invoiced .col-total-invoiced-not-paid { +.reports-report-sales-invoiced .col-qty, +.reports-report-sales-invoiced .col-invoiced, +.reports-report-sales-invoiced .col-total-invoiced, +.reports-report-sales-invoiced .col-total-invoiced-paid, +.reports-report-sales-invoiced .col-total-invoiced-not-paid { text-align: right; width: 19%; } /* Reports - Tax -------------------------------------- */ -.adminhtml-report-sales-tax .col-period { +.reports-report-sales-tax .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-sales-tax .col-rate, -.adminhtml-report-sales-tax .col-qty, -.adminhtml-report-sales-tax .col-tax-amount { +.reports-report-sales-tax .col-rate, +.reports-report-sales-tax .col-qty, +.reports-report-sales-tax .col-tax-amount { text-align: right; width: 105px; } /* Reports - Orders -------------------------------------- */ -.adminhtml-report-sales-sales .col-period { +.reports-report-sales-sales .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-sales-sales .col-orders, -.adminhtml-report-sales-sales .col-sales-items, -.adminhtml-report-sales-sales .col-sales-total, -.adminhtml-report-sales-sales .col-invoiced, -.adminhtml-report-sales-sales .col-refunded, -.adminhtml-report-sales-sales .col-sales-tax, -.adminhtml-report-sales-sales .col-sales-shipping, -.adminhtml-report-sales-sales .col-sales-discount, -.adminhtml-report-sales-sales .col-canceled { +.reports-report-sales-sales .col-orders, +.reports-report-sales-sales .col-sales-items, +.reports-report-sales-sales .col-sales-total, +.reports-report-sales-sales .col-invoiced, +.reports-report-sales-sales .col-refunded, +.reports-report-sales-sales .col-sales-tax, +.reports-report-sales-sales .col-sales-shipping, +.reports-report-sales-sales .col-sales-discount, +.reports-report-sales-sales .col-canceled { text-align: right; width: 10.5%; } @@ -8450,32 +8500,32 @@ table .col-draggable .draggable-handle { Reports - Coupons -------------------------------------- */ /* TODO: re-check styles for coupons table after coupons functionality will have been repaired */ -.adminhtml-report-sales-coupons .col-period { +.reports-report-sales-coupons .col-period { white-space: nowrap; width: 70px; } -.adminhtml-report-sales-coupons .col-sales, -.adminhtml-report-sales-coupons .col-users, -.adminhtml-report-sales-coupons .col-sales-discount, -.adminhtml-report-sales-coupons .col-total-amount, -.adminhtml-report-sales-coupons .col-subtotal, -.adminhtml-report-sales-coupons .col-discount, -.adminhtml-report-sales-coupons .col-total { +.reports-report-sales-coupons .col-sales, +.reports-report-sales-coupons .col-users, +.reports-report-sales-coupons .col-sales-discount, +.reports-report-sales-coupons .col-total-amount, +.reports-report-sales-coupons .col-subtotal, +.reports-report-sales-coupons .col-discount, +.reports-report-sales-coupons .col-total { text-align: right; } /* Reports - Low Stock -------------------------------------- */ -.adminhtml-report-product-lowstock .col-qty { +.reports-report-product-lowstock .col-qty { width: 10%; } -.adminhtml-report-product-lowstock .range-line { +.reports-report-product-lowstock .range-line { display: inline-block; } -.adminhtml-report-product-lowstock .col-product { +.reports-report-product-lowstock .col-product { width: 65%; } -.adminhtml-report-product-lowstock .col-sku { +.reports-report-product-lowstock .col-sku { width: 25%; } /* @@ -8863,6 +8913,28 @@ table .col-draggable .draggable-handle { float: right; width: 49%; } +.order-gift-options .box-left:last-child, +.order-gift-options .fieldset-wrapper-title + .box-right { + float: none; + width: auto; +} +.order-gift-options fieldset { + border-radius: 5px; +} +.order-gift-options .gift-wrapping-form select { + margin-left: 10px; +} +.order-gift-options .giftmessage-entire-order textarea { + height: 6em; + width: 100%; +} +.order-gift-options .giftmessage-whole-order-container textarea { + height: 6em; + width: 100%; +} +.order-gift-options .giftmessage-whole-order-container .actions { + margin-left: 20%; +} .ui-dialog.gift-options-popup .ui-dialog-content { padding: 25px; } @@ -8990,6 +9062,27 @@ table .col-draggable .draggable-handle { .sales-order-create-index #order-data .fieldset-wrapper .actions .action-delete { margin: 11px 0 0; } +.sales-order-create-index .ui-dialog .downloadable.information .link .label { + margin-left: 0; +} +.sales-order-create-index .ui-dialog .downloadable.information .link .nested { + margin-left: 8px; +} +.sales-order-create-index .ui-dialog .fieldset.bundle .nested { + padding-left: 6px; +} +.sales-order-create-index .ui-dialog .fieldset.bundle .nested .field { + margin: 0 0 5px; +} +.sales-order-create-index .ui-dialog .fieldset.bundle .nested .label { + font-size: 13px; + margin: 0; +} +.sales-order-create-index .ui-dialog .fieldset.bundle .nested .qty .control { + display: inline-block; + margin: 0 0 0 10px; + width: 60px; +} /* ----------------------------------- */ #order-data .page-actions { padding-top: 0; @@ -9451,6 +9544,9 @@ table.items-to-invoice tbody tr:hover td { .col-product .product_to_add { float: right; } +[class^=" adminhtml-extension-custom-"] #authors_fieldset .data-table td { + vertical-align: top; +} /* Packaging for Shipping Popup -------------------------------------- */ @@ -9875,8 +9971,6 @@ table.items-to-invoice tbody tr:hover td { /* Clearfix -------------------------------------- */ -.order-gift-options:before, -.order-gift-options:after, .image-panel:before, .image-panel:after, .images:before, @@ -9888,7 +9982,6 @@ table.items-to-invoice tbody tr:hover td { content: ""; display: table; } -.order-gift-options:after, .image-panel:after, .images:after, .tax-rate-popup .field:after, diff --git a/app/design/adminhtml/magento_backend/less/styles/admin.less b/app/design/adminhtml/magento_backend/less/styles/admin.less index 8a46c3163a1..7c81ffd765f 100644 --- a/app/design/adminhtml/magento_backend/less/styles/admin.less +++ b/app/design/adminhtml/magento_backend/less/styles/admin.less @@ -1644,8 +1644,8 @@ input.mage-error ~ .addafter { } .addon input ~ .addafter strong { + display: inline-block; background: #fff; - display: block; line-height: 24px; margin: 0 3px 0 -2px; padding-left: 4px; @@ -4142,10 +4142,19 @@ table tbody tr:nth-child(odd):hover th { .grid-actions .required:after { content: '*'; - color: red; + color: #f00; +} + +[class^=" reports-report-"] { + .grid-actions .required:after { + content: ''; + } + .grid-actions .required .label span:after { + content: '*'; + color: #f00; + } } -/* TODO: remove styles for images when images will be replaced by font icons */ .grid-actions img { vertical-align: middle; height: 22px; @@ -4157,7 +4166,6 @@ table tbody tr:nth-child(odd):hover th { height: auto; } -/* TODO: refactor validation fields styles after approved design comes */ .grid-actions .validation-advice { background: #f3dcd8; border: 1px solid #963535; @@ -4187,6 +4195,11 @@ table tbody tr:nth-child(odd):hover th { white-space: nowrap; } +.grid-actions input[type="text"].validation-failed { + border-color: #fa7973; + box-shadow: 0 0 8px rgba(250, 121, 115, 0.6); +} + /* Grid - Headings -------------------------------------- */ @@ -4803,6 +4816,7 @@ table .col-draggable .draggable-handle { .order-information .data-table tbody tr th, .order-account-information .data-table tbody tr th, .adminhtml-rma-new .data-table tbody tr th, +.adminhtml-logging-details .log-details .data-table th, [class^=" sales-transactions-"] .data-table tbody tr th, [class^=" sales-"] .order-payment-method .data-table tbody tr th, [class^=" sales-billing-agreement-"] .log-details .data-table tbody tr th { @@ -4815,6 +4829,8 @@ table .col-draggable .draggable-handle { .order-information .data-table tbody tr th, .order-account-information .data-table tbody tr td, .order-account-information .data-table tbody tr th, +.adminhtml-logging-details .log-details .data-table td, +.adminhtml-logging-details .log-details .data-table th, [class^=" adminhtml-rma-"] .data-table tbody tr td, [class^=" adminhtml-rma-"] .data-table tbody tr th, [class^=" sales-transactions-"] .data-table tbody tr th, @@ -4836,6 +4852,8 @@ table .col-draggable .draggable-handle { .order-information .data-table tbody tr:nth-child(2n+1) th, .order-account-information .data-table tbody tr:nth-child(2n+1) td, .order-account-information .data-table tbody tr:nth-child(2n+1) th, +.adminhtml-logging-details .log-details .data-table tr:nth-child(odd) td, +.adminhtml-logging-details .log-details .data-table tr:nth-child(odd) th, [class^=" adminhtml-rma-"] .data-table tbody tr:nth-child(2n+1) td, [class^=" adminhtml-rma-"] .data-table tbody tr:nth-child(2n+1) th, [class^=" sales-transactions-"] .data-table tbody tr:nth-child(2n+1) th, diff --git a/app/design/adminhtml/magento_backend/less/styles/pages.less b/app/design/adminhtml/magento_backend/less/styles/pages.less index 8ba6964fc10..b3df16f4cff 100644 --- a/app/design/adminhtml/magento_backend/less/styles/pages.less +++ b/app/design/adminhtml/magento_backend/less/styles/pages.less @@ -98,6 +98,11 @@ margin-top: 8px; } +.catalog-product-new .user-defined.type-select select, +.catalog-product-edit .user-defined.type-select select { + width: 100%; +} + /* Customer ---------------------------------------*/ @@ -406,6 +411,44 @@ width: 100%; } +/* + System -> Action Log -> Report +-------------------------------------- */ +.adminhtml-logging-details .log-details-grid table { + th { + border: 1px solid #c9c2b8; + border-width: 0 0 1px; + padding: 6px 10px 7px; + background: #fff; + .style2(); + + span { + border: 0; + padding: 0; + } + } + + td { + border: none; + padding: 6px 10px 7px; + background: #fff; + } + + tr:last-child td { + border: 1px solid #eae8e4; + border-width: 0 0 1px; + } + + tr.on-mouse { + cursor: inherit; + } + + tr:nth-child(odd) td, + tr.on-mouse:nth-child(odd):hover td { + background: #fbfaf6; + } +} + /* System -> Export -------------------------------------- */ @@ -1335,6 +1378,37 @@ width: 49%; } +.order-gift-options .box-left:last-child, +.order-gift-options .fieldset-wrapper-title + .box-right { + float: none; + width: auto; +} + +.order-gift-options { + fieldset { + border-radius: 5px; + } + + .gift-wrapping-form select { + margin-left: 10px; + } + + .giftmessage-entire-order textarea { + height: 6em; + width: 100%; + } + + .giftmessage-whole-order-container { + textarea { + height: 6em; + width: 100%; + } + .actions { + margin-left: 20%; + } + } +} + .ui-dialog.gift-options-popup .ui-dialog-content { padding: 25px; } @@ -1489,6 +1563,39 @@ margin: 11px 0 0; } +.sales-order-create-index { + // Configure product popup + .ui-dialog { + // Virtual and downloadable product + .downloadable.information .link { + .label { + margin-left: 0; + } + .nested { + margin-left: 8px; + } + } + // Bundle product + .fieldset.bundle { + .nested { + padding-left: 6px; + .field { + margin: 0 0 5px; + } + .label { + font-size: 13px; + margin: 0; + } + .qty .control { + display: inline-block; + margin: 0 0 0 10px; + width: 60px; + } + } + } + } +} + /* ----------------------------------- */ #order-data .page-actions { @@ -2037,6 +2144,12 @@ table.items-to-invoice tbody tr:hover td { float: right; } +[class^=" adminhtml-extension-custom-"] { + #authors_fieldset .data-table td { + vertical-align: top; + } +} + /* Packaging for Shipping Popup -------------------------------------- */ @@ -2550,8 +2663,6 @@ table.items-to-invoice tbody tr:hover td { /* Clearfix -------------------------------------- */ -.order-gift-options:before, -.order-gift-options:after, .image-panel:before, .image-panel:after, .images:before, @@ -2564,7 +2675,6 @@ table.items-to-invoice tbody tr:hover td { display: table; } -.order-gift-options:after, .image-panel:after, .images:after, .tax-rate-popup .field:after, diff --git a/app/design/frontend/magento_plushe/Magento_Catalog/layout/default.xml b/app/design/frontend/magento_plushe/Magento_Catalog/layout/default.xml index f4a769d4752..1af97e55c26 100644 --- a/app/design/frontend/magento_plushe/Magento_Catalog/layout/default.xml +++ b/app/design/frontend/magento_plushe/Magento_Catalog/layout/default.xml @@ -26,6 +26,6 @@ <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <!-- <block class="Magento\Catalog\Block\Product\Compare\Sidebar" name="catalog.compare.link" template="Magento_Catalog::product/compare/link.phtml"/> --> <referenceBlock name="header.links"> - <block class="Magento\View\Block\Template" name="catalog.compare.link" before="-" template="Magento_Catalog::product/compare/link.phtml"/> + <block class="Magento\View\Element\Template" name="catalog.compare.link" before="-" template="Magento_Catalog::product/compare/link.phtml"/> </referenceBlock> </layout> diff --git a/app/design/frontend/magento_plushe/Magento_Checkout/layout/checkout_cart_index.xml b/app/design/frontend/magento_plushe/Magento_Checkout/layout/checkout_cart_index.xml index 61b761c8e9f..d24667c2328 100644 --- a/app/design/frontend/magento_plushe/Magento_Checkout/layout/checkout_cart_index.xml +++ b/app/design/frontend/magento_plushe/Magento_Checkout/layout/checkout_cart_index.xml @@ -28,7 +28,7 @@ <referenceContainer name="checkout.cart.items"> <container name="checkout.cart.container" label="invisible" htmlTag="div" htmlClass="cart container" before="-"> <container name="cart.summary" label="Cart Summary Container" htmlTag="div" htmlClass="cart summary" after="-"> - <block class="Magento\View\Block\Template" name="checkout.cart.summary.title" before="-" template="Magento_Core::text.phtml"> + <block class="Magento\View\Element\Template" name="checkout.cart.summary.title" before="-" template="Magento_Core::text.phtml"> <arguments> <argument translate="true" name="text" xsi:type="string">Summary</argument> <argument name="tag" xsi:type="string">strong</argument> diff --git a/app/design/frontend/magento_plushe/Magento_Core/template.phtml b/app/design/frontend/magento_plushe/Magento_Core/template.phtml index 70aa089bb5c..537167a59ad 100644 --- a/app/design/frontend/magento_plushe/Magento_Core/template.phtml +++ b/app/design/frontend/magento_plushe/Magento_Core/template.phtml @@ -23,5 +23,5 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -/** @var $this \Magento\View\Block\Template */ +/** @var $this \Magento\View\Element\Template */ echo $this->getChildHtml('', false); diff --git a/app/design/frontend/magento_plushe/Magento_Customer/layout/default.xml b/app/design/frontend/magento_plushe/Magento_Customer/layout/default.xml index 78ca4af2db4..fe3e588b0c8 100644 --- a/app/design/frontend/magento_plushe/Magento_Customer/layout/default.xml +++ b/app/design/frontend/magento_plushe/Magento_Customer/layout/default.xml @@ -28,7 +28,7 @@ <block class="Magento\Customer\Block\Account\Customer" name="customer" template="account/customer.phtml" /> <block class="Magento\Customer\Block\Account\RegisterLink" after="authorization-link-login" name="register-link"> <arguments> - <argument name="label" xsi:type="string">register</argument> + <argument name="label" xsi:type="string">Register</argument> </arguments> </block> <block class="Magento\Customer\Block\Account\AuthorizationLink" name="authorization-link-login"/> diff --git a/app/design/frontend/magento_plushe/Magento_Page/layout/default.xml b/app/design/frontend/magento_plushe/Magento_Theme/layout/default.xml similarity index 80% rename from app/design/frontend/magento_plushe/Magento_Page/layout/default.xml rename to app/design/frontend/magento_plushe/Magento_Theme/layout/default.xml index 37a8bf5c911..f5b5eb31ee7 100644 --- a/app/design/frontend/magento_plushe/Magento_Page/layout/default.xml +++ b/app/design/frontend/magento_plushe/Magento_Theme/layout/default.xml @@ -30,47 +30,47 @@ </arguments> </referenceBlock> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="css-styles-css"> + <block class="Magento\Theme\Block\Html\Head\Css" name="css-styles-css"> <arguments> <argument name="file" xsi:type="string">css/styles.css</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="js-matchmedia-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="js-matchmedia-js"> <arguments> <argument name="file" xsi:type="string">js/matchMedia.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="js-responsive-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="js-responsive-js"> <arguments> <argument name="file" xsi:type="string">js/responsive.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="js-head-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="js-head-js"> <arguments> <argument name="file" xsi:type="string">js/head.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="js-jquery-dropdowns-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="js-jquery-dropdowns-js"> <arguments> <argument name="file" xsi:type="string">js/jquery.dropdowns.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="js-tabs-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="js-tabs-js"> <arguments> <argument name="file" xsi:type="string">js/tabs.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="js-navigation-menu-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="js-navigation-menu-js"> <arguments> <argument name="file" xsi:type="string">js/navigation-menu.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="js-theme-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="js-theme-js"> <arguments> <argument name="file" xsi:type="string">js/theme.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="js-selectivizr-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="js-selectivizr-js"> <arguments> <argument name="file" xsi:type="string">js/selectivizr.js</argument> <argument name="properties" xsi:type="array"> @@ -80,7 +80,7 @@ </block> </referenceBlock> <referenceContainer name="header"> - <block class="Magento\Page\Block\Links" name="header.links" after="minicart"> + <block class="Magento\View\Element\Html\Links" name="header.links" after="minicart"> <arguments> <argument name="css_class" xsi:type="string">links</argument> </arguments> diff --git a/app/design/frontend/magento_plushe/css/styles.css b/app/design/frontend/magento_plushe/css/styles.css index 627537351d5..850ec7b1f98 100644 --- a/app/design/frontend/magento_plushe/css/styles.css +++ b/app/design/frontend/magento_plushe/css/styles.css @@ -4196,7 +4196,7 @@ strong { padding-right: 20px; } /* - Magento_Page + Magento_Theme -------------------------------------- */ html, body, diff --git a/app/design/frontend/magento_plushe/less/styles.less b/app/design/frontend/magento_plushe/less/styles.less index 8d1328c59d6..5ff9cd504cc 100644 --- a/app/design/frontend/magento_plushe/less/styles.less +++ b/app/design/frontend/magento_plushe/less/styles.less @@ -62,7 +62,7 @@ strong { } /* - Magento_Page + Magento_Theme -------------------------------------- */ html, body, button, input, select, textarea { color: @textColor; diff --git a/app/etc/di.xml b/app/etc/di.xml index fb25f549097..128bbed6945 100644 --- a/app/etc/di.xml +++ b/app/etc/di.xml @@ -61,6 +61,8 @@ <preference for="Magento\View\Design\Theme\Domain\PhysicalInterface" type="Magento\Core\Model\Theme\Domain\Physical" /> <preference for="Magento\View\Design\Theme\Domain\VirtualInterface" type="Magento\Core\Model\Theme\Domain\Virtual" /> <preference for="Magento\View\Design\Theme\Domain\StagingInterface" type="Magento\Core\Model\Theme\Domain\Staging" /> + <preference for="Magento\Json\EncoderInterface" type="Magento\Json\Encoder" /> + <preference for="Magento\Json\DecoderInterface" type="Magento\Json\Decoder" /> <type name="Magento\View\BlockPool" shared="false" /> <type name="Magento\App\Request\Http"> <param name="pathInfoProcessor"> @@ -72,6 +74,8 @@ <preference for="Magento\View\Design\Theme\CustomizationInterface" type="Magento\View\Design\Theme\Customization" /> <preference for="Magento\Image\Adapter\ConfigInterface" type="Magento\Core\Model\Image\Adapter\Config" /> <preference for="Magento\View\Design\Theme\Image\PathInterface" type="Magento\Core\Model\Theme\Image\Path" /> + <preference for="Magento\Session\Config\ConfigInterface" type="Magento\Core\Model\Session\Config" /> + <preference for="Magento\Session\SidResolverInterface" type="Magento\Core\Model\Session\SidResolver\Proxy" /> <preference for="Magento\TranslateInterface" type="Magento\Core\Model\Translate" /> <preference for="Magento\Config\ScopeListInterface" type="interceptionConfigScope" /> <virtualType name="interceptionConfigScope" type="Magento\Config\Scope"> @@ -273,7 +277,4 @@ <value/> </param> </type> - <type name="Magento\App\FrontController"> - <plugin name="install" type="Magento\Module\FrontController\Plugin\Install" sortOrder="40"/> - </type> </config> diff --git a/dev/tests/integration/framework/Magento/TestFramework/Cookie.php b/dev/tests/integration/framework/Magento/TestFramework/Cookie.php index bcd1d13ce01..3452a853c75 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/Cookie.php +++ b/dev/tests/integration/framework/Magento/TestFramework/Cookie.php @@ -30,25 +30,17 @@ */ namespace Magento\TestFramework; -class Cookie extends \Magento\Core\Model\Cookie +class Cookie extends \Magento\Stdlib\Cookie { /** - * @param \Magento\Core\Model\Store\Config $coreStoreConfig - * @param \Magento\Core\Model\StoreManager $storeManager * @param \Magento\App\RequestInterface $request - * @param \Magento\App\ResponseInterface $response */ public function __construct( - \Magento\Core\Model\Store\Config $coreStoreConfig, - \Magento\Core\Model\StoreManager $storeManager, - \Magento\App\RequestInterface $request = null, - \Magento\App\ResponseInterface $response = null + \Magento\App\RequestInterface $request = null ) { - $this->_storeManager = $storeManager; $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $request = $request ?: $objectManager->get('Magento\App\RequestInterface'); - $response = $response ?: $objectManager->get('Magento\App\ResponseInterface'); - parent::__construct($request, $response, $coreStoreConfig, $storeManager); + parent::__construct($request); } /** @@ -59,49 +51,15 @@ class Cookie extends \Magento\Core\Model\Cookie * @param int $period Lifetime period * @param string $path * @param string $domain - * @param int|bool $secure - * @param bool $httponly + * @param bool|int|string $secure + * @param bool|string $httponly * @return \Magento\TestFramework\Cookie * * @SuppressWarnings(PHPMD.UnusedFormalParameter) */ - public function set($name, $value, $period = null, $path = null, $domain = null, $secure = null, $httponly = null) + public function set($name, $value, $period = 0, $path = '', $domain = '', $secure = '', $httponly = '') { $_COOKIE[$name] = $value; return $this; } - - /** - * Dummy function, which removes value directly from $_COOKIE super-global array instead of calling setcookie() - * - * @param string $name - * @param string $path - * @param string $domain - * @param int|bool $secure - * @param int|bool $httponly - * @return \Magento\TestFramework\Cookie - * - * @SuppressWarnings(PHPMD.UnusedFormalParameter) - */ - public function delete($name, $path = null, $domain = null, $secure = null, $httponly = null) - { - unset($_COOKIE[$name]); - return $this; - } - - /** - * Is https secure request - * - * @return bool - */ - public function isSecure() - { - $areaCode = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State') - ->getAreaCode(); - if ($areaCode == \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE) { - return $this->_getRequest()->isSecure(); - } else { - return parent::isSecure(); - } - } } diff --git a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Configurator.php b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Configurator.php index 7109f806f72..9154549aecd 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Configurator.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ObjectManager/Configurator.php @@ -36,7 +36,7 @@ class Configurator { return array( 'preferences' => array( - 'Magento\Core\Model\Cookie' => 'Magento\TestFramework\Cookie' + 'Magento\Stdlib\Cookie' => 'Magento\TestFramework\Cookie' ) ); } diff --git a/dev/tests/integration/framework/Magento/TestFramework/ObjectManagerFactory.php b/dev/tests/integration/framework/Magento/TestFramework/ObjectManagerFactory.php index c3f49d7d4f5..09a58e7defb 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/ObjectManagerFactory.php +++ b/dev/tests/integration/framework/Magento/TestFramework/ObjectManagerFactory.php @@ -82,8 +82,7 @@ class ObjectManagerFactory extends \Magento\App\ObjectManagerFactory 'type' => 'Magento\TestFramework\Db\ConnectionAdapter' ), 'preferences' => array( - 'Magento\Core\Model\Cookie' => 'Magento\TestFramework\Cookie', - 'Magento\Backend\Model\Cookie' => 'Magento\TestFramework\Cookie', + 'Magento\Stdlib\Cookie' => 'Magento\TestFramework\Cookie', 'Magento\App\RequestInterface' => 'Magento\TestFramework\Request', 'Magento\App\ResponseInterface' => 'Magento\TestFramework\Response', ), diff --git a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php index e5d8c02f7e2..af10bb180a0 100644 --- a/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php +++ b/dev/tests/integration/framework/Magento/TestFramework/TestCase/AbstractController.php @@ -77,7 +77,7 @@ abstract class AbstractController extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_assertSessionErrors = false; - $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager();; + $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_objectManager->removeSharedInstance('Magento\App\ResponseInterface'); $this->_objectManager->removeSharedInstance('Magento\App\RequestInterface'); diff --git a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/CookieTest.php b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/CookieTest.php index 62997c8abc9..9b124daebc0 100644 --- a/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/CookieTest.php +++ b/dev/tests/integration/framework/tests/unit/testsuite/Magento/Test/CookieTest.php @@ -41,12 +41,7 @@ class CookieTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $coreStoreConfig = $this->getMockBuilder('Magento\Core\Model\Store\Config') - ->disableOriginalConstructor() - ->getMock(); $this->_model = new \Magento\TestFramework\Cookie( - $coreStoreConfig, - $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false), new \Magento\TestFramework\Request( $this->getMock('\Magento\App\Route\ConfigInterface'), $this->getMock('Magento\App\Request\PathInfoProcessorInterface'), @@ -66,12 +61,4 @@ class CookieTest extends \PHPUnit_Framework_TestCase $this->assertEquals($cookieValue, $this->_model->get(self::SAMPLE_COOKIE_NAME)); $this->assertEquals($cookieValue, $_COOKIE[self::SAMPLE_COOKIE_NAME]); } - - public function testDelete() - { - $this->_model->set(self::SAMPLE_COOKIE_NAME, 'some_value'); - $this->_model->delete(self::SAMPLE_COOKIE_NAME); - $this->assertFalse($this->_model->get(self::SAMPLE_COOKIE_NAME)); - $this->assertArrayNotHasKey(self::SAMPLE_COOKIE_NAME, $_COOKIE); - } } diff --git a/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/Form/ContainerTest.php b/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/Form/ContainerTest.php index 0e0e6b03072..aa93b4b504d 100644 --- a/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/Form/ContainerTest.php +++ b/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/Form/ContainerTest.php @@ -41,13 +41,12 @@ class ContainerTest extends \PHPUnit_Framework_TestCase /** @var $block \Magento\Adminhtml\Block\Widget\Form\Container */ $block = $this->getMock('Magento\Adminhtml\Block\Widget\Form\Container', array('_prepareLayout'), array( - $objectManager->create('Magento\Backend\Block\Template\Context'), - $objectManager->create('Magento\Core\Helper\Data'), + $objectManager->create('Magento\Backend\Block\Template\Context') ) ); $layout->addBlock($block, 'block'); - $form = $layout->addBlock('Magento\View\Block\Text', 'form', 'block'); + $form = $layout->addBlock('Magento\View\Element\Text', 'form', 'block'); $expectedHtml = '<b>html</b>'; $this->assertNotEquals($expectedHtml, $block->getFormHtml()); diff --git a/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/Grid/Massaction/ItemTest.php b/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/Grid/Massaction/ItemTest.php index bdfc76be3fa..b2f77a73509 100644 --- a/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/Grid/Massaction/ItemTest.php +++ b/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/Grid/Massaction/ItemTest.php @@ -38,7 +38,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); /** @var $block \Magento\Adminhtml\Block\Widget\Grid\Massaction\Item */ $block = $layout->createBlock('Magento\Adminhtml\Block\Widget\Grid\Massaction\Item', 'block'); - $expected = $layout->addBlock('Magento\View\Block\Template', 'additional_action', 'block'); + $expected = $layout->addBlock('Magento\View\Element\Template', 'additional_action', 'block'); $this->assertSame($expected, $block->getAdditionalActionBlock()); } } diff --git a/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/GridTest.php b/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/GridTest.php index f3bd2e29252..4e95f9f4b43 100644 --- a/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/GridTest.php +++ b/dev/tests/integration/testsuite/Magento/Adminhtml/Block/Widget/GridTest.php @@ -38,7 +38,7 @@ class GridTest extends \PHPUnit_Framework_TestCase $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); /** @var $block \Magento\Adminhtml\Block\Widget\Grid */ $block = $layout->createBlock('Magento\Adminhtml\Block\Widget\Grid', 'block'); - $child = $layout->addBlock('Magento\View\Block\Template', 'massaction', 'block'); + $child = $layout->addBlock('Magento\View\Element\Template', 'massaction', 'block'); $this->assertSame($child, $block->getMassactionBlock()); } } diff --git a/dev/tests/integration/testsuite/Magento/App/FrontController/Plugin/InstallTest.php b/dev/tests/integration/testsuite/Magento/App/FrontController/Plugin/InstallTest.php new file mode 100644 index 00000000000..552349bc49f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/App/FrontController/Plugin/InstallTest.php @@ -0,0 +1,82 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\App\FrontController\Plugin; +class InstallTest extends \Magento\TestFramework\TestCase\AbstractController +{ + /** + * @var \Magento\ObjectManager + */ + protected $_objectManager; + + /** + * @var \Magento\Core\Model\Resource\Setup + */ + protected $_model; + + protected function setUp() + { + $this->_objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->_model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Core\Model\Resource\Setup', + array('resourceName' => 'default_setup', 'moduleName' => 'Magento_Core') + ); + } + + public function testApplyAllDataUpdates() + { + /*reset versions*/ + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Core\Model\Resource\Resource') + ->setDbVersion('adminnotification_setup', false); + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\Core\Model\Resource\Resource') + ->setDataVersion('adminnotification_setup', false); + $this->_model->deleteTableRow('core_resource', 'code', 'adminnotification_setup'); + $this->_model->getConnection()->dropTable($this->_model->getTable('adminnotification_inbox')); + $this->_model->getConnection()->dropTable($this->_model->getTable('admin_system_messages')); + /** @var \Magento\Cache\FrontendInterface $cache */ + $cache = $this->_objectManager->get('Magento\App\Cache\Type\Config'); + $cache->clean(); + + try { + /* This triggers plugin to be executed */ + $this->dispatch('index/index'); + } catch (\Exception $e) { + $this->fail("Impossible to continue other tests, because database is broken: {$e}"); + } + + try { + $tableData = $this->_model->getConnection() + ->describeTable($this->_model->getTable('adminnotification_inbox')); + $this->assertNotEmpty($tableData); + } catch (\Exception $e) { + $this->fail("Impossible to continue other tests, because database is broken: {$e}"); + } + + $this->assertNotEmpty( + $this->_model->getTableRow('core_resource', 'code', 'adminnotification_setup', 'version') + ); + $this->assertNotEmpty( + $this->_model->getTableRow('core_resource', 'code', 'adminnotification_setup', 'data_version') + ); + } +} \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Authz/Service/AuthorizationV1Test.php b/dev/tests/integration/testsuite/Magento/Authz/Service/AuthorizationV1Test.php new file mode 100644 index 00000000000..a3261e7cb16 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Authz/Service/AuthorizationV1Test.php @@ -0,0 +1,237 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Authz\Service; + +use Magento\Authz\Service\AuthorizationV1Test\UserLocatorStub; +use Magento\Authz\Model\UserIdentifier; + +/** + * Authorization service test. + */ +class AuthorizationV1Test extends \PHPUnit_Framework_TestCase +{ + /** @var AuthorizationV1 */ + protected $_service; + + protected function setUp() + { + parent::setUp(); + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $loggerMock = $this->getMockBuilder('Magento\\Logger')->disableOriginalConstructor()->getMock(); + $loggerMock->expects($this->any())->method('logException')->will($this->returnSelf()); + $this->_service = $objectManager->create( + 'Magento\\Authz\\Service\\AuthorizationV1', + array( + 'userIdentifier' => $this->_createUserIdentifier(UserIdentifier::USER_TYPE_INTEGRATION), + 'logger' => $loggerMock + ) + ); + } + + /** + * @param string $userType + * @param string[] $resources + * @magentoDbIsolation enabled + * @dataProvider basicAuthFlowProvider + */ + public function testBasicAuthFlow($userType, $resources) + { + $userIdentifier = $this->_createUserIdentifier($userType); + + /** Preconditions check */ + $this->_ensurePermissionsAreNotGranted($userIdentifier, $resources); + + $this->_service->grantPermissions($userIdentifier, $resources); + + /** Validate that access to the specified resources is granted */ + $this->_ensurePermissionsAreGranted($userIdentifier, $resources); + } + + public function basicAuthFlowProvider() + { + return array( + 'integration' => array( + 'userType' => UserIdentifier::USER_TYPE_INTEGRATION, + 'resources' => array('Magento_Sales::create', 'Magento_Cms::page', 'Magento_Adminhtml::dashboard') + ) + ); + } + + /** + * @param string $userType + * @param string[] $initialResources + * @param string[] $newResources + * @magentoDbIsolation enabled + * @dataProvider changePermissionsProvider + */ + public function testChangePermissions($userType, $initialResources, $newResources) + { + $userIdentifier = $this->_createUserIdentifier($userType); + + $this->_service->grantPermissions($userIdentifier, $initialResources); + /** Preconditions check */ + $this->_ensurePermissionsAreGranted($userIdentifier, $initialResources); + $this->_ensurePermissionsAreNotGranted($userIdentifier, $newResources); + + $this->_service->grantPermissions($userIdentifier, $newResources); + + /** Check the results of permissions change */ + $this->_ensurePermissionsAreGranted($userIdentifier, $newResources); + $this->_ensurePermissionsAreNotGranted($userIdentifier, $initialResources); + } + + public function changePermissionsProvider() + { + return array( + 'integration' => array( + 'userType' => UserIdentifier::USER_TYPE_INTEGRATION, + 'initialResources' => array('Magento_Cms::page', 'Magento_Adminhtml::dashboard'), + 'newResources' => array('Magento_Sales::cancel', 'Magento_Cms::page_delete') + ), + 'integration clear permissions' => array( + 'userType' => UserIdentifier::USER_TYPE_INTEGRATION, + 'initialResources' => array('Magento_Sales::capture', 'Magento_Cms::page_delete'), + 'newResources' => array(), + ), + ); + } + + /** + * @magentoDbIsolation enabled + */ + public function testIsAllowedArrayOfResources() + { + $userIdentifier = $this->_createUserIdentifier(UserIdentifier::USER_TYPE_INTEGRATION); + $resources = array('Magento_Cms::page', 'Magento_Adminhtml::dashboard'); + $this->_service->grantPermissions($userIdentifier, $resources); + /** Preconditions check */ + $this->_ensurePermissionsAreGranted($userIdentifier, $resources); + + /** Ensure that permissions check to multiple resources at once works as expected */ + $this->assertTrue( + $this->_service->isAllowed($resources, $userIdentifier), + 'Access to multiple resources is expected to be granted, but is prohibited.' + ); + $this->assertFalse( + $this->_service->isAllowed(array_merge($resources, array('invalid_resource')), $userIdentifier), + 'Access is expected to be denied when at least one of the resources is unavailable.' + ); + } + + /** + * @magentoDbIsolation enabled + */ + public function testGetAllowedResources() + { + $userIdentifierA = $this->_createUserIdentifier(UserIdentifier::USER_TYPE_INTEGRATION); + $resourcesA = array('Magento_Adminhtml::dashboard', 'Magento_Cms::page'); + $this->_service->grantPermissions($userIdentifierA, $resourcesA); + + $userIdentifierB = $this->_createUserIdentifier(UserIdentifier::USER_TYPE_INTEGRATION); + $resourcesB = array('Magento_Cms::block', 'Magento_Sales::cancel'); + $this->_service->grantPermissions($userIdentifierB, $resourcesB); + + /** Preconditions check */ + $this->_ensurePermissionsAreGranted($userIdentifierA, $resourcesA); + $this->_ensurePermissionsAreGranted($userIdentifierB, $resourcesB); + + $this->assertEquals( + $resourcesA, + $this->_service->getAllowedResources($userIdentifierA), + "The list of resources allowed to the user is invalid." + ); + + $this->assertEquals( + $resourcesB, + $this->_service->getAllowedResources($userIdentifierB), + "The list of resources allowed to the user is invalid." + ); + } + + /** + * @expectedException \Magento\Service\Exception + * @expectedMessage The role associated with the specified user cannot be found. + */ + public function testGetAllowedResourcesRoleNotFound() + { + $userIdentifier = $this->_createUserIdentifier(UserIdentifier::USER_TYPE_INTEGRATION); + $this->_service->getAllowedResources($userIdentifier); + } + + /** + * @magentoDbIsolation enabled + */ + public function testGrantAllPermissions() + { + $userIdentifier = $this->_createUserIdentifier(UserIdentifier::USER_TYPE_INTEGRATION); + $this->_service->grantAllPermissions($userIdentifier); + $this->_ensurePermissionsAreGranted($userIdentifier, array('Magento_Adminhtml::all')); + } + + /** + * Create new User identifier + * + * @param string $userType + * @return UserIdentifier + */ + protected function _createUserIdentifier($userType) + { + $userId = ($userType == UserIdentifier::USER_TYPE_GUEST) ? 0 : rand(1, 1000); + $userLocatorStub = new UserLocatorStub(); + return new UserIdentifier($userLocatorStub, $userType, $userId); + } + + /** + * Check if user has access to the specified resources. + * + * @param UserIdentifier $userIdentifier + * @param string[] $resources + */ + protected function _ensurePermissionsAreGranted($userIdentifier, $resources) + { + foreach ($resources as $resource) { + $this->assertTrue( + $this->_service->isAllowed($resource, $userIdentifier), + "Access to resource '{$resource}' is prohibited while it is expected to be granted." + ); + } + } + + /** + * Check if access to the specified resources is prohibited to the user. + * + * @param UserIdentifier $userIdentifier + * @param string[] $resources + */ + protected function _ensurePermissionsAreNotGranted($userIdentifier, $resources) + { + foreach ($resources as $resource) { + $this->assertFalse( + $this->_service->isAllowed($resource, $userIdentifier), + "Access to resource '{$resource}' is expected to be prohibited." + ); + } + } +} diff --git a/app/code/Magento/Backend/Model/Cookie.php b/dev/tests/integration/testsuite/Magento/Authz/Service/AuthorizationV1Test/UserLocatorStub.php similarity index 73% rename from app/code/Magento/Backend/Model/Cookie.php rename to dev/tests/integration/testsuite/Magento/Authz/Service/AuthorizationV1Test/UserLocatorStub.php index 13754662d08..bfa487e34f2 100644 --- a/app/code/Magento/Backend/Model/Cookie.php +++ b/dev/tests/integration/testsuite/Magento/Authz/Service/AuthorizationV1Test/UserLocatorStub.php @@ -18,27 +18,29 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Backend * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Backend\Model; +namespace Magento\Authz\Service\AuthorizationV1Test; -/** - * Backend cookie model - */ -class Cookie extends \Magento\Core\Model\Cookie +use Magento\Authz\Model\UserLocatorInterface; + +class UserLocatorStub implements UserLocatorInterface { /** - * Is https secure request - * Use secure on adminhtml only - * - * @return bool + * {@inheritdoc} + */ + public function getUserId() + { + return ''; + } + + /** + * {@inheritdoc} */ - public function isSecure() + public function getUserType() { - return $this->_getRequest()->isSecure(); + return ''; } } diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php b/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php index ca2e56e43f7..57d1cf4f129 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/System/Config/FormTest.php @@ -78,8 +78,8 @@ class FormTest extends \PHPUnit_Framework_TestCase /** @var $block \Magento\Backend\Block\System\Config\Form */ $block = $layout->createBlock('Magento\Backend\Block\System\Config\Form', 'block'); - /** @var $childBlock \Magento\View\Block\Text */ - $childBlock = $layout->addBlock('Magento\View\Block\Text', 'element_dependence', 'block'); + /** @var $childBlock \Magento\View\Element\Text */ + $childBlock = $layout->addBlock('Magento\View\Element\Text', 'element_dependence', 'block'); $expectedValue = 'dependence_html_relations'; $this->assertNotContains($expectedValue, $block->toHtml()); diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/ColumnSetTest.php b/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/ColumnSetTest.php index b1a1059d4d6..0076b6dc78a 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/ColumnSetTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/Grid/ColumnSetTest.php @@ -62,7 +62,7 @@ class ColumnSetTest extends \PHPUnit_Framework_TestCase )); $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\View\Block\Template\Context', array('layout' => $this->_layoutMock)); + ->create('Magento\View\Element\Template\Context', array('layout' => $this->_layoutMock)); $this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') ->createBlock( 'Magento\Backend\Block\Widget\Grid\ColumnSet', '', array('context' => $context) diff --git a/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/GridTest.php b/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/GridTest.php index 6755bdcac10..2ec7ff59702 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/GridTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Block/Widget/GridTest.php @@ -88,11 +88,10 @@ class GridTest extends \PHPUnit_Framework_TestCase { return $this->getMock('Magento\Backend\Block\Widget\Grid\ColumnSet', array(), array( \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\View\Block\Template\Context', array( + ->create('Magento\View\Element\Template\Context', array( 'dirs' => new \Magento\App\Dir(__DIR__), 'filesystem' => new \Magento\Filesystem(new \Magento\Filesystem\Adapter\Local), )), - $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false), \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\Backend\Model\Widget\Grid\Row\UrlGeneratorFactory'), \Magento\TestFramework\Helper\Bootstrap::getObjectManager() diff --git a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php index 58025f3e309..aed3ba0beb4 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php @@ -174,7 +174,8 @@ class CacheTest extends \Magento\Backend\Utility\Controller $this->dispatch('backend/admin/cache/' . $action); $this->assertSessionMessages( $this->contains("Specified cache type(s) don't exist: invalid_type_1, invalid_type_2"), - \Magento\Message\Factory::ERROR + \Magento\Message\Factory::ERROR, + 'Magento\Core\Model\Session\AbstractSession' ); } diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/AuthTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/AuthTest.php index c10c76ae2d1..4ef0e465333 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/AuthTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/AuthTest.php @@ -82,9 +82,6 @@ class AuthTest extends \PHPUnit_Framework_TestCase $this->assertInstanceOf('Magento\Backend\Model\Auth\Credential\StorageInterface', $storage); } - /** - * @magentoAppIsolation enabled - */ public function testLoginSuccessful() { $this->_model->login( @@ -93,20 +90,19 @@ class AuthTest extends \PHPUnit_Framework_TestCase $this->assertGreaterThan(time() - 10, $this->_model->getAuthStorage()->getUpdatedAt()); } + /** + * @magentoAppIsolation enabled + */ public function testLogout() { $this->_model->login( \Magento\TestFramework\Bootstrap::ADMIN_NAME, \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD); $this->assertNotEmpty($this->_model->getAuthStorage()->getData()); - $this->_model->getAuthStorage() - ->getCookie() - ->set($this->_model->getAuthStorage()->getSessionName(), 'session_id'); + $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('\Magento\Stdlib\Cookie'); + $cookie->set($this->_model->getAuthStorage()->getName(), 'session_id'); $this->_model->logout(); $this->assertEmpty($this->_model->getAuthStorage()->getData()); - $this->assertEmpty($this->_model->getAuthStorage() - ->getCookie() - ->get($this->_model->getAuthStorage()->getSessionName()) - ); + $this->assertEmpty($cookie->get($this->_model->getAuthStorage()->getName())); } /** diff --git a/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php b/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php index 772567cc1c8..02832693aff 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Model/UrlTest.php @@ -108,7 +108,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase ->setRouteName('default_router'); $this->_model->setRequest($request); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Session') + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Session\AbstractSession') ->setData('_form_key', 'salt'); $this->assertEquals($expectedHash, $this->_model->getSecretKey($routeName, $controller, $action)); } @@ -159,7 +159,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase $request->setControllerName('controller')->setActionName('action'); $request->initForward()->setControllerName(uniqid())->setActionName(uniqid()); $this->_model->setRequest($request); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Session') + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Session\AbstractSession') ->setData('_form_key', 'salt'); $this->assertEquals( $encryptor->getHash('controller' . 'action' . 'salt'), diff --git a/dev/tests/integration/testsuite/Magento/Backend/Utility/Controller.php b/dev/tests/integration/testsuite/Magento/Backend/Utility/Controller.php index 9537974c07d..0c4f9edfbf4 100644 --- a/dev/tests/integration/testsuite/Magento/Backend/Utility/Controller.php +++ b/dev/tests/integration/testsuite/Magento/Backend/Utility/Controller.php @@ -48,22 +48,31 @@ class Controller extends \Magento\TestFramework\TestCase\AbstractController { parent::setUp(); - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Backend\Model\Url') - ->turnOffSecretKey(); + $this->_objectManager->get('Magento\Backend\Model\Url')->turnOffSecretKey(); - $this->_auth = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Backend\Model\Auth'); + $this->_auth = $this->_objectManager->get('Magento\Backend\Model\Auth'); $this->_session = $this->_auth->getAuthStorage(); $this->_auth->login( - \Magento\TestFramework\Bootstrap::ADMIN_NAME, \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD); + \Magento\TestFramework\Bootstrap::ADMIN_NAME, + \Magento\TestFramework\Bootstrap::ADMIN_PASSWORD + ); } protected function tearDown() { - $this->_auth->logout(); + /** @var $checkoutSession \Magento\Checkout\Model\Session */ + $checkoutSession = $this->_objectManager->get('Magento\Checkout\Model\Session'); + $checkoutSession->clearStorage(); + if (session_status() === PHP_SESSION_ACTIVE) { + session_destroy(); + } + if (isset($_COOKIE[$checkoutSession->getName()])) { + unset($_COOKIE[$checkoutSession->getName()]); + } + $this->_auth = null; $this->_session = null; - \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Backend\Model\Url')->turnOnSecretKey(); + $this->_objectManager->get('Magento\Backend\Model\Url')->turnOnSecretKey(); parent::tearDown(); } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/AddTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/AddTest.php index 9d361167fa0..0f541491fc1 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/AddTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Attribute/Set/Toolbar/AddTest.php @@ -41,7 +41,7 @@ class AddTest extends \PHPUnit_Framework_TestCase 'block'); $block->setArea('adminhtml')->unsetChild('setForm'); - $childBlock = $layout->addBlock('Magento\View\Block\Template', 'setForm', 'block'); + $childBlock = $layout->addBlock('Magento\View\Element\Template', 'setForm', 'block'); $form = new \Magento\Object(); $childBlock->setForm($form); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/MatrixTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/MatrixTest.php index b643a33212f..54bc4b8ac8e 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/MatrixTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/Config/MatrixTest.php @@ -44,7 +44,7 @@ class MatrixTest extends \PHPUnit_Framework_TestCase ->register('current_product', \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\Catalog\Model\Product')->load(1)); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text', 'head'); + ->createBlock('Magento\View\Element\Text', 'head'); /** @var $usedAttribute \Magento\Catalog\Model\Entity\Attribute */ $usedAttribute = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\Catalog\Model\Entity\Attribute')->loadByCode( diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/ConfigTest.php index 2f61f44383f..54015189708 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/Tab/Super/ConfigTest.php @@ -57,7 +57,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->get('Magento\Core\Model\Registry') ->register('current_product', $objectManager->create('Magento\Catalog\Model\Product')->load(1)); - $objectManager->get('Magento\View\LayoutInterface')->createBlock('Magento\View\Block\Text', 'head'); + $objectManager->get('Magento\View\LayoutInterface')->createBlock('Magento\View\Element\Text', 'head'); $usedAttribute = $objectManager->get('Magento\Catalog\Model\Entity\Attribute')->loadByCode( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Eav\Model\Config') ->getEntityType('catalog_product')->getId(), diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/TabsTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/TabsTest.php index c933d3fb364..1c3629c255d 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/TabsTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Adminhtml/Product/Edit/TabsTest.php @@ -50,7 +50,7 @@ class TabsTest extends \PHPUnit_Framework_TestCase $objectManager->get('Magento\App\State')->setAreaCode('nonexisting'); /** @var $layout \Magento\Core\Model\Layout */ $layout = $objectManager->get('Magento\View\LayoutInterface'); - $layout->addBlock('Magento\View\Block\Text', 'head'); + $layout->addBlock('Magento\View\Element\Text', 'head'); /** @var $block \Magento\Catalog\Block\Adminhtml\Product\Edit\Tabs */ $block = $layout->createBlock('Magento\Catalog\Block\Adminhtml\Product\Edit\Tabs'); $this->assertArrayHasKey(0, $block->getTabsIds()); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSetTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSetTest.php index f94f82e2b4f..9dfec8062c3 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSetTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/Configurable/AssociatedSelector/Backend/Grid/ColumnSetTest.php @@ -34,6 +34,7 @@ class ColumnSetTest /** * Testing adding column with configurable attribute to column set * + * @magentoAppArea adminhtml * @magentoAppIsolation enabled * @magentoDataFixture Magento/Catalog/_files/product_configurable.php */ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListTest.php index 8d26cb49102..0d55c0ba0a1 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ListTest.php @@ -98,7 +98,11 @@ class ListTest extends \PHPUnit_Framework_TestCase $layout = $this->_getLayout(); /** @var $parent \Magento\Catalog\Block\Product\ListProduct */ $parent = $layout->createBlock('Magento\Catalog\Block\Product\ListProduct'); - $childBlock = $layout->createBlock('Magento\View\Block\Text', 'test', array('data' => array('text' => 'test'))); + $childBlock = $layout->createBlock( + 'Magento\View\Element\Text', + 'test', + array('data' => array('text' => 'test')) + ); $layout->setChild($parent->getNameInLayout(), $childBlock->getNameInLayout(), 'additional'); $this->assertEquals('test', $parent->getAdditionalHtml()); } diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ProductList/ToolbarTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ProductList/ToolbarTest.php index a85e6bb3ab7..0db7d7cb42d 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ProductList/ToolbarTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ProductList/ToolbarTest.php @@ -35,8 +35,8 @@ class ToolbarTest extends \PHPUnit_Framework_TestCase $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); /** @var $block \Magento\Catalog\Block\Product\ProductList\Toolbar */ $block = $layout->createBlock('Magento\Catalog\Block\Product\ProductList\Toolbar', 'block'); - /** @var $childBlock \Magento\View\Block\Text */ - $childBlock = $layout->addBlock('Magento\View\Block\Text', 'product_list_toolbar_pager', 'block'); + /** @var $childBlock \Magento\View\Element\Text */ + $childBlock = $layout->addBlock('Magento\View\Element\Text', 'product_list_toolbar_pager', 'block'); $expectedHtml = '<b>Any text there</b>'; $this->assertNotEquals($expectedHtml, $block->getPagerHtml()); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/AdditionalTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/AdditionalTest.php index d5b05edbee9..0c0f1b8e950 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/AdditionalTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/View/AdditionalTest.php @@ -36,13 +36,13 @@ class AdditionalTest extends \PHPUnit_Framework_TestCase /** @var $block \Magento\Catalog\Block\Product\View\Additional */ $block = $layout->createBlock('Magento\Catalog\Block\Product\View\Additional', 'block'); - /** @var $childFirst \Magento\View\Block\Text */ - $childFirst = $layout->addBlock('Magento\View\Block\Text', 'child1', 'block'); + /** @var $childFirst \Magento\View\Element\Text */ + $childFirst = $layout->addBlock('Magento\View\Element\Text', 'child1', 'block'); $htmlFirst = '<b>Any html of child1</b>'; $childFirst->setText($htmlFirst); - /** @var $childSecond \Magento\View\Block\Text */ - $childSecond = $layout->addBlock('Magento\View\Block\Text', 'child2', 'block'); + /** @var $childSecond \Magento\View\Element\Text */ + $childSecond = $layout->addBlock('Magento\View\Element\Text', 'child2', 'block'); $htmlSecond = '<b>Any html of child2</b>'; $childSecond->setText($htmlSecond); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ViewTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ViewTest.php index daabbdfccd3..231377651af 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ViewTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Block/Product/ViewTest.php @@ -58,7 +58,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase { /** @var $layout \Magento\Core\Model\Layout */ $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); - $headBlock = $layout->createBlock('Magento\View\Block\Template', 'head'); + $headBlock = $layout->createBlock('Magento\View\Element\Template', 'head'); $layout->addBlock($this->_block); $this->assertNotEmpty($headBlock->getTitle()); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php index 2ac45f964bf..f1580964f9f 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Helper/Product/ViewTest.php @@ -107,7 +107,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase $this->_helper->initProductLayout($product, $this->_controller); $rootBlock = $this->_layout->getBlock('root'); - $this->assertInstanceOf('Magento\Page\Block\Html', $rootBlock); + $this->assertInstanceOf('Magento\Theme\Block\Html', $rootBlock); $this->assertContains("product-{$uniqid}", $rootBlock->getBodyClass()); $handles = $this->_layout->getUpdate()->getHandles(); $this->assertContains('catalog_product_view_type_simple', $handles); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/AttributeTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/AttributeTest.php index 48b2e4cb96c..ab03d6a33d8 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/AttributeTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/AttributeTest.php @@ -80,7 +80,7 @@ class AttributeTest extends \PHPUnit_Framework_TestCase $this->_model->apply( $request, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text')) + ->createBlock('Magento\View\Element\Text')) ; $this->assertEmpty($this->_model->getLayer()->getState()->getFilters()); @@ -96,7 +96,7 @@ class AttributeTest extends \PHPUnit_Framework_TestCase $this->_model->apply( $request, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text') + ->createBlock('Magento\View\Element\Text') ); $this->assertNotEmpty($this->_model->getLayer()->getState()->getFilters()); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/CategoryTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/CategoryTest.php index 6f5b0a39c5f..63ab5c23342 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/CategoryTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/CategoryTest.php @@ -70,7 +70,7 @@ class CategoryTest extends \PHPUnit_Framework_TestCase $this->_model->apply( $objectManager->get('Magento\TestFramework\Request'), \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text') + ->createBlock('Magento\View\Element\Text') ); /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); @@ -85,7 +85,7 @@ class CategoryTest extends \PHPUnit_Framework_TestCase $this->_model->apply( $request, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text') + ->createBlock('Magento\View\Element\Text') ); /** @var $category \Magento\Catalog\Model\Category */ diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DecimalTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DecimalTest.php index 0c46998b7b9..ca6f81e31d9 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DecimalTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/DecimalTest.php @@ -72,7 +72,7 @@ class DecimalTest extends \PHPUnit_Framework_TestCase $this->_model->apply( $request, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text') + ->createBlock('Magento\View\Element\Text') ); $this->assertEmpty($this->_model->getData('range')); @@ -89,7 +89,7 @@ class DecimalTest extends \PHPUnit_Framework_TestCase $this->_model->apply( $request, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text') + ->createBlock('Magento\View\Element\Text') ); $this->assertEmpty($this->_model->getData('range')); @@ -105,7 +105,7 @@ class DecimalTest extends \PHPUnit_Framework_TestCase $this->_model->apply( $request, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text') + ->createBlock('Magento\View\Element\Text') ); $this->assertEquals(100, $this->_model->getData('range')); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/ItemTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/ItemTest.php index 24902a8cf61..2c144f3639a 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/ItemTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/ItemTest.php @@ -108,7 +108,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase $this->_model->getFilter()->apply( $request, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text') + ->createBlock('Magento\View\Element\Text') ); $this->assertStringEndsWith('/x/y/z/?cat=3', $this->_model->getRemoveUrl()); diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmAdvancedTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmAdvancedTest.php index 94d6c2bf252..e3a7e48194a 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmAdvancedTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/Price/AlgorithmAdvancedTest.php @@ -68,7 +68,7 @@ class AlgorithmAdvancedTest extends \PHPUnit_Framework_TestCase $filter->apply( $request, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text') + ->createBlock('Magento\View\Element\Text') ); $interval = $filter->getInterval(); if ($interval) { diff --git a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/PriceTest.php b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/PriceTest.php index 2b5cd688ff3..b676bd54eeb 100644 --- a/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/PriceTest.php +++ b/dev/tests/integration/testsuite/Magento/Catalog/Model/Layer/Filter/PriceTest.php @@ -105,7 +105,7 @@ class PriceTest extends \PHPUnit_Framework_TestCase $this->_model->apply( $request, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text') + ->createBlock('Magento\View\Element\Text') ); $this->assertEmpty($this->_model->getData('price_range')); @@ -122,7 +122,7 @@ class PriceTest extends \PHPUnit_Framework_TestCase $this->_model->apply( $request, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text') + ->createBlock('Magento\View\Element\Text') ); $this->assertEmpty($this->_model->getData('price_range')); @@ -141,7 +141,7 @@ class PriceTest extends \PHPUnit_Framework_TestCase $this->_model->apply( $request, \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text') + ->createBlock('Magento\View\Element\Text') ); $this->assertEquals(array(10, 20), $this->_model->getData('interval')); diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/Advanced/ResultTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/Advanced/ResultTest.php index 8273f564ee6..df9347b77c0 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/Advanced/ResultTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/Advanced/ResultTest.php @@ -66,7 +66,7 @@ class ResultTest extends \PHPUnit_Framework_TestCase \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Catalog\Model\Layer') ->setCurrentCategory($category); - $childBlock = $this->_layout->addBlock('Magento\View\Block\Text', 'search_result_list', 'block'); + $childBlock = $this->_layout->addBlock('Magento\View\Element\Text', 'search_result_list', 'block'); $expectedOptions = array( 'option1' => 'Label Option 1', @@ -82,8 +82,8 @@ class ResultTest extends \PHPUnit_Framework_TestCase */ public function testSetListModes() { - /** @var $childBlock \Magento\View\Block\Text */ - $childBlock = $this->_layout->addBlock('Magento\View\Block\Text', 'search_result_list', 'block'); + /** @var $childBlock \Magento\View\Element\Text */ + $childBlock = $this->_layout->addBlock('Magento\View\Element\Text', 'search_result_list', 'block'); $this->assertEmpty($childBlock->getModes()); $this->_block->setListModes(); $this->assertNotEmpty($childBlock->getModes()); @@ -91,8 +91,8 @@ class ResultTest extends \PHPUnit_Framework_TestCase public function testSetListCollection() { - /** @var $childBlock \Magento\View\Block\Text */ - $childBlock = $this->_layout->addBlock('Magento\View\Block\Text', 'search_result_list', 'block'); + /** @var $childBlock \Magento\View\Element\Text */ + $childBlock = $this->_layout->addBlock('Magento\View\Element\Text', 'search_result_list', 'block'); $this->assertEmpty($childBlock->getCollection()); $this->_block->setListCollection(); $this->assertInstanceOf( diff --git a/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/ResultTest.php b/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/ResultTest.php index 71aae82a729..880749fc466 100644 --- a/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/ResultTest.php +++ b/dev/tests/integration/testsuite/Magento/CatalogSearch/Block/ResultTest.php @@ -33,10 +33,10 @@ class ResultTest extends \PHPUnit_Framework_TestCase { /** @var $layout \Magento\Core\Model\Layout */ $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); - $layout->addBlock('Magento\View\Block\Text', 'head'); // The tested block is using head block + $layout->addBlock('Magento\View\Element\Text', 'head'); // The tested block is using head block /** @var $block \Magento\CatalogSearch\Block\Result */ $block = $layout->addBlock('Magento\CatalogSearch\Block\Result', 'block'); - $childBlock = $layout->addBlock('Magento\View\Block\Text', 'search_result_list', 'block'); + $childBlock = $layout->addBlock('Magento\View\Element\Text', 'search_result_list', 'block'); $this->assertSame($childBlock, $block->getListBlock()); } diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Block/CartTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Block/CartTest.php index 4cfec93d00a..aa0cf6258b0 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Block/CartTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Block/CartTest.php @@ -36,9 +36,9 @@ class CartTest extends \PHPUnit_Framework_TestCase { /** @var $layout \Magento\Core\Model\Layout */ $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); - $child = $layout->createBlock('Magento\View\Block\Text') - ->setChild('child1', $layout->createBlock('Magento\View\Block\Text', 'method1')) - ->setChild('child2', $layout->createBlock('Magento\View\Block\Text', 'method2')); + $child = $layout->createBlock('Magento\View\Element\Text') + ->setChild('child1', $layout->createBlock('Magento\View\Element\Text', 'method1')) + ->setChild('child2', $layout->createBlock('Magento\View\Element\Text', 'method2')); /** @var $block \Magento\Checkout\Block\Cart */ $block = $layout->createBlock('Magento\Checkout\Block\Cart') ->setChild('child', $child); @@ -50,7 +50,7 @@ class CartTest extends \PHPUnit_Framework_TestCase { /** @var $layout \Magento\Core\Model\Layout */ $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); - $childEmpty = $layout->createBlock('Magento\View\Block\Text'); + $childEmpty = $layout->createBlock('Magento\View\Element\Text'); /** @var $block \Magento\Checkout\Block\Cart */ $block = $layout->createBlock('Magento\Checkout\Block\Cart') ->setChild('child', $childEmpty); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Block/Onepage/Payment/MethodsTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Block/Onepage/Payment/MethodsTest.php index 610ac9efd05..00f2df13fd6 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Block/Onepage/Payment/MethodsTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Block/Onepage/Payment/MethodsTest.php @@ -54,7 +54,7 @@ class MethodsTest extends \PHPUnit_Framework_TestCase $method = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\Payment\Model\Method\Free'); - $block = $this->_block->getLayout()->createBlock('Magento\View\Block\Text') + $block = $this->_block->getLayout()->createBlock('Magento\View\Element\Text') ->setMethodTitle($expectedTitle) ->setMethodLabelAfterHtml($expectedLabel); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/Controller/CartTest.php b/dev/tests/integration/testsuite/Magento/Checkout/Controller/CartTest.php index a9a707c5407..eec7687d299 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/Controller/CartTest.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/Controller/CartTest.php @@ -40,8 +40,7 @@ class CartTest extends \Magento\TestFramework\TestCase\AbstractController public function testConfigureActionWithSimpleProduct() { /** @var $session \Magento\Checkout\Model\Session */ - $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Checkout\Model\Session'); + $session = $this->_objectManager->create('Magento\Checkout\Model\Session'); $quoteItem = $this->_getQuoteItemIdByProductId($session->getQuote(), 1); $this->assertNotNull($quoteItem, 'Cannot get quote item for simple product'); @@ -55,8 +54,12 @@ class CartTest extends \Magento\TestFramework\TestCase\AbstractController 'Magento\Checkout\Model\Session' ); - $this->assertSelectCount('button[type="button"][title="Update Cart"]', 1, $response->getBody(), - 'Response for simple product doesn\'t contain "Update Cart" button'); + $this->assertSelectCount( + 'button[type="button"][title="Update Cart"]', + 1, + $response->getBody(), + 'Response for simple product doesn\'t contain "Update Cart" button' + ); } /** @@ -67,8 +70,7 @@ class CartTest extends \Magento\TestFramework\TestCase\AbstractController public function testConfigureActionWithSimpleProductAndCustomOption() { /** @var $session \Magento\Checkout\Model\Session */ - $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Checkout\Model\Session'); + $session = $this->_objectManager->create('Magento\Checkout\Model\Session'); $quoteItem = $this->_getQuoteItemIdByProductId($session->getQuote(), 1); $this->assertNotNull($quoteItem, 'Cannot get quote item for simple product with custom option'); @@ -82,11 +84,19 @@ class CartTest extends \Magento\TestFramework\TestCase\AbstractController 'Magento\Checkout\Model\Session' ); - $this->assertSelectCount('button[type="button"][title="Update Cart"]', 1, $response->getBody(), - 'Response for simple product with custom option doesn\'t contain "Update Cart" button'); + $this->assertSelectCount( + 'button[type="button"][title="Update Cart"]', + 1, + $response->getBody(), + 'Response for simple product with custom option doesn\'t contain "Update Cart" button' + ); - $this->assertSelectCount('input.product-custom-option[type="text"]', 1, $response->getBody(), - 'Response for simple product with custom option doesn\'t contain custom option input field'); + $this->assertSelectCount( + 'input.product-custom-option[type="text"]', + 1, + $response->getBody(), + 'Response for simple product with custom option doesn\'t contain custom option input field' + ); } /** @@ -97,8 +107,7 @@ class CartTest extends \Magento\TestFramework\TestCase\AbstractController public function testConfigureActionWithBundleProduct() { /** @var $session \Magento\Checkout\Model\Session */ - $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Checkout\Model\Session'); + $session = $this->_objectManager->create('Magento\Checkout\Model\Session'); $quoteItem = $this->_getQuoteItemIdByProductId($session->getQuote(), 3); $this->assertNotNull($quoteItem, 'Cannot get quote item for bundle product'); @@ -112,8 +121,12 @@ class CartTest extends \Magento\TestFramework\TestCase\AbstractController 'Magento\Checkout\Model\Session' ); - $this->assertSelectCount('button[type="button"][title="Update Cart"]', 1, $response->getBody(), - 'Response for bundle product doesn\'t contain "Update Cart" button'); + $this->assertSelectCount( + 'button[type="button"][title="Update Cart"]', + 1, + $response->getBody(), + 'Response for bundle product doesn\'t contain "Update Cart" button' + ); } /** @@ -124,8 +137,7 @@ class CartTest extends \Magento\TestFramework\TestCase\AbstractController public function testConfigureActionWithDownloadableProduct() { /** @var $session \Magento\Checkout\Model\Session */ - $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Checkout\Model\Session'); + $session = $this->_objectManager->create('Magento\Checkout\Model\Session'); $quoteItem = $this->_getQuoteItemIdByProductId($session->getQuote(), 1); $this->assertNotNull($quoteItem, 'Cannot get quote item for downloadable product'); @@ -139,11 +151,19 @@ class CartTest extends \Magento\TestFramework\TestCase\AbstractController 'Magento\Checkout\Model\Session' ); - $this->assertSelectCount('button[type="button"][title="Update Cart"]', 1, $response->getBody(), - 'Response for downloadable product doesn\'t contain "Update Cart" button'); + $this->assertSelectCount( + 'button[type="button"][title="Update Cart"]', + 1, + $response->getBody(), + 'Response for downloadable product doesn\'t contain "Update Cart" button' + ); - $this->assertSelectCount('#downloadable-links-list', 1, $response->getBody(), - 'Response for downloadable product doesn\'t contain links for download'); + $this->assertSelectCount( + '#downloadable-links-list', + 1, + $response->getBody(), + 'Response for downloadable product doesn\'t contain links for download' + ); } /** @@ -154,8 +174,7 @@ class CartTest extends \Magento\TestFramework\TestCase\AbstractController public function testConfigureActionWithConfigurableProduct() { /** @var $session \Magento\Checkout\Model\Session */ - $session = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Checkout\Model\Session'); + $session = $this->_objectManager->create('Magento\Checkout\Model\Session'); $quoteItem = $this->_getQuoteItemIdByProductId($session->getQuote(), 1); $this->assertNotNull($quoteItem, 'Cannot get quote item for configurable product'); @@ -169,11 +188,19 @@ class CartTest extends \Magento\TestFramework\TestCase\AbstractController 'Magento\Checkout\Model\Session' ); - $this->assertSelectCount('button[type="button"][title="Update Cart"]', 1, $response->getBody(), - 'Response for configurable product doesn\'t contain "Update Cart" button'); + $this->assertSelectCount( + 'button[type="button"][title="Update Cart"]', + 1, + $response->getBody(), + 'Response for configurable product doesn\'t contain "Update Cart" button' + ); - $this->assertSelectCount('select.super-attribute-select', 1, $response->getBody(), - 'Response for configurable product doesn\'t contain select for super attribute'); + $this->assertSelectCount( + 'select.super-attribute-select', + 1, + $response->getBody(), + 'Response for configurable product doesn\'t contain select for super attribute' + ); } /** diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_bundle_product.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_bundle_product.php index a95764179cf..a4683196162 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_bundle_product.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_bundle_product.php @@ -61,10 +61,6 @@ $cart = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() $cart->addProduct($product, $requestInfo); $cart->save(); -/** @var $objectManager \Magento\TestFramework\ObjectManager */ -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$objectManager->get('Magento\Core\Model\Registry')->unregister('_singleton/Magento\Checkout\Model\Session'); - /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->removeSharedInstance('Magento\Checkout\Model\Session'); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_configurable_product.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_configurable_product.php index dcfa18f85fc..2e8c3aa3dc5 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_configurable_product.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_configurable_product.php @@ -51,10 +51,6 @@ $cart = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() $cart->addProduct($product, $requestInfo); $cart->save(); -/** @var $objectManager \Magento\TestFramework\ObjectManager */ -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$objectManager->get('Magento\Core\Model\Registry')->unregister('_singleton/Magento\Checkout\Model\Session'); - /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->removeSharedInstance('Magento\Checkout\Model\Session'); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_downloadable_product.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_downloadable_product.php index f4c46aa0fa4..6f03c9dda6d 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_downloadable_product.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_downloadable_product.php @@ -53,10 +53,6 @@ $cart = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() $cart->addProduct($product, $requestInfo); $cart->save(); -/** @var $objectManager \Magento\TestFramework\ObjectManager */ -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$objectManager->get('Magento\Core\Model\Registry')->unregister('_singleton/Magento\Checkout\Model\Session'); - /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->removeSharedInstance('Magento\Checkout\Model\Session'); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product.php index 9a6e2f71130..0bba1eeeedc 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product.php @@ -42,10 +42,6 @@ $cart = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() $cart->addProduct($product, $requestInfo); $cart->save(); -/** @var $objectManager \Magento\TestFramework\ObjectManager */ -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$objectManager->get('Magento\Core\Model\Registry')->unregister('_singleton/Magento\Checkout\Model\Session'); - /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->removeSharedInstance('Magento\Checkout\Model\Session'); diff --git a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product_and_custom_option.php b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product_and_custom_option.php index 04fda32ef9f..db0120697db 100644 --- a/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product_and_custom_option.php +++ b/dev/tests/integration/testsuite/Magento/Checkout/_files/quote_with_simple_product_and_custom_option.php @@ -62,10 +62,6 @@ $cart = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() $cart->addProduct($product, $requestInfo); $cart->save(); -/** @var $objectManager \Magento\TestFramework\ObjectManager */ -$objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); -$objectManager->get('Magento\Core\Model\Registry')->unregister('_singleton/Magento\Checkout\Model\Session'); - /** @var $objectManager \Magento\TestFramework\ObjectManager */ $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $objectManager->removeSharedInstance('Magento\Checkout\Model\Session'); diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/AppTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/AppTest.php index e9c1fe7debd..139474cc7f8 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/AppTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/AppTest.php @@ -57,7 +57,7 @@ class AppTest extends \PHPUnit_Framework_TestCase public function testGetCookie() { - $this->assertInstanceOf('Magento\Core\Model\Cookie', $this->_model->getCookie()); + $this->assertInstanceOf('Magento\Stdlib\Cookie', $this->_model->getCookie()); } /** diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/DataService/LayoutTest/layout_update.xml b/dev/tests/integration/testsuite/Magento/Core/Model/DataService/LayoutTest/layout_update.xml index e844109ab93..7697d3fcb4b 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/DataService/LayoutTest/layout_update.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/DataService/LayoutTest/layout_update.xml @@ -24,7 +24,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\View\Block\Template" name="block_with_service_calls"> + <block class="Magento\View\Element\Template" name="block_with_service_calls"> <data service_call="testServiceCall" alias="testData"/> </block> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/LayoutDirectivesTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/LayoutDirectivesTest.php index e7cfbed7b7a..d5f4b4a93a2 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/LayoutDirectivesTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/LayoutDirectivesTest.php @@ -58,8 +58,8 @@ class LayoutDirectivesTest extends \PHPUnit_Framework_TestCase public function testGetBlockUnscheduled() { $layout = $this->_getLayoutModel('get_block.xml'); - $this->assertInstanceOf('Magento\View\Block\Text', $layout->getBlock('block1')); - $this->assertInstanceOf('Magento\View\Block\Text', $layout->getBlock('block2')); + $this->assertInstanceOf('Magento\View\Element\Text', $layout->getBlock('block1')); + $this->assertInstanceOf('Magento\View\Element\Text', $layout->getBlock('block2')); } /** diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/LayoutTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/LayoutTest.php index 5b2e198655f..8acc273c2b9 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/LayoutTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/LayoutTest.php @@ -87,7 +87,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase */ public function testDestructor() { - $this->_layout->addBlock('Magento\View\Block\Text', 'test'); + $this->_layout->addBlock('Magento\View\Element\Text', 'test'); $this->assertNotEmpty($this->_layout->getAllBlocks()); $this->_layout->__destruct(); $this->assertEmpty($this->_layout->getAllBlocks()); @@ -126,11 +126,11 @@ class LayoutTest extends \PHPUnit_Framework_TestCase { $this->_layout->setXml(simplexml_load_string( '<layout> - <block class="Magento\View\Block\Text" name="block1"> - <block class="Magento\View\Block\Text"/> + <block class="Magento\View\Element\Text" name="block1"> + <block class="Magento\View\Element\Text"/> </block> - <block class="Magento\View\Block\Text" template="test"/> - <block class="Magento\View\Block\Text"/> + <block class="Magento\View\Element\Text" template="test"/> + <block class="Magento\View\Element\Text"/> </layout>', 'Magento\View\Layout\Element' )); @@ -149,14 +149,17 @@ class LayoutTest extends \PHPUnit_Framework_TestCase $name = 'test'; $this->_layout->addContainer($name, 'Test', array('option1' => 1, 'option2' => 2)); $this->assertEquals('Test', $this->_layout->getElementProperty( - $name, \Magento\Core\Model\Layout::CONTAINER_OPT_LABEL + $name, \Magento\View\Layout\Element::CONTAINER_OPT_LABEL )); - $this->assertEquals(\Magento\Core\Model\Layout::TYPE_CONTAINER, + $this->assertEquals(\Magento\View\Layout\Element::TYPE_CONTAINER, $this->_layout->getElementProperty($name, 'type')); $this->assertSame(2, $this->_layout->getElementProperty($name, 'option2')); - $this->_layout->addBlock('Magento\View\Block\Text', 'text', $name); - $this->assertEquals(\Magento\Core\Model\Layout::TYPE_BLOCK, $this->_layout->getElementProperty('text', 'type')); + $this->_layout->addBlock('Magento\View\Element\Text', 'text', $name); + $this->assertEquals( + \Magento\View\Layout\Element::TYPE_BLOCK, + $this->_layout->getElementProperty('text', 'type') + ); $this->assertSame(array('text' => 'text'), $this->_layout->getElementProperty( $name, \Magento\Data\Structure::CHILDREN )); @@ -170,7 +173,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase $this->assertFalse($this->_layout->isBlock('container')); $this->assertFalse($this->_layout->isBlock('block')); $this->_layout->addContainer('container', 'Container'); - $this->_layout->addBlock('Magento\View\Block\Text', 'block'); + $this->_layout->addBlock('Magento\View\Element\Text', 'block'); $this->assertFalse($this->_layout->isBlock('container')); $this->assertTrue($this->_layout->isBlock('block')); } @@ -178,7 +181,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase public function testSetUnsetBlock() { $expectedBlockName = 'block_' . __METHOD__; - $expectedBlock = $this->_layout->createBlock('Magento\View\Block\Text'); + $expectedBlock = $this->_layout->createBlock('Magento\View\Element\Text'); $this->_layout->setBlock($expectedBlockName, $expectedBlock); $this->assertSame($expectedBlock, $this->_layout->getBlock($expectedBlockName)); @@ -206,16 +209,16 @@ class LayoutTest extends \PHPUnit_Framework_TestCase { return array( 'named block' => array( - 'Magento\View\Block\Template', + 'Magento\View\Element\Template', 'some_block_name_full_class', - array('type' => 'Magento\View\Block\Template', 'is_anonymous' => false), + array('type' => 'Magento\View\Element\Template', 'is_anonymous' => false), '/^some_block_name_full_class$/' ), 'no name block' => array( - 'Magento\View\Block\Text\ListText', + 'Magento\View\Element\Text\ListText', '', array( - 'type' => 'Magento\View\Block\Text\ListText', + 'type' => 'Magento\View\Element\Text\ListText', 'key1' => 'value1', ), '/text\\\\list/' @@ -242,9 +245,9 @@ class LayoutTest extends \PHPUnit_Framework_TestCase public function testAddBlock() { - $this->assertInstanceOf('Magento\View\Block\Text', $this->_layout->addBlock('Magento\View\Block\Text', + $this->assertInstanceOf('Magento\View\Element\Text', $this->_layout->addBlock('Magento\View\Element\Text', 'block1')); - $block2 = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\View\Block\Text'); + $block2 = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->create('Magento\View\Element\Text'); $block2->setNameInLayout('block2'); $this->_layout->addBlock($block2, '', 'block1'); @@ -305,7 +308,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase public function testGetChildBlock() { $this->_layout->addContainer('parent', 'Parent'); - $block = $this->_layout->addBlock('Magento\View\Block\Text', 'block', 'parent', 'block_alias'); + $block = $this->_layout->addBlock('Magento\View\Element\Text', 'block', 'parent', 'block_alias'); $this->_layout->addContainer('container', 'Container', array(), 'parent', 'container_alias'); $this->assertSame($block, $this->_layout->getChildBlock('parent', 'block_alias')); $this->assertFalse($this->_layout->getChildBlock('parent', 'container_alias')); @@ -364,9 +367,9 @@ class LayoutTest extends \PHPUnit_Framework_TestCase public function testGetChildBlocks() { $this->_layout->addContainer('parent', 'Parent'); - $block1 = $this->_layout->addBlock('Magento\View\Block\Text', 'block1', 'parent'); + $block1 = $this->_layout->addBlock('Magento\View\Element\Text', 'block1', 'parent'); $this->_layout->addContainer('container', 'Container', array(), 'parent'); - $block2 = $this->_layout->addBlock('Magento\View\Block\Template', 'block2', 'parent'); + $block2 = $this->_layout->addBlock('Magento\View\Element\Template', 'block2', 'parent'); $this->assertSame(array('block1' => $block1, 'block2' => $block2), $this->_layout->getChildBlocks('parent')); } @@ -385,7 +388,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase { $block = 'block'; $container = 'container'; - $this->_layout->addBlock('Magento\View\Block\Text', $block); + $this->_layout->addBlock('Magento\View\Element\Text', $block); $this->_layout->addContainer($container, 'Container'); $this->assertFalse($this->_layout->isContainer($block)); $this->assertTrue($this->_layout->isContainer($container)); @@ -394,13 +397,13 @@ class LayoutTest extends \PHPUnit_Framework_TestCase public function testIsManipulationAllowed() { - $this->_layout->addBlock('Magento\View\Block\Text', 'block1'); - $this->_layout->addBlock('Magento\View\Block\Text', 'block2', 'block1'); + $this->_layout->addBlock('Magento\View\Element\Text', 'block1'); + $this->_layout->addBlock('Magento\View\Element\Text', 'block2', 'block1'); $this->assertFalse($this->_layout->isManipulationAllowed('block1')); $this->assertFalse($this->_layout->isManipulationAllowed('block2')); $this->_layout->addContainer('container1', 'Container 1'); - $this->_layout->addBlock('Magento\View\Block\Text', 'block3', 'container1'); + $this->_layout->addBlock('Magento\View\Element\Text', 'block3', 'container1'); $this->_layout->addContainer('container2', 'Container 2', array(), 'container1'); $this->assertFalse($this->_layout->isManipulationAllowed('container1')); $this->assertTrue($this->_layout->isManipulationAllowed('block3')); @@ -413,7 +416,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase $expBlockName = 'block_renamed'; $containerName = 'container'; $expContainerName = 'container_renamed'; - $block = $this->_layout->createBlock('Magento\View\Block\Text', $blockName); + $block = $this->_layout->createBlock('Magento\View\Element\Text', $blockName); $this->_layout->addContainer($containerName, 'Container'); $this->assertEquals($block, $this->_layout->getBlock($blockName)); @@ -429,7 +432,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase { $this->assertFalse($this->_layout->getBlock('test')); $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Layout') - ->createBlock('Magento\View\Block\Text'); + ->createBlock('Magento\View\Element\Text'); $this->_layout->setBlock('test', $block); $this->assertSame($block, $this->_layout->getBlock('test')); } @@ -463,7 +466,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase $blockName = 'block_' . __METHOD__; $expectedText = "some_text_for_$blockName"; - $block = $this->_layout->addBlock('Magento\View\Block\Text', $blockName); + $block = $this->_layout->addBlock('Magento\View\Element\Text', $blockName); $block->setText($expectedText); $this->_layout->addOutputElement($blockName); @@ -477,14 +480,14 @@ class LayoutTest extends \PHPUnit_Framework_TestCase public function testGetMessagesBlock() { - $this->assertInstanceOf('Magento\View\Block\Messages', $this->_layout->getMessagesBlock()); + $this->assertInstanceOf('Magento\View\Element\Messages', $this->_layout->getMessagesBlock()); } public function testGetBlockSingleton() { - $block = $this->_layout->getBlockSingleton('Magento\View\Block\Text'); - $this->assertInstanceOf('Magento\View\Block\Text', $block); - $this->assertSame($block, $this->_layout->getBlockSingleton('Magento\View\Block\Text')); + $block = $this->_layout->getBlockSingleton('Magento\View\Element\Text'); + $this->assertInstanceOf('Magento\View\Element\Text', $block); + $this->assertSame($block, $this->_layout->getBlockSingleton('Magento\View\Element\Text')); } public function testUpdateContainerAttributes() diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Db/Collection/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Db/Collection/AbstractTest.php index 413d20ff1a1..c06a5516b83 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Db/Collection/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Resource/Db/Collection/AbstractTest.php @@ -58,7 +58,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $this->_model = $this->getMockForAbstractClass( 'Magento\Core\Model\Resource\Db\Collection\AbstractCollection', - array($eventManager, $logger, $fetchStrategy, $entityFactory, $resource) + array($entityFactory, $logger, $fetchStrategy, $eventManager, null, $resource) ); } diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Session/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Session/AbstractSessionTest.php similarity index 63% rename from dev/tests/integration/testsuite/Magento/Core/Model/Session/AbstractTest.php rename to dev/tests/integration/testsuite/Magento/Core/Model/Session/AbstractSessionTest.php index 8ece7e703e9..1743b465f81 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Session/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Session/AbstractSessionTest.php @@ -27,33 +27,39 @@ namespace Magento\Core\Model\Session; -class AbstractTest extends \PHPUnit_Framework_TestCase +class AbstractSessionTest extends \PHPUnit_Framework_TestCase { /** * @var \Magento\Core\Model\Session\AbstractSession */ protected $_model; + /** + * @var \Magento\Session\SidResolverInterface + */ + protected $_sidResolver; + protected function setUp() { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + /** @var \Magento\Session\SidResolverInterface $sidResolver */ + $this->_sidResolver = $objectManager->get('Magento\Session\SidResolverInterface'); + /** @var \Magento\Core\Model\Session\AbstractSession _model */ - $this->_model = $this->getMockForAbstractClass('Magento\Core\Model\Session\AbstractSession', + $this->_model = $this->getMockForAbstractClass( + 'Magento\Core\Model\Session\AbstractSession', array( - $objectManager->get('Magento\Core\Model\Session\Context') - )); - } - - public function testGetCookie() - { - $cookie = $this->_model->getCookie(); - $this->assertInstanceOf('Magento\Core\Model\Cookie', $cookie); - $this->assertSame($cookie, $this->_model->getCookie()); + $objectManager->create('Magento\Core\Model\Session\Context'), + $this->_sidResolver, + $objectManager->create('Magento\Session\Config\ConfigInterface'), + ) + ); } public function testInit() { - $this->_model->init('test'); + $this->_model->start('test'); $this->_model->setTestData('test'); $data = $this->_model->getData(); $this->assertArrayHasKey('test_data', $data); @@ -72,24 +78,24 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $this->assertEquals(session_id(), $this->_model->getSessionId()); } - public function testGetSessionName() + public function testGetName() { - $this->assertEquals(session_name(), $this->_model->getSessionName()); + $this->assertEquals(session_name(), $this->_model->getName()); } public function testSetSessionName() { $this->_model->setSessionName('test'); - $this->assertEquals('test', $this->_model->getSessionName()); + $this->assertEquals('test', $this->_model->getName()); } - public function testUnsetAll() + public function testDestroy() { $data = array('key' => 'value'); $this->_model->setData($data); $this->assertEquals($data, $this->_model->getData()); - $this->_model->unsetAll(); + $this->_model->destroy(); $this->assertEquals(array(), $this->_model->getData()); } @@ -97,7 +103,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase public function testSetSessionId() { $sessionId = $this->_model->getSessionId(); - $this->_model->setSessionId(); + $this->_model->setSessionId($this->_sidResolver->getSid($this->_model)); $this->assertEquals($sessionId, $this->_model->getSessionId()); $this->_model->setSessionId('test'); @@ -110,44 +116,22 @@ class AbstractTest extends \PHPUnit_Framework_TestCase public function testSetSessionIdFromParam() { $this->assertNotEquals('test_id', $this->_model->getSessionId()); - $_GET[$this->_model->getSessionIdQueryParam()] = 'test-id'; - $this->_model->setSessionId(); + $_GET[$this->_sidResolver->getSessionIdQueryParam($this->_model)] = 'test-id'; + $this->_model->setSessionId($this->_sidResolver->getSid($this->_model)); $this->assertEquals('test-id', $this->_model->getSessionId()); /* Use not valid identifier */ - $_GET[$this->_model->getSessionIdQueryParam()] = 'test_id'; - $this->_model->setSessionId(); + $_GET[$this->_sidResolver->getSessionIdQueryParam($this->_model)] = 'test_id'; + $this->_model->setSessionId($this->_sidResolver->getSid($this->_model)); $this->assertEquals('test-id', $this->_model->getSessionId()); } - public function testGetEncryptedSessionId() - { - $sessionId = $this->_model->getEncryptedSessionId(); - $this->_model->setSessionId('new-id'); - $this->assertEquals($sessionId, $this->_model->getEncryptedSessionId()); - } - - public function testGetSessionIdQueryParam() - { - $this->assertEquals( - \Magento\Core\Model\Session\AbstractSession::SESSION_ID_QUERY_PARAM, - $this->_model->getSessionIdQueryParam() - ); - } - - public function testSetGetSkipSessionIdFlag() - { - $this->assertFalse($this->_model->getSkipSessionIdFlag()); - $this->_model->setSkipSessionIdFlag(true); - $this->assertTrue($this->_model->getSkipSessionIdFlag()); - } - public function testGetSessionIdForHost() { $_SERVER['HTTP_HOST'] = 'localhost'; - $this->_model->init('test'); + $this->_model->start('test'); $this->assertEmpty($this->_model->getSessionIdForHost('localhost')); $this->assertNotEmpty($this->_model->getSessionIdForHost('test')); } @@ -155,7 +139,12 @@ class AbstractTest extends \PHPUnit_Framework_TestCase public function testIsValidForHost() { $_SERVER['HTTP_HOST'] = 'localhost'; - $this->_model->init('test'); + $this->_model->start('test'); + + $reflection = new \ReflectionMethod($this->_model, '_addHost'); + $reflection->setAccessible(true); + $reflection->invoke($this->_model); + $this->assertFalse($this->_model->isValidForHost('test.com')); $this->assertTrue($this->_model->isValidForHost('localhost')); } @@ -164,13 +153,4 @@ class AbstractTest extends \PHPUnit_Framework_TestCase { $this->assertEquals('files', $this->_model->getSessionSaveMethod()); } - - public function testGetSessionSavePath() - { - $this->assertEquals( - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Dir') - ->getDir('session'), - $this->_model->getSessionSavePath() - ); - } } diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Session/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Session/ConfigTest.php new file mode 100644 index 00000000000..304f00efaa8 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Session/ConfigTest.php @@ -0,0 +1,71 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Core\Model\Session; + +class ConfigTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Core\Model\Session\Config + */ + protected $_model; + + /** + * @var string + */ + protected $_cacheLimiter = 'private_no_expire'; + + protected function setUp() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + /** @var \Magento\Core\Model\Session\AbstractSession _model */ + $this->_model = $objectManager->create('\Magento\Core\Model\Session\Config', array( + 'cacheLimiter' => $this->_cacheLimiter + )); + } + + /** + * @magentoAppIsolation enabled + */ + public function testDefaultConfiguration() + { + $this->assertEquals( + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\Dir')->getDir('session'), + $this->_model->getSavePath() + ); + $this->assertEquals( + \Magento\Core\Model\Session\Config::COOKIE_LIFETIME_DEFAULT, + $this->_model->getCookieLifetime() + ); + $this->assertEquals($this->_cacheLimiter, $this->_model->getCacheLimiter()); + $this->assertEquals('/', $this->_model->getCookiePath()); + $this->assertEquals('localhost', $this->_model->getCookieDomain()); + $this->assertEquals(false, $this->_model->getCookieSecure()); + $this->assertEquals(true, $this->_model->getCookieHttpOnly()); + } +} + diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Session/SidResolverTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/Session/SidResolverTest.php new file mode 100644 index 00000000000..73d5ab3289b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Core/Model/Session/SidResolverTest.php @@ -0,0 +1,173 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Core\Model\Session; + +class SidResolverTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Core\Model\Session\SidResolver + */ + protected $model; + + /** + * @var \Magento\Core\Model\Session + */ + protected $session; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\Store + */ + protected $store; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Core\Model\Store\ConfigInterface + */ + protected $coreStoreConfig; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject|\Magento\UrlInterface + */ + protected $urlBuilder; + + /** + * @var string + */ + protected $customSessionName = 'csn'; + + /** + * @var string + */ + protected $customSessionQueryParam = 'csqp'; + + protected function setUp() + { + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + /** @var \Magento\Core\Model\Session _model */ + $this->session = $objectManager->get('Magento\Core\Model\Session'); + + $this->store = $this->getMockBuilder('Magento\Core\Model\Store') + ->setMethods(array('isAdmin')) + ->disableOriginalConstructor() + ->getMock(); + + $this->coreStoreConfig = $this->getMockBuilder('Magento\Core\Model\Store\ConfigInterface') + ->setMethods(array('getConfig')) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $this->urlBuilder = $this->getMockBuilder('Magento\UrlInterface') + ->setMethods(array('isOwnOriginUrl')) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + + $storeManager = $this->getMockBuilder('Magento\Core\Model\StoreManagerInterface') + ->setMethods(array('getStore')) + ->disableOriginalConstructor() + ->getMockForAbstractClass(); + $storeManager->expects($this->any()) + ->method('getStore') + ->will($this->returnValue($this->store)); + + $this->model = $objectManager->create( + 'Magento\Core\Model\Session\SidResolver', + array( + 'storeManager' => $storeManager, + 'coreStoreConfig' => $this->coreStoreConfig, + 'urlBuilder' => $this->urlBuilder, + 'sidNameMap' => array($this->customSessionName => $this->customSessionQueryParam) + ) + ); + } + + public function tearDown() + { + if (is_object($this->model) && isset($_GET[$this->model->getSessionIdQueryParam($this->session)])) { + unset($_GET[$this->model->getSessionIdQueryParam($this->session)]); + } + } + + /** + * @param mixed $sid + * @param bool $useFrontedSid + * @param bool $isOwnOriginUrl + * @param mixed $testSid + * @dataProvider dataProviderTestGetSid + */ + public function testGetSid($sid, $useFrontedSid, $isOwnOriginUrl, $testSid) + { + $this->coreStoreConfig->expects($this->any()) + ->method('getConfig') + ->with(SidResolver::XML_PATH_USE_FRONTEND_SID) + ->will($this->returnValue($useFrontedSid)); + + $this->urlBuilder->expects($this->any()) + ->method('isOwnOriginUrl') + ->will($this->returnValue($isOwnOriginUrl)); + + if ($testSid) { + $_GET[$this->model->getSessionIdQueryParam($this->session)] = $testSid; + } + $this->assertEquals($sid, $this->model->getSid($this->session)); + } + + /** + * @return array + */ + public function dataProviderTestGetSid() + { + return array( + array(null, false, false, 'test-sid'), + array(null, false, true, 'test-sid'), + array(null, false, false, 'test-sid'), + array(null, true, false, 'test-sid'), + array(null, false, true, 'test-sid'), + array('test-sid', true, true, 'test-sid'), + array(null, true, true, null), + ); + } + + public function testGetSessionIdQueryParam() + { + $this->assertEquals( + SidResolver::SESSION_ID_QUERY_PARAM, + $this->model->getSessionIdQueryParam($this->session) + ); + } + + public function testGetSessionIdQueryParamCustom() + { + $oldSessionName = $this->session->getName(); + $this->session->setSessionName($this->customSessionName); + $this->assertEquals( + $this->customSessionQueryParam, + $this->model->getSessionIdQueryParam($this->session) + ); + $this->session->setSessionName($oldSessionName); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/StoreTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/StoreTest.php index 806ec740e42..1917b28bc5f 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/StoreTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/StoreTest.php @@ -51,9 +51,9 @@ class StoreTest extends \PHPUnit_Framework_TestCase { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_modelParams = array( - 'coreFileStorageDatabase' => $objectManager->get('Magento\Core\Helper\File\Storage\Database'), 'context' => $objectManager->get('Magento\Core\Model\Context'), 'registry' => $objectManager->get('Magento\Core\Model\Registry'), + 'coreFileStorageDatabase' => $objectManager->get('Magento\Core\Helper\File\Storage\Database'), 'configCacheType' => $objectManager->get('Magento\App\Cache\Type\Config'), 'url' => $objectManager->get('Magento\Core\Model\Url'), 'request' => $objectManager->get('Magento\App\RequestInterface'), @@ -63,6 +63,8 @@ class StoreTest extends \PHPUnit_Framework_TestCase 'coreConfig' => $objectManager->get('Magento\Core\Model\Config'), 'resource' => $objectManager->get('Magento\Core\Model\Resource\Store'), 'storeManager' => $objectManager->get('Magento\Core\Model\StoreManager'), + 'sidResolver' => $objectManager->get('Magento\Session\SidResolverInterface'), + 'cookie' => $objectManager->get('Magento\Stdlib\Cookie'), ); return $this->getMock( diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/UrlTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/UrlTest.php index df4c9d89b60..db43b76114d 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/UrlTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/UrlTest.php @@ -599,7 +599,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase public function testSessionUrlVar() { $sessionId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Session') - ->getEncryptedSessionId(); + ->getSessionId(); $sessionUrl = $this->_model->sessionUrlVar('<a href="http://example.com/?___SID=U">www.example.com</a>'); $this->assertEquals('<a href="http://example.com/?SID=' . $sessionId . '">www.example.com</a>', $sessionUrl diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php b/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php index de3e5df9fe3..bbcdb2dcdc4 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php +++ b/dev/tests/integration/testsuite/Magento/Core/Model/View/DesignTest.php @@ -317,8 +317,8 @@ class DesignTest extends \PHPUnit_Framework_TestCase return array( array( \Magento\App\State::MODE_DEFAULT, - 'Magento_Page::favicon.ico', - 'http://localhost/pub/static/frontend/test_default/en_US/Magento_Page/favicon.ico', + 'Magento_Theme::favicon.ico', + 'http://localhost/pub/static/frontend/test_default/en_US/Magento_Theme/favicon.ico', ), array( \Magento\App\State::MODE_DEFAULT, @@ -327,13 +327,13 @@ class DesignTest extends \PHPUnit_Framework_TestCase ), array( \Magento\App\State::MODE_DEVELOPER, - 'Magento_Page::menu.js', - 'http://localhost/pub/static/frontend/test_default/en_US/Magento_Page/menu.js' + 'Magento_Theme::menu.js', + 'http://localhost/pub/static/frontend/test_default/en_US/Magento_Theme/menu.js' ), array( \Magento\App\State::MODE_DEFAULT, - 'Magento_Page::menu.js', - 'http://localhost/pub/static/frontend/test_default/en_US/Magento_Page/menu.js' + 'Magento_Theme::menu.js', + 'http://localhost/pub/static/frontend/test_default/en_US/Magento_Theme/menu.js' ), array( \Magento\App\State::MODE_DEFAULT, diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_cache_test_theme/layout_test_handle.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_cache_test_theme/layout_test_handle.xml index 28e08efbb6d..44329928043 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_cache_test_theme/layout_test_handle.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_cache_test_theme/layout_test_handle.xml @@ -27,7 +27,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > - <block class="Magento\View\Block\Text" name="sample_text_block"> + <block class="Magento\View\Element\Text" name="sample_text_block"> <action method="setText"> <argument name="text" xsi:type="string">Text declared in the frontend/test/cache_test_theme</argument> </action> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Core/layout_test_handle_main.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Core/layout_test_handle_main.xml index 78e759838fb..e17b34172c6 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Core/layout_test_handle_main.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Core/layout_test_handle_main.xml @@ -38,7 +38,7 @@ </action> </referenceBlock> <referenceBlock name="some_element_1"/> - <block name="test.nonexisting.block" class="Magento\View\Block\Text\ListText"/> + <block name="test.nonexisting.block" class="Magento\View\Element\Text\ListText"/> <remove name="test.nonexisting.block"/> <referenceBlock name="test.nonexisting.block"> <action method="getSomething"/> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Core/layout_test_handle_sample.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Core/layout_test_handle_sample.xml index d4c188c7bbc..3cf9822b6f4 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Core/layout_test_handle_sample.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_default/Magento_Core/layout_test_handle_sample.xml @@ -41,11 +41,11 @@ <action method="addJs" ifconfig="dev/js/deprecation"> <argument name="file" xsi:type="string">prototype/deprecation.js</argument> </action> - <block class="Magento\View\Block\Html\Calendar" name="head.calendar" as="calendar" template="page/js/calendar.phtml"/> + <block class="Magento\View\Element\Html\Calendar" name="head.calendar" as="calendar" template="page/js/calendar.phtml"/> </block> <block class="Magento\Backend\Block\Page\Header" name="header" as="header"/> <block class="Magento\Backend\Block\Menu" name="menu" as="menu"/> - <block class="Magento\View\Block\Messages" name="messages" as="messages"/> - <block class="Magento\View\Block\Text" as="no_name"/> + <block class="Magento\View\Element\Messages" name="messages" as="messages"/> + <block class="Magento\View\Element\Text" as="no_name"/> </block> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_test_theme/layout_test_handle.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_test_theme/layout_test_handle.xml index 1cc34a278f3..4ac9978736f 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_test_theme/layout_test_handle.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/test_test_theme/layout_test_handle.xml @@ -27,7 +27,7 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > - <block class="Magento\View\Block\Text" name="sample_text_block"> + <block class="Magento\View\Element\Text" name="sample_text_block"> <action method="setText"> <argument name="text" xsi:type="string">Text declared in the frontend/test/test_theme</argument> </action> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/vendor_default/css/file.css b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/vendor_default/css/file.css index 02389a7aaa5..7e89b1ff1d1 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/vendor_default/css/file.css +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/design/frontend/vendor_default/css/file.css @@ -35,4 +35,4 @@ ol {background: url(http://example.com/absolute.gif);} li {background: url("https://example.com/absolute.gif");} ol.valid {background: url(Namespace_Module::absolute_valid_module.gif)} /* theme file modular */ -ol.favicon {background: url(Magento_Page::favicon.ico)} /* base file */ +ol.favicon {background: url(Magento_Theme::favicon.ico)} /* base file */ diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout/container_attributes.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout/container_attributes.xml index 788ebe73981..89d0492805e 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout/container_attributes.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout/container_attributes.xml @@ -25,28 +25,28 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <container name="container1" label="test1" htmlTag="div" htmlId="container1-1" htmlClass="class11"> - <block class="Magento\View\Block\Text" name="block11"> + <block class="Magento\View\Element\Text" name="block11"> <action method="setText"> <argument name="text" xsi:type="string">Test11</argument> </action> </block> </container> <referenceContainer name="container1" label="test1" htmlId="container1-2" htmlClass="class12"> - <block class="Magento\View\Block\Text" name="block12"> + <block class="Magento\View\Element\Text" name="block12"> <action method="setText"> <argument name="text" xsi:type="string">Test12</argument> </action> </block> </referenceContainer> <container name="container2" label="test2" htmlTag="div" htmlClass="class21"> - <block class="Magento\View\Block\Text" name="block21"> + <block class="Magento\View\Element\Text" name="block21"> <action method="setText"> <argument name="text" xsi:type="string">Test21</argument> </action> </block> </container> <referenceContainer name="container2" label="test2" htmlId="container2-2" htmlClass="class22"> - <block class="Magento\View\Block\Text" name="block22"> + <block class="Magento\View\Element\Text" name="block22"> <action method="setText"> <argument name="text" xsi:type="string">Test22</argument> </action> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/action_for_anonymous_parent_block.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/action_for_anonymous_parent_block.xml index 1889d197fbf..42a2743d06f 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/action_for_anonymous_parent_block.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/action_for_anonymous_parent_block.xml @@ -24,14 +24,14 @@ */ --> <layout> - <block name="test.block.insert" class="Magento\View\Block\Text"/> - <block class="Magento\View\Block\Template"> + <block name="test.block.insert" class="Magento\View\Element\Text"/> + <block class="Magento\View\Element\Template"> <action method="insert"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="element" xsi:type="string">test.block.insert</argument> </action> </block> - <block name="test.block.append" class="Magento\View\Block\Text"/> - <block class="Magento\View\Block\Text"> + <block name="test.block.append" class="Magento\View\Element\Text"/> + <block class="Magento\View\Element\Text"> <action method="append"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="element" xsi:type="string">test.block.append</argument> </action> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments.xml index 5380bb06f0b..a38f3d34e7b 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments.xml @@ -24,7 +24,7 @@ */ --> <layout> - <block class="Magento\View\Block\Text" name="block_with_args"> + <block class="Magento\View\Element\Text" name="block_with_args"> <arguments> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="one" xsi:type="string">1</argument> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="two" xsi:type="string">2</argument> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_complex_values.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_complex_values.xml index e5ff876835e..6a7b80d2500 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_complex_values.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_complex_values.xml @@ -24,7 +24,7 @@ */ --> <layout> - <block class="Magento\View\Block\Text" name="block_with_args_complex_values"> + <block class="Magento\View\Element\Text" name="block_with_args_complex_values"> <arguments> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="one" xsi:type="array"> <item name="parameters" xsi:type="array"> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_object_type.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_object_type.xml index 90bb85d1728..cad98a11618 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_object_type.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_object_type.xml @@ -24,7 +24,7 @@ */ --> <layout> - <block class="Magento\View\Block\Text" name="block_with_object_args"> + <block class="Magento\View\Element\Text" name="block_with_object_args"> <arguments> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="one" xsi:type="object">Magento\Data\Collection\Db</argument> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="two" xsi:type="object">Magento\Data\Collection\Db</argument> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_object_type_updaters.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_object_type_updaters.xml index c87ac3cfcf1..b9501910ed3 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_object_type_updaters.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_object_type_updaters.xml @@ -24,7 +24,7 @@ */ --> <layout> - <block class="Magento\View\Block\Text" name="block_with_object_updater_args"> + <block class="Magento\View\Element\Text" name="block_with_object_updater_args"> <arguments> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="one" xsi:type="object">Magento\Core\Model\DataSource</argument> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="two" xsi:type="number">0</argument> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_url_type.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_url_type.xml index 2812596b8c6..e931b2aa0ac 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_url_type.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/arguments_url_type.xml @@ -24,7 +24,7 @@ */ --> <layout> - <block class="Magento\View\Block\Text" name="block_with_url_args"> + <block class="Magento\View\Element\Text" name="block_with_url_args"> <arguments> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="one" xsi:type="url" path="customer/account/login"> <param name="_current">1</param> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/get_block.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/get_block.xml index 76066a8776d..44cde07f8e4 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/get_block.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/get_block.xml @@ -24,10 +24,10 @@ */ --> <layout> - <block name="block1" class="Magento\View\Block\Text"> + <block name="block1" class="Magento\View\Element\Text"> <action method="getChildBlock"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="value" xsi:type="string">block2</argument> </action> - <block name="block2" class="Magento\View\Block\Text"/> + <block name="block2" class="Magento\View\Element\Text"/> </block> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/get_block_exception.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/get_block_exception.xml index c5b88654117..0f6e2f1e1bf 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/get_block_exception.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/get_block_exception.xml @@ -24,7 +24,7 @@ */ --> <layout> - <block name="block1" class="Magento\View\Block\Text"> + <block name="block1" class="Magento\View\Element\Text"> <container name="container" label="Container"/> <action method="getChildBlock"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="value" xsi:type="string">container</argument> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/group.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/group.xml index b22987c91d0..353ff0de1fa 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/group.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/group.xml @@ -24,18 +24,18 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\View\Block\Text" name="block1"> - <block class="Magento\View\Block\Text" name="block2" group="group1"> + <block class="Magento\View\Element\Text" name="block1"> + <block class="Magento\View\Element\Text" name="block2" group="group1"> <argumrnts> <argument xsi:type="string" name="text">blok2</argument> </argumrnts> </block> - <block class="Magento\View\Block\Text" name="block3" group="group1" > + <block class="Magento\View\Element\Text" name="block3" group="group1" > <argumrnts> <argument xsi:type="string" name="text">blok3</argument> </argumrnts> </block> - <block class="Magento\View\Block\Text" name="block4"> + <block class="Magento\View\Element\Text" name="block4"> <argumrnts> <argument xsi:type="string" name="text">blok4</argument> </argumrnts> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/ifconfig.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/ifconfig.xml index 9a457a04f60..7b00f5b00df 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/ifconfig.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/ifconfig.xml @@ -24,10 +24,10 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> - <block class="Magento\View\Block\Text" name="block1" ifconfig="not_exists"> - <block class="Magento\View\Block\Text" name="block2"/> + <block class="Magento\View\Element\Text" name="block1" ifconfig="not_exists"> + <block class="Magento\View\Element\Text" name="block2"/> </block> - <block class="Magento\View\Block\Text" name="block3" ifconfig="true_options"> - <block class="Magento\View\Block\Text" name="block4" ifconfig="not_exists"/> + <block class="Magento\View\Element\Text" name="block3" ifconfig="true_options"> + <block class="Magento\View\Element\Text" name="block4" ifconfig="not_exists"/> </block> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move.xml index 47ccbb54e71..7a096d5b259 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move.xml @@ -25,20 +25,20 @@ --> <layout> <container name="container1" label="Container 1"> - <block class="Magento\View\Block\Text" name="no.name2" as="no.name2"/> + <block class="Magento\View\Element\Text" name="no.name2" as="no.name2"/> </container> <container name="container2" label="Container 2"/> <move element="container1" destination="container2"/> - <block class="Magento\View\Block\Text" name="block_container" as="block.container"> - <block class="Magento\View\Block\Text" name="child_block1"/> - <block class="Magento\View\Block\Text" name="child_block2"/> + <block class="Magento\View\Element\Text" name="block_container" as="block.container"> + <block class="Magento\View\Element\Text" name="child_block1"/> + <block class="Magento\View\Element\Text" name="child_block2"/> </block> <container name="container3" label="Container 3"> - <block class="Magento\View\Block\Text" name="no_name"/> + <block class="Magento\View\Element\Text" name="no_name"/> </container> <move element="no_name" destination="block_container" after="child_block1"/> - <block class="Magento\View\Block\Text" name="no_name4"/> + <block class="Magento\View\Element\Text" name="no_name4"/> <move element="no_name4" destination="block_container" before="child_block2"/> <move element="no_name3" destination="block_container"/> - <block class="Magento\View\Block\Text" name="no_name3"/> + <block class="Magento\View\Element\Text" name="no_name3"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_alias_broken.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_alias_broken.xml index 9a289aa37c2..e2e8bea900b 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_alias_broken.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_alias_broken.xml @@ -25,8 +25,8 @@ --> <layout> <container name="container1" label="Container 1"> - <block class="Magento\View\Block\Text" name="no_name1" as="same_alias"/> + <block class="Magento\View\Element\Text" name="no_name1" as="same_alias"/> </container> <move element="no_name3" destination="container1" as="same_alias"/> - <block class="Magento\View\Block\Text" name="no_name3" as="same_alias"/> + <block class="Magento\View\Element\Text" name="no_name3" as="same_alias"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_broken.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_broken.xml index f697895b68b..1d06e7c657e 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_broken.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_broken.xml @@ -26,5 +26,5 @@ <layout> <container name="container1" label="Container 1"/> <move element="no_name3"/> - <block class="Magento\View\Block\Text" name="no_name3"/> + <block class="Magento\View\Element\Text" name="no_name3"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_new_alias.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_new_alias.xml index 0e699133bbc..7d05fdce51f 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_new_alias.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_new_alias.xml @@ -25,8 +25,8 @@ --> <layout> <container name="container1" label="Container 1"> - <block class="Magento\View\Block\Text" name="no_name1" as="same_alias"/> + <block class="Magento\View\Element\Text" name="no_name1" as="same_alias"/> </container> <move element="no_name3" destination="container1" as="new_alias"/> - <block class="Magento\View\Block\Text" name="no_name3" as="same_alias"/> + <block class="Magento\View\Element\Text" name="no_name3" as="same_alias"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_the_same_alias.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_the_same_alias.xml index 3306c8580d1..bc9c9971d61 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_the_same_alias.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/move_the_same_alias.xml @@ -25,8 +25,8 @@ --> <layout> <container name="container1" label="Container 1"> - <block class="Magento\View\Block\Text" name="no_name1" as="same_alias"/> + <block class="Magento\View\Element\Text" name="no_name1" as="same_alias"/> </container> <move element="no_name3" destination="container1"/> - <block class="Magento\View\Block\Text" name="no_name3" as="same_alias"/> + <block class="Magento\View\Element\Text" name="no_name3" as="same_alias"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/remove.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/remove.xml index d51f5bb2d61..3cac51956fc 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/remove.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/remove.xml @@ -25,13 +25,13 @@ --> <layout> <container name="container1" label="Container 1"> - <block class="Magento\View\Block\Text" name="no_name2"/> + <block class="Magento\View\Element\Text" name="no_name2"/> </container> <remove name="container1"/> <remove name="child_block1"/> - <block class="Magento\View\Block\Text" name="block_container" as="block.container"> - <block class="Magento\View\Block\Text" name="child_block1"/> - <block class="Magento\View\Block\Text" name="child_block2"/> + <block class="Magento\View\Element\Text" name="block_container" as="block.container"> + <block class="Magento\View\Element\Text" name="child_block1"/> + <block class="Magento\View\Element\Text" name="child_block2"/> </block> <remove name="not_exist"/> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/remove_broken.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/remove_broken.xml index 691d29e02bf..c5907f92fb3 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/remove_broken.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/remove_broken.xml @@ -24,9 +24,9 @@ */ --> <layout> - <block name="test.broken.block" type="Magento\View\Block\Text"/> + <block name="test.broken.block" type="Magento\View\Element\Text"/> <remove name="test.broken.block"/> - <block class="Magento\View\Block\Template" name="bug.without.name.action.is.ignored"> + <block class="Magento\View\Element\Template" name="bug.without.name.action.is.ignored"> <action method="insert"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="element" xsi:type="string">test.broken.block</argument> </action> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/render.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/render.xml index 5afed0bc447..261d0d0da35 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/render.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/render.xml @@ -31,12 +31,12 @@ </action> </referenceBlock> <container name="container1" label="Container 1"> - <block class="Magento\View\Block\Text" name="block1"> + <block class="Magento\View\Element\Text" name="block1"> <action method="addText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="value" xsi:type="string">2</argument> </action> </block> - <block class="Magento\View\Block\Text" name="block2"> + <block class="Magento\View\Element\Text" name="block2"> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="value" xsi:type="string">3</argument> </action> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_after_after.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_after_after.xml index 4450ec759e5..2902eae2c27 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_after_after.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_after_after.xml @@ -25,17 +25,17 @@ --> <layout> <container name="root" label="Root"> - <block class="Magento\View\Block\Text" name="element1" after="element3"> + <block class="Magento\View\Element\Text" name="element1" after="element3"> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">1</argument> </action> </block> - <block class="Magento\View\Block\Text" name="element2" after="element1"> + <block class="Magento\View\Element\Text" name="element2" after="element1"> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">2</argument> </action> </block> - <block class="Magento\View\Block\Text" name="element3" after="element_non_existing"> + <block class="Magento\View\Element\Text" name="element3" after="element_non_existing"> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">3</argument> </action> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_after_previous.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_after_previous.xml index c8ea855fba1..47d8b706667 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_after_previous.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_after_previous.xml @@ -25,17 +25,17 @@ --> <layout> <container name="root" label="Root"> - <block class="Magento\View\Block\Text" name="element1" after="element2"> + <block class="Magento\View\Element\Text" name="element1" after="element2"> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">1</argument> </action> </block> - <block class="Magento\View\Block\Text" name="element2" after="element3"> + <block class="Magento\View\Element\Text" name="element2" after="element3"> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">2</argument> </action> </block> - <block class="Magento\View\Block\Text" name="element3"> + <block class="Magento\View\Element\Text" name="element3"> <!-- neither "before" or "after" specified, therefore insert before all elements --> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">3</argument> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_before_after.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_before_after.xml index d7ecf105a82..69a488eb663 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_before_after.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_before_after.xml @@ -25,17 +25,17 @@ --> <layout> <container name="root" label="Root"> - <block class="Magento\View\Block\Text" name="element1" before="element2"> + <block class="Magento\View\Element\Text" name="element1" before="element2"> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">1</argument> </action> </block> - <block class="Magento\View\Block\Text" name="element2" after="element3"> + <block class="Magento\View\Element\Text" name="element2" after="element3"> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">2</argument> </action> </block> - <block class="Magento\View\Block\Text" name="element3" after="-"> + <block class="Magento\View\Element\Text" name="element3" after="-"> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">3</argument> </action> diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_before_before.xml b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_before_before.xml index 06da3c34dad..ba80f7d253d 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_before_before.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Model/_files/layout_directives_test/sort_before_before.xml @@ -25,17 +25,17 @@ --> <layout> <container name="root" label="Root"> - <block class="Magento\View\Block\Text" name="element1" before="element3"> + <block class="Magento\View\Element\Text" name="element1" before="element3"> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">1</argument> </action> </block> - <block class="Magento\View\Block\Text" name="element2" before="element1"> + <block class="Magento\View\Element\Text" name="element2" before="element1"> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">2</argument> </action> </block> - <block class="Magento\View\Block\Text" name="element3" before="element_non_existing"> + <block class="Magento\View\Element\Text" name="element3" before="element_non_existing"> <!-- element_non_existing doesn't exist, so element3 is generated at the end --> <action method="setText"> <argument xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="text" xsi:type="string">3</argument> diff --git a/dev/tests/integration/testsuite/Magento/Core/Utility/_files/layout/handle_one.xml b/dev/tests/integration/testsuite/Magento/Core/Utility/_files/layout/handle_one.xml index 8003c92da01..4039ea95e4f 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Utility/_files/layout/handle_one.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Utility/_files/layout/handle_one.xml @@ -24,7 +24,7 @@ */ --> <layout> - <block class="Magento\View\Block\Text" name="some_text_block"> + <block class="Magento\View\Element\Text" name="some_text_block"> <action method="setText"> <text>Some Default Text</text> </action> diff --git a/dev/tests/integration/testsuite/Magento/Core/Utility/_files/layout_merged/multiple_handles.xml b/dev/tests/integration/testsuite/Magento/Core/Utility/_files/layout_merged/multiple_handles.xml index 94213cee83f..c43962c9246 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Utility/_files/layout_merged/multiple_handles.xml +++ b/dev/tests/integration/testsuite/Magento/Core/Utility/_files/layout_merged/multiple_handles.xml @@ -25,7 +25,7 @@ --> <layouts> <handle id="handle_one"> - <block class="Magento\View\Block\Text" name="some_text_block"> + <block class="Magento\View\Element\Text" name="some_text_block"> <action method="setText"> <text>Some Default Text</text> </action> diff --git a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php index de9be851472..87e1edfcbe2 100644 --- a/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php +++ b/dev/tests/integration/testsuite/Magento/Customer/Controller/Adminhtml/GroupTest.php @@ -67,7 +67,9 @@ class GroupTest extends \Magento\Backend\Utility\Controller * Check that success message is set */ $this->assertSessionMessages( - $this->equalTo(array('The customer group has been deleted.')), \Magento\Message\Factory::SUCCESS + $this->equalTo(array('The customer group has been deleted.')), + \Magento\Message\Factory::SUCCESS, + 'Magento\Core\Model\Session\AbstractSession' ); } diff --git a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/ObserverTest.php b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/ObserverTest.php index a5d60320b88..655252730d2 100644 --- a/dev/tests/integration/testsuite/Magento/DesignEditor/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/DesignEditor/Model/ObserverTest.php @@ -40,17 +40,14 @@ class ObserverTest extends \PHPUnit_Framework_TestCase public function testCleanJs($area, $designMode, $expectedAssets) { $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); - /** @var $headBlock \Magento\Page\Block\Html\Head */ - $headBlock = $layout->createBlock('Magento\Page\Block\Html\Head', 'head'); + /** @var $headBlock \Magento\Theme\Block\Html\Head */ + $headBlock = $layout->createBlock('Magento\Theme\Block\Html\Head', 'head'); $headBlock->setData('vde_design_mode', $designMode); $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); - /** @var $page \Magento\Core\Model\Page */ - $page = $objectManager->get('Magento\Core\Model\Page'); - - /** @var $pageAssets \Magento\Page\Model\Asset\GroupedCollection */ - $pageAssets = $page->getAssets(); + /** @var $pageAssets \Magento\View\Asset\GroupedCollection */ + $pageAssets = $objectManager->get('Magento\View\Asset\GroupedCollection'); $fixtureAssets = array( array('name' => 'test_css', 'type' => \Magento\View\Publisher::CONTENT_TYPE_CSS, @@ -66,7 +63,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase foreach ($fixtureAssets as $asset) { $pageAssets->add( $asset['name'], - $objectManager->create('Magento\Core\Model\Page\Asset\ViewFile', array( + $objectManager->create('Magento\View\Asset\ViewFile', array( 'file' => 'some_file', 'contentType' => $asset['type'], )), diff --git a/dev/tests/integration/testsuite/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinksTest.php b/dev/tests/integration/testsuite/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinksTest.php index 8d65b73dbbc..d3179b050f0 100644 --- a/dev/tests/integration/testsuite/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinksTest.php +++ b/dev/tests/integration/testsuite/Magento/Downloadable/Block/Adminhtml/Catalog/Product/Edit/Tab/Downloadable/LinksTest.php @@ -30,6 +30,9 @@ namespace Magento\Downloadable\Block\Adminhtml\Catalog\Product\Edit\Tab\Download class LinksTest extends \PHPUnit_Framework_TestCase { + /** + * @magentoAppArea adminhtml + */ public function testGetUploadButtonsHtml() { $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') @@ -40,9 +43,9 @@ class LinksTest /** * Reuse code for testing getUploadButtonHtml() * - * @param \Magento\View\Block\AbstractBlock $block + * @param \Magento\View\Element\AbstractBlock $block */ - public static function performUploadButtonTest(\Magento\View\Block\AbstractBlock $block) + public static function performUploadButtonTest(\Magento\View\Element\AbstractBlock $block) { /** @var $layout \Magento\View\LayoutInterface */ $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() @@ -50,13 +53,14 @@ class LinksTest $layout->addBlock($block, 'links'); $expected = uniqid(); $text = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text', '', array('data' => array('text' => $expected))); + ->createBlock('Magento\View\Element\Text', '', array('data' => array('text' => $expected))); $block->unsetChild('upload_button'); $layout->addBlock($text, 'upload_button', 'links'); self::assertEquals($expected, $block->getUploadButtonHtml()); } /** + * @magentoAppArea adminhtml * @magentoAppIsolation enabled */ public function testGetLinkData() @@ -77,6 +81,7 @@ class LinksTest * @magentoAppIsolation enabled * @dataProvider productLinksTitleDataProvider * + * @magentoAppArea adminhtml * @param string $productType * @param string $linksTitle * @param string $expectedResult diff --git a/dev/tests/integration/testsuite/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractTest.php index 2ba6e9d740d..9cfcf90ff3b 100644 --- a/dev/tests/integration/testsuite/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Eav/Block/Adminhtml/Attribute/Edit/Main/AbstractTest.php @@ -55,7 +55,6 @@ class AbstractTest 'Magento\Eav\Block\Adminhtml\Attribute\Edit\Main\AbstractMain', array( $objectManager->get('Magento\Backend\Block\Template\Context'), - $objectManager->get('Magento\Core\Helper\Data'), $objectManager->get('Magento\Core\Model\Registry'), $objectManager->get('Magento\Data\FormFactory'), $objectManager->get('Magento\Eav\Helper\Data'), diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php index d165b3f8eaf..12b4e0e142d 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/Template/FilterTest.php @@ -48,9 +48,9 @@ class FilterTest extends \PHPUnit_Framework_TestCase public function testViewDirective() { $url = $this->_model->viewDirective(array( - '{{view url="Magento_Page::favicon.ico"}}', + '{{view url="Magento_Theme::favicon.ico"}}', 'view', - ' url="Magento_Page::favicon.ico"', // note leading space + ' url="Magento_Theme::favicon.ico"', // note leading space )); $this->assertStringEndsWith('favicon.ico', $url); } diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php index 3a0885349e0..a65c17eba1b 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Email/Model/TemplateTest.php @@ -49,16 +49,16 @@ class TemplateTest extends \PHPUnit_Framework_TestCase ->setMethods(array('_getMail')) ->setConstructorArgs(array( \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Context'), + $objectManager->get('Magento\View\DesignInterface'), $objectManager->get('Magento\Core\Model\Registry'), $objectManager->get('Magento\Core\Model\App\Emulation'), + $objectManager->get('Magento\Core\Model\StoreManager'), $objectManager->create('Magento\Filesystem'), $objectManager->create('Magento\View\Url'), $objectManager->create('Magento\View\FileSystem'), - $objectManager->get('Magento\View\DesignInterface'), $objectManager->create('Magento\Core\Model\Store\Config'), $objectManager->create('Magento\Core\Model\Config'), $objectManager->get('Magento\Email\Model\Template\FilterFactory'), - $objectManager->get('Magento\Core\Model\StoreManager'), $objectManager->get('Magento\App\Dir'), $objectManager->get('Magento\Email\Model\Template\Config'), )) @@ -113,8 +113,8 @@ class TemplateTest extends \PHPUnit_Framework_TestCase \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\App') ->getArea(\Magento\Core\Model\App\Area::AREA_FRONTEND)->load(); $this->_setBlankThemeForFixtureStore(); - $expectedViewUrl = 'static/frontend/magento_blank/en_US/Magento_Page/favicon.ico'; - $this->_model->setTemplateText('{{view url="Magento_Page::favicon.ico"}}'); + $expectedViewUrl = 'static/frontend/magento_blank/en_US/Magento_Theme/favicon.ico'; + $this->_model->setTemplateText('{{view url="Magento_Theme::favicon.ico"}}'); $this->assertStringEndsNotWith($expectedViewUrl, $this->_model->getProcessedTemplate()); $this->_model->setDesignConfig(array( 'area' => 'frontend', @@ -148,9 +148,9 @@ class TemplateTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\App') ->getArea(\Magento\Core\Model\App\Area::AREA_FRONTEND)->load(); - $this->_model->setTemplateText('{{view url="Magento_Page::favicon.ico"}}'); + $this->_model->setTemplateText('{{view url="Magento_Theme::favicon.ico"}}'); $this->assertStringEndsWith( - 'static/frontend/magento_blank/en_US/Magento_Page/favicon.ico', + 'static/frontend/magento_blank/en_US/Magento_Theme/favicon.ico', $this->_model->getProcessedTemplate() ); } @@ -164,8 +164,8 @@ class TemplateTest extends \PHPUnit_Framework_TestCase \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\App') ->getArea(\Magento\Core\Model\App\Area::AREA_FRONTEND)->load(); $this->_setBlankThemeForFixtureStore(); - $expectedViewUrl = 'static/frontend/magento_blank/en_US/Magento_Page/favicon.ico'; - $this->_model->setTemplateSubject('{{view url="Magento_Page::favicon.ico"}}'); + $expectedViewUrl = 'static/frontend/magento_blank/en_US/Magento_Theme/favicon.ico'; + $this->_model->setTemplateSubject('{{view url="Magento_Theme::favicon.ico"}}'); $this->assertStringEndsNotWith($expectedViewUrl, $this->_model->getProcessedTemplateSubject(array())); $this->_model->setDesignConfig(array( 'area' => 'frontend', diff --git a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/test_default/Magento_Core/layout/email_template_test_handle.xml b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/test_default/Magento_Core/layout/email_template_test_handle.xml index 05f821c354e..a8d92311623 100644 --- a/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/test_default/Magento_Core/layout/email_template_test_handle.xml +++ b/dev/tests/integration/testsuite/Magento/Email/Model/_files/design/frontend/test_default/Magento_Core/layout/email_template_test_handle.xml @@ -27,8 +27,8 @@ */ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > - <block class="Magento\View\Block\Template" name="sample_email_content" template="Magento_Core::sample_email_content.phtml"/> - <block class="Magento\View\Block\Text" name="ignored_email_content"> + <block class="Magento\View\Element\Template" name="sample_email_content" template="Magento_Core::sample_email_content.phtml"/> + <block class="Magento\View\Element\Text" name="ignored_email_content"> <action method="setText"> <argument name="text" xsi:type="string">Ignored e-mail content, only the first block is used</argument> </action> diff --git a/dev/tests/integration/testsuite/Magento/GoogleShopping/Block/Adminhtml/Items/ProductTest.php b/dev/tests/integration/testsuite/Magento/GoogleShopping/Block/Adminhtml/Items/ProductTest.php index 4df92be2738..7b2b93d8347 100644 --- a/dev/tests/integration/testsuite/Magento/GoogleShopping/Block/Adminhtml/Items/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/GoogleShopping/Block/Adminhtml/Items/ProductTest.php @@ -39,9 +39,9 @@ class ProductTest extends \PHPUnit_Framework_TestCase $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') ->createBlock('Magento\GoogleShopping\Block\Adminhtml\Items\Product'); $filter = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text'); + ->createBlock('Magento\View\Element\Text'); $search = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text'); + ->createBlock('Magento\View\Element\Text'); $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); $layout->addBlock($block, 'product'); diff --git a/dev/tests/integration/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php b/dev/tests/integration/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php index 17fcedfb37b..4216f45fc6c 100644 --- a/dev/tests/integration/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php +++ b/dev/tests/integration/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php @@ -68,7 +68,7 @@ class IntegrationTest extends \Magento\Backend\Utility\Controller $this->dispatch('backend/admin/integration/edit'); $response = $this->getResponse()->getBody(); $saveLink = 'integration/save/'; - + $this->assertContains('entry-edit form-inline', $response); $this->assertContains('Edit "'. $this->_integration->getName() .'" Integration', $response); $this->assertContains($saveLink, $response); @@ -121,10 +121,21 @@ class IntegrationTest extends \Magento\Backend\Utility\Controller private function _createDummyIntegration() { /** @var $factory \Magento\Integration\Model\Integration\Factory */ - $factory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Integration\Model\Integration\Factory'); + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $factory = $objectManager->create('Magento\Integration\Model\Integration\Factory'); $this->_integration = $factory->create() ->setName(md5(rand())) ->save(); + + /** Grant permissions to integrations */ + /** @var \Magento\Authz\Model\UserIdentifier\Factory $userIdentifierFactory */ + $userIdentifierFactory = $objectManager->create('Magento\Authz\Model\UserIdentifier\Factory'); + /** @var \Magento\Authz\Service\AuthorizationV1 $authzService */ + $userIdentifier = $userIdentifierFactory->create( + \Magento\Authz\Model\UserIdentifier::USER_TYPE_INTEGRATION, + $this->_integration->getId() + ); + $authzService = $objectManager->create('Magento\Authz\Service\AuthorizationV1'); + $authzService->grantAllPermissions($userIdentifier); } } diff --git a/dev/tests/integration/testsuite/Magento/Integration/Model/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Integration/Model/Config/ReaderTest.php new file mode 100644 index 00000000000..73960a607aa --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Integration/Model/Config/ReaderTest.php @@ -0,0 +1,67 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * + */ + +namespace Magento\Integration\Model\Config; + +use Magento\Integration\Model\Config\Reader as ConfigReader; + +/** + * Integration config reader test. + */ +class ReaderTest extends \PHPUnit_Framework_TestCase +{ + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $_fileResolverMock; + + /** @var ConfigReader */ + protected $_configReader; + + protected function setUp() + { + parent::setUp(); + $this->_fileResolverMock = $this->getMock('Magento\Config\FileResolverInterface'); + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->_configReader = $objectManager->create( + 'Magento\Integration\Model\Config\Reader', + array('fileResolver' => $this->_fileResolverMock) + ); + } + + public function testRead() + { + $configFiles = array( + realpath(__DIR__ . '/_files/integrationA.xml'), + realpath(__DIR__ . '/_files/integrationB.xml') + ); + $this->_fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($configFiles)); + + $expectedResult = require __DIR__ . '/_files/integration.php'; + $this->assertEquals( + $expectedResult, + $this->_configReader->read(), + 'Error happened during config reading.' + ); + } +} diff --git a/app/code/Magento/Page/Block/Template/Container.php b/dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integration.php similarity index 69% rename from app/code/Magento/Page/Block/Template/Container.php rename to dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integration.php index b0cb503af21..0174f55ae61 100644 --- a/app/code/Magento/Page/Block/Template/Container.php +++ b/dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integration.php @@ -18,25 +18,19 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - - -/** - * Abstract container block with header - * - * @category Magento - * @package Magento_Core - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Page\Block\Template; - -class Container extends \Magento\View\Block\Template -{ - - protected $_template = 'template/container.phtml'; - -} +return array( + 'TestIntegration1' => array( + 'email' => 'test-integration1@example.com', + 'endpoint_url' => 'http://example.com/endpoint1' + ), + 'TestIntegration2' => array( + 'email' => 'test-integration2@example.com', + 'endpoint_url' => 'http://example.com/integration2' + ), + 'TestIntegration3' => array( + 'email' => 'test-integration3@example.com', + ), +); diff --git a/dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integrationA.xml b/dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integrationA.xml new file mode 100644 index 00000000000..9adf046a90d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integrationA.xml @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<integrations> + <integration name="TestIntegration1"> + <email>test-integration1@example.com</email> + <endpoint_url>http://example.com/endpoint1</endpoint_url> + </integration> + <integration name="TestIntegration2"> + <email>test-integration2@example.com</email> + </integration> +</integrations> diff --git a/dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integrationB.xml b/dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integrationB.xml new file mode 100644 index 00000000000..5096a031de5 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Integration/Model/Config/_files/integrationB.xml @@ -0,0 +1,34 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<integrations> + <integration name="TestIntegration2"> + <!--Extension of data provided in integrationA.xml--> + <endpoint_url>http://example.com/integration2</endpoint_url> + </integration> + <integration name="TestIntegration3"> + <email>test-integration3@example.com</email> + </integration> +</integrations> diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Block/Adminhtml/SubscriberTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Block/Adminhtml/SubscriberTest.php index 5a4215b2485..c4486e27634 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Block/Adminhtml/SubscriberTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Block/Adminhtml/SubscriberTest.php @@ -38,8 +38,8 @@ class SubscriberTest extends \PHPUnit_Framework_TestCase $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); /** @var $block \Magento\Newsletter\Block\Adminhtml\Subscriber */ $block = $layout->createBlock('Magento\Newsletter\Block\Adminhtml\Subscriber', 'block'); - /** @var $childBlock \Magento\View\Block\Template */ - $childBlock = $layout->addBlock('Magento\View\Block\Template', 'grid', 'block'); + /** @var $childBlock \Magento\View\Element\Template */ + $childBlock = $layout->addBlock('Magento\View\Element\Template', 'grid', 'block'); $expected = 'test_data'; $this->assertNotEquals($expected, $block->getShowQueueAdd()); diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Controller/Adminhtml/NewsletterTemplateTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Controller/Adminhtml/NewsletterTemplateTest.php index cbe0015142a..e6a20aca050 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Controller/Adminhtml/NewsletterTemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Controller/Adminhtml/NewsletterTemplateTest.php @@ -56,7 +56,7 @@ class NewsletterTemplateTest extends \Magento\Backend\Utility\Controller * Unset messages */ \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Backend\Model\Session') - ->getMessages(true); + ->destroy(); unset($this->_model); } diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php index 0653284ae5c..7804d9c7261 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/QueueTest.php @@ -74,16 +74,16 @@ class QueueTest extends \PHPUnit_Framework_TestCase array('_getMail', '_getLogoUrl', '__wakeup', 'setTemplateFilter'), array( $objectManager->get('Magento\Core\Model\Context'), + $design, $objectManager->get('Magento\Core\Model\Registry'), $appEmulation, + $objectManager->get('Magento\Core\Model\StoreManagerInterface'), $objectManager->get('Magento\Filesystem'), $objectManager->get('Magento\View\Url'), $objectManager->get('Magento\View\FileSystem'), - $design, $objectManager->get('Magento\Core\Model\Store\ConfigInterface'), $objectManager->get('Magento\Core\Model\ConfigInterface'), $objectManager->get('Magento\Email\Model\Template\FilterFactory'), - $objectManager->get('Magento\Core\Model\StoreManagerInterface'), $objectManager->get('Magento\App\Dir'), $objectManager->get('Magento\Email\Model\Template\Config'), ) @@ -121,16 +121,16 @@ class QueueTest extends \PHPUnit_Framework_TestCase array('_getMail', '_getLogoUrl', '__wakeup'), array( $objectManager->get('Magento\Core\Model\Context'), + $objectManager->get('Magento\Core\Model\View\Design'), $objectManager->get('Magento\Core\Model\Registry'), $objectManager->get('Magento\Core\Model\App\Emulation'), + $objectManager->get('Magento\Core\Model\StoreManagerInterface'), $objectManager->get('Magento\Filesystem'), $objectManager->get('Magento\View\Url'), $objectManager->get('Magento\View\FileSystem'), - $objectManager->get('Magento\Core\Model\View\Design'), $objectManager->get('Magento\Core\Model\Store\ConfigInterface'), $objectManager->get('Magento\Core\Model\ConfigInterface'), $objectManager->get('Magento\Email\Model\Template\FilterFactory'), - $objectManager->get('Magento\Core\Model\StoreManagerInterface'), $objectManager->get('Magento\App\Dir'), $objectManager->get('Magento\Email\Model\Template\Config'), ) diff --git a/dev/tests/integration/testsuite/Magento/Newsletter/Model/TemplateTest.php b/dev/tests/integration/testsuite/Magento/Newsletter/Model/TemplateTest.php index cd86bcf71fa..9f7c6f89a3b 100644 --- a/dev/tests/integration/testsuite/Magento/Newsletter/Model/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/Newsletter/Model/TemplateTest.php @@ -55,12 +55,12 @@ class TemplateTest extends \PHPUnit_Framework_TestCase public function testGetProcessedTemplate($area, $store, $design) { $this->markTestIncomplete('Test partially fails bc of MAGETWO-557.'); - $this->_model->setTemplateText('{{view url="Magento_Page::favicon.ico"}}'); - $this->assertStringEndsWith('theme/frontend/magento_blank/en_US/Magento_Page/favicon.ico', + $this->_model->setTemplateText('{{view url="Magento_Theme::favicon.ico"}}'); + $this->assertStringEndsWith('theme/frontend/magento_blank/en_US/Magento_Theme/favicon.ico', $this->_model->getProcessedTemplate() ); $this->_model->emulateDesign($store, $area); - $expectedTemplateText = "theme/{$area}/{$design}/en_US/Magento_Page/favicon.ico"; + $expectedTemplateText = "theme/{$area}/{$design}/en_US/Magento_Theme/favicon.ico"; $this->assertStringEndsWith($expectedTemplateText, $this->_model->getProcessedTemplate()); $this->_model->revertDesign(); } diff --git a/dev/tests/integration/testsuite/Magento/Page/_files/robots.txt b/dev/tests/integration/testsuite/Magento/Page/_files/robots.txt deleted file mode 100644 index d1a0bb31072..00000000000 --- a/dev/tests/integration/testsuite/Magento/Page/_files/robots.txt +++ /dev/null @@ -1,19 +0,0 @@ -User-agent: * -Disallow: /index.php/ -Disallow: /*? -Disallow: /*.js$ -Disallow: /*.css$ -Disallow: /checkout/ -Disallow: /app/ -Disallow: /downloader/ -Disallow: /js/ -Disallow: /lib/ -Disallow: /*.php$ -Disallow: /pkginfo/ -Disallow: /report/ -Disallow: /var/ -Disallow: /catalog/ -Disallow: /customer/ -Disallow: /sendfriend/ -Disallow: /review/ -Disallow: /*SID= \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/PageCache/Helper/DataTest.php b/dev/tests/integration/testsuite/Magento/PageCache/Helper/DataTest.php index 4b8897273f1..e0830ca2206 100644 --- a/dev/tests/integration/testsuite/Magento/PageCache/Helper/DataTest.php +++ b/dev/tests/integration/testsuite/Magento/PageCache/Helper/DataTest.php @@ -42,8 +42,8 @@ class DataTest extends \PHPUnit_Framework_TestCase public function testSetNoCacheCookie() { - /** @var $cookie \Magento\Core\Model\Cookie */ - $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Cookie'); + /** @var $cookie \Magento\Stdlib\Cookie */ + $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Stdlib\Cookie'); $this->assertEmpty($cookie->get(\Magento\PageCache\Helper\Data::NO_CACHE_COOKIE)); $this->_helper->setNoCacheCookie(); $this->assertNotEmpty($cookie->get(\Magento\PageCache\Helper\Data::NO_CACHE_COOKIE)); @@ -51,8 +51,8 @@ class DataTest extends \PHPUnit_Framework_TestCase public function testRemoveNoCacheCookie() { - /** @var $cookie \Magento\Core\Model\Cookie */ - $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Cookie'); + /** @var $cookie \Magento\Stdlib\Cookie */ + $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Stdlib\Cookie'); $this->_helper->setNoCacheCookie(); $this->_helper->removeNoCacheCookie(); $this->assertEmpty($cookie->get(\Magento\PageCache\Helper\Data::NO_CACHE_COOKIE)); @@ -60,8 +60,8 @@ class DataTest extends \PHPUnit_Framework_TestCase public function testLockUnlockNoCacheCookie() { - /** @var $cookie \Magento\Core\Model\Cookie */ - $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Cookie'); + /** @var $cookie \Magento\Stdlib\Cookie */ + $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Stdlib\Cookie'); $this->_helper->setNoCacheCookie(); $this->assertNotEmpty($cookie->get(\Magento\PageCache\Helper\Data::NO_CACHE_COOKIE)); diff --git a/dev/tests/integration/testsuite/Magento/PageCache/Model/ObserverTest.php b/dev/tests/integration/testsuite/Magento/PageCache/Model/ObserverTest.php index adaaf9755be..a947bd2106f 100644 --- a/dev/tests/integration/testsuite/Magento/PageCache/Model/ObserverTest.php +++ b/dev/tests/integration/testsuite/Magento/PageCache/Model/ObserverTest.php @@ -45,8 +45,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase */ public function testSetNoCacheCookie() { - /** @var $cookie \Magento\Core\Model\Cookie */ - $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Cookie'); + /** @var $cookie \Magento\Stdlib\Cookie */ + $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Stdlib\Cookie'); $this->assertEmpty($cookie->get(\Magento\PageCache\Helper\Data::NO_CACHE_COOKIE)); $this->_observer->setNoCacheCookie(new \Magento\Event\Observer()); $this->assertNotEmpty($cookie->get(\Magento\PageCache\Helper\Data::NO_CACHE_COOKIE)); @@ -57,8 +57,8 @@ class ObserverTest extends \PHPUnit_Framework_TestCase */ public function testDeleteNoCacheCookie() { - /** @var $cookie \Magento\Core\Model\Cookie */ - $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\Cookie'); + /** @var $cookie \Magento\Stdlib\Cookie */ + $cookie = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Stdlib\Cookie'); $cookie->set(\Magento\PageCache\Helper\Data::NO_CACHE_COOKIE, '1'); $this->_observer->deleteNoCacheCookie(new \Magento\Event\Observer()); $this->assertEmpty($cookie->get(\Magento\PageCache\Helper\Data::NO_CACHE_COOKIE)); diff --git a/dev/tests/integration/testsuite/Magento/Payment/Block/InfoTest.php b/dev/tests/integration/testsuite/Magento/Payment/Block/InfoTest.php index ede0e33dfaa..eb77e63494f 100644 --- a/dev/tests/integration/testsuite/Magento/Payment/Block/InfoTest.php +++ b/dev/tests/integration/testsuite/Magento/Payment/Block/InfoTest.php @@ -50,7 +50,7 @@ class InfoTest extends \PHPUnit_Framework_TestCase $childBank->setInfo($paymentInfoBank); $nonExpectedHtml = 'non-expected html'; - $childHtml = $layout->addBlock('Magento\View\Block\Text', 'child.html', 'block'); + $childHtml = $layout->addBlock('Magento\View\Element\Text', 'child.html', 'block'); $childHtml->setText($nonExpectedHtml); /** @var $paymentInfoCheckmo \Magento\Payment\Model\Info */ diff --git a/dev/tests/integration/testsuite/Magento/Review/Controller/ProductTest.php b/dev/tests/integration/testsuite/Magento/Review/Controller/ProductTest.php index 876985e0bc8..d1c3c608755 100644 --- a/dev/tests/integration/testsuite/Magento/Review/Controller/ProductTest.php +++ b/dev/tests/integration/testsuite/Magento/Review/Controller/ProductTest.php @@ -38,7 +38,7 @@ class ProductTest extends \Magento\TestFramework\TestCase\AbstractController $this->getRequest()->setParam('id', $productId); $this->dispatch('review/product/list'); $result = $this->getResponse()->getBody(); - $this->assertContains("static/frontend/{$expectedDesign}/en_US/Magento_Page/favicon.ico", $result); + $this->assertContains("static/frontend/{$expectedDesign}/en_US/Magento_Theme/favicon.ico", $result); } /** diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Items/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Items/AbstractTest.php index a92d2d17068..3ed43dd69e3 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Items/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Items/AbstractTest.php @@ -44,8 +44,8 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $this->assertEmpty($block->getItemExtraInfoHtml($item)); $expectedHtml ='<html><body>some data</body></html>'; - /** @var $childBlock \Magento\View\Block\Text */ - $childBlock = $layout->addBlock('Magento\View\Block\Text', 'other_block', 'block', 'order_item_extra_info'); + /** @var $childBlock \Magento\View\Element\Text */ + $childBlock = $layout->addBlock('Magento\View\Element\Text', 'other_block', 'block', 'order_item_extra_info'); $childBlock->setText($expectedHtml); $this->assertEquals($expectedHtml, $block->getItemExtraInfoHtml($item)); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AbstractTest.php index 4c3c5b741f4..db90790bef4 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Form/AbstractTest.php @@ -46,7 +46,6 @@ class AbstractTest ->setDefaultDesignTheme(); $arguments = array( $objectManager->get('Magento\Backend\Block\Template\Context'), - $objectManager->get('Magento\Core\Helper\Data'), $objectManager->get('Magento\Adminhtml\Model\Session\Quote'), $objectManager->get('Magento\Sales\Model\AdminOrder\Create'), $objectManager->get('Magento\Data\FormFactory'), diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Creditmemo/ItemsTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Creditmemo/ItemsTest.php index 041fa027d85..a334ce12166 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Creditmemo/ItemsTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Creditmemo/ItemsTest.php @@ -58,7 +58,7 @@ class ItemsTest extends \PHPUnit_Framework_TestCase */ public function testGetTotalsHtml() { - $childBlock = $this->_layout->addBlock('Magento\View\Block\Text', 'creditmemo_totals', 'block'); + $childBlock = $this->_layout->addBlock('Magento\View\Element\Text', 'creditmemo_totals', 'block'); $expectedHtml = '<b>Any html</b>'; $this->assertEmpty($childBlock->getCreditmemo()); @@ -72,7 +72,7 @@ class ItemsTest extends \PHPUnit_Framework_TestCase public function testGetCommentsHtml() { - $childBlock = $this->_layout->addBlock('Magento\View\Block\Text', 'creditmemo_comments', 'block'); + $childBlock = $this->_layout->addBlock('Magento\View\Element\Text', 'creditmemo_comments', 'block'); $expectedHtml = '<b>Any html</b>'; $this->assertEmpty($childBlock->getEntity()); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Invoice/ItemsTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Invoice/ItemsTest.php index 7663aa8d94a..a2e559d91e4 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Invoice/ItemsTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Invoice/ItemsTest.php @@ -58,7 +58,7 @@ class ItemsTest extends \PHPUnit_Framework_TestCase */ public function testGetInvoiceTotalsHtml() { - $childBlock = $this->_layout->addBlock('Magento\View\Block\Text', 'invoice_totals', 'block'); + $childBlock = $this->_layout->addBlock('Magento\View\Element\Text', 'invoice_totals', 'block'); $expectedHtml = '<b>Any html</b>'; $this->assertEmpty($childBlock->getInvoice()); @@ -72,7 +72,7 @@ class ItemsTest extends \PHPUnit_Framework_TestCase public function testGetInvoiceCommentsHtml() { - $childBlock = $this->_layout->addBlock('Magento\View\Block\Text', 'invoice_comments', 'block'); + $childBlock = $this->_layout->addBlock('Magento\View\Element\Text', 'invoice_comments', 'block'); $expectedHtml = '<b>Any html</b>'; $this->assertEmpty($childBlock->getEntity()); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/CreditmemoTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/CreditmemoTest.php index 083be5f59ff..c25433fd487 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/CreditmemoTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/CreditmemoTest.php @@ -46,7 +46,7 @@ class CreditmemoTest extends \PHPUnit_Framework_TestCase $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); $block = $layout->createBlock('Magento\Sales\Block\Order\PrintOrder\Creditmemo', 'block'); - $childBlock = $layout->addBlock('Magento\View\Block\Text', 'creditmemo_totals', 'block'); + $childBlock = $layout->addBlock('Magento\View\Element\Text', 'creditmemo_totals', 'block'); $expectedHtml = '<b>Any html</b>'; $creditmemo = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/InvoiceTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/InvoiceTest.php index 38e05d40f19..1654a109ba7 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/InvoiceTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/PrintOrder/InvoiceTest.php @@ -46,7 +46,7 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); $block = $layout->createBlock('Magento\Sales\Block\Order\PrintOrder\Invoice', 'block'); - $childBlock = $layout->addBlock('Magento\View\Block\Text', 'invoice_totals', 'block'); + $childBlock = $layout->addBlock('Magento\View\Element\Text', 'invoice_totals', 'block'); $expectedHtml = '<b>Any html</b>'; $invoice = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Shipment/ItemsTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Shipment/ItemsTest.php index f39f69c46b1..84c5e7b8c2e 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Shipment/ItemsTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/Shipment/ItemsTest.php @@ -33,7 +33,7 @@ class ItemsTest extends \PHPUnit_Framework_TestCase { $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); $block = $layout->createBlock('Magento\Sales\Block\Order\Shipment\Items', 'block'); - $childBlock = $layout->addBlock('Magento\View\Block\Text', 'shipment_comments', 'block'); + $childBlock = $layout->addBlock('Magento\View\Element\Text', 'shipment_comments', 'block'); $shipment = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\Sales\Model\Order\Shipment'); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/TotalsTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/TotalsTest.php index 14b97f1a47e..393ab645743 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Order/TotalsTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Order/TotalsTest.php @@ -41,18 +41,18 @@ class TotalsTest extends \PHPUnit_Framework_TestCase ->create('Magento\Sales\Model\Order')) ->setTemplate('order/totals.phtml'); - $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\Block\Context'); - $childOne = $this->getMock('Magento\View\Block\Text', array('initTotals'), array($context)); + $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\Element\Context'); + $childOne = $this->getMock('Magento\View\Element\Text', array('initTotals'), array($context)); $childOne->expects($this->once()) ->method('initTotals'); $layout->addBlock($childOne, 'child1', 'block'); - $childTwo = $this->getMock('Magento\View\Block\Text', array('initTotals'), array($context)); + $childTwo = $this->getMock('Magento\View\Element\Text', array('initTotals'), array($context)); $childTwo->expects($this->once()) ->method('initTotals'); $layout->addBlock($childTwo, 'child2', 'block'); - $childThree = $this->getMock('Magento\View\Block\Text', array('initTotals'), array($context)); + $childThree = $this->getMock('Magento\View\Element\Text', array('initTotals'), array($context)); $childThree->expects($this->once()) ->method('initTotals'); $layout->addBlock($childThree, 'child3', 'block'); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Block/Recurring/Profile/ViewTest.php b/dev/tests/integration/testsuite/Magento/Sales/Block/Recurring/Profile/ViewTest.php index fd0e8bf159c..6e605af257e 100644 --- a/dev/tests/integration/testsuite/Magento/Sales/Block/Recurring/Profile/ViewTest.php +++ b/dev/tests/integration/testsuite/Magento/Sales/Block/Recurring/Profile/ViewTest.php @@ -72,9 +72,9 @@ class ViewTest extends \PHPUnit_Framework_TestCase \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State') ->setAreaCode('frontend'); $this->_block->setShouldPrepareInfoTabs(true); - $childOne = $this->_layout->addBlock('Magento\View\Block\Text', 'child1', 'block'); + $childOne = $this->_layout->addBlock('Magento\View\Element\Text', 'child1', 'block'); $this->_layout->addToParentGroup('child1', 'info_tabs'); - $childTwo = $this->_layout->addBlock('Magento\View\Block\Text', 'child2', 'block'); + $childTwo = $this->_layout->addBlock('Magento\View\Element\Text', 'child2', 'block'); $this->_layout->addToParentGroup('child2', 'info_tabs'); $this->assertEmpty($childOne->getViewUrl()); diff --git a/dev/tests/integration/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotalsTest.php b/dev/tests/integration/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotalsTest.php new file mode 100644 index 00000000000..5dbb88ff36f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotalsTest.php @@ -0,0 +1,109 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Model\Observer\Frontend\Quote\Address; + +class CollectTotalsTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Sales\Model\Observer\Frontend\Quote\Address\CollectTotals + */ + protected $model; + + protected function setUp() + { + $this->model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('\Magento\Sales\Model\Observer\Frontend\Quote\Address\CollectTotals'); + } + + /** + * @magentoConfigFixture current_store customer/create_account/auto_group_assign 1 + * @magentoConfigFixture current_store customer/create_account/default_group 1 + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Sales/_files/quote.php + * + * @covers \Magento\Sales\Model\Observer\Frontend\Quote\Address\CollectTotals::dispatch + */ + public function testChangeQuoteCustomerGroupIdForCustomerWithDisabledAutomaticGroupChange() + { + /** @var \Magento\ObjectManager $objectManager */ + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + /** @var $customer \Magento\Customer\Model\Customer */ + $customer = $objectManager->create('Magento\Customer\Model\Customer'); + $customer->load(1); + $customer->setDisableAutoGroupChange(1); + $customer->setGroupId(2); + $customer->save(); + + /** @var $quote \Magento\Sales\Model\Quote */ + $quote = $objectManager->create('Magento\Sales\Model\Quote'); + $quote->load('test01', 'reserved_order_id'); + $quote->setCustomer($customer); + + $quoteAddress = $quote->getBillingAddress(); + + $eventObserver = $objectManager->create('Magento\Event\Observer', + array('data' => array('quote_address' => $quoteAddress)) + ); + $this->model->dispatch($eventObserver); + + $this->assertEquals(2, $quote->getCustomer()->getGroupId()); + } + + /** + * @magentoConfigFixture current_store customer/create_account/auto_group_assign 1 + * @magentoConfigFixture current_store customer/create_account/default_group 1 + * @magentoDataFixture Magento/Customer/_files/customer.php + * @magentoDataFixture Magento/Sales/_files/quote.php + * + * @covers \Magento\Sales\Model\Observer\Frontend\Quote\Address\CollectTotals::dispatch + */ + public function testChangeQuoteCustomerGroupIdForCustomerWithEnabledAutomaticGroupChange() + { + /** @var \Magento\ObjectManager $objectManager */ + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + + /** @var $customer \Magento\Customer\Model\Customer */ + $customer = $objectManager->create('Magento\Customer\Model\Customer'); + $customer->load(1); + $customer->setDisableAutoGroupChange(0); + $customer->setGroupId(2); + $customer->save(); + + /** @var $quote \Magento\Sales\Model\Quote */ + $quote = $objectManager->create('Magento\Sales\Model\Quote'); + $quote->load('test01', 'reserved_order_id'); + $quote->setCustomer($customer); + + $quoteAddress = $quote->getBillingAddress(); + + $eventObserver = $objectManager->create('Magento\Event\Observer', + array('data' => array('quote_address' => $quoteAddress)) + ); + $this->model->dispatch($eventObserver); + + $this->assertEquals(1, $quote->getCustomer()->getGroupId()); + } +} \ No newline at end of file diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Payment/MethodsTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Payment/MethodsTest.php index 437a66a7e32..846e0afbfa9 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Payment/MethodsTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Payment/MethodsTest.php @@ -57,7 +57,7 @@ class MethodsTest extends \PHPUnit_Framework_TestCase $this->assertNotEmpty($model->getTitle()); foreach (array($model->getFormBlockType(), $model->getInfoBlockType()) as $blockClass) { $message = "Block class: {$blockClass}"; - /** @var $block \Magento\View\Block\Template */ + /** @var $block \Magento\View\Element\Template */ $block = $blockFactory->createBlock($blockClass); $block->setArea('frontend'); $this->assertFileExists($block->getTemplateFile(), $message); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/TemplateFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/TemplateFilesTest.php index f702e88e2b8..86ab47e540f 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Magento/Widget/TemplateFilesTest.php @@ -46,9 +46,9 @@ class TemplateFilesTest extends \PHPUnit_Framework_TestCase /** @var $blockFactory \Magento\View\Element\BlockFactory */ $blockFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\View\Element\BlockFactory'); - /** @var \Magento\View\Block\Template $block */ + /** @var \Magento\View\Element\Template $block */ $block = $blockFactory->createBlock($class); - $this->assertInstanceOf('Magento\View\Block\Template', $block); + $this->assertInstanceOf('Magento\View\Element\Template', $block); $block->setTemplate((string)$template); $this->assertFileExists($block->getTemplateFile()); } @@ -70,7 +70,7 @@ class TemplateFilesTest extends \PHPUnit_Framework_TestCase ->create('Magento\Widget\Model\Widget\Instance'); $config = $instance->setType($row['type'])->getWidgetConfigAsArray(); $class = $row['type']; - if (is_subclass_of($class, 'Magento\View\Block\Template')) { + if (is_subclass_of($class, 'Magento\View\Element\Template')) { if (isset($config['parameters']) && isset($config['parameters']['template']) && isset($config['parameters']['template']['values'])) { $templates = $config['parameters']['template']['values']; diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/BlockInstantiationTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/BlockInstantiationTest.php index 519e494ed5a..d1c346a6a16 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/BlockInstantiationTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/BlockInstantiationTest.php @@ -83,7 +83,7 @@ class BlockInstantiationTest extends \Magento\TestFramework\TestCase\AbstractInt continue; } $class = new \ReflectionClass($blockClass); - if ($class->isAbstract() || !$class->isSubclassOf('Magento\View\Block\Template')) { + if ($class->isAbstract() || !$class->isSubclassOf('Magento\View\Element\Template')) { continue; } $templateBlocks = $this->_addBlock($module, $blockClass, $class, $templateBlocks); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php index 7a30001afca..80c4037e82b 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/TemplateFilesTest.php @@ -79,7 +79,7 @@ class TemplateFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrit continue; } $class = new \ReflectionClass($blockClass); - if ($class->isAbstract() || !$class->isSubclassOf('Magento\View\Block\Template')) { + if ($class->isAbstract() || !$class->isSubclassOf('Magento\View\Element\Template')) { continue; } diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/PageConfigFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php similarity index 89% rename from dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/PageConfigFilesTest.php rename to dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php index e9c6be0c2fd..f444b511f94 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/PageConfigFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/ThemeConfigFilesTest.php @@ -25,7 +25,7 @@ */ namespace Magento\Test\Integrity\Modular; -class PageConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfigFiles +class ThemeConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfigFiles { /** * Returns the reader class name that will be instantiated via ObjectManager @@ -34,7 +34,7 @@ class PageConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfig */ protected function _getReaderClassName() { - return 'Magento\Page\Model\Config\Reader'; + return 'Magento\Theme\Model\Layout\Config\Reader'; } /** @@ -56,6 +56,6 @@ class PageConfigFilesTest extends \Magento\TestFramework\TestCase\AbstractConfig */ protected function _getXsdPath() { - return '/Magento/Page/etc/page_layouts_file.xsd'; + return '/Magento/Theme/etc/page_layouts_file.xsd'; } } diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/view_files_ce.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/view_files_ce.php index 0f4ca514054..6547c18b0bd 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/view_files_ce.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Modular/_files/view_files_ce.php @@ -39,12 +39,12 @@ return array( array('adminhtml', 'Magento_Cms::images/placeholder_thumbnail.jpg'), array('adminhtml', 'Magento_Cms::images/wysiwyg_skin_image.png'), array('adminhtml', 'Magento_Core::fam_book_open.png'), - array('adminhtml', 'Magento_Page::favicon.ico'), + array('adminhtml', 'Magento_Theme::favicon.ico'), array('frontend', 'Magento_Cms::images/about_us_img.jpg'), array('frontend', 'Magento_Core::calendar.gif'), array('frontend', 'Magento_Core::fam_book_open.png'), - array('frontend', 'Magento_Page::favicon.ico'), + array('frontend', 'Magento_Theme::favicon.ico'), array('frontend', 'Magento_Catalog::images/product/placeholder/image.jpg'), array('frontend', 'Magento_Catalog::images/product/placeholder/small_image.jpg'), - array('install', 'Magento_Page::favicon.ico') + array('install', 'Magento_Theme::favicon.ico') ); diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/TemplateFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/TemplateFilesTest.php index 3fb570f22d0..0081c4125ff 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/TemplateFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/TemplateFilesTest.php @@ -41,7 +41,7 @@ class TemplateFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrit if ($area === 'frontend' && in_array($module . '::' . $file, array( 'Magento_Reports::Magento_Catalog::product/list/items.phtml', 'Magento_Review::redirect.phtml', - 'Magento_Page::blank.phtml', + 'Magento_Theme::blank.phtml', ))) { continue; // $this->markTestIncomplete('MAGETWO-9806'); } diff --git a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php index d8cbb573f38..ea787fbb74d 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php +++ b/dev/tests/integration/testsuite/Magento/Test/Integrity/Theme/ViewFilesTest.php @@ -171,7 +171,7 @@ class ViewFilesTest extends \Magento\TestFramework\TestCase\AbstractIntegrity ->create('Magento\View\Layout\ProcessorInterface', array('theme' => $theme)); $fileLayoutUpdates = $layoutUpdate->getFileLayoutUpdatesXml(); $elements = $fileLayoutUpdates->xpath( - '//block[@class="Magento\Page\Block\Html\Head\Css" or @class="Magento\Page\Block\Html\Head\Script"]' + '//block[@class="Magento\Theme\Block\Html\Head\Css" or @class="Magento\Theme\Block\Html\Head\Script"]' . '/arguments/argument[@name="file"]' ); if ($elements) { diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutInvalid.xml b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutInvalid.xml index 83fadec45fb..d60244b0c69 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutInvalid.xml +++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutInvalid.xml @@ -25,13 +25,13 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <handle id="test"> - <block class="Magento\View\Block\Template" name="block"/> + <block class="Magento\View\Element\Template" name="block"/> <container name="block" label="Container"/> <reference name="block"> - <block class="Magento\View\Block\Template" name="another.block"/> + <block class="Magento\View\Element\Template" name="another.block"/> </reference> <reference name="broken.reference"> - <block class="Magento\View\Block\Template" name="another.block"/> + <block class="Magento\View\Element\Template" name="another.block"/> </reference> </handle> </layout> diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValid.xml b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValid.xml index cfa01aa6376..f939b9658f3 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValid.xml +++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValid.xml @@ -25,10 +25,10 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <handle id="test"> - <block class="Magento\View\Block\Template" name="block"/> + <block class="Magento\View\Element\Template" name="block"/> <container name="container" label="Container"/> <reference name="block"> - <block class="Magento\View\Block\Template" name="another.block"/> + <block class="Magento\View\Element\Template" name="another.block"/> </reference> <reference name="container"> <container name="another.container" label="Container"/> diff --git a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValidExpectUpdated.xml b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValidExpectUpdated.xml index 1978a9750dc..a84917c4bdc 100644 --- a/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValidExpectUpdated.xml +++ b/dev/tests/integration/testsuite/Magento/Test/Tools/Layout/Reference/_files/layoutValidExpectUpdated.xml @@ -25,10 +25,10 @@ --> <layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <handle id="test"> - <block class="Magento\View\Block\Template" name="block"/> + <block class="Magento\View\Element\Template" name="block"/> <container name="container" label="Container"/> <referenceBlock name="block"> - <block class="Magento\View\Block\Template" name="another.block"/> + <block class="Magento\View\Element\Template" name="another.block"/> </referenceBlock> <referenceContainer name="container"> <container name="another.container" label="Container"/> diff --git a/dev/tests/integration/testsuite/Magento/Page/Block/Html/BreadcrumbsTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/BreadcrumbsTest.php similarity index 93% rename from dev/tests/integration/testsuite/Magento/Page/Block/Html/BreadcrumbsTest.php rename to dev/tests/integration/testsuite/Magento/Theme/Block/Html/BreadcrumbsTest.php index b3dfb0adca0..1d002da1e51 100644 --- a/dev/tests/integration/testsuite/Magento/Page/Block/Html/BreadcrumbsTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/BreadcrumbsTest.php @@ -19,18 +19,18 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Page + * @package Magento_Theme * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Html; +namespace Magento\Theme\Block\Html; class BreadcrumbsTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Page\Block\Html\Breadcrumbs + * @var \Magento\Theme\Block\Html\Breadcrumbs */ protected $_block; @@ -38,7 +38,7 @@ class BreadcrumbsTest extends \PHPUnit_Framework_TestCase { \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); $this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\Page\Block\Html\Breadcrumbs'); + ->createBlock('Magento\Theme\Block\Html\Breadcrumbs'); } public function testAddCrumb() diff --git a/dev/tests/integration/testsuite/Magento/Page/Block/Html/FooterTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/FooterTest.php similarity index 93% rename from dev/tests/integration/testsuite/Magento/Page/Block/Html/FooterTest.php rename to dev/tests/integration/testsuite/Magento/Theme/Block/Html/FooterTest.php index 9ddbce10975..7befa95cc49 100644 --- a/dev/tests/integration/testsuite/Magento/Page/Block/Html/FooterTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/FooterTest.php @@ -19,13 +19,13 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Page + * @package Magento_Theme * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Html; +namespace Magento\Theme\Block\Html; class FooterTest extends \PHPUnit_Framework_TestCase { @@ -45,7 +45,7 @@ class FooterTest extends \PHPUnit_Framework_TestCase public function testGetCacheKeyInfo() { $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\Page\Block\Html\Footer'); + ->createBlock('Magento\Theme\Block\Html\Footer'); $storeId = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\Core\Model\StoreManagerInterface')->getStore()->getId(); $this->assertEquals( diff --git a/dev/tests/integration/testsuite/Magento/Page/Block/Html/HeadTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/HeadTest.php similarity index 90% rename from dev/tests/integration/testsuite/Magento/Page/Block/Html/HeadTest.php rename to dev/tests/integration/testsuite/Magento/Theme/Block/Html/HeadTest.php index 0ce75e260b5..21c159974e1 100644 --- a/dev/tests/integration/testsuite/Magento/Page/Block/Html/HeadTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/Html/HeadTest.php @@ -19,18 +19,18 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Page + * @package Magento_Theme * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Html; +namespace Magento\Theme\Block\Html; class HeadTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Page\Block\Html\Head + * @var \Magento\Theme\Block\Html\Head */ private $_block; @@ -41,7 +41,7 @@ class HeadTest extends \PHPUnit_Framework_TestCase \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\DesignInterface') ->setDesignTheme('magento_blank'); $this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\Page\Block\Html\Head'); + ->createBlock('Magento\Theme\Block\Html\Head'); } /** @@ -53,7 +53,7 @@ class HeadTest extends \PHPUnit_Framework_TestCase { $this->_block->addChild( 'zero.js', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'zero.js', 'properties' => array( @@ -63,28 +63,28 @@ class HeadTest extends \PHPUnit_Framework_TestCase ); $this->_block->addChild( 'varien/js.js', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'varien/js.js', ) ); $this->_block->addChild( 'Magento_Bundle::bundle.js', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'Magento_Bundle::bundle.js', ) ); $this->_block->addChild( 'ui.css', - 'Magento\Page\Block\Html\Head\Css', + 'Magento\Theme\Block\Html\Head\Css', array( 'file' => 'tiny_mce/themes/advanced/skins/default/ui.css', ) ); $this->_block->addChild( 'styles.css', - 'Magento\Page\Block\Html\Head\Css', + 'Magento\Theme\Block\Html\Head\Css', array( 'file' => 'css/styles.css', 'properties' => array( @@ -96,7 +96,7 @@ class HeadTest extends \PHPUnit_Framework_TestCase $this->_block->addChild( 'magento-page-head-canonical-link', - 'Magento\Page\Block\Html\Head\Link', + 'Magento\Theme\Block\Html\Head\Link', array( 'url' => 'http://localhost/index.php/category.html', 'properties' => array('attributes' => array('rel' => 'next')) @@ -105,7 +105,7 @@ class HeadTest extends \PHPUnit_Framework_TestCase $this->_block->addChild( 'varien/form.js', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'varien/form.js', 'properties' => array( @@ -141,14 +141,14 @@ class HeadTest extends \PHPUnit_Framework_TestCase $this->_block->addChild( 'ui.css', - 'Magento\Page\Block\Html\Head\Css', + 'Magento\Theme\Block\Html\Head\Css', array( 'file' => 'not_exist_folder/wrong_bad_file2.xyz', ) ); $this->_block->addChild( 'jjs', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'not_exist_folder/wrong_bad_file.xyz', ) @@ -172,21 +172,21 @@ class HeadTest extends \PHPUnit_Framework_TestCase { $this->_block->addChild( 'varien/js.js', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'varien/js.js', ) ); $this->_block->addChild( 'jjs', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'not_exist_folder/wrong_bad_file.xyz', ) ); $this->_block->addChild( 'wrong_bad_file2.xyz', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'not_exist_folder/wrong_bad_file2.xyz', 'properties' => array( @@ -196,7 +196,7 @@ class HeadTest extends \PHPUnit_Framework_TestCase ); $this->_block->addChild( 'sdsdsd.css', - 'Magento\Page\Block\Html\Head\Css', + 'Magento\Theme\Block\Html\Head\Css', array( 'file' => 'not_exist_folder/wrong_bad_file2.xyz', ) @@ -204,7 +204,7 @@ class HeadTest extends \PHPUnit_Framework_TestCase $this->_block->addChild( 'css/styles.css', - 'Magento\Page\Block\Html\Head\Css', + 'Magento\Theme\Block\Html\Head\Css', array( 'file' => 'css/styles.css', 'properties' => array( @@ -235,7 +235,7 @@ class HeadTest extends \PHPUnit_Framework_TestCase { $this->_block->addChild( 'jjs', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'varien/js.js', ) @@ -254,7 +254,7 @@ class HeadTest extends \PHPUnit_Framework_TestCase { $this->_block->addChild( 'jjs', - 'Magento\Page\Block\Html\Head\Script', + 'Magento\Theme\Block\Html\Head\Script', array( 'file' => 'varien/js.js', ) @@ -273,7 +273,7 @@ class HeadTest extends \PHPUnit_Framework_TestCase { $this->_block->addChild( 'magento-page-head-test-link', - 'Magento\Page\Block\Html\Head\Link', + 'Magento\Theme\Block\Html\Head\Link', array( 'url' => 'http://localhost/index.php/category.html', 'properties' => array('attributes' => array( diff --git a/dev/tests/integration/testsuite/Magento/Page/Block/HtmlTest.php b/dev/tests/integration/testsuite/Magento/Theme/Block/HtmlTest.php similarity index 93% rename from dev/tests/integration/testsuite/Magento/Page/Block/HtmlTest.php rename to dev/tests/integration/testsuite/Magento/Theme/Block/HtmlTest.php index 3d0297c92a7..59eec98220d 100644 --- a/dev/tests/integration/testsuite/Magento/Page/Block/HtmlTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Block/HtmlTest.php @@ -19,13 +19,13 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Page + * @package Magento_Theme * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block; +namespace Magento\Theme\Block; class HtmlTest extends \PHPUnit_Framework_TestCase { @@ -55,6 +55,7 @@ class HtmlTest extends \PHPUnit_Framework_TestCase $this->getMock('Magento\Core\Model\App', array(), array(), '', false), $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false), $this->getMock('Magento\Core\Model\Session', array(), array(), '', false), + $this->getMock('Magento\Session\SidResolverInterface', array(), array(), '', false), null, array() ) @@ -64,7 +65,7 @@ class HtmlTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue('http://localhost/pub/media/')); $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\View\Block\Template\Context', array( + ->create('Magento\View\Element\Template\Context', array( 'storeConfig' => $storeConfig, 'urlBuilder' => $urlBuilder, )); @@ -72,7 +73,7 @@ class HtmlTest extends \PHPUnit_Framework_TestCase ->get('Magento\Core\Model\StoreManagerInterface'); $locale = $this->getMock('Magento\Core\Model\LocaleInterface', array(), array(), '', false); $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Page\Block\Html', array( + ->create('Magento\Theme\Block\Html', array( 'storeManager' => $storeManager, 'locale' => $locale, 'urlHelperMock' => $codeData, diff --git a/dev/tests/integration/testsuite/Magento/Page/Model/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/Config/ReaderTest.php similarity index 94% rename from dev/tests/integration/testsuite/Magento/Page/Model/Config/ReaderTest.php rename to dev/tests/integration/testsuite/Magento/Theme/Model/Layout/Config/ReaderTest.php index 4219eaf5ed3..4fd615055e9 100644 --- a/dev/tests/integration/testsuite/Magento/Page/Model/Config/ReaderTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/Config/ReaderTest.php @@ -1,6 +1,6 @@ <?php /** - * \Magento\Page\Model\Config\Reader + * \Magento\Theme\Model\Layout\Config\Reader * * Magento * @@ -23,12 +23,12 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Model\Config; +namespace Magento\Theme\Model\Layout\Config; class ReaderTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Page\Model\Config\Reader + * @var \Magento\Theme\Model\Layout\Config\Reader */ protected $_model; @@ -44,7 +44,7 @@ class ReaderTest extends \PHPUnit_Framework_TestCase $this->_fileResolverMock = $this->getMockBuilder('Magento\Config\FileResolverInterface') ->disableOriginalConstructor() ->getMock(); - $this->_model = $objectManager->create('Magento\Page\Model\Config\Reader', + $this->_model = $objectManager->create('Magento\Theme\Model\Layout\Config\Reader', array('fileResolver'=>$this->_fileResolverMock)); } diff --git a/dev/tests/integration/testsuite/Magento/Page/Model/ConfigTest.php b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/ConfigTest.php similarity index 87% rename from dev/tests/integration/testsuite/Magento/Page/Model/ConfigTest.php rename to dev/tests/integration/testsuite/Magento/Theme/Model/Layout/ConfigTest.php index 20e828eff0f..7f13dc37cdc 100644 --- a/dev/tests/integration/testsuite/Magento/Page/Model/ConfigTest.php +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/ConfigTest.php @@ -1,6 +1,6 @@ <?php /** - * \Magento\Page\Model\Config + * \Magento\Theme\Model\Layout\Config * * Magento * @@ -23,12 +23,12 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Model; +namespace Magento\Theme\Model\Layout; class ConfigTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Page\Model\Config + * @var \Magento\Theme\Model\Layout\Config */ protected $_model; @@ -45,10 +45,10 @@ class ConfigTest extends \PHPUnit_Framework_TestCase $fileResolverMock->expects($this->any()) ->method('get') ->will($this->returnValue(array($configFile))); - $reader = $objectManager->create('Magento\Page\Model\Config\Reader', + $reader = $objectManager->create('Magento\Theme\Model\Layout\Config\Reader', array('fileResolver'=>$fileResolverMock)); - $data = $objectManager->create('Magento\Page\Model\Config\Data', array('reader'=> $reader)); - $this->_model = $objectManager->create('Magento\Page\Model\Config', array('dataStorage'=>$data)); + $data = $objectManager->create('Magento\Theme\Model\Layout\Config\Data', array('reader'=> $reader)); + $this->_model = $objectManager->create('Magento\Theme\Model\Layout\Config', array('dataStorage'=>$data)); } public function testGetPageLayouts() diff --git a/dev/tests/integration/testsuite/Magento/Page/Model/_files/page_layouts.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts.xml similarity index 96% rename from dev/tests/integration/testsuite/Magento/Page/Model/_files/page_layouts.xml rename to dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts.xml index 1c0d5516f0d..c004d0f491e 100644 --- a/dev/tests/integration/testsuite/Magento/Page/Model/_files/page_layouts.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts.xml @@ -24,7 +24,7 @@ */ --> <page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Page/etc/page_layouts.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Theme/etc/page_layouts.xsd"> <layouts default="one_column"> <layout id="empty"> <label translate="true">Empty</label> diff --git a/dev/tests/integration/testsuite/Magento/Page/Model/_files/page_layouts2.xml b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts2.xml similarity index 96% rename from dev/tests/integration/testsuite/Magento/Page/Model/_files/page_layouts2.xml rename to dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts2.xml index ee701c208ab..67969705c33 100644 --- a/dev/tests/integration/testsuite/Magento/Page/Model/_files/page_layouts2.xml +++ b/dev/tests/integration/testsuite/Magento/Theme/Model/Layout/_files/page_layouts2.xml @@ -24,7 +24,7 @@ */ --> <page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Page/etc/page_layouts.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../app/code/Magento/Theme/etc/page_layouts.xsd"> <layouts default="one_column"> <layout id="one_column"> <label translate="true">1 column modified</label> diff --git a/dev/tests/integration/testsuite/Magento/User/Model/Resource/Role/CollectionTest.php b/dev/tests/integration/testsuite/Magento/User/Model/Resource/Role/CollectionTest.php index 33daf9e948a..47fb013ecba 100644 --- a/dev/tests/integration/testsuite/Magento/User/Model/Resource/Role/CollectionTest.php +++ b/dev/tests/integration/testsuite/Magento/User/Model/Resource/Role/CollectionTest.php @@ -48,12 +48,12 @@ class CollectionTest extends \PHPUnit_Framework_TestCase $user = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\User\Model\User'); $user->loadByUsername(\Magento\TestFramework\Bootstrap::ADMIN_NAME); - $this->_collection->setUserFilter($user->getId()); + $this->_collection->setUserFilter($user->getId(), \Magento\Authz\Model\UserIdentifier::USER_TYPE_ADMIN); $selectQueryStr = $this->_collection->getSelect()->__toString(); $this->assertContains('user_id', $selectQueryStr); - $this->assertContains('role_type', $selectQueryStr); + $this->assertContains('user_type', $selectQueryStr); } public function testSetRolesFilter() diff --git a/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php b/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php index 31d3da30607..2f9ba9e44ac 100644 --- a/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php +++ b/dev/tests/integration/testsuite/Magento/User/Model/UserTest.php @@ -195,12 +195,12 @@ class UserTest extends \PHPUnit_Framework_TestCase $this->assertEquals('firstname///lastname', $this->_model->getName('///')); } - public function testGetAclRole() + public function testGetUninitializedAclRole() { $newuser = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->create('Magento\User\Model\User'); $newuser->setUserId(10); - $this->assertNotEquals($this->_model->getAclRole(), $newuser->getAclRole()); + $this->assertNull($newuser->getAclRole(), "User role was not initialized and is expected to be empty."); } /** diff --git a/dev/tests/integration/testsuite/Magento/Core/Model/Page/Asset/MergedTest.php b/dev/tests/integration/testsuite/Magento/View/Asset/MergedTest.php similarity index 93% rename from dev/tests/integration/testsuite/Magento/Core/Model/Page/Asset/MergedTest.php rename to dev/tests/integration/testsuite/Magento/View/Asset/MergedTest.php index 5f53d1b2ea7..2231c1fd456 100644 --- a/dev/tests/integration/testsuite/Magento/Core/Model/Page/Asset/MergedTest.php +++ b/dev/tests/integration/testsuite/Magento/View/Asset/MergedTest.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset; +namespace Magento\View\Asset; /** * @magentoDataFixture Magento/Core/Model/_files/design/themes.php @@ -53,14 +53,14 @@ class MergedTest extends \PHPUnit_Framework_TestCase /** @var \Magento\App\Dir $dirs */ $dirs = $objectManager->get('Magento\App\Dir'); self::$_viewPublicMergedDir = $dirs->getDir(\Magento\App\Dir::PUB_VIEW_CACHE) - . DIRECTORY_SEPARATOR . \Magento\Core\Model\Page\Asset\Merged::PUBLIC_MERGE_DIR; + . DIRECTORY_SEPARATOR . \Magento\View\Asset\Merged::PUBLIC_MERGE_DIR; } protected function setUp() { \Magento\TestFramework\Helper\Bootstrap::getInstance()->reinitialize(array( \Magento\App\Dir::PARAM_APP_DIRS => array( - \Magento\App\Dir::THEMES => realpath(__DIR__ . '/../../_files/design') + \Magento\App\Dir::THEMES => realpath(__DIR__ . '/../_files/design') ) )); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); @@ -80,18 +80,18 @@ class MergedTest extends \PHPUnit_Framework_TestCase * * @param array $files * @param string $contentType - * @return \Magento\Core\Model\Page\Asset\Merged + * @return \Magento\View\Asset\Merged */ protected function _buildModel(array $files, $contentType) { $assets = array(); foreach ($files as $file) { $assets[] = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Page\Asset\ViewFile', + ->create('Magento\View\Asset\ViewFile', array('file' => $file, 'contentType' => $contentType)); } $model = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Core\Model\Page\Asset\Merged', array('assets' => $assets)); + ->create('Magento\View\Asset\Merged', array('assets' => $assets)); return $model; } @@ -178,7 +178,7 @@ class MergedTest extends \PHPUnit_Framework_TestCase 'h1.gif', 'images/h2.gif', 'Namespace_Module/absolute_valid_module.gif', - 'Magento_Page/favicon.ico', // non-fixture file from real module + 'Magento_Theme/favicon.ico', // non-fixture file from real module ), ), array( diff --git a/dev/tests/integration/testsuite/Magento/View/Block/AbstractBlockTest.php b/dev/tests/integration/testsuite/Magento/View/Element/AbstractBlockTest.php similarity index 82% rename from dev/tests/integration/testsuite/Magento/View/Block/AbstractBlockTest.php rename to dev/tests/integration/testsuite/Magento/View/Element/AbstractBlockTest.php index 2e4fdaeff2a..55075fc6733 100644 --- a/dev/tests/integration/testsuite/Magento/View/Block/AbstractBlockTest.php +++ b/dev/tests/integration/testsuite/Magento/View/Element/AbstractBlockTest.php @@ -25,7 +25,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block; +namespace Magento\View\Element; /** * @magentoAppIsolation enabled @@ -33,7 +33,7 @@ namespace Magento\View\Block; class AbstractBlockTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\View\Block\AbstractBlock + * @var \Magento\View\Element\AbstractBlock */ protected $_block; @@ -49,8 +49,8 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\App\State')->setAreaCode('frontend'); \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\DesignInterface') ->setDefaultDesignTheme(); - $this->_block = $this->getMockForAbstractClass('Magento\View\Block\AbstractBlock', array( - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\Block\Context'), + $this->_block = $this->getMockForAbstractClass('Magento\View\Element\AbstractBlock', array( + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\Element\Context'), array('module_name' => 'Magento_Core') )); } @@ -92,7 +92,7 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase $this->assertFalse($this->_block->getParentBlock()); // Need to create blocks through layout - $parentBlock = $this->_createBlockWithLayout('block1', 'block1', 'Magento\View\Block\Text'); + $parentBlock = $this->_createBlockWithLayout('block1', 'block1', 'Magento\View\Element\Text'); $childBlock = $this->_createBlockWithLayout('block2', 'block2'); $this->assertEmpty($childBlock->getParentBlock()); @@ -101,13 +101,17 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\View\Block\AbstractBlock::addChild + * @covers \Magento\View\Element\AbstractBlock::addChild */ public function testAddChild() { - $parentBlock = $this->_createBlockWithLayout('testAddChild', 'testAddChild', 'Magento\View\Block\Text'); - $child = $parentBlock->addChild('testAddChildAlias', 'Magento\View\Block\Text', array('content' => 'content')); - $this->assertInstanceOf('Magento\View\Block\Text', $child); + $parentBlock = $this->_createBlockWithLayout('testAddChild', 'testAddChild', 'Magento\View\Element\Text'); + $child = $parentBlock->addChild( + 'testAddChildAlias', + 'Magento\View\Element\Text', + array('content' => 'content') + ); + $this->assertInstanceOf('Magento\View\Element\Text', $child); $this->assertEquals('testAddChild.testAddChildAlias', $child->getNameInLayout()); $this->assertEquals($child, $parentBlock->getChildBlock('testAddChildAlias')); $this->assertEquals('content', $child->getContent()); @@ -123,11 +127,11 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase // Setting second time, along with the layout $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); - $layout->createBlock('Magento\View\Block\Template', $name); + $layout->createBlock('Magento\View\Element\Template', $name); $block = $layout->getBlock($name); - $this->assertInstanceOf('Magento\View\Block\AbstractBlock', $block); + $this->assertInstanceOf('Magento\View\Element\AbstractBlock', $block); $block->setNameInLayout($name); - $this->assertInstanceOf('Magento\View\Block\AbstractBlock', $layout->getBlock($name)); + $this->assertInstanceOf('Magento\View\Element\AbstractBlock', $layout->getBlock($name)); $this->assertEquals($name, $block->getNameInLayout()); $this->assertTrue($layout->hasElement($name)); $newName = 'new_name'; @@ -138,8 +142,8 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase /** * @magentoAppIsolation enabled - * @covers \Magento\View\Block\AbstractBlock::getChildNames - * @covers \Magento\View\Block\AbstractBlock::insert + * @covers \Magento\View\Element\AbstractBlock::getChildNames + * @covers \Magento\View\Element\AbstractBlock::insert */ public function testGetChildNames() { @@ -220,8 +224,8 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase /** * @magentoAppIsolation enabled - * @covers \Magento\View\Block\AbstractBlock::unsetChildren - * @covers \Magento\View\Block\AbstractBlock::getChildBlock + * @covers \Magento\View\Element\AbstractBlock::unsetChildren + * @covers \Magento\View\Element\AbstractBlock::getChildBlock */ public function testUnsetChildren() { @@ -252,21 +256,21 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase // With layout /** @var $layout \Magento\Core\Model\Layout */ $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); - $child = $layout->createBlock('Magento\View\Block\Text', $childName); + $child = $layout->createBlock('Magento\View\Element\Text', $childName); $layout->addBlock($this->_block, $parentName); $this->_block->setChild($childAlias, $child); $result = $this->_block->getChildBlock($childAlias); - $this->assertInstanceOf('Magento\View\Block\Text', $result); + $this->assertInstanceOf('Magento\View\Element\Text', $result); $this->assertEquals($childName, $result->getNameInLayout()); $this->assertEquals($child, $result); } /** * @magentoAppIsolation enabled - * @covers \Magento\View\Block\AbstractBlock::getChildHtml - * @covers \Magento\View\Block\AbstractBlock::getChildChildHtml + * @covers \Magento\View\Element\AbstractBlock::getChildHtml + * @covers \Magento\View\Element\AbstractBlock::getChildChildHtml */ public function testGetChildHtml() { @@ -276,8 +280,8 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase // With layout $parent = $this->_createBlockWithLayout('parent', 'parent'); - $blockOne = $this->_createBlockWithLayout('block1', 'block1', 'Magento\View\Block\Text'); - $blockTwo = $this->_createBlockWithLayout('block2', 'block2', 'Magento\View\Block\Text'); + $blockOne = $this->_createBlockWithLayout('block1', 'block1', 'Magento\View\Element\Text'); + $blockTwo = $this->_createBlockWithLayout('block2', 'block2', 'Magento\View\Element\Text'); $blockOne->setText('one'); $blockTwo->setText('two'); $parent->insert($blockTwo, '-', false, 'block2'); // make block2 1st @@ -308,10 +312,10 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase $parent1 = $this->_createBlockWithLayout('parent1', 'parent1'); $parent2 = $this->_createBlockWithLayout('parent2', 'parent2'); - $block1 = $this->_createBlockWithLayout('block1', 'block1', 'Magento\View\Block\Text'); - $block2 = $this->_createBlockWithLayout('block2', 'block2', 'Magento\View\Block\Text'); - $block3 = $this->_createBlockWithLayout('block3', 'block3', 'Magento\View\Block\Text'); - $block4 = $this->_createBlockWithLayout('block4', 'block4', 'Magento\View\Block\Text'); + $block1 = $this->_createBlockWithLayout('block1', 'block1', 'Magento\View\Element\Text'); + $block2 = $this->_createBlockWithLayout('block2', 'block2', 'Magento\View\Element\Text'); + $block3 = $this->_createBlockWithLayout('block3', 'block3', 'Magento\View\Element\Text'); + $block4 = $this->_createBlockWithLayout('block4', 'block4', 'Magento\View\Element\Text'); $block1->setText('one'); $block2->setText('two'); @@ -332,7 +336,7 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase /** @var $blockFactory \Magento\View\Element\BlockFactory */ $blockFactory = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\View\Element\BlockFactory'); - $block1 = $blockFactory->createBlock('Magento\View\Block\Text'); + $block1 = $blockFactory->createBlock('Magento\View\Element\Text'); $block1->setText('Block text'); $block1->setNameInLayout('block'); $html = $this->_block->getBlockHtml('block'); @@ -341,7 +345,7 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase // With layout $expected = 'Block2'; - $block2 = $this->_createBlockWithLayout('block2', 'block2', 'Magento\View\Block\Text'); + $block2 = $this->_createBlockWithLayout('block2', 'block2', 'Magento\View\Element\Text'); $block3 = $this->_createBlockWithLayout('block3', 'block3'); $block2->setText($expected); $html = $block3->getBlockHtml('block2'); @@ -437,7 +441,7 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase /** * @magentoAppIsolation enabled - * @covers \Magento\View\Block\AbstractBlock::getGroupChildNames + * @covers \Magento\View\Element\AbstractBlock::getGroupChildNames * @covers \Magento\Core\Model\Layout::addToParentGroup */ public function testAddToParentGroup() @@ -474,22 +478,6 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase $this->assertNull($parent->getChildData('unknown_block')); } - public function testSetFrameTags() - { - $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text'); - $block->setText('text'); - - $block->setFrameTags('p'); - $this->assertEquals('<p>text</p>', $block->toHtml()); - - $block->setFrameTags('p class="note"', '/p'); - $this->assertEquals('<p class="note">text</p>', $block->toHtml()); - - $block->setFrameTags('non-wellformed tag', 'closing tag'); - $this->assertEquals('<non-wellformed tag>text<closing tag>', $block->toHtml()); - } - public function testGetUrl() { $base = 'http://localhost/index.php/'; @@ -498,27 +486,6 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase $this->assertEquals($withRoute, $this->_block->getUrl('catalog/product/view', array('id' => 10))); } - /** - * @covers \Magento\View\Block\AbstractBlock::getUrlBase64 - * @covers \Magento\View\Block\AbstractBlock::getUrlEncoded - */ - public function testGetUrlBase64() - { - foreach (array('getUrlBase64', 'getUrlEncoded') as $method) { - $base = 'http://localhost/index.php/'; - $withRoute = "{$base}catalog/product/view/id/10/"; - - $encoded = $this->_block->$method(); - $this->assertEquals(\Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Helper\Data') - ->urlDecode($encoded), $base); - $encoded = $this->_block->$method('catalog/product/view', array('id' => 10)); - $this->assertEquals(\Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->get('Magento\Core\Helper\Data') - ->urlDecode($encoded), $withRoute); - } - } - /** * Isolation level has been raised in order to flush themes configuration in-memory cache * @@ -539,21 +506,6 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase ); } - public function testGetSetMessagesBlock() - { - // Get one from layout - $this->_block->setLayout( - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ); - $this->assertInstanceOf('Magento\View\Block\Messages', $this->_block->getMessagesBlock()); - - // Set explicitly - $messages = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Messages'); - $this->_block->setMessagesBlock($messages); - $this->assertSame($messages, $this->_block->getMessagesBlock()); - } - public function testHelper() { // Without layout @@ -641,7 +593,7 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase { $name = uniqid('block.'); $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text'); + ->createBlock('Magento\View\Element\Text'); $block->setNameInLayout($name); $this->assertEquals(array($name), $block->getCacheKeyInfo()); } @@ -650,7 +602,7 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase { $name = uniqid('block.'); $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text'); + ->createBlock('Magento\View\Element\Text'); $block->setNameInLayout($name); $key = $block->getCacheKey(); $this->assertNotEmpty($key); @@ -661,24 +613,6 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase $this->assertEquals('key', $block->getCacheKey()); } - public function testGetCacheTags() - { - $this->assertContains(\Magento\View\Block\AbstractBlock::CACHE_GROUP, $this->_block->getCacheTags()); - - $this->_block->setCacheTags(array('one', 'two')); - $tags = $this->_block->getCacheTags(); - $this->assertContains(\Magento\View\Block\AbstractBlock::CACHE_GROUP, $tags); - $this->assertContains('one', $tags); - $this->assertContains('two', $tags); - } - - public function testGetCacheLifetime() - { - $this->assertNull($this->_block->getCacheLifetime()); - $this->_block->setCacheLifetime(1800); - $this->assertEquals(1800, $this->_block->getCacheLifetime()); - } - /** * Create <N> sample blocks * @@ -687,7 +621,7 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase * @param string $className * @return array */ - protected function _createSampleBlocks($qty, $withLayout = true, $className = 'Magento\View\Block\Template') + protected function _createSampleBlocks($qty, $withLayout = true, $className = 'Magento\View\Element\Template') { $blocks = array(); $names = array(); $layout = false; @@ -715,16 +649,16 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase * @param string $name * @param null|string $alias * @param null|string $type - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _createBlockWithLayout($name = 'block', $alias = null, - $type = 'Magento\View\Block\AbstractBlock' + $type = 'Magento\View\Element\AbstractBlock' ) { $typePart = explode('\\', $type); $mockClass = array_pop($typePart) . 'Mock'; if (!isset(self::$_mocks[$mockClass])) { self::$_mocks[$mockClass] = $this->getMockForAbstractClass($type, array( - \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\Block\Context'), + \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\Element\Context'), array('module_name' => 'Magento_Core') ), $mockClass diff --git a/dev/tests/integration/testsuite/Magento/View/Block/TemplateTest.php b/dev/tests/integration/testsuite/Magento/View/Element/TemplateTest.php similarity index 86% rename from dev/tests/integration/testsuite/Magento/View/Block/TemplateTest.php rename to dev/tests/integration/testsuite/Magento/View/Element/TemplateTest.php index 3d444fa170d..2e177eb8017 100644 --- a/dev/tests/integration/testsuite/Magento/View/Block/TemplateTest.php +++ b/dev/tests/integration/testsuite/Magento/View/Element/TemplateTest.php @@ -25,12 +25,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block; +namespace Magento\View\Element; class TemplateTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\View\Block\Template + * @var \Magento\View\Element\Template */ protected $_block; @@ -38,15 +38,18 @@ class TemplateTest extends \PHPUnit_Framework_TestCase { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $params = array('layout' => $objectManager->create('Magento\Core\Model\Layout', array())); - $context = $objectManager->create('Magento\View\Block\Template\Context', $params); + $context = $objectManager->create('Magento\View\Element\Template\Context', $params); $this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Template', '', array('context' => $context)); + ->createBlock('Magento\View\Element\Template', '', array( + 'context' => $context, + 'data' => array('module_name' => 'Magento_View'), + )); } public function testConstruct() { $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Template', '', array('data' => array('template' => 'value'))); + ->createBlock('Magento\View\Element\Template', '', array('data' => array('template' => 'value'))); $this->assertEquals('value', $block->getTemplate()); } @@ -69,7 +72,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase } /** - * @covers \Magento\View\Block\AbstractBlock::toHtml + * @covers \Magento\View\Element\AbstractBlock::toHtml * @see testAssign() */ public function testToHtml() diff --git a/dev/tests/integration/testsuite/Magento/View/Block/Text/ListTest.php b/dev/tests/integration/testsuite/Magento/View/Element/Text/ListTest.php similarity index 78% rename from dev/tests/integration/testsuite/Magento/View/Block/Text/ListTest.php rename to dev/tests/integration/testsuite/Magento/View/Element/Text/ListTest.php index f43f1b978f1..fa0f4ba9959 100644 --- a/dev/tests/integration/testsuite/Magento/View/Block/Text/ListTest.php +++ b/dev/tests/integration/testsuite/Magento/View/Element/Text/ListTest.php @@ -23,7 +23,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block\Text; +namespace Magento\View\Element\Text; class ListTest extends \PHPUnit_Framework_TestCase { @@ -33,7 +33,7 @@ class ListTest extends \PHPUnit_Framework_TestCase protected $_layout; /** - * @var \Magento\View\Block\Text\ListText + * @var \Magento\View\Element\Text\ListText */ protected $_block; @@ -41,15 +41,15 @@ class ListTest extends \PHPUnit_Framework_TestCase { $this->_layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\View\LayoutInterface'); - $this->_block = $this->_layout->createBlock('Magento\View\Block\Text\ListText'); + $this->_block = $this->_layout->createBlock('Magento\View\Element\Text\ListText'); } public function testToHtml() { $children = array( - array('block1', 'Magento\View\Block\Text', 'text1'), - array('block2', 'Magento\View\Block\Text', 'text2'), - array('block3', 'Magento\View\Block\Text', 'text3'), + array('block1', 'Magento\View\Element\Text', 'text1'), + array('block2', 'Magento\View\Element\Text', 'text2'), + array('block3', 'Magento\View\Element\Text', 'text3'), ); foreach ($children as $child) { $this->_layout->addBlock($child[1], $child[0], $this->_block->getNameInLayout()) @@ -62,10 +62,10 @@ class ListTest extends \PHPUnit_Framework_TestCase public function testToHtmlWithContainer() { $listName = $this->_block->getNameInLayout(); - $block1 = $this->_layout->addBlock('Magento\View\Block\Text', '', $listName); + $block1 = $this->_layout->addBlock('Magento\View\Element\Text', '', $listName); $this->_layout->addContainer('container', 'Container', array(), $listName); - $block2 = $this->_layout->addBlock('Magento\View\Block\Text', '', 'container'); - $block3 = $this->_layout->addBlock('Magento\View\Block\Text', '', $listName); + $block2 = $this->_layout->addBlock('Magento\View\Element\Text', '', 'container'); + $block3 = $this->_layout->addBlock('Magento\View\Element\Text', '', $listName); $block1->setText('text1'); $block2->setText('text2'); $block3->setText('text3'); diff --git a/dev/tests/integration/testsuite/Magento/View/Block/TextTest.php b/dev/tests/integration/testsuite/Magento/View/Element/TextTest.php similarity index 93% rename from dev/tests/integration/testsuite/Magento/View/Block/TextTest.php rename to dev/tests/integration/testsuite/Magento/View/Element/TextTest.php index 1d2bd9649d9..1e0c860f679 100644 --- a/dev/tests/integration/testsuite/Magento/View/Block/TextTest.php +++ b/dev/tests/integration/testsuite/Magento/View/Element/TextTest.php @@ -23,19 +23,19 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block; +namespace Magento\View\Element; class TextTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\View\Block\Text + * @var \Magento\View\Element\Text */ protected $_block; protected function setUp() { $this->_block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface') - ->createBlock('Magento\View\Block\Text'); + ->createBlock('Magento\View\Element\Text'); } public function testSetGetText() diff --git a/dev/tests/integration/testsuite/Magento/View/Block/_files/frontend/magento_plushe/css/wrong.css b/dev/tests/integration/testsuite/Magento/View/Element/_files/frontend/magento_plushe/css/wrong.css similarity index 100% rename from dev/tests/integration/testsuite/Magento/View/Block/_files/frontend/magento_plushe/css/wrong.css rename to dev/tests/integration/testsuite/Magento/View/Element/_files/frontend/magento_plushe/css/wrong.css diff --git a/dev/tests/integration/testsuite/Magento/View/Layout/_files/_layout_update.xml b/dev/tests/integration/testsuite/Magento/View/Layout/_files/_layout_update.xml index 072d3a23fba..529def79006 100644 --- a/dev/tests/integration/testsuite/Magento/View/Layout/_files/_layout_update.xml +++ b/dev/tests/integration/testsuite/Magento/View/Layout/_files/_layout_update.xml @@ -32,27 +32,27 @@ <action method="setTitle"> <argument translate="true" name="title" xsi:type="string">Magento Admin</argument> </action> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-prototype-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-prototype-js"> <arguments> <argument name="file" xsi:type="string">prototype/prototype.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-window-js"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-window-js"> <arguments> <argument name="file" xsi:type="string">prototype/window.js</argument> </arguments> </block> - <block class="Magento\Page\Block\Html\Head\Script" name="prototype-deprecation-js" ifconfig="dev/js/deprecation"> + <block class="Magento\Theme\Block\Html\Head\Script" name="prototype-deprecation-js" ifconfig="dev/js/deprecation"> <arguments> <argument name="file" xsi:type="string">prototype/deprecation.js</argument> </arguments> </block> - <block class="Magento\View\Block\Html\Calendar" name="head.calendar" as="calendar" template="page/js/calendar.phtml"/> + <block class="Magento\View\Element\Html\Calendar" name="head.calendar" as="calendar" template="page/js/calendar.phtml"/> </block> <block class="Magento\Backend\Block\Page\Header" name="header" as="header"/> <block class="Magento\Backend\Block\Menu" name="menu" as="menu"/> - <block class="Magento\View\Block\Messages" name="messages" as="messages"/> - <block class="Magento\View\Block\Text" as="no_name"/> + <block class="Magento\View\Element\Messages" name="messages" as="messages"/> + <block class="Magento\View\Element\Text" as="no_name"/> </block> <update handle="layout_test_handle_sample"/> <remove name="header"/> @@ -65,7 +65,7 @@ </action> </referenceBlock> <referenceBlock name="some_element_1"/> - <block class="Magento\View\Block\Text\ListText" name="test.nonexisting.block"/> + <block class="Magento\View\Element\Text\ListText" name="test.nonexisting.block"/> <remove name="test.nonexisting.block"/> <referenceBlock name="test.nonexisting.block"> <action method="getSomething"/> diff --git a/dev/tests/integration/testsuite/Magento/View/PublicationTest.php b/dev/tests/integration/testsuite/Magento/View/PublicationTest.php index 2ed4704a4c9..a6d6b4436dc 100644 --- a/dev/tests/integration/testsuite/Magento/View/PublicationTest.php +++ b/dev/tests/integration/testsuite/Magento/View/PublicationTest.php @@ -281,9 +281,9 @@ class PublicationTest extends \PHPUnit_Framework_TestCase 'frontend/test_default/en_US/images/logo_email.gif', ), 'view modular file' => array( - 'Magento_Page::favicon.ico', + 'Magento_Theme::favicon.ico', $designParams, - 'frontend/test_default/en_US/Magento_Page/favicon.ico', + 'frontend/test_default/en_US/Magento_Theme/favicon.ico', ), ); } @@ -307,7 +307,7 @@ class PublicationTest extends \PHPUnit_Framework_TestCase 'h1.gif', 'images/h2.gif', 'Namespace_Module/absolute_valid_module.gif', - 'Magento_Page/favicon.ico', // non-fixture file from real module + 'Magento_Theme/favicon.ico', // non-fixture file from real module ); $publishedDir = $this->_viewService->getPublicDir() . '/frontend/vendor_default/en_US'; $this->assertFileNotExists($publishedDir, 'Please verify isolation from previous test(s).'); diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/adminhtml/vendor_test/theme.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/adminhtml/vendor_test/theme.xml new file mode 100644 index 00000000000..a41b2687a60 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/adminhtml/vendor_test/theme.xml @@ -0,0 +1,28 @@ +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<theme> + <title>Default</title> + <version>2.0.0.0</version> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/area_two/vendor_theme_one/file b/dev/tests/integration/testsuite/Magento/View/_files/design/area_two/vendor_theme_one/file new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/area_two/vendor_theme_one/theme.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/area_two/vendor_theme_one/theme.xml new file mode 100644 index 00000000000..07a2f62c52b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/area_two/vendor_theme_one/theme.xml @@ -0,0 +1,28 @@ +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<theme> + <title>Theme One</title> + <version>2.0.0.0</version> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/design_area/vendor_theme_one/file b/dev/tests/integration/testsuite/Magento/View/_files/design/design_area/vendor_theme_one/file new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/design_area/vendor_theme_one/theme.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/design_area/vendor_theme_one/theme.xml new file mode 100644 index 00000000000..07a2f62c52b --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/design_area/vendor_theme_one/theme.xml @@ -0,0 +1,28 @@ +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<theme> + <title>Theme One</title> + <version>2.0.0.0</version> +</theme> diff --git a/app/code/Magento/Page/Helper/Data.php b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/access_violation.php similarity index 86% rename from app/code/Magento/Page/Helper/Data.php rename to dev/tests/integration/testsuite/Magento/View/_files/design/frontend/access_violation.php index cbc6a151a36..a4bf39f5ae8 100644 --- a/app/code/Magento/Page/Helper/Data.php +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/access_violation.php @@ -19,17 +19,8 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Page + * @package Magento_Core + * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * Page data helper - */ -namespace Magento\Page\Helper; - -class Data extends \Magento\App\Helper\AbstractHelper -{ - -} diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/magento_default/theme.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/magento_default/theme.xml new file mode 100644 index 00000000000..51f2b128206 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/magento_default/theme.xml @@ -0,0 +1,31 @@ +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Design + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<theme> + <title>Default</title> + <version>2.0.0.0</version> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/magento_default_iphone/theme.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/magento_default_iphone/theme.xml new file mode 100644 index 00000000000..92a306f5fbb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/magento_default_iphone/theme.xml @@ -0,0 +1,35 @@ +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Design + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<theme> + <title>Iphone</title> + <version>2.0.0.0</version> + <parent>magento_default</parent> + <media> + <preview_image>images/preview.png</preview_image> + </media> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_cache_test_theme/layout_test_handle.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_cache_test_theme/layout_test_handle.xml new file mode 100644 index 00000000000..44329928043 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_cache_test_theme/layout_test_handle.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package design + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > + <block class="Magento\View\Element\Text" name="sample_text_block"> + <action method="setText"> + <argument name="text" xsi:type="string">Text declared in the frontend/test/cache_test_theme</argument> + </action> + </block> +</layout> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_cache_test_theme/theme.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_cache_test_theme/theme.xml new file mode 100644 index 00000000000..550dfe7869d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_cache_test_theme/theme.xml @@ -0,0 +1,32 @@ +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Design + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<theme> + <title>Cache Test Theme</title> + <version>2.0.0.0</version> + <parent>test_default</parent> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view.xml new file mode 100644 index 00000000000..73d468dae96 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view_type_default.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view_type_default.xml new file mode 100644 index 00000000000..73d468dae96 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_category_view_type_default.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view.xml new file mode 100644 index 00000000000..73d468dae96 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view_type_simple.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view_type_simple.xml new file mode 100644 index 00000000000..73d468dae96 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/catalog_product_view_type_simple.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/theme_file.txt b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/theme_file.txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/theme_file_with_2_dots..txt b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/theme_file_with_2_dots..txt new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/code/Magento/Page/view/frontend/links.phtml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/theme_template.phtml similarity index 73% rename from app/code/Magento/Page/view/frontend/links.phtml rename to dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/theme_template.phtml index 21195779d8f..9dfe71409da 100644 --- a/app/code/Magento/Page/view/frontend/links.phtml +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Catalog/theme_template.phtml @@ -18,17 +18,9 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -/** - * @var $this \Magento\Page\Block\Links - */ -?> -<?php if ($links = $this->getLinks()): ?> -<ul <?php if ($this->hasCssClass()): echo 'class="' . $this->escapeHtml($this->getCssClass()) . '"'; endif; ?>> -<?php foreach ($links as $link): ?> - <?php echo $this->renderLink($link) ?> -<?php endforeach; ?> -</ul> -<?php endif; ?> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Cms/layout_test_handle_extra.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Cms/layout_test_handle_extra.xml new file mode 100644 index 00000000000..73d468dae96 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Cms/layout_test_handle_extra.xml @@ -0,0 +1,29 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/layout_test_handle_main.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/layout_test_handle_main.xml new file mode 100644 index 00000000000..e17b34172c6 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/layout_test_handle_main.xml @@ -0,0 +1,46 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <update handle="layout_test_handle_sample"/> + <remove name="header"/> + <remove name="menu"/> + <remove name="some_element_1"/> + <remove name="some_element_2"/> + <referenceBlock name="root"> + <action method="setTemplate"> + <argument name="template" xsi:type="string">popup.phtml</argument> + </action> + </referenceBlock> + <referenceBlock name="some_element_1"/> + <block name="test.nonexisting.block" class="Magento\View\Element\Text\ListText"/> + <remove name="test.nonexisting.block"/> + <referenceBlock name="test.nonexisting.block"> + <action method="getSomething"/> + </referenceBlock> +</layout> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/layout_test_handle_sample.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/layout_test_handle_sample.xml new file mode 100644 index 00000000000..0ee1ef27ceb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/layout_test_handle_sample.xml @@ -0,0 +1,51 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> + <block class="Magento\Adminhtml\Block\Page" name="root" output="1" template="page.phtml"> + <block class="Magento\Adminhtml\Block\Page\Head" name="head" as="head" template="page/head.phtml"> + <action method="setTitle"> + <argument translate="true" name="title" xsi:type="string">Magento Admin</argument> + </action> + <action method="addJs"> + <argument name="file" xsi:type="string">prototype/prototype.js</argument> + </action> + <action method="addJs"> + <argument name="file" xsi:type="string">prototype/window.js</argument> + </action> + <action method="addJs" ifconfig="dev/js/deprecation"> + <argument name="file" xsi:type="string">prototype/deprecation.js</argument> + </action> + <block class="Magento\View\Element\Html\Calendar" name="head.calendar" as="calendar" template="page/js/calendar.phtml"/> + </block> + <block class="Magento\Adminhtml\Block\Page\Header" name="header" as="header"/> + <block class="Magento\Backend\Block\Menu" name="menu" as="menu"/> + <block class="Magento\View\Element\Messages" name="messages" as="messages"/> + <block class="Magento\View\Element\Text" as="no_name"/> + </block> +</layout> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/test.phtml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/test.phtml new file mode 100644 index 00000000000..708bcd7549e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Magento_Core/test.phtml @@ -0,0 +1,27 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +echo 'Content of this file is not asserted. Only its presence.'; diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Namespace_Module/favicon.ico b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/Namespace_Module/favicon.ico new file mode 100644 index 00000000000..e69de29bb2d diff --git a/app/code/Magento/Page/view/frontend/template/container.phtml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/css/styles.css similarity index 81% rename from app/code/Magento/Page/view/frontend/template/container.phtml rename to dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/css/styles.css index 4ec11750598..1680dac037a 100644 --- a/app/code/Magento/Page/view/frontend/template/container.phtml +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/css/styles.css @@ -1,4 +1,3 @@ -<?php /** * Magento * @@ -19,17 +18,8 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default + * @package default_default + * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -?> -<?php -/** - * @see \Magento\Page\Block\Template\Container - */ -?> -<div class="page-title"> - <h1><?php echo $this->getTitle() ?></h1> -</div> -<?php echo $this->getChildHtml() ?> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/i18n/en_US.csv b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/i18n/en_US.csv new file mode 100644 index 00000000000..5352fe17010 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/i18n/en_US.csv @@ -0,0 +1,2 @@ +"Design value to translate","Design translated value" +"translation to the same value","translation to the same value" diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/i18n/fr_FR/logo.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/i18n/fr_FR/logo.gif new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/images/logo.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/images/logo.gif new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/images/logo_email.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/images/logo_email.gif new file mode 100644 index 00000000000..e69de29bb2d diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/js/tabs.js b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/js/tabs.js new file mode 100644 index 00000000000..1906afb22d3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/js/tabs.js @@ -0,0 +1,25 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/theme.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/theme.xml new file mode 100644 index 00000000000..51f2b128206 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/theme.xml @@ -0,0 +1,31 @@ +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Design + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<theme> + <title>Default</title> + <version>2.0.0.0</version> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/view.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/view.xml new file mode 100644 index 00000000000..d6df1917876 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_default/view.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<view> + <vars module="Magento_Core"> + <var name="var1">Core Value1</var> + </vars> + <vars module="Namespace_Module"> + <var name="var1">value1</var> + <var name="var2">value2</var> + </vars> +</view> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/images/rectangle.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/images/rectangle.gif new file mode 100644 index 0000000000000000000000000000000000000000..893bda02b6f087c94548e93e1a41f2981eb5a151 GIT binary patch literal 52 zcmZ?wbhEHblw;s$Xkaj8U|{(F|Gy59VgQLSFbVhcuRQ&hfAO3xx4Jjq+w+^hEtrwP F8UT4Y5kUX| literal 0 HcmV?d00001 diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/images/square.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/images/square.gif new file mode 100644 index 0000000000000000000000000000000000000000..86d02651b33492c67c822721830486de406e8233 GIT binary patch literal 46 zcmZ?wbhEHb<Y(Y#Xkaj8U|{(F|Gy590`mD87?^ll`d6NQ%fEQemRsHFj11NQ36Kp; literal 0 HcmV?d00001 diff --git a/app/code/Magento/Page/view/frontend/redirect.phtml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/style.css similarity index 69% rename from app/code/Magento/Page/view/frontend/redirect.phtml rename to dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/style.css index 8fa794add68..a4061ee04b1 100644 --- a/app/code/Magento/Page/view/frontend/redirect.phtml +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/style.css @@ -1,4 +1,3 @@ -<?php /** * Magento * @@ -19,18 +18,10 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default + * @package default_default + * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -?> -<div class="page-title"> - <h1><?php echo __('Redirecting...') ?></h1> -</div> -<?php if($this->getMessage()): ?> - <p><?php echo $this->getMessage() ?></p> -<?php endif; ?> -<?php echo $this->getRedirectOutput() ?> -<?php if(!$this->isHtmlFormRedirect()): ?> - <p><?php echo __('Click <a href="%1">here</a> if nothing has happened', $this->getTargetURL()) ?></p> -<?php endif; ?> +@import url(sub.css); +p {background: url(images/square.gif);} diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/sub.css b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/sub.css new file mode 100644 index 00000000000..ad5b982cab3 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/sub.css @@ -0,0 +1,26 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +.sub {font-size: 100px} diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/theme.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/theme.xml new file mode 100644 index 00000000000..51f2b128206 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/theme.xml @@ -0,0 +1,31 @@ +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Design + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<theme> + <title>Default</title> + <version>2.0.0.0</version> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_test_theme/layout_test_handle.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_test_theme/layout_test_handle.xml new file mode 100644 index 00000000000..4ac9978736f --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_test_theme/layout_test_handle.xml @@ -0,0 +1,35 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package design + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<layout xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > + <block class="Magento\View\Element\Text" name="sample_text_block"> + <action method="setText"> + <argument name="text" xsi:type="string">Text declared in the frontend/test/test_theme</argument> + </action> + </block> +</layout> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_test_theme/theme.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_test_theme/theme.xml new file mode 100644 index 00000000000..8039168a9fa --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_test_theme/theme.xml @@ -0,0 +1,32 @@ +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Design + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<theme> + <title>Test Theme</title> + <version>2.0.0.0</version> + <parent>test_default</parent> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_custom_theme/Fixture_Module/fixture_script.js b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_custom_theme/Fixture_Module/fixture_script.js new file mode 100644 index 00000000000..4cc8b3b1db8 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_custom_theme/Fixture_Module/fixture_script.js @@ -0,0 +1,26 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/* modular fixture view file located inside the nested view of the custom theme */ diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_custom_theme/theme.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_custom_theme/theme.xml new file mode 100644 index 00000000000..d86c1898d83 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_custom_theme/theme.xml @@ -0,0 +1,32 @@ +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Design + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<theme> + <title>Custom Theme</title> + <version>2.0.0.0</version> + <parent>vendor_default</parent> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/Namespace_Module/absolute_valid_module.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/Namespace_Module/absolute_valid_module.gif new file mode 100644 index 0000000000000000000000000000000000000000..6d3c22c4c4270e3af2904e4e26121c454eb98ff2 GIT binary patch literal 810 zcmZ?wbhEHbWMW`pC}&_${K>)q0y-c9B-Re38^E{$Of>*`4Gjl?;Ld?%r#}4u{~sth s3PwX<=!U@m-yaq%SklnY07}aL8NewTNPt*Cz`@QS$|0j+puk`a02^8*vj6}9 literal 0 HcmV?d00001 diff --git a/app/code/Magento/Page/Block/Js/Translate.php b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/access_violation.php similarity index 75% rename from app/code/Magento/Page/Block/Js/Translate.php rename to dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/access_violation.php index bcee260cfa3..a4bf39f5ae8 100644 --- a/app/code/Magento/Page/Block/Js/Translate.php +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/access_violation.php @@ -19,19 +19,8 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Page + * @package Magento_Core + * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * Js translation block - * - * @deprecated since 1.7.0.0 (used in adminhtml/default/default/layout/main.xml) - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Page\Block\Js; - -class Translate extends \Magento\View\Block\Template -{ -} diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/1.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/1.gif new file mode 100644 index 0000000000000000000000000000000000000000..6d3c22c4c4270e3af2904e4e26121c454eb98ff2 GIT binary patch literal 810 zcmZ?wbhEHbWMW`pC}&_${K>)q0y-c9B-Re38^E{$Of>*`4Gjl?;Ld?%r#}4u{~sth s3PwX<=!U@m-yaq%SklnY07}aL8NewTNPt*Cz`@QS$|0j+puk`a02^8*vj6}9 literal 0 HcmV?d00001 diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/base64.css b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/base64.css new file mode 100644 index 00000000000..589f3c83811 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/base64.css @@ -0,0 +1,29 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ + +li.test { + background: url(data:image/svg+xml;base64,PD94bWwgdmVyc2lvbj0iMS4wIiA/Pgo8c3ZnIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgd2lkdGg9IjEwMCUiIGhlaWdodD0iMTAwJSIgdmlld0JveD0iMCAwIDEgMSIgcHJlc2VydmVBc3BlY3RSYXRpbz0ibm9uZSI+CiAgPGxpbmVhckdyYWRpZW50IGlkPSJncmFkLXVjZ2ctZ2VuZXJhdGVkIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSIgeDE9IjAlIiB5MT0iMCUiIHgyPSIwJSIgeTI9IjEwMCUiPgogICAgPHN0b3Agb2Zmc2V0PSIwJSIgc3RvcC1jb2xvcj0iI2ZmZmZmZiIgc3RvcC1vcGFjaXR5PSIxIi8+CiAgICA8c3RvcCBvZmZzZXQ9IjEwMCUiIHN0b3AtY29sb3I9IiNlNmU2ZTYiIHN0b3Atb3BhY2l0eT0iMSIvPgogIDwvbGluZWFyR3JhZGllbnQ+CiAgPHJlY3QgeD0iMCIgeT0iMCIgd2lkdGg9IjEiIGhlaWdodD0iMSIgZmlsbD0idXJsKCNncmFkLXVjZ2ctZ2VuZXJhdGVkKSIgLz4KPC9zdmc+); +} diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/body.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/body.gif new file mode 100644 index 0000000000000000000000000000000000000000..6d3c22c4c4270e3af2904e4e26121c454eb98ff2 GIT binary patch literal 810 zcmZ?wbhEHbWMW`pC}&_${K>)q0y-c9B-Re38^E{$Of>*`4Gjl?;Ld?%r#}4u{~sth s3PwX<=!U@m-yaq%SklnY07}aL8NewTNPt*Cz`@QS$|0j+puk`a02^8*vj6}9 literal 0 HcmV?d00001 diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/deep/recursive.css b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/deep/recursive.css new file mode 100644 index 00000000000..ca8741e8493 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/deep/recursive.css @@ -0,0 +1,26 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +dt {background: url('../../recursive2.gif')} diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/exception.css b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/exception.css new file mode 100644 index 00000000000..13ef18a72ad --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/exception.css @@ -0,0 +1,27 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +li.rogue {background: url(../access_violation.php);} +li.test {background: url(../../access_violation.php);} diff --git a/app/code/Magento/Page/view/frontend/template/linksblock.phtml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/file.css similarity index 59% rename from app/code/Magento/Page/view/frontend/template/linksblock.phtml rename to dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/file.css index 116ea9f70ee..7e89b1ff1d1 100644 --- a/app/code/Magento/Page/view/frontend/template/linksblock.phtml +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/file.css @@ -1,4 +1,3 @@ -<?php /** * Magento * @@ -19,14 +18,21 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category design - * @package base_default + * @package default_default + * @subpackage integration_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -?> -<?php -/** - * @see \Magento\Page\Block\Template\Links\Block - */ -?> -<li<?php if($this->getIsFirst()||$this->getIsLast()): ?> class="<?php if($this->getIsFirst()): ?>first<?php endif; ?><?php if($this->getIsLast()): ?> last<?php endif; ?>"<?php endif; ?> <?php echo $this->getLiParams() ?>><?php echo $this->getBeforeText() ?><a href="<?php echo $this->getLinkUrl() ?>" title="<?php echo $this->getTitle() ?>" <?php echo $this->getAParams() ?>><?php echo $this->getLabel() ?></a><?php echo $this->getAfterText() ?></li> +@import url(../recursive.css); +@import url("deep/recursive.css"); +body {background: url(body.gif);} +p {background: url(1.gif?param);} +h1 {background: url('../h1.gif#param');} h2 {background: url(../images/h2.gif?test);} +a {background: url(data:image/png;)} + +ul {background: url(/absolute.gif);} +ol {background: url(http://example.com/absolute.gif);} +li {background: url("https://example.com/absolute.gif");} + +ol.valid {background: url(Namespace_Module::absolute_valid_module.gif)} /* theme file modular */ +ol.favicon {background: url(Magento_Theme::favicon.ico)} /* base file */ diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/h1.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/h1.gif new file mode 100644 index 0000000000000000000000000000000000000000..6d3c22c4c4270e3af2904e4e26121c454eb98ff2 GIT binary patch literal 810 zcmZ?wbhEHbWMW`pC}&_${K>)q0y-c9B-Re38^E{$Of>*`4Gjl?;Ld?%r#}4u{~sth s3PwX<=!U@m-yaq%SklnY07}aL8NewTNPt*Cz`@QS$|0j+puk`a02^8*vj6}9 literal 0 HcmV?d00001 diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/images/h2.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/images/h2.gif new file mode 100644 index 0000000000000000000000000000000000000000..6d3c22c4c4270e3af2904e4e26121c454eb98ff2 GIT binary patch literal 810 zcmZ?wbhEHbWMW`pC}&_${K>)q0y-c9B-Re38^E{$Of>*`4Gjl?;Ld?%r#}4u{~sth s3PwX<=!U@m-yaq%SklnY07}aL8NewTNPt*Cz`@QS$|0j+puk`a02^8*vj6}9 literal 0 HcmV?d00001 diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive.css b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive.css new file mode 100644 index 00000000000..4d59e4d69dd --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive.css @@ -0,0 +1,26 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category design + * @package default_default + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +dl {background: url(recursive.gif)} diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive.gif new file mode 100644 index 0000000000000000000000000000000000000000..6d3c22c4c4270e3af2904e4e26121c454eb98ff2 GIT binary patch literal 810 zcmZ?wbhEHbWMW`pC}&_${K>)q0y-c9B-Re38^E{$Of>*`4Gjl?;Ld?%r#}4u{~sth s3PwX<=!U@m-yaq%SklnY07}aL8NewTNPt*Cz`@QS$|0j+puk`a02^8*vj6}9 literal 0 HcmV?d00001 diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive2.gif b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive2.gif new file mode 100644 index 0000000000000000000000000000000000000000..6d3c22c4c4270e3af2904e4e26121c454eb98ff2 GIT binary patch literal 810 zcmZ?wbhEHbWMW`pC}&_${K>)q0y-c9B-Re38^E{$Of>*`4Gjl?;Ld?%r#}4u{~sth s3PwX<=!U@m-yaq%SklnY07}aL8NewTNPt*Cz`@QS$|0j+puk`a02^8*vj6}9 literal 0 HcmV?d00001 diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/scripts.js b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/scripts.js new file mode 100644 index 00000000000..595b459369a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/scripts.js @@ -0,0 +1,26 @@ +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +/* scripts.js */ diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/theme.xml b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/theme.xml new file mode 100644 index 00000000000..51f2b128206 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/theme.xml @@ -0,0 +1,31 @@ +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Design + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<theme> + <title>Default</title> + <version>2.0.0.0</version> +</theme> diff --git a/dev/tests/integration/testsuite/Magento/View/_files/design/themes.php b/dev/tests/integration/testsuite/Magento/View/_files/design/themes.php new file mode 100644 index 00000000000..513f228949e --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/View/_files/design/themes.php @@ -0,0 +1,43 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @subpackage integration_tests + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\Core\Model\App') + ->loadAreaPart( + \Magento\Backend\App\Area\FrontNameResolver::AREA_CODE, + \Magento\Core\Model\App\Area::PART_CONFIG + ); +\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->configure(array( + 'preferences' => array( + 'Magento\Core\Model\Theme' => 'Magento\Core\Model\Theme\Data' + ) +)); +/** @var $registration \Magento\Core\Model\Theme\Registration */ +$registration = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() + ->create('Magento\Core\Model\Theme\Registration'); +$registration->register( + __DIR__, + implode(DIRECTORY_SEPARATOR, array('*', '*', 'theme.xml')) +); diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/User/Edit/TabsTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/User/Edit/TabsTest.php index cab9d183e98..31589d32a53 100644 --- a/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/User/Edit/TabsTest.php +++ b/dev/tests/integration/testsuite/Magento/Webapi/Block/Adminhtml/User/Edit/TabsTest.php @@ -70,13 +70,13 @@ class TabsTest extends \PHPUnit_Framework_TestCase // TODO: Move to unit tests after MAGETWO-4015 complete. /** @var \Magento\Webapi\Block\Adminhtml\User\Edit\Tab\Main $mainTabBlock */ $mainTabBlock = $this->_layout->addBlock( - 'Magento\View\Block\Text', + 'Magento\View\Element\Text', 'webapi.user.edit.tab.main', 'webapi.user.edit.tabs' )->setText('Main Block Content'); $this->_layout->addBlock( - 'Magento\View\Block\Text', + 'Magento\View\Element\Text', 'webapi.user.edit.tab.roles.grid', 'webapi.user.edit.tabs' )->setText('Grid Block Content'); diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/ReaderTest.php new file mode 100644 index 00000000000..b60ba7e6a3d --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/ReaderTest.php @@ -0,0 +1,67 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * + */ + +namespace Magento\Webapi\Model\Config\Integration; + +use Magento\Webapi\Model\Config\Integration\Reader as ConfigReader; + +/** + * Integration API config reader test. + */ +class ReaderTest extends \PHPUnit_Framework_TestCase +{ + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $_fileResolverMock; + + /** @var ConfigReader */ + protected $_configReader; + + protected function setUp() + { + parent::setUp(); + $this->_fileResolverMock = $this->getMock('Magento\Config\FileResolverInterface'); + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->_configReader = $objectManager->create( + 'Magento\Webapi\Model\Config\Integration\Reader', + array('fileResolver' => $this->_fileResolverMock) + ); + } + + public function testRead() + { + $configFiles = array( + realpath(__DIR__ . '/_files/apiA.xml'), + realpath(__DIR__ . '/_files/apiB.xml') + ); + $this->_fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($configFiles)); + + $expectedResult = require __DIR__ . '/_files/api.php'; + $this->assertEquals( + $expectedResult, + $this->_configReader->read(), + 'Error happened during config reading.' + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/api.php b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/api.php new file mode 100644 index 00000000000..85a467f444a --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/api.php @@ -0,0 +1,46 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +return array( + 'TestIntegration1' => array( + 'resources' => array( + 'Magento_Customer::manage', + 'Magento_Customer::online', + 'Magento_Sales::capture', + 'Magento_SalesRule::quote' + ) + ), + 'TestIntegration2' => array( + 'resources' => array( + 'Magento_Catalog::product_read', + 'Magento_SalesRule::config_promo' + ) + ), + 'TestIntegration3' => array( + 'resources' => array( + 'Magento_Catalog::product_read', + 'Magento_Sales::create', + 'Magento_SalesRule::quote' + ) + ), +); diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/apiA.xml b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/apiA.xml new file mode 100644 index 00000000000..8fc3c0df061 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/apiA.xml @@ -0,0 +1,42 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<integrations> + <integration name="TestIntegration1"> + <!-- List of API resources required by the integration. These are resource ids defined + in etc/acl.xml of modules and subsequently mapped to web APIs in webapi.xml. --> + <resources> + <resource name="Magento_Customer::manage" /> + <resource name="Magento_Customer::online" /> + <resource name="Magento_Sales::capture" /> + <resource name="Magento_SalesRule::quote" /> + </resources> + </integration> + <integration name="TestIntegration2"> + <resources> + <resource name="Magento_Catalog::product_read" /> + </resources> + </integration> +</integrations> diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/apiB.xml b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/apiB.xml new file mode 100644 index 00000000000..cdf7287f464 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/Integration/_files/apiB.xml @@ -0,0 +1,40 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<integrations> + <integration name="TestIntegration2"> + <resources> + <!--Extension of resources list defined in apiA.xml--> + <resource name="Magento_SalesRule::config_promo" /> + </resources> + </integration> + <integration name="TestIntegration3"> + <resources> + <resource name="Magento_Catalog::product_read" /> + <resource name="Magento_Sales::create" /> + <resource name="Magento_SalesRule::quote" /> + </resources> + </integration> +</integrations> diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/ReaderTest.php b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/ReaderTest.php new file mode 100644 index 00000000000..874f8e6eccb --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/ReaderTest.php @@ -0,0 +1,67 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + * + */ + +namespace Magento\Webapi\Model\Config; + +use Magento\Webapi\Model\Config\Reader as ConfigReader; + +/** + * Webapi config reader test. + */ +class ReaderTest extends \PHPUnit_Framework_TestCase +{ + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $_fileResolverMock; + + /** @var ConfigReader */ + protected $_configReader; + + protected function setUp() + { + parent::setUp(); + $this->_fileResolverMock = $this->getMock('Magento\Config\FileResolverInterface'); + $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); + $this->_configReader = $objectManager->create( + 'Magento\Webapi\Model\Config\Reader', + array('fileResolver' => $this->_fileResolverMock) + ); + } + + public function testRead() + { + $configFiles = array( + realpath(__DIR__ . '/_files/webapiA.xml'), + realpath(__DIR__ . '/_files/webapiB.xml') + ); + $this->_fileResolverMock->expects($this->any())->method('get')->will($this->returnValue($configFiles)); + + $expectedResult = require __DIR__ . '/_files/webapi.php'; + $this->assertEquals( + $expectedResult, + $this->_configReader->read(), + 'Error happened during config reading.' + ); + } +} diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapi.php b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapi.php new file mode 100644 index 00000000000..acd67d02c69 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapi.php @@ -0,0 +1,93 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +return array( + '\Magento\TestModule1\Service\AllSoapAndRestV1Interface' => array( + 'class' => '\Magento\TestModule1\Service\AllSoapAndRestV1Interface', + 'methods' => array( + 'item' => array( + 'httpMethod' => 'GET', + 'method' => 'item', + 'route' => '/:id', + 'isSecure' => false, + ), + 'create' => array( + 'httpMethod' => 'POST', + 'method' => 'create', + 'route' => '', + 'isSecure' => false, + ), + ), + 'baseUrl' => '/V1/testmodule1', + ), + '\Magento\TestModule1\Service\AllSoapAndRestV2Interface' => array( + 'class' => '\Magento\TestModule1\Service\AllSoapAndRestV2Interface', + 'methods' => array( + 'item' => array( + 'httpMethod' => 'GET', + 'method' => 'item', + 'route' => '/:id', + 'isSecure' => false, + ), + 'create' => array( + 'httpMethod' => 'POST', + 'method' => 'create', + 'route' => '', + 'isSecure' => false, + ), + 'delete' => array( + 'httpMethod' => 'DELETE', + 'method' => 'delete', + 'route' => '/:id', + 'isSecure' => true, + ), + ), + 'baseUrl' => '/V2/testmodule1', + ), + '\Magento\TestModule1\Service\AllSoapAndRestV3Interface' => array( + 'class' => '\Magento\TestModule1\Service\AllSoapAndRestV3Interface', + 'methods' => array(), + ), + '\Magento\TestModule2\Service\SomeVInterface' => array( + 'class' => '\Magento\TestModule2\Service\SomeVInterface', + 'methods' => array(), + ), + '\Magento\TestModule2\Service\AllSoapAndRestV2Interface' => array( + 'class' => '\Magento\TestModule2\Service\AllSoapAndRestV2Interface', + 'methods' => array( + 'create' => array( + 'httpMethod' => 'POST', + 'method' => 'create', + 'route' => '', + 'isSecure' => false, + ), + 'delete' => array( + 'httpMethod' => 'DELETE', + 'method' => 'delete', + 'route' => '/:id', + 'isSecure' => true, + ), + ), + 'baseUrl' => '/V2/testmodule2', + ), +); diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiA.xml b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiA.xml new file mode 100644 index 00000000000..2ab43187f04 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiA.xml @@ -0,0 +1,38 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config> + <service class="\Magento\TestModule1\Service\AllSoapAndRestV1Interface" baseUrl="/V1/testmodule1"> + <rest-route httpMethod="GET" method="item">/:id</rest-route> + </service> + + <service class="\Magento\TestModule1\Service\AllSoapAndRestV2Interface" baseUrl="/V2/testmodule1"> + <rest-route httpMethod="GET" method="item">/:id</rest-route> + <rest-route httpMethod="POST" method="create"></rest-route> + <rest-route httpMethod="DELETE" method="delete" isSecure="true">/:id</rest-route> + </service> + + <service class="\Magento\TestModule1\Service\AllSoapAndRestV3Interface"/> +</config> diff --git a/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiB.xml b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiB.xml new file mode 100644 index 00000000000..8165984b516 --- /dev/null +++ b/dev/tests/integration/testsuite/Magento/Webapi/Model/Config/_files/webapiB.xml @@ -0,0 +1,38 @@ +<?xml version="1.0"?> +<!-- +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Academic Free License (AFL 3.0) + * that is bundled with this package in the file LICENSE_AFL.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/afl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) + */ +--> +<config> + <service class="\Magento\TestModule1\Service\AllSoapAndRestV1Interface" baseUrl="/V1/testmodule1"> + <!--Extension of service declared in webapiA.xml--> + <rest-route httpMethod="POST" method="create"></rest-route> + </service> + + <service class="\Magento\TestModule2\Service\SomeVInterface"/> + + <service class="\Magento\TestModule2\Service\AllSoapAndRestV2Interface" baseUrl="/V2/testmodule2"> + <rest-route httpMethod="POST" method="create"></rest-route> + <rest-route httpMethod="DELETE" method="delete" isSecure="true">/:id</rest-route> + </service> +</config> diff --git a/dev/tests/integration/testsuite/Magento/Webhook/Block/Adminhtml/Registration/ActivateTest.php b/dev/tests/integration/testsuite/Magento/Webhook/Block/Adminhtml/Registration/ActivateTest.php index d45a17cea2f..33446ace090 100644 --- a/dev/tests/integration/testsuite/Magento/Webhook/Block/Adminhtml/Registration/ActivateTest.php +++ b/dev/tests/integration/testsuite/Magento/Webhook/Block/Adminhtml/Registration/ActivateTest.php @@ -54,9 +54,9 @@ class ActivateTest extends \PHPUnit_Framework_TestCase $registry->register(\Magento\Webhook\Block\Adminhtml\Registration\Activate::REGISTRY_KEY_CURRENT_SUBSCRIPTION, $subscriptionData); - /** @var \Magento\View\Block\Template\Context $context */ + /** @var \Magento\View\Element\Template\Context $context */ $context = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\View\Block\Template\Context'); + ->create('Magento\View\Element\Template\Context'); /** @var \Magento\Webhook\Block\Adminhtml\Registration\Activate $block */ $block = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() diff --git a/dev/tests/integration/testsuite/Magento/Webhook/Block/Adminhtml/Registration/Create/Form/ContainerTest.php b/dev/tests/integration/testsuite/Magento/Webhook/Block/Adminhtml/Registration/Create/Form/ContainerTest.php index abcecd94e39..efcf7e870b4 100644 --- a/dev/tests/integration/testsuite/Magento/Webhook/Block/Adminhtml/Registration/Create/Form/ContainerTest.php +++ b/dev/tests/integration/testsuite/Magento/Webhook/Block/Adminhtml/Registration/Create/Form/ContainerTest.php @@ -52,8 +52,8 @@ class ContainerTest extends \PHPUnit_Framework_TestCase $registry->register(\Magento\Webhook\Block\Adminhtml\Registration\Activate::REGISTRY_KEY_CURRENT_SUBSCRIPTION, $subscriptionData); - /** @var \Magento\View\Block\Template\Context $context */ - $context = $objectManager->create('Magento\View\Block\Template\Context'); + /** @var \Magento\View\Element\Template\Context $context */ + $context = $objectManager->create('Magento\View\Element\Template\Context'); /** @var \Magento\Webhook\Block\Adminhtml\Registration\Activate $block */ $block = $objectManager diff --git a/dev/tests/integration/testsuite/Magento/Webhook/Model/SubscriptionTest.php b/dev/tests/integration/testsuite/Magento/Webhook/Model/SubscriptionTest.php index 152321cca9b..8a26a897835 100644 --- a/dev/tests/integration/testsuite/Magento/Webhook/Model/SubscriptionTest.php +++ b/dev/tests/integration/testsuite/Magento/Webhook/Model/SubscriptionTest.php @@ -193,6 +193,9 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase public function testFindRestrictedTopics() { + /** TODO: This test should be rewritten after global ACL service introduction. */ + $this->markTestIncomplete("This test should be rewritten after global ACL service introduction."); + /** @var \Magento\Webhook\Model\Subscription $subscription */ $subscription = $this->_objectManager->create('Magento\Webhook\Model\Subscription'); @@ -308,7 +311,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase $this->assertEquals(self::VALUE_API_USER_ID, $subscription->getApiUserId()); } - + public function testSetGetMethods() { @@ -397,7 +400,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase ); $this->assertEquals(self::VALUE_TIMEOUT_IN_SECS, $loadedSubscription->getData(self::KEY_TIMEOUT_IN_SECS)); } - + public function testSetDataArray() { $data = array( @@ -481,5 +484,5 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase $this->assertEquals($value, $superSet[$key]); } } - + } diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php index a508803fa38..baaf1d96a7d 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/DesignAbstractionTest.php @@ -48,7 +48,7 @@ class DesignAbstractionTest extends \PHPUnit_Framework_TestCase $appState = $objectManager->get('Magento\App\State'); $appState->setAreaCode(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); $args = array( - 'context' => $objectManager->get('Magento\View\Block\Template\Context'), + 'context' => $objectManager->get('Magento\View\Element\Template\Context'), 'layoutProcessorFactory' => $this->getMock('Magento\View\Layout\ProcessorFactory', array(), array(), '', false), 'themesFactory' => $objectManager->get('Magento\Core\Model\Resource\Theme\CollectionFactory'), diff --git a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/LayoutTest.php b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/LayoutTest.php index 2f781bf2973..42a5f0e734e 100644 --- a/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/LayoutTest.php +++ b/dev/tests/integration/testsuite/Magento/Widget/Block/Adminhtml/Widget/Instance/Edit/Chooser/LayoutTest.php @@ -66,7 +66,7 @@ class LayoutTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($pageTypeValues)); $this->_block = new \Magento\Widget\Block\Adminhtml\Widget\Instance\Edit\Chooser\Layout( - $objectManager->get('Magento\View\Block\Template\Context'), + $objectManager->get('Magento\View\Element\Template\Context'), $config, array( 'name' => 'page_type', diff --git a/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php b/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php index fb0ac2302e1..89b68ab5f80 100644 --- a/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php +++ b/dev/tests/integration/testsuite/Magento/Wishlist/Block/AbstractTest.php @@ -38,8 +38,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase { $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager(); $this->_block = $this->getMockForAbstractClass('Magento\Wishlist\Block\AbstractBlock', array( - $objectManager->get('Magento\View\Block\Template\Context'), - $objectManager->get('Magento\Core\Helper\Data'), + $objectManager->get('Magento\View\Element\Template\Context'), $objectManager->get('Magento\Catalog\Model\Config'), $objectManager->get('Magento\Core\Model\Registry'), $objectManager->get('Magento\Tax\Helper\Data'), diff --git a/dev/tests/integration/testsuite/Magento/Wishlist/Block/Customer/Wishlist/Item/ColumnTest.php b/dev/tests/integration/testsuite/Magento/Wishlist/Block/Customer/Wishlist/Item/ColumnTest.php index cfcac8100b6..9359537afe8 100644 --- a/dev/tests/integration/testsuite/Magento/Wishlist/Block/Customer/Wishlist/Item/ColumnTest.php +++ b/dev/tests/integration/testsuite/Magento/Wishlist/Block/Customer/Wishlist/Item/ColumnTest.php @@ -44,7 +44,7 @@ class ColumnTest extends \PHPUnit_Framework_TestCase $this->_layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() ->get('Magento\View\LayoutInterface'); $this->_block = $this->_layout->addBlock('Magento\Wishlist\Block\Customer\Wishlist\Item\Column', 'test'); - $this->_layout->addBlock('Magento\View\Block\Text', 'child', 'test'); + $this->_layout->addBlock('Magento\View\Element\Text', 'child', 'test'); } /** diff --git a/dev/tests/integration/testsuite/Magento/Wishlist/Block/Customer/Wishlist/ItemsTest.php b/dev/tests/integration/testsuite/Magento/Wishlist/Block/Customer/Wishlist/ItemsTest.php index 45ab6ffa1f4..27472c10f60 100644 --- a/dev/tests/integration/testsuite/Magento/Wishlist/Block/Customer/Wishlist/ItemsTest.php +++ b/dev/tests/integration/testsuite/Magento/Wishlist/Block/Customer/Wishlist/ItemsTest.php @@ -33,8 +33,8 @@ class ItemsTest extends \PHPUnit_Framework_TestCase { $layout = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\LayoutInterface'); $block = $layout->addBlock('Magento\Wishlist\Block\Customer\Wishlist\Items', 'test'); - $child = $this->getMock('Magento\View\Block\Text', array('isEnabled'), - array(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\Block\Context'))); + $child = $this->getMock('Magento\View\Element\Text', array('isEnabled'), + array(\Magento\TestFramework\Helper\Bootstrap::getObjectManager()->get('Magento\View\Element\Context'))); $child->expects($this->any()) ->method('isEnabled') ->will($this->returnValue(true)); diff --git a/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php b/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php index cf5211844e2..82c7b3ff9cf 100644 --- a/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php +++ b/dev/tests/integration/testsuite/Magento/Wishlist/Controller/IndexTest.php @@ -39,7 +39,7 @@ class IndexTest extends \Magento\TestFramework\TestCase\AbstractController parent::setUp(); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $this->_customerSession = \Magento\TestFramework\Helper\Bootstrap::getObjectManager() - ->create('Magento\Customer\Model\Session', array($logger)); + ->get('Magento\Customer\Model\Session', array($logger)); $this->_customerSession->login('customer@example.com', 'password'); } diff --git a/dev/tests/performance/testsuite/checkout.jmx b/dev/tests/performance/testsuite/checkout.jmx index c4d3938033d..a0237d3b091 100644 --- a/dev/tests/performance/testsuite/checkout.jmx +++ b/dev/tests/performance/testsuite/checkout.jmx @@ -198,7 +198,7 @@ <RegexExtractor guiclass="RegexExtractorGui" testclass="RegexExtractor" testname="Extract product name" enabled="true"> <stringProp name="RegexExtractor.useHeaders">false</stringProp> <stringProp name="RegexExtractor.refname">product_name</stringProp> - <stringProp name="RegexExtractor.regex"><h1 class="title"><span class="base">(.+?)</span></h1></stringProp> + <stringProp name="RegexExtractor.regex"><h1 class="title"><span class="base"[^>]*>(.+?)</span></h1></stringProp> <stringProp name="RegexExtractor.template">$1$</stringProp> <stringProp name="RegexExtractor.default"></stringProp> <stringProp name="RegexExtractor.match_number">1</stringProp> diff --git a/dev/tests/static/framework/Magento/TestFramework/Dependency/LayoutRule.php b/dev/tests/static/framework/Magento/TestFramework/Dependency/LayoutRule.php index 06b09396f00..6b9a4f84a67 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Dependency/LayoutRule.php +++ b/dev/tests/static/framework/Magento/TestFramework/Dependency/LayoutRule.php @@ -52,7 +52,7 @@ class LayoutRule implements \Magento\TestFramework\Dependency\RuleInterface */ protected $_defaultModules = array( 'default' => 'Magento\Install', - 'frontend' => 'Magento\Page', + 'frontend' => 'Magento\Theme', 'adminhtml' => 'Magento\Adminhtml', ); diff --git a/dev/tests/static/framework/Magento/TestFramework/Dependency/TemplateRule.php b/dev/tests/static/framework/Magento/TestFramework/Dependency/TemplateRule.php index f9a76d0cf81..398a775a321 100644 --- a/dev/tests/static/framework/Magento/TestFramework/Dependency/TemplateRule.php +++ b/dev/tests/static/framework/Magento/TestFramework/Dependency/TemplateRule.php @@ -52,7 +52,7 @@ class TemplateRule implements \Magento\TestFramework\Dependency\RuleInterface */ protected $_defaultModules = array( 'default' => 'Magento_Install', - 'frontend' => 'Magento_Page', + 'frontend' => 'Magento_Theme', 'adminhtml' => 'Magento_Adminhtml', ); diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt index 23cb16b70ce..e221386708f 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Library/_files/blacklist.txt @@ -35,17 +35,21 @@ lib/Magento/Data/Form/AbstractForm.php lib/Magento/Data/Form/Factory.php lib/Magento/Data/Collection.php lib/Magento/Data/Form.php +lib/Magento/Data/Form/FormKey.php lib/Magento/Filter/Object/Grid.php lib/Magento/Filter/Object.php lib/Magento/View/Context.php -lib/Magento/View/Block/Html/Calendar.php -lib/Magento/View/Block/Messages.php -lib/Magento/View/Block/AbstractBlock.php -lib/Magento/View/Block/Template.php -lib/Magento/View/Block/Context.php -lib/Magento/View/Block/Template/Context.php +lib/Magento/View/Element/Js/Cookie.php +lib/Magento/View/Element/Html/Calendar.php +lib/Magento/View/Element/Html/Link/Current.php +lib/Magento/View/Element/Messages.php +lib/Magento/View/Element/AbstractBlock.php +lib/Magento/View/Element/Template.php +lib/Magento/View/Element/Context.php +lib/Magento/View/Element/Template/Context.php +lib/Magento/View/Element/Redirect.php lib/Magento/App/Module/ResourceResolver.php lib/Magento/Event/Invoker/InvokerDefault.php @@ -57,3 +61,4 @@ lib/Magento/Oauth/Exception.php lib/Magento/App/Helper/AbstractHelper.php lib/Magento/App/Helper/Context.php +lib/Magento/Session/SidResolverInterface.php diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/invalid_persistent.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/invalid_persistent.xml index e3c9ef876e4..7852512b194 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/invalid_persistent.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/invalid_persistent.xml @@ -34,13 +34,13 @@ <name_in_layout>header</name_in_layout> <class>Magento\Persistent\Model\Observer</class> <method>emulateWelcomeBlock</method> - <block_type>Magento\Page\Block\Html\Header</block_type> + <block_type>Magento\Theme\Block\Html\Header</block_type> </welcome> <top_links> <name_in_layout>top.links</name_in_layout> <class>Magento\Persistent\Model\Observer</class> <method>emulateTopLinks</method> - <block_type>Magento\Page\Block\Template\Links</block_type> + <block_type>Magento\Theme\Block\Template\Links</block_type> </top_links> </blocks> <models /> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/valid_persistent.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/valid_persistent.xml index 89dd656a3f8..43da678e691 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/valid_persistent.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Persistent/_files/valid_persistent.xml @@ -30,13 +30,13 @@ <name_in_layout>header</name_in_layout> <class>Magento\Persistent\Model\Observer</class> <method>emulateWelcomeBlock</method> - <block_type>Magento\Page\Block\Html\Header</block_type> + <block_type>Magento\Theme\Block\Html\Header</block_type> </reference> <reference id="top_links"> <name_in_layout>top.links</name_in_layout> <class>Magento\Persistent\Model\Observer</class> <method>emulateTopLinks</method> - <block_type>Magento\Page\Block\Template\Links</block_type> + <block_type>Magento\Theme\Block\Template\Links</block_type> </reference> </blocks> </instances> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/Config/ReferentialTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/Config/ReferentialTest.php similarity index 98% rename from dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/Config/ReferentialTest.php rename to dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/Config/ReferentialTest.php index 257eb367199..362d1136452 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/Config/ReferentialTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/Config/ReferentialTest.php @@ -23,7 +23,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Test\Integrity\Magento\Page\Config; +namespace Magento\Test\Integrity\Magento\Theme\Config; class ReferentialTest extends \PHPUnit_Framework_TestCase { diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/ConfigTest.php b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/ConfigTest.php similarity index 95% rename from dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/ConfigTest.php rename to dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/ConfigTest.php index 48295e9ff32..823ae562ae6 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/ConfigTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/ConfigTest.php @@ -26,7 +26,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Test\Integrity\Magento\Page; +namespace Magento\Test\Integrity\Magento\Theme; class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig { @@ -62,7 +62,7 @@ class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig */ protected function _getXsd() { - return '/app/code/Magento/Page/etc/page_layouts.xsd'; + return '/app/code/Magento/Theme/etc/page_layouts.xsd'; } /** @@ -102,7 +102,7 @@ class ConfigTest extends \Magento\TestFramework\Integrity\AbstractConfig */ protected function _getFileXsd() { - return '/app/code/Magento/Page/etc/page_layouts_file.xsd'; + return '/app/code/Magento/Theme/etc/page_layouts_file.xsd'; } /** diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/_files/invalid_page_layouts.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/invalid_page_layouts.xml similarity index 95% rename from dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/_files/invalid_page_layouts.xml rename to dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/invalid_page_layouts.xml index c4449de5f83..2972db10e7b 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/_files/invalid_page_layouts.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/invalid_page_layouts.xml @@ -24,7 +24,7 @@ */ --> <page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Page/etc/page_layouts.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Theme/etc/page_layouts.xsd"> <layouts default="bad_ref"> <layout id="empty"> <template>empty.phtml</template> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/_files/invalid_page_layouts_partial.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/invalid_page_layouts_partial.xml similarity index 100% rename from dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/_files/invalid_page_layouts_partial.xml rename to dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/invalid_page_layouts_partial.xml diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/_files/valid_page_layouts.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts.xml similarity index 95% rename from dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/_files/valid_page_layouts.xml rename to dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts.xml index 67c0171a8a4..d05d45faa19 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/_files/valid_page_layouts.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts.xml @@ -24,7 +24,7 @@ */ --> <page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Page/etc/page_layouts.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Theme/etc/page_layouts.xsd"> <layouts default="empty"> <layout id="empty"> <label translate="true">Empty</label> diff --git a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/_files/valid_page_layouts_partial.xml b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts_partial.xml similarity index 96% rename from dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/_files/valid_page_layouts_partial.xml rename to dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts_partial.xml index 33735844d3b..7ea89038a3e 100644 --- a/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Page/_files/valid_page_layouts_partial.xml +++ b/dev/tests/static/testsuite/Magento/Test/Integrity/Magento/Theme/_files/valid_page_layouts_partial.xml @@ -24,7 +24,7 @@ */ --> <page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Page/etc/page_layouts_file.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../../../app/code/Magento/Theme/etc/page_layouts_file.xsd"> <layouts default="one"> <layout id="one"> <template>empty.phtml</template> diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt index b6d8747db51..9ac33494f34 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/blacklist/core.txt @@ -4,7 +4,7 @@ pub/lib/mage/backend/editablemultiselect.js pub/lib/mage/captcha.js pub/lib/mage/directpost.js pub/lib/mage/jquery-no-conflict.js -app/code/Magento/Page/view/frontend/menu.js +app/code/Magento/Theme/view/frontend/menu.js app/code/Magento/Checkout/view/frontend/multishipping/payment.js app/code/Magento/Checkout/view/frontend/onepage/accordion.js app/code/Magento/Checkout/view/frontend/opcheckout.js diff --git a/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/core.txt b/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/core.txt index 3304e65c0a4..54c56692c82 100644 --- a/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/core.txt +++ b/dev/tests/static/testsuite/Magento/Test/Js/_files/whitelist/core.txt @@ -2,7 +2,7 @@ pub/lib/mage app/code/Magento/Install app/code/Magento/Catalog app/code/Magento/Newsletter -app/code/Magento/Page +app/code/Magento/Theme app/code/Magento/PageCache app/code/Magento/CatalogSearch app/code/Magento/Checkout diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/LayoutTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/LayoutTest.php index 5b1cfc991d6..6ae4091c957 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/LayoutTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/LayoutTest.php @@ -114,12 +114,12 @@ class LayoutTest extends \PHPUnit_Framework_TestCase . '(@name="head" or @name="convert_root_head" or @name="vde_head")'; $this->assertSame(array(), $layoutXml->xpath( - '//block[@class="Magento\Page\Block\Html\Head\Css" ' - . 'or @class="Magento\Page\Block\Html\Head\Link" ' - . 'or @class="Magento\Page\Block\Html\Head\Script"]' + '//block[@class="Magento\Theme\Block\Html\Head\Css" ' + . 'or @class="Magento\Theme\Block\Html\Head\Link" ' + . 'or @class="Magento\Theme\Block\Html\Head\Script"]' . '/parent::*[not(' . $selectorHeadBlock . ')]' ), - 'Blocks \Magento\Page\Block\Html\Head\{Css,Link,Script} are allowed within the "head" block only. ' + 'Blocks \Magento\Theme\Block\Html\Head\{Css,Link,Script} are allowed within the "head" block only. ' . 'Verify integrity of the nodes nesting.' ); $this->assertSame(array(), @@ -145,8 +145,8 @@ class LayoutTest extends \PHPUnit_Framework_TestCase ); } $this->assertSame(array(), - $layoutXml->xpath('/layout//block[@class="Magento\View\Block\Text\ListText"]'), - 'The class \Magento\View\Block\Text\ListTest is not supposed to be used in layout anymore.' + $layoutXml->xpath('/layout//block[@class="Magento\View\Element\Text\ListText"]'), + 'The class \Magento\View\Element\Text\ListTest is not supposed to be used in layout anymore.' ); }, \Magento\TestFramework\Utility\Files::init()->getLayoutFiles() diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/Magento/Core/Block/AbstractBlockTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/Magento/Core/Block/AbstractBlockTest.php index 564a6124eae..03933d7bfa8 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/Magento/Core/Block/AbstractBlockTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/Magento/Core/Block/AbstractBlockTest.php @@ -26,7 +26,7 @@ */ /** - * Tests usage of \Magento\View\Block\AbstractBlock + * Tests usage of \Magento\View\Element\AbstractBlock */ namespace Magento\Test\Legacy\Magento\Core\Block; diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php index 2e9825fc784..26b1e034d57 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/ObsoleteCodeTest.php @@ -308,7 +308,7 @@ class ObsoleteCodeTest extends \PHPUnit_Framework_TestCase if (0 === strpos($file, \Magento\TestFramework\Utility\Files::init()->getPathToSource() . '/app/')) { $this->_assertNotRegexp('/[^a-z\d_]getChild\s*\(/iS', $content, 'Block method getChild() is obsolete. ' . - 'Replacement suggestion: \Magento\View\Block\AbstractBlock::getChildBlock()' + 'Replacement suggestion: \Magento\View\Element\AbstractBlock::getChildBlock()' ); } } diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php index 3d18ba84872..39c96db5864 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_classes.php @@ -1454,11 +1454,11 @@ return array( array('Magento\Backend\Controller\AbstractAction', 'Magento\Backend\App\AbstractAction'), array('Magento\Backend\Controller\Context', 'Magento\Backend\App\Action\Context'), array('Magento\Backend\Controller\Adminhtml\Action', 'Magento\Backend\App\Action'), - array('Magento\Core\Block\Text', 'Magento\View\Block\Text'), - array('Magento\Core\Block\Text\ListText', 'Magento\View\Block\Text\ListText'), - array('Magento\Core\Block\Text\TextList\Item', 'Magento\View\Block\Text\TextList\Item'), - array('Magento\Core\Block\Text\TextList\Link', 'Magento\View\Block\Text\TextList\Link'), - array('Magento\Core\Block\Messages', 'Magento\View\Block\Messages'), + array('Magento\Core\Block\Text', 'Magento\View\Element\Text'), + array('Magento\Core\Block\Text\ListText', 'Magento\View\Element\Text\ListText'), + array('Magento\Core\Block\Text\TextList\Item', 'Magento\View\Element\Text\TextList\Item'), + array('Magento\Core\Block\Text\TextList\Link', 'Magento\View\Element\Text\TextList\Link'), + array('Magento\Core\Block\Messages', 'Magento\View\Element\Messages'), array('Magento\Core\Model\Message', 'Magento\Message\Factory'), array('Magento\Core\Model\Message\AbstractMessage', 'Magento\Message\AbstractMessage'), array('Magento\Core\Model\Message\Collection', 'Magento\Message\Collection'), @@ -1467,17 +1467,16 @@ return array( array('Magento\Core\Model\Message\Warning', 'Magento\Message\Warning'), array('Magento\Core\Model\Message\Notice', 'Magento\Message\Notice'), array('Magento\Core\Model\Message\Success', 'Magento\Message\Success'), - array('Magento\Core\Block\Html\Date', 'Magento\View\Block\Html\Date'), - array('Magento\Core\Block\Html\Select', 'Magento\View\Block\Html\Select'), - array('Magento\Core\Block\AbstractBlock', 'Magento\View\Block\AbstractBlock'), - array('Magento\Core\Block\Template', 'Magento\View\Block\Template'), - array('Magento\Core\Block\Html\Calendar', 'Magento\View\Block\Html\Calendar'), - array('Magento\Core\Block\Html\Link', 'Magento\View\Block\Html\Link'), - array('Magento\Core\Block\Context', 'Magento\View\Block\Context'), + array('Magento\Core\Block\Html\Date', 'Magento\View\Element\Html\Date'), + array('Magento\Core\Block\Html\Select', 'Magento\View\Element\Html\Select'), + array('Magento\Core\Block\AbstractBlock', 'Magento\View\Element\AbstractBlock'), + array('Magento\Core\Block\Template', 'Magento\View\Element\Template'), + array('Magento\Core\Block\Html\Calendar', 'Magento\View\Element\Html\Calendar'), + array('Magento\Core\Block\Html\Link', 'Magento\View\Element\Html\Link'), + array('Magento\Core\Block\Context', 'Magento\View\Element\Context'), array('Magento\Core\Model\Factory\Helper', 'Magento\App\Helper\HelperFactory'), array('Magento\Core\Helper\AbstractHelper', 'Magento\App\Helper\AbstractHelper'), array('Magento\Core\Helper\Context', 'Magento\App\Helper\Context'), - array('Magento\Core\Block\Template\Context', 'Magento\View\Block\Template\Context'), array( 'Magento\Adminhtml\Controller\Report\AbstractReport', 'Magento\Reports\Controller\Adminhtml\AbstractReport' @@ -1690,4 +1689,56 @@ return array( 'Magento\Adminhtml\Block\Report\Wishlist', 'Magento\Reports\Block\Adminhtml\Wishlist' ), + array('Magento\Core\Model\Cookie', 'Magento\Stdlib\Cookie'), + array('Magento\Core\Model\Logger', 'Magento\Logger'), + array('Magento\Core\Block\Template\Context', 'Magento\View\Element\Template\Context'), + array('Magento\Page\Block\Template\Container'), + array('Magento\Page\Block\Redirect', 'Magento\View\Element\Redirect'), + array('Magento\Page\Block\Js\Translate'), + array('Magento\Page\Block\Js\Components', 'Magento\View\Element\Js\Components'), + array('Magento\Page\Block\Js\Cookie', 'Magento\View\Element\Js\Cookie'), + array('Magento\Page\Block\Html', 'Magento\Theme\Block\Html'), + array('Magento\Page\Block\Html\Breadcrumbs', 'Magento\Theme\Block\Html\Breadcrumbs'), + array('Magento\Page\Block\Html\Footer', 'Magento\Theme\Block\Html\Footer'), + array('Magento\Page\Block\Html\Head', 'Magento\Theme\Block\Html\Head'), + array('Magento\Page\Block\Html\Header', 'Magento\Theme\Block\Html\Header'), + array('Magento\Page\Block\Html\Notices', 'Magento\Theme\Block\Html\Notices'), + array('Magento\Page\Block\Html\Pager', 'Magento\Theme\Block\Html\Pager'), + array('Magento\Page\Block\Html\Title', 'Magento\Theme\Block\Html\Title'), + array('Magento\Page\Block\Html\Topmenu', 'Magento\Theme\Block\Html\Topmenu'), + array('Magento\Page\Block\Html\Welcome', 'Magento\Theme\Block\Html\Welcome'), + array('Magento\Page\Helper\Layout', 'Magento\Theme\Helper\Layout'), + array('Magento\Page\Model\Source\Layout', 'Magento\Theme\Model\Layout\Source\Layout'), + array('Magento\Page\Model\Config\Converter', 'Magento\Theme\Model\Layout\Config\Converter'), + array('Magento\Page\Model\Config\Reader', 'Magento\Theme\Model\Layout\Config\Reader'), + array('Magento\Page\Model\Config\SchemaLocator', 'Magento\Theme\Model\Layout\Config\SchemaLocator'), + array('Magento\Page\Helper\Data'), + array('Magento\Page\Helper\Html'), + array('Magento\Page\Helper\Robots'), + array('Magento\Core\Model\Page'), + array('Magento\Core\Model\Page\Asset\AssetInterface', 'Magento\View\Asset\AssetInterface'), + array('Magento\Core\Model\Page\Asset\Collection', 'Magento\View\Asset\Collection'), + array('Magento\Core\Model\Page\Asset\LocalInterface', 'Magento\View\Asset\LocalInterface'), + array('Magento\Core\Model\Page\Asset\MergeService', 'Magento\View\Asset\MergeService'), + array('Magento\Core\Model\Page\Asset\MergeStrategy\Checksum', 'Magento\View\Asset\MergeStrategy\Checksum'), + array('Magento\Core\Model\Page\Asset\MergeStrategy\Direct', 'Magento\View\Asset\MergeStrategy\Direct'), + array('Magento\Core\Model\Page\Asset\MergeStrategy\FileExists', 'Magento\View\Asset\MergeStrategy\FileExists'), + array('Magento\Core\Model\Page\Asset\MergeStrategyInterface', 'Magento\View\Asset\MergeStrategyInterface'), + array('Magento\Core\Model\Page\Asset\MergeableInterface', 'Magento\View\Asset\MergeableInterface'), + array('Magento\Core\Model\Page\Asset\Merged', 'Magento\View\Asset\Merged'), + array('Magento\Core\Model\Page\Asset\Minified', 'Magento\View\Asset\Minified'), + array('Magento\Core\Model\Page\Asset\MinifyService', 'Magento\View\Asset\MinifyService'), + array('Magento\Core\Model\Page\Asset\PublicFile', 'Magento\View\Asset\PublicFile'), + array('Magento\Core\Model\Page\Asset\Remote', 'Magento\View\Asset\Remote'), + array('Magento\Core\Model\Page\Asset\ViewFile', 'Magento\View\Asset\ViewFile'), + array('Magento\Page\Block\Html\Head\AssetBlock', 'Magento\Theme\Block\Html\Head\AssetBlockInterface'), + array('Magento\Page\Block\Html\Head\Css', 'Magento\Theme\Block\Html\Head\Css'), + array('Magento\Page\Block\Html\Head\Link', 'Magento\Theme\Block\Html\Head\Link'), + array('Magento\Page\Block\Html\Head\Script', 'Magento\Theme\Block\Html\Head\Script'), + array('Magento\Page\Model\Asset\GroupedCollection', 'Magento\View\Asset\GroupedCollection'), + array('Magento\Page\Model\Asset\PropertyGroup', 'Magento\View\Asset\PropertyGroup'), + array('Magento\Page\Block\Template\Links\Block'), + array('Magento\Page\Block\Link\Current', 'Magento\View\Element\Html\Link\Current'), + array('Magento\Page\Block\Links', 'Magento\View\Element\Html\Links'), + array('Magento\Page\Block\Link', 'Magento\View\Element\Html\Link'), ); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php index 48ea702498f..d1099749d03 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_constants.php @@ -170,12 +170,12 @@ return array( array('XML_PATH_COUNTRY_DEFAULT', 'Magento\Paypal\Model\System\Config\Backend\MerchantCountry'), array( 'XML_PATH_DEBUG_TEMPLATE_HINTS', - 'Magento\View\Block\Template', + 'Magento\View\Element\Template', 'Magento\Core\Model\TemplateEngine\Plugin::XML_PATH_DEBUG_TEMPLATE_HINTS' ), array( 'XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS', - 'Magento\View\Block\Template', + 'Magento\View\Element\Template', 'Magento\Core\Model\TemplateEngine\Plugin::XML_PATH_DEBUG_TEMPLATE_HINTS_BLOCKS' ), array('XML_PATH_DEFAULT_COUNTRY', 'Magento\Core\Model\Locale'), @@ -395,4 +395,72 @@ return array( array('XML_PATH_WEBHOOK', 'Magento\Webhook\Model\Source\Hook'), array('XML_PATH_SUBSCRIPTIONS', 'Magento\Webhook\Model\Subscription\Config'), array('PAYMENT_INFO_TRANSPORT_SHIPPING_OVERRIDEN', 'Magento\Paypal\Model\Express\Checkout'), + array( + 'XML_PATH_USE_FRONTEND_SID', + '\Magento\Core\Model\Session\AbstractSession', + '\Magento\Core\Model\Session\SidResolver::XML_PATH_USE_FRONTEND_SID' + ), + array( + 'SESSION_ID_QUERY_PARAM', + '\Magento\Core\Model\Session\AbstractSession', + '\Magento\Session\SidResolverInterface::SESSION_ID_QUERY_PARAM' + ), + array( + 'XML_PATH_COOKIE_DOMAIN', + '\Magento\Stdlib\Cookie', + '\Magento\Core\Model\Session\Config::XML_PATH_COOKIE_DOMAIN' + ), + array( + 'XML_PATH_COOKIE_PATH', + '\Magento\Stdlib\Cookie', + '\Magento\Core\Model\Session\Config::XML_PATH_COOKIE_PATH' + ), + array( + 'XML_PATH_COOKIE_LIFETIME', + '\Magento\Stdlib\Cookie', + '\Magento\Core\Model\Session\Config::XML_PATH_COOKIE_LIFETIME' + ), + array( + 'XML_PATH_COOKIE_HTTPONLY', + '\Magento\Stdlib\Cookie', + '\Magento\Core\Model\Session\Config::XML_PATH_COOKIE_HTTPONLY' + ), + array( + 'PARAM_SESSION_SAVE_METHOD', + '\Magento\Core\Model\Session\AbstractSession', + '\Magento\Core\Model\Session\Config::PARAM_SESSION_SAVE_METHOD' + ), + array( + 'PARAM_SESSION_SAVE_PATH', + '\Magento\Core\Model\Session\AbstractSession', + '\Magento\Core\Model\Session\Config::PARAM_SESSION_SAVE_METHOD' + ), + array( + 'PARAM_SESSION_CACHE_LIMITER', + '\Magento\Core\Model\Session\AbstractSession', + '\Magento\Core\Model\Session\Config::PARAM_SESSION_SAVE_METHOD' + ), + + array( + 'XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS', + 'Magento\Theme\Helper\Robots', + 'Magento\Adminhtml\Block\Page\System\Config\Robots::XML_PATH_ROBOTS_DEFAULT_CUSTOM_INSTRUCTIONS', + ), + array('XML_PATH_MERGE_CSS_FILES', 'Magento\View\Asset\MergeService'), + array('XML_PATH_MERGE_JS_FILES', 'Magento\View\Asset\MergeService'), + array('XML_PATH_MINIFICATION_ENABLED', 'Magento\View\Asset\MinifyService'), + array('XML_PATH_MINIFICATION_ADAPTER', 'Magento\View\Asset\MinifyService'), + array('TYPE_BLOCK', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('TYPE_CONTAINER', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('TYPE_ACTION', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('TYPE_ARGUMENTS', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('TYPE_ARGUMENT', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('TYPE_REFERENCE_BLOCK', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('TYPE_REFERENCE_CONTAINER', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('TYPE_REMOVE', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('TYPE_MOVE', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('CONTAINER_OPT_HTML_TAG', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('CONTAINER_OPT_HTML_CLASS', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('CONTAINER_OPT_HTML_ID', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), + array('CONTAINER_OPT_LABEL', '\Magento\Core\Model\Layout', '\Magento\View\Layout\Element'), ); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php index 70d71d1ad1b..fa34f242ce4 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_methods.php @@ -28,7 +28,7 @@ return array( array('__get', 'Magento\Object'), array('__set', 'Magento\Object'), - array('_addItem', 'Magento\Page\Block\Html\Head'), + array('_addItem', 'Magento\Theme\Block\Html\Head'), array('_addLink', 'Magento\Customer\Block\Account\Link'), array('_addMinimalPrice', 'Magento\Catalog\Model\Resource\Product\Collection'), array('_addTaxPercents', 'Magento\Catalog\Model\Resource\Product\Collection'), @@ -60,8 +60,8 @@ return array( array('_escapeValue', 'Magento\Adminhtml\Block\Widget\Grid\Column\Filter\AbstractFilter'), array('_extractData', 'Magento\ObjectManager\Config\Reader\Dom'), array('_filterPostData', 'Magento\Catalog\Controller\Adminhtml\Product\Attribute'), - array('_generateCssHtml', 'Magento\Page\Block\Html\Head'), - array('_generateJsHtml', 'Magento\Page\Block\Html\Head'), + array('_generateCssHtml', 'Magento\Theme\Block\Html\Head'), + array('_generateJsHtml', 'Magento\Theme\Block\Html\Head'), array('_getAddressTaxRequest', 'Magento\Tax\Model\Sales\Total\Quote\Shipping'), array('_getAggregationPerStoreView'), array('_getAttributeFilterBlockName'), @@ -74,7 +74,7 @@ return array( array('_getCacheLockId', 'Magento\Core\Model\Config'), array('_getCacheTags', 'Magento\Core\Model\App'), array('_getChildHtml'), - array('_getConfig', 'Magento\Page\Helper\Layout'), + array('_getConfig', 'Magento\Theme\Helper\Layout'), array('_getCookie', 'Magento\PageCache\Helper\Data'), array('_getCollapseState', 'Magento\Backend\Block\System\Config\Form\Fieldset', '_isCollapseState'), array('_getCollectionNames', 'Magento\Adminhtml\Controller\Report\Sales'), @@ -186,18 +186,18 @@ return array( array('addColumnRender', 'Magento\Sales\Block\Adminhtml\Items\AbstractItems', 'setColumnRenders'), array('addConfigField', 'Magento\Core\Model\Resource\Setup'), array('addConstraint', 'Magento\DB\Adapter\Pdo\Mysql'), - array('addCss', 'Magento\Page\Block\Html\Head'), - array('addCssIe', 'Magento\Page\Block\Html\Head'), + array('addCss', 'Magento\Theme\Block\Html\Head'), + array('addCssIe', 'Magento\Theme\Block\Html\Head'), array('addCustomersToAlertQueueAction'), array('addCustomerToSegments'), array('addHandle', 'Magento\Core\Model\Layout\Update', 'Magento\Core\Model\Layout\Merge'), array('addItemRender', 'Magento\Sales\Block\Adminhtml\Items\AbstractItems'), array('addItemRender', 'Magento\Checkout\Block\Cart\AbstractCart'), array('addItemRender', 'Magento\Sales\Block\Items\AbstractItems'), - array('addJs', 'Magento\Page\Block\Html\Head'), - array('addJsIe', 'Magento\Page\Block\Html\Head'), + array('addJs', 'Magento\Theme\Block\Html\Head'), + array('addJsIe', 'Magento\Theme\Block\Html\Head'), array('addKey', 'Magento\DB\Adapter\Pdo\Mysql'), - array('addLinkRel', 'Magento\Page\Block\Html\Head'), + array('addLinkRel', 'Magento\Theme\Block\Html\Head'), array('addLogInLink', 'Magento\Customer\Block\Account\Link'), array('addModule', 'Magento\Core\App\Router\Base'), array('addRouter', 'Magento\App\FrontController'), @@ -261,12 +261,12 @@ return array( array('chooseTemplate', 'Magento\Checkout\Block\Cart'), array('cleanCache', 'Magento\Core\Model\Config'), array('cleanDbRow', 'Magento\App\Resource'), - array('cleanMergedJsCss', 'Magento\Core\Model\Design\Package', 'Magento\Core\Model\Page\Asset\MergeService'), - array('cleanMergedJsCss', 'Magento\Core\Model\Design\Package\Proxy', 'Magento\Core\Model\Page\Asset\MergeService'), + array('cleanMergedJsCss', 'Magento\Core\Model\Design\Package', 'Magento\View\Asset\MergeService'), + array('cleanMergedJsCss', 'Magento\Core\Model\Design\Package\Proxy', 'Magento\View\Asset\MergeService'), array( 'cleanMergedJsCss', 'Magento\Core\Model\Design\PackageInterface', - 'Magento\Core\Model\Page\Asset\MergeService' + 'Magento\View\Asset\MergeService' ), array('cleanVarFolder', '', 'Magento_Io_File::rmdirRecursive()'), array('cleanVarSubFolders', '', @@ -358,12 +358,12 @@ return array( array('getDebug', 'Magento\Paypal\Model\Api\AbstractApi'), array('getDefaultBasePath', 'Magento\Core\Model\Store'), array('getDeleteUrl', 'Magento\Adminhtml\Block\Catalog\Product\Edit'), - array('getDirectOutput', 'Magento\View\Block\Template'), + array('getDirectOutput', 'Magento\View\Element\Template'), array('getDirectOutput', 'Magento\Core\Model\Layout'), array('getDirectOutput', 'Magento\View\LayoutInterface'), array('getDistroServerVars', 'Magento\Core\Model\Config', 'getDistroBaseUrl'), array('getElementClass', 'Magento\Core\Model\Layout\Update'), - array('getEngineFactory', 'Magento\View\Block\Template\Context', 'getEnginePool'), + array('getEngineFactory', 'Magento\View\Element\Template\Context', 'getEnginePool'), array('getEntityIdsToIncrementIds', 'Magento\Rss\Model\Resource\Order'), array('getEntityTypeIdsToTypes', 'Magento\Rss\Model\Resource\Order'), array('getEventConfig', 'Magento\Core\Model\Config'), @@ -420,10 +420,10 @@ return array( array('getModuleSetup', 'Magento\Core\Model\Config'), array('getNeedUsePriceExcludeTax', '', 'Magento_Tax_Model_Config::priceIncludesTax()'), array('getOneBalanceTotal'), - array('getOptimalCssUrls', 'Magento\Core\Model\Design\Package\Proxy', 'Magento\Core\Model\Page\Asset\Merged'), - array('getOptimalJsUrls', 'Magento\Core\Model\Design\Package\Proxy', 'Magento\Core\Model\Page\Asset\Merged'), - array('getOptimalCssUrls', 'Magento\Core\Model\Design\Package', 'Magento\Core\Model\Page\Asset\Merged'), - array('getOptimalJsUrls', 'Magento\Core\Model\Design\Package', 'Magento\Core\Model\Page\Asset\Merged'), + array('getOptimalCssUrls', 'Magento\Core\Model\Design\Package\Proxy', 'Magento\View\Asset\Merged'), + array('getOptimalJsUrls', 'Magento\Core\Model\Design\Package\Proxy', 'Magento\View\Asset\Merged'), + array('getOptimalCssUrls', 'Magento\Core\Model\Design\Package', 'Magento\View\Asset\Merged'), + array('getOptimalJsUrls', 'Magento\Core\Model\Design\Package', 'Magento\View\Asset\Merged'), array('getOption', 'Magento\Captcha\Helper\Data', 'Magento_Core_Model_Dir::getDir()'), array('getOptions', 'Magento\Core\Model\Config'), array( @@ -500,7 +500,7 @@ return array( array('getSecure', 'Magento\Core\Model\Url', 'isSecure'), array('getSelectionFinalPrice', 'Magento\Bundle\Model\Product\Price'), array('getShipId', 'Magento\Shipping\Block\Tracking\Popup'), - array('getShowTemplateHints', 'Magento\View\Block\Template'), + array('getShowTemplateHints', 'Magento\View\Element\Template'), array('getSortedChildBlocks', '', 'getChildNames() + $this->getLayout()->getBlock($name)'), array('getSortedChildren', '', 'getChildNames'), array('getSortedElements', 'Magento\Data\Form\Element\Fieldset', 'getElements'), @@ -618,17 +618,17 @@ return array( array('logEncryptionKeySave'), array('logI' . 'nvitationSave'), array('map', 'Magento\ObjectManager\Config\Mapper\Dom', 'Magento_ObjectManager_Config_Mapper_Dom::convert'), - array('mergeFiles', 'Magento\Core\Helper\Data', 'Magento\Core\Model\Page\Asset\MergeStrategyInterface'), - array('mergeFiles', 'Magento\Core\Model\Design\Package', 'Magento\Core\Model\Page\Asset\MergeStrategyInterface'), + array('mergeFiles', 'Magento\Core\Helper\Data', 'Magento\View\Asset\MergeStrategyInterface'), + array('mergeFiles', 'Magento\Core\Model\Design\Package', 'Magento\View\Asset\MergeStrategyInterface'), array( 'mergeFiles', 'Magento\Core\Model\Design\Package\Proxy', - 'Magento\Core\Model\Page\Asset\MergeStrategyInterface' + 'Magento\View\Asset\MergeStrategyInterface' ), array( 'mergeFiles', 'Magento\Core\Model\Design\PackageInterface', - 'Magento\Core\Model\Page\Asset\MergeStrategyInterface' + 'Magento\View\Asset\MergeStrategyInterface' ), array('order_success_page_view', 'Magento\GoogleAnalytics\Model\Observer'), array('orderedAction', 'Magento\Adminhtml\Controller\Report\Product'), @@ -664,7 +664,7 @@ return array( array('regenerateSessionId', 'Magento\Core\Model\Session\AbstractSession'), array('reinitialize', 'Magento\TestFramework\Bootstrap', 'Magento_TestFramework_Helper_Bootstrap::reinitialize'), array('removeAuthLink', 'Magento\Customer\Block\Account\Link'), - array('removeItem', 'Magento\Page\Block\Html\Head'), + array('removeItem', 'Magento\Theme\Block\Html\Head'), array('removeCustomerFromSegments'), array('removeHandle', 'Magento\Core\Model\Layout\Update', 'Magento\Core\Model\Layout\Merge'), array('removeParentCartLink', 'Magento\Checkout\Block\Links'), @@ -707,7 +707,7 @@ return array( array('setResourceConfig', 'Magento\App\Resource'), array('setSaveTemplateFlag', 'Magento\Newsletter\Model\Queue'), array('setScriptPath'), - array('setScriptPath', 'Magento\View\Block\Template'), + array('setScriptPath', 'Magento\View\Element\Template'), array('setShipId', 'Magento\Shipping\Block\Tracking\Popup'), array('setSortElementsByAttribute', 'Magento\Data\Form\Element\Fieldset'), array('setStore', 'Magento\Captcha\Helper\Data'), @@ -823,14 +823,14 @@ return array( array('getInsertFromSelectUsingAnalytic', 'Magento\Eav\Model\Resource\Helper'), array('setOneRowLimit', 'Magento\Eav\Model\Resource\Helper'), array('getCastToIntExpression', 'Magento\Eav\Model\Resource\Helper'), - array('_initMetaTags', 'Magento\Page\Block\Html\Head'), - array('addMetaTag', 'Magento\Page\Block\Html\Head'), - array('getDefaultMetaTags', 'Magento\Page\Block\Html\Head'), + array('_initMetaTags', 'Magento\Theme\Block\Html\Head'), + array('addMetaTag', 'Magento\Theme\Block\Html\Head'), + array('getDefaultMetaTags', 'Magento\Theme\Block\Html\Head'), array('getDefaultTemplates', 'Magento\Email\Model\Template'), array('getDefaultTemplatesAsOptionsArray', 'Magento\Email\Model\Template', 'Magento_Adminhtml_Block_System_Email_Template_Edit::_getDefaultTemplatesAsOptionsArray'), - array('getMetaTags', 'Magento\Page\Block\Html\Head'), - array('getMetaTagHtml', 'Magento\Page\Block\Html\Head'), + array('getMetaTags', 'Magento\Theme\Block\Html\Head'), + array('getMetaTagHtml', 'Magento\Theme\Block\Html\Head'), array('addLink', 'Magento\Sales\Block\Order\Info'), array('checkLinks', 'Magento\Sales\Block\Order\Info'), array('getLinks', 'Magento\Sales\Block\Order\Info'), @@ -928,8 +928,8 @@ return array( array('getPublicFilesValidPath', '\Magento\Core\Helper\Data'), array('getViewConfig', '\Magento\Core\Model\View\Config', 'get'), array('_getSession', '\Magento\Catalog\Helper\Product\Compare', '$this->_catalogSession'), - array('getEnginePool', '\Magento\View\Block\Template\Context', 'getEngineFactory'), - array('getHtml', 'Magento\View\Block\Messages'), + array('getEnginePool', '\Magento\View\Element\Template\Context', 'getEngineFactory'), + array('getHtml', 'Magento\View\Element\Messages'), array('is_dir_writeable'), array('destruct'), array('mageDebugBacktrace'), @@ -1017,4 +1017,70 @@ return array( array('_saveCache', '\Magento\App\Helper\AbstractHelper'), array('_removeCache', '\Magento\App\Helper\AbstractHelper'), array('_cleanCache', '\Magento\App\Helper\AbstractHelper'), + array('changeQuoteCustomerGroupId', '\Magento\Sales\Model\Observer', + '\Magento\Sales\Model\Observer\Frontend\Quote\Address\CollectTotals::dispatch' + ), + array( + 'getEncryptedSessionId', + '\Magento\Core\Model\Session\AbstractSession', + '\Magento\Core\Model\Session\AbstractSession::getSessionId' + ), + array( + 'getSessionIdQueryParam', + '\Magento\Core\Model\Session\AbstractSession', + '\Magento\Core\Model\Session\SidResolver::getSessionIdQueryParam' + ), + array('getCookie', '\Magento\Core\Model\Session\AbstractSession'), + array( + 'unsetAll', + '\Magento\Core\Model\Session\AbstractSession', + '\Magento\Core\Model\Session\AbstractSession::clearStorage' + ), + array( + 'clear', + '\Magento\Core\Model\Session\AbstractSession', + '\Magento\Core\Model\Session\AbstractSession::clearStorage' + ), + array('delete', '\Magento\Stdlib\Cookie', '\Magento\Stdlib\Cookie::set'), + array('setSkipSessionIdFlag', '\Magento\Core\Model\Session\AbstractSession'), + array('getSkipSessionIdFlag', '\Magento\Core\Model\Session\AbstractSession'), + array('getConfigDomain', '\Magento\Stdlib\Cookie'), + array('getDomain', '\Magento\Stdlib\Cookie'), + array('getDefaultLifetime', '\Magento\Stdlib\Cookie'), + array('getPath', '\Magento\Stdlib\Cookie'), + array('getHttponly', '\Magento\Stdlib\Cookie'), + array('isSecure', '\Magento\Stdlib\Cookie'), + array('getStore', '\Magento\Stdlib\Cookie'), + array('setStore', '\Magento\Stdlib\Cookie'), + array('setLifetime', '\Magento\Stdlib\Cookie'), + array('_getResponse', '\Magento\Stdlib\Cookie'), + array('_getRequest', '\Magento\Stdlib\Cookie'), + array('init', '\Magento\Core\Model\Session\AbstractSession', '\Magento\Core\Model\Session\AbstractSession::start'), + array('getCacheLimiter', '\Magento\Core\Model\Session\Context', '\Magento\Core\Model\Session\Config'), + array('getDir', '\Magento\Core\Model\Session\Context', '\Magento\Core\Model\Session\Config'), + array('getSavePath', '\Magento\Core\Model\Session\Context', '\Magento\Core\Model\Session\Config'), + array('getSessionSavePath', '\Magento\Core\Model\Session\AbstractSession', '\Magento\Core\Model\Session\Config'), + array('getMethod', '\Magento\GoogleCheckout\Block\Redirect', 'getFormMethod'), + array('getCookie', 'Magento\View\Element\Js\Cookie'), + array('setCopyright', 'Magento\Theme\Block\Html\Footer'), + array('setLogo', 'Magento\Theme\Block\Html\Header'), + array('_beforeCacheUrl', 'Magento\View\Element\AbstractBlock'), + array('_afterCacheUrl', 'Magento\View\Element\AbstractBlock'), + array('_getGroupFor', 'Magento\View\Asset\GroupedCollection', 'getGroupFor'), + array('_composeMergedContent', 'Magento\View\Asset\MergeStrategy\Direct', 'composeMergedContent'), + array('_initialize', 'Magento\View\Asset\Merged', 'initialize'), + array('_getMergedAsset', 'Magento\View\Asset\Merged', 'getMergedAsset'), + array('_getPublicFilesToMerge', 'Magento\View\Asset\Merged', 'getPublicFilesToMerge'), + array('_getMergedFilePath', 'Magento\View\Asset\Merged', 'getMergedFilePath'), + array('_process', 'Magento\View\Asset\Minified', 'process'), + array('_getMinifier', 'Magento\View\Asset\MinifyService', 'getMinifier'), + array('_isEnabled', 'Magento\View\Asset\MinifyService', 'isEnabled'), + array('_getAdapter', 'Magento\View\Asset\MinifyService', 'getAdapter'), + array('getShowPerPage', 'Magento\Theme\Block\Html\Pager', 'isShowPerPage'), + array('setFrameTags', 'Magento\View\Element\AbstractBlock'), + array('getMessagesBlock', 'Magento\View\Element\AbstractBlock'), + array('setMessagesBlock', 'Magento\View\Element\AbstractBlock'), + array('getUrlEncoded', 'Magento\View\Element\AbstractBlock'), + array('getUrlBase64', 'Magento\View\Element\AbstractBlock'), + array('getMessagesBlock', 'Magento\MultipleWishlist\Block\Info'), ); diff --git a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php index f9904b14edb..2dbdbfe40bc 100644 --- a/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php +++ b/dev/tests/static/testsuite/Magento/Test/Legacy/_files/obsolete_properties.php @@ -87,9 +87,9 @@ return array( array('_skipFieldsByModel'), array('_ship_id'), array('_shipTable', 'Magento\Shipping\Model\Resource\Carrier\Tablerate\Collection'), - array('_showTemplateHints', 'Magento\View\Block\Template', + array('_showTemplateHints', 'Magento\View\Element\Template', 'Magento\Core\Model\TemplateEngine\Plugin\DebugHints'), - array('_showTemplateHintsBlocks', 'Magento\View\Block\Template', + array('_showTemplateHintsBlocks', 'Magento\View\Element\Template', 'Magento\Core\Model\TemplateEngine\Plugin\DebugHints'), array('_sortedChildren'), array('_sortInstructions'), @@ -97,7 +97,7 @@ return array( array('_substServerVars'), array('_track_id'), array('_varSubFolders', null, 'Magento\App\Dir'), - array('_viewDir', 'Magento\View\Block\Template', '_dirs'), + array('_viewDir', 'Magento\View\Element\Template', '_dirs'), array('decoratedIsFirst', null, 'getDecoratedIsFirst'), array('decoratedIsEven', null, 'getDecoratedIsEven'), array('decoratedIsOdd', null, 'getDecoratedIsOdd'), @@ -108,13 +108,13 @@ return array( array('_engine', 'Magento\CatalogSearch\Model\Resource\Fulltext'), array('_allowedAreas', 'Magento\Core\Model\Config'), array('_app', 'Magento\Core\Block\AbstractBlock'), - array('_app', 'Magento\View\Block\Template'), + array('_app', 'Magento\View\Element\Template'), array('_config', 'Magento\Backend\Helper\Data'), array('_defaultAreaFrontName', 'Magento\Backend\Helper\Data'), array('_areaFrontName', 'Magento\Backend\Helper\Data'), array('_backendFrontName', 'Magento\Backend\Helper\Data'), array('_app', 'Magento\Backend\Block\Widget\Grid\Column\Renderer\Currency'), - array('_enginePool', '\Magento\View\Block\Template\Context', '_engineFactory'), + array('_enginePool', '\Magento\View\Element\Template\Context', '_engineFactory'), array('_allowedFormats', '\Magento\Core\Helper\Data', '\Magento\Core\Model\Locale'), array('types', '\Magento\Core\Model\Theme'), array('_collectionFactory', '\Magento\Install\Controller\Action', 'themeProvider'), @@ -127,4 +127,66 @@ return array( array('_sessionQuote', 'Magento\Sales\Block\Adminhtml\Order\Create\Messages', 'sessionQuote'), array('_coreRegistry', 'Magento\Sales\Block\Adminhtml\Order\View\Messages', 'coreRegistry'), array('_message', 'Magento\Sales\Model\Quote', 'messageFactory'), + array('_encryptedSessionId', '\Magento\Core\Model\Session\AbstractSession'), + array('_skipSessionIdFlag', '\Magento\Core\Model\Session\AbstractSession'), + array('_url', '\Magento\Core\Model\Session\AbstractSession'), + array('_sidNameMap', '\Magento\Core\Model\Session\AbstractSession'), + array('_store', '\Magento\Stdlib\Cookie'), + array('_lifetime', '\Magento\Stdlib\Cookie'), + array('_httpResponse', '\Magento\Stdlib\Cookie'), + array('_storeManager', '\Magento\Stdlib\Cookie'), + array('_coreStoreConfig', '\Magento\Stdlib\Cookie'), + array('_savePath', '\Magento\Core\Model\Session\Context'), + array('_cacheLimiter', '\Magento\Core\Model\Session\Context'), + array('_dir', '\Magento\Core\Model\Session\Context'), + array('_cacheLimiter', 'Magento\Core\Model\Session\AbstractSession'), + array('_dir', 'Magento\Core\Model\Session\AbstractSession'), + array('_savePath', 'Magento\Core\Model\Session\AbstractSession'), + array('_formFields', 'Magento\View\Element\Redirect', 'formFields'), + array('_formFactory', 'Magento\View\Element\Redirect', 'formFactory'), + array('_dispersion', 'Magento\Theme\Block\Html\Pager'), + array('_assets', 'Magento\View\Asset\Collection', 'assets'), + array('_objectManager', 'Magento\View\Asset\GroupedCollection', 'objectManager'), + array('_groups', 'Magento\View\Asset\GroupedCollection', 'groups'), + array('_objectManager', 'Magento\View\Asset\MergeService', 'objectManager'), + array('_storeConfig', 'Magento\View\Asset\MergeService', 'config'), + array('_filesystem', 'Magento\View\Asset\MergeService', 'filesystem'), + array('_dirs', 'Magento\View\Asset\MergeService', 'dirs'), + array('_state', 'Magento\View\Asset\MergeService', 'state'), + array('_strategy', 'Magento\View\Asset\MergeStrategy\Checksum', 'strategy'), + array('_filesystem', 'Magento\View\Asset\MergeStrategy\Checksum', 'filesystem'), + array('_filesystem', 'Magento\View\Asset\MergeStrategy\Direct', 'filesystem'), + array('_dirs', 'Magento\View\Asset\MergeStrategy\Direct', 'dirs'), + array('_cssUrlResolver', 'Magento\View\Asset\MergeStrategy\Direct', 'cssUrlResolver'), + array('_strategy', 'Magento\View\Asset\MergeStrategy\FileExists', 'strategy'), + array('_filesystem', 'Magento\View\Asset\MergeStrategy\FileExists', 'filesystem'), + array('_objectManager', 'Magento\View\Asset\Merged', 'objectManager'), + array('_logger', 'Magento\View\Asset\Merged', 'logger'), + array('_mergeStrategy', 'Magento\View\Asset\Merged', 'mergeStrategy'), + array('_assets', 'Magento\View\Asset\Merged', 'assets'), + array('_contentType', 'Magento\View\Asset\Merged', 'contentType'), + array('_originalAsset', 'Magento\View\Asset\Minified', 'originalAsset'), + array('_minifier', 'Magento\View\Asset\Minified', 'minifier'), + array('_file', 'Magento\View\Asset\Minified', 'file'), + array('_url', 'Magento\View\Asset\Minified', 'url'), + array('_viewUrl', 'Magento\View\Asset\Minified', 'viewUrl'), + array('_logger', 'Magento\View\Asset\Minified', 'logger'), + array('_storeConfig', 'Magento\View\Asset\MinifyService', 'Ñonfig'), + array('_objectManager', 'Magento\View\Asset\MinifyService', 'objectManager'), + array('_enabled', 'Magento\View\Asset\MinifyService', 'enabled'), + array('_minifiers', 'Magento\View\Asset\MinifyService', 'minifiers'), + array('_dirs', 'Magento\View\Asset\MinifyService', 'dirs'), + array('_appState', 'Magento\View\Asset\MinifyService', 'appState'), + array('_properties', 'Magento\View\Asset\PropertyGroup', 'properties'), + array('_viewUrl', 'Magento\View\Asset\PublicFile', 'viewUrl'), + array('_file', 'Magento\View\Asset\PublicFile', 'file'), + array('_contentType', 'Magento\View\Asset\PublicFile', 'contentType'), + array('_url', 'Magento\View\Asset\Remote', 'url'), + array('_contentType', 'Magento\View\Asset\Remote', 'contentType'), + array('_viewUrl', 'Magento\View\Asset\ViewFile', 'viewUrl'), + array('_file', 'Magento\View\Asset\ViewFile', 'file'), + array('_contentType', 'Magento\View\Asset\ViewFile', 'contentType'), + array('_frameOpenTag', 'Magento\View\Element\AbstractBlock'), + array('_frameCloseTag', 'Magento\View\Element\AbstractBlock'), + array('_messagesBlock', 'Magento\View\Element\AbstractBlock'), ); diff --git a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php index 0f95fbd175f..a21ced3c604 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php +++ b/dev/tests/static/testsuite/Magento/Test/Php/LiveCodeTest.php @@ -70,7 +70,6 @@ class LiveCodeTest extends \PHPUnit_Framework_TestCase */ public function testCodeStylePsr2() { - $this->markTestSkipped('Skipped'); $reportFile = self::$_reportDir . '/phpcs_psr2_report.xml'; $wrapper = new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer\Wrapper(); $codeSniffer = new \Magento\TestFramework\CodingStandard\Tool\CodeSniffer( diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt index 9be1da2d862..cf159184bd8 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/blacklist/common.txt @@ -10,6 +10,7 @@ app/code/Magento/Backend/view app/code/Magento/Core/Model/Config/Element.php app/code/Magento/DesignEditor/view app/code/Magento/Email/view +app/code/Magento/Integration/view app/code/Magento/Theme/view app/code/Magento/User/view app/code/Magento/Webapi/view @@ -30,6 +31,7 @@ dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Option/MysqlStub dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Option/ValueTest.php dev/tests/unit/testsuite/Magento/Code/Plugin/GeneratorTest/SimpleObjectManager.php dev/tests/unit/testsuite/Magento/Core/Model/Resource/Db/AbstractTest.php +dev/tests/unit/testsuite/Magento/Core/Model/Session/ConfigTest.php dev/tests/unit/testsuite/Magento/View/TemplateEngine/_files dev/tools/Magento/Tools/I18n/Zend lib/Magento/Archive diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt index 639bd9da5ad..1aa0a61d96f 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcpd/blacklist/common.txt @@ -56,6 +56,7 @@ Magento/DesignEditor/Model/Url Magento/GiftMessage/Block/Adminhtml/Sales/Order Magento/ImportExport/Model Magento/Index/Model/Process +Magento/Integration/Controller/Adminhtml Magento/Install/Block/Db Magento/Newsletter/Block/Adminhtml/Template/Preview Magento/Newsletter/Block/Adminhtml/Queue/Preview @@ -84,6 +85,7 @@ Magento/Tax/Block/Checkout Magento/Tax/Model/Sales/Pdf Magento/Tax/Model/Config/Price Magento/Usa/Model/Shipping/Carrier +Magento/Webapi/Block/Adminhtml Magento/Webapi/Model Magento/Webhook/Model Magento/Widget/Model/Widget/Instance @@ -107,4 +109,6 @@ Magento/User/Block/User/Edit var/generation Magento/Newsletter/Block/Adminhtml/Template/Grid/Renderer Magento/Newsletter/Model/Template/Filter +Magento/Newsletter/Model/Resource/Subscriber +Magento/CatalogInventory/Model/Resource/Stock/Item diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/blacklist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/blacklist/common.txt index 5d24c7f740b..982fbfe77f2 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/blacklist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/phpcs/blacklist/common.txt @@ -29,8 +29,6 @@ dev/tools/layout # Not magento code dev/tools/xml # PSR-1 not applied to -dev/tests/functional-old -# PSR-1 not applied to dev/tests/js # Example files that are expected to fail code sniffer dev/tests/static/testsuite/Magento/Test/Php/Exemplar/CodeStyleTest/phpcs/input diff --git a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt index 556cf1b6365..2cade8fb437 100644 --- a/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt +++ b/dev/tests/static/testsuite/Magento/Test/Php/_files/whitelist/common.txt @@ -46,8 +46,6 @@ app/code/Magento/Core/Model/Layout/Update.php app/code/Magento/Core/Model/Layout/Argument app/code/Magento/Core/Model/Locale/Validator.php app/code/Magento/Core/Model/LocaleInterface.php -app/code/Magento/Core/Model/Page -app/code/Magento/Core/Model/Page.php app/code/Magento/Core/Model/Resource/Theme app/code/Magento/Core/Model/Resource/Theme.php app/code/Magento/Core/Model/Session/Validator.php @@ -98,10 +96,7 @@ app/code/Magento/Log/Model/Resource/Helper.php app/code/Magento/Log/Model/Resource/Shell.php app/code/Magento/Log/Model/Shell.php app/code/Magento/Log/Model/Shell -app/code/Magento/Page/Block/Html/Head -app/code/Magento/Page/Block/Link{,.php,s.php} -app/code/Magento/Page/Helper/Robots.php -app/code/Magento/Page/Model/Asset +app/code/Magento/Theme/Block/Html/Head app/code/Magento/PageCache/Model/CacheControlFactory.php app/code/Magento/ProductAlert/Block/Product/View app/code/Magento/Reports/Block/Adminhtml/Customer @@ -120,6 +115,7 @@ app/code/Magento/Sales/Block/Recurring/Profile/View app/code/Magento/Sales/Model/Order/Pdf/Config app/code/Magento/Sales/Model/Order/Pdf/Config.php app/code/Magento/Sales/Model/Order/Pdf/Total/Factory.php +app/code/Magento/Sales/Model/Observer app/code/Magento/SalesRule/Model/Plugin app/code/Magento/Theme app/code/Magento/Webapi diff --git a/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php b/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php index b0c480d47a7..6285a8f0176 100644 --- a/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php +++ b/dev/tests/unit/framework/Magento/Test/Block/Adminhtml.php @@ -42,6 +42,9 @@ class Adminhtml extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $_sessionMock; + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $_sidResolver; + /** @var \PHPUnit_Framework_MockObject_MockObject */ protected $_translatorMock; @@ -93,15 +96,19 @@ class Adminhtml extends \PHPUnit_Framework_TestCase /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Math\Random */ protected $_mathMock; + /** @var \PHPUnit_Framework_MockObject_MockObject|\Magento\Data\Form\FormKey */ + protected $_formKey; + protected function setUp() { // These mocks are accessed via context $this->_designMock = $this->_makeMock('Magento\View\DesignInterface'); $this->_sessionMock = $this->_makeMock('Magento\Core\Model\Session'); + $this->_sidResolver = $this->_makeMock('Magento\Core\Model\Session\SidResolver'); $this->_translatorMock = $this->_makeMock('Magento\Core\Model\Translate'); $this->_layoutMock = $this->_makeMock('Magento\Core\Model\Layout'); $this->_requestMock = $this->_makeMock('Magento\App\RequestInterface'); - $this->_messagesMock = $this->_makeMock('Magento\View\Block\Messages'); + $this->_messagesMock = $this->_makeMock('Magento\View\Element\Messages'); $this->_urlMock = $this->_makeMock('Magento\UrlInterface'); $this->_eventManagerMock = $this->_makeMock('Magento\Event\ManagerInterface'); $this->_controllerMock = $this->_makeMock('Magento\App\FrontController'); @@ -125,6 +132,7 @@ class Adminhtml extends \PHPUnit_Framework_TestCase $this->_localeMock = $this->_makeMock('Magento\Core\Model\LocaleInterface'); $appState = $this->_makeMock('Magento\App\State'); $this->_mathMock = $this->_makeMock('Magento\Math\Random'); + $this->_formKey = $this->_makeMock('Magento\Data\Form\FormKey'); $appState->setAreaCode(\Magento\Backend\App\Area\FrontNameResolver::AREA_CODE); @@ -142,6 +150,7 @@ class Adminhtml extends \PHPUnit_Framework_TestCase $this->_cacheMock, $this->_designMock, $this->_sessionMock, + $this->_sidResolver, $this->_storeConfigMock, $this->_controllerMock, $this->_helperFactoryMock, @@ -161,7 +170,8 @@ class Adminhtml extends \PHPUnit_Framework_TestCase $this->_storeManagerMock, $authorizationMock, $backendSessionMock, - $this->_mathMock + $this->_mathMock, + $this->_formKey ); } diff --git a/dev/tests/unit/framework/tests/unit/testsuite/Magento/TestFramework/Helper/ObjectManagerTest.php b/dev/tests/unit/framework/tests/unit/testsuite/Magento/TestFramework/Helper/ObjectManagerTest.php index cea8eeb8a3f..761170154c7 100644 --- a/dev/tests/unit/framework/tests/unit/testsuite/Magento/TestFramework/Helper/ObjectManagerTest.php +++ b/dev/tests/unit/framework/tests/unit/testsuite/Magento/TestFramework/Helper/ObjectManagerTest.php @@ -64,9 +64,9 @@ class ObjectManagerTest extends \PHPUnit_Framework_TestCase public function testGetBlock() { $objectManager = new \Magento\TestFramework\Helper\ObjectManager($this); - /** @var $template \Magento\View\Block\Template */ - $template = $objectManager->getObject('Magento\View\Block\Template'); - $this->assertInstanceOf('Magento\View\Block\Template', $template); + /** @var $template \Magento\View\Element\Template */ + $template = $objectManager->getObject('Magento\View\Element\Template'); + $this->assertInstanceOf('Magento\View\Element\Template', $template); foreach ($this->_blockDependencies as $propertyName => $propertyType) { $this->assertAttributeInstanceOf($propertyType, '_' . $propertyName, $template); } @@ -76,13 +76,13 @@ class ObjectManagerTest extends \PHPUnit_Framework_TestCase $appStateMock = $this->getMock('Magento\App\State', array('getAreaCode'), array(), '', false); $appStateMock->expects($this->once())->method('getAreaCode')->will($this->returnValue($area)); - $context = $objectManager->getObject('Magento\View\Block\Template\Context'); - $appStateProperty = new \ReflectionProperty('Magento\View\Block\Template\Context', '_appState'); + $context = $objectManager->getObject('Magento\View\Element\Template\Context'); + $appStateProperty = new \ReflectionProperty('Magento\View\Element\Template\Context', '_appState'); $appStateProperty->setAccessible(true); $appStateProperty->setValue($context, $appStateMock); - /** @var $template \Magento\View\Block\Template */ - $template = $objectManager->getObject('Magento\View\Block\Template', array('context' => $context)); + /** @var $template \Magento\View\Element\Template */ + $template = $objectManager->getObject('Magento\View\Element\Template', array('context' => $context)); $this->assertEquals($area, $template->getArea()); } diff --git a/dev/tests/unit/testsuite/Magento/Acl/Resource/ProviderTest.php b/dev/tests/unit/testsuite/Magento/Acl/Resource/ProviderTest.php index 99b0e80021e..6a41cde8c38 100644 --- a/dev/tests/unit/testsuite/Magento/Acl/Resource/ProviderTest.php +++ b/dev/tests/unit/testsuite/Magento/Acl/Resource/ProviderTest.php @@ -40,31 +40,22 @@ class ProviderTest extends \PHPUnit_Framework_TestCase */ protected $_treeBuilderMock; - /** - * @var \Magento\App\State|\PHPUnit_Framework_MockObject_MockObject - */ - protected $_appState; - protected function setUp() { $this->_configReaderMock = $this->getMock('Magento\Config\ReaderInterface'); - $this->_appState = $this->getMock('Magento\App\State', array('getAreaCode'), array(), '', false); $this->_treeBuilderMock = $this->getMock('Magento\Acl\Resource\TreeBuilder', array(), array(), '', false); $this->_model = new \Magento\Acl\Resource\Provider( $this->_configReaderMock, - $this->_treeBuilderMock, - $this->_appState + $this->_treeBuilderMock ); } public function testGetIfAclResourcesExist() { $aclResourceConfig['config']['acl']['resources'] = array('ExpectedValue'); - $scope = 'scopeName'; - $this->_appState->expects($this->once())->method('getAreaCode')->will($this->returnValue($scope)); $this->_configReaderMock->expects($this->once()) - ->method('read')->with($scope)->will($this->returnValue($aclResourceConfig)); + ->method('read')->will($this->returnValue($aclResourceConfig)); $this->_treeBuilderMock->expects($this->once()) ->method('build')->will($this->returnValue('ExpectedResult')); $this->assertEquals('ExpectedResult', $this->_model->getAclResources()); @@ -72,10 +63,8 @@ class ProviderTest extends \PHPUnit_Framework_TestCase public function testGetIfAclResourcesEmpty() { - $scope = 'scopeName'; - $this->_appState->expects($this->once())->method('getAreaCode')->will($this->returnValue($scope)); $this->_configReaderMock->expects($this->once()) - ->method('read')->with($scope)->will($this->returnValue(array())); + ->method('read')->will($this->returnValue(array())); $this->_treeBuilderMock->expects($this->never())->method('build'); $this->assertEquals(array(), $this->_model->getAclResources()); } diff --git a/dev/tests/unit/testsuite/Magento/Authz/Model/UserIdentifierTest.php b/dev/tests/unit/testsuite/Magento/Authz/Model/UserIdentifierTest.php new file mode 100644 index 00000000000..e5becdc1633 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Authz/Model/UserIdentifierTest.php @@ -0,0 +1,93 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Authz\Model; + +use Magento\Authz\Model\UserIdentifier; + +/** + * Tests for User identifier. + */ +class UserIdentifierTest extends \PHPUnit_Framework_TestCase +{ + /** @var \PHPUnit_Framework_MockObject_MockObject */ + protected $_userLocatorMock; + + protected function setUp() + { + parent::setUp(); + $this->_userLocatorMock = $this->getMock( + 'Magento\Authz\Model\UserLocatorInterface', + array('getUserId', 'getUserType') + ); + } + + /** + * @param string $userType + * @param int $userId + * @dataProvider constructProvider + */ + public function testConstruct($userType, $userId) + { + $context = new UserIdentifier($this->_userLocatorMock, $userType, $userId); + $this->assertEquals($userId, $context->getUserId()); + $this->assertEquals($userType, $context->getUserType()); + } + + /** + * @param string $userType + * @param int $userId + * @param string $exceptionMessage + * @dataProvider constructProviderInvalidData + */ + public function testConstructInvalidData($userType, $userId, $exceptionMessage) + { + $this->setExpectedException('\LogicException', $exceptionMessage); + new UserIdentifier($this->_userLocatorMock, $userType, $userId); + } + + public function constructProvider() + { + return array( + array(UserIdentifier::USER_TYPE_GUEST, 0), + array(UserIdentifier::USER_TYPE_CUSTOMER, 1), + array(UserIdentifier::USER_TYPE_ADMIN, 2), + array(UserIdentifier::USER_TYPE_INTEGRATION, 3), + ); + } + + public function constructProviderInvalidData() + { + return array( + array( + 'InvalidUserType', + 1, + 'Invalid user type: \'InvalidUserType\'. Allowed types: Guest, Customer, Admin, Integration' + ), + array(UserIdentifier::USER_TYPE_CUSTOMER, -1, 'Invalid user ID: \'-1\''), + array(UserIdentifier::USER_TYPE_ADMIN, 'InvalidUserId', 'Invalid user ID: \'InvalidUserId\''), + array(UserIdentifier::USER_TYPE_GUEST, 3, 'Guest user must not have user ID set.'), + ); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Backend/Block/Page/System/Config/Robots/ResetTest.php b/dev/tests/unit/testsuite/Magento/Backend/Block/Page/System/Config/Robots/ResetTest.php index 896de7ab771..bede5ea701d 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Block/Page/System/Config/Robots/ResetTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Block/Page/System/Config/Robots/ResetTest.php @@ -38,39 +38,21 @@ class ResetTest extends \PHPUnit_Framework_TestCase private $_resetRobotsBlock; /** - * @var \Magento\Page\Helper\Robots|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\Core\Model\ConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ - private $_mockRobotsHelper; + protected $coreConfigMock; protected function setUp() { - $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - - $this->_mockRobotsHelper = $this->getMock('Magento\Page\Helper\Robots', - array('getRobotsDefaultCustomInstructions'), array(), '', false, false + $this->coreConfigMock = $this->getMock( + 'Magento\Core\Model\Config', array('getValue'), array(), '', false ); - $this->_resetRobotsBlock = $objectManagerHelper->getObject( - 'Magento\Backend\Block\Page\System\Config\Robots\Reset', - array( - 'pageRobots' => $this->_mockRobotsHelper, - 'coreData' => $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false), - 'application' => $this->getMock('Magento\Core\Model\App', array(), array(), '', false), - ) + $this->_resetRobotsBlock = new Reset( + $this->getMock('Magento\Backend\Block\Template\Context', array(), array(), '', false), + $this->coreConfigMock, + array() ); - - $coreRegisterMock = $this->getMock('Magento\Core\Model\Registry'); - $coreRegisterMock->expects($this->any()) - ->method('registry') - ->with('_helper/\Magento\Page\Helper\Robots') - ->will($this->returnValue($this->_mockRobotsHelper)); - - $objectManagerMock = $this->getMockBuilder('Magento\ObjectManager')->getMock(); - $objectManagerMock->expects($this->any()) - ->method('get') - ->with('Magento\Core\Model\Registry') - ->will($this->returnValue($coreRegisterMock)); - \Magento\App\ObjectManager::setInstance($objectManagerMock); } /** @@ -79,8 +61,8 @@ class ResetTest extends \PHPUnit_Framework_TestCase public function testGetRobotsDefaultCustomInstructions() { $expectedInstructions = 'User-agent: *'; - $this->_mockRobotsHelper->expects($this->once()) - ->method('getRobotsDefaultCustomInstructions') + $this->coreConfigMock->expects($this->once()) + ->method('getValue') ->will($this->returnValue($expectedInstructions)); $this->assertEquals($expectedInstructions, $this->_resetRobotsBlock->getRobotsDefaultCustomInstructions()); } diff --git a/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/ColumnTest.php b/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/ColumnTest.php index 5bbe040e9b4..97c2501e380 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/ColumnTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Block/Widget/Grid/ColumnTest.php @@ -50,7 +50,7 @@ class ColumnTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_layoutMock = $this->getMock('Magento\Core\Model\Layout', array(), array(), '', false, false); - $this->_blockMock = $this->getMock('Magento\View\Block\Template', array('setColumn', 'getHtml'), array(), '', + $this->_blockMock = $this->getMock('Magento\View\Element\Template', array('setColumn', 'getHtml'), array(), '', false, false ); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php index 5415075f031..03132e99598 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Controller/Adminhtml/CacheTest.php @@ -33,7 +33,13 @@ class CacheTest extends \PHPUnit_Framework_TestCase $objectManager = $this->getMock('Magento\ObjectManager'); $eventManager = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); $backendHelper = $this->getMock('Magento\Backend\Helper\Data', array(), array(), '', false); - $session = $this->getMock('Magento\Adminhtml\Model\Session', array('addSuccess'), array(), '', false); + $session = $this->getMock( + 'Magento\Core\Model\Session\AbstractSession', + array('addSuccess'), + array(), + '', + false + ); $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $controller = $helper->getObject('Magento\Backend\Controller\Adminhtml\Cache', array( 'objectManager' => $objectManager, @@ -44,7 +50,7 @@ class CacheTest extends \PHPUnit_Framework_TestCase ); // Setup expectations - $mergeService = $this->getMock('Magento\Core\Model\Page\Asset\MergeService', array(), array(), '', false); + $mergeService = $this->getMock('Magento\View\Asset\MergeService', array(), array(), '', false); $mergeService->expects($this->once()) ->method('cleanMergedJsCss'); @@ -53,8 +59,8 @@ class CacheTest extends \PHPUnit_Framework_TestCase ->with('The JavaScript/CSS cache has been cleaned.'); $valueMap = array( - array('Magento\Core\Model\Page\Asset\MergeService', $mergeService), - array('Magento\Adminhtml\Model\Session', $session), + array('Magento\View\Asset\MergeService', $mergeService), + array('Magento\Core\Model\Session\AbstractSession', $session), ); $objectManager->expects($this->any()) ->method('get') diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php index 025f350bb0e..986d59e9ec4 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/BaseurlTest.php @@ -45,7 +45,7 @@ class BaseurlTest extends \PHPUnit_Framework_TestCase ->method('addCommitCallback') ->will($this->returnValue($resource)); $resourceCollection = $this->getMock('Magento\Data\Collection\Db', array(), array(), '', false); - $mergeService = $this->getMock('Magento\Core\Model\Page\Asset\MergeService', array(), array(), '', false); + $mergeService = $this->getMock('Magento\View\Asset\MergeService', array(), array(), '', false); $coreRegistry = $this->getMock('Magento\Core\Model\Registry', array(), array(), '', false); $coreConfig = $this->getMock('Magento\Core\Model\Config', array(), array(), '', false); $storeManager = $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php index 15bebde7390..dcf20e70319 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/Config/Backend/SecureTest.php @@ -45,7 +45,7 @@ class SecureTest extends \PHPUnit_Framework_TestCase ->method('addCommitCallback') ->will($this->returnValue($resource)); $resourceCollection = $this->getMock('Magento\Data\Collection\Db', array(), array(), '', false); - $mergeService = $this->getMock('Magento\Core\Model\Page\Asset\MergeService', array(), array(), '', false); + $mergeService = $this->getMock('Magento\View\Asset\MergeService', array(), array(), '', false); $coreRegistry = $this->getMock('Magento\Core\Model\Registry', array(), array(), '', false); $coreConfig = $this->getMock('Magento\Core\Model\Config', array(), array(), '', false); $storeManager = $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/CookieTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/CookieTest.php deleted file mode 100644 index e6df4f5b43c..00000000000 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/CookieTest.php +++ /dev/null @@ -1,44 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @category Magento - * @package Magento_Backend - * @subpackage unit_tests - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ - -namespace Magento\Backend\Model; - -class CookieTest extends \PHPUnit_Framework_TestCase -{ - public function testIsSecure() - { - $request = $this->getMock('Magento\App\Request\Http', array('isSecure'), array(), '', false); - $request->expects($this->once())->method('isSecure')->will($this->returnValue('some value')); - - $response = $this->getMockForAbstractClass('Magento\App\ResponseInterface'); - $coreStoreConfig = $this->getMock('Magento\Core\Model\Store\Config', null, array(), '', false); - $storeManager = $this->getMockForAbstractClass('Magento\Core\Model\StoreManagerInterface'); - - $model = new Cookie($request, $response, $coreStoreConfig, $storeManager); - $this->assertEquals('some value', $model->isSecure()); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php b/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php index e79ef9f95b1..30dbf2ed417 100644 --- a/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php +++ b/dev/tests/unit/testsuite/Magento/Backend/Model/UrlTest.php @@ -48,7 +48,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_coreSessionMock; + protected $_formKey; /** * @var \PHPUnit_Framework_MockObject_MockObject @@ -92,10 +92,10 @@ class UrlTest extends \PHPUnit_Framework_TestCase $this->_menuConfigMock = $this->getMock('Magento\Backend\Model\Menu\Config', array(), array(), '', false); $this->_menuConfigMock->expects($this->any())->method('getMenu')->will($this->returnValue($this->_menuMock)); - $this->_coreSessionMock = $this->getMock( - 'Magento\Core\Model\Session', array('getFormKey'), array(), '', false + $this->_formKey = $this->getMock( + 'Magento\Data\Form\FormKey', array('getFormKey'), array(), '', false ); - $this->_coreSessionMock->expects($this->any())->method('getFormKey')->will($this->returnValue('salt')); + $this->_formKey->expects($this->any())->method('getFormKey')->will($this->returnValue('salt')); $mockItem = $this->getMock('Magento\Backend\Model\Menu\Item', array(), array(), '', false); $mockItem->expects($this->any())->method('isDisabled')->will($this->returnValue(false)); @@ -129,7 +129,7 @@ class UrlTest extends \PHPUnit_Framework_TestCase $this->_model = $helper->getObject('Magento\Backend\Model\Url', array( 'coreStoreConfig' => $this->_storeConfigMock, 'backendHelper' => $helperMock, - 'session' => $this->_coreSessionMock, + 'formKey' => $this->_formKey, 'menuConfig' => $this->_menuConfigMock, 'coreData' => $this->_coreDataMock, 'authSession' => $this->_authSessionMock, diff --git a/dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/BundleTest.php b/dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/BundleTest.php index 186c62e085f..2a48d47630a 100644 --- a/dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/BundleTest.php +++ b/dev/tests/unit/testsuite/Magento/Bundle/Block/Catalog/Product/View/Type/BundleTest.php @@ -44,7 +44,7 @@ class BundleTest extends \PHPUnit_Framework_TestCase public function testGetOptionHtmlNoRenderer() { - $option = $this->getMock('\Magento\Bundle\Model\Option', ['getType'], [], '', false); + $option = $this->getMock('\Magento\Bundle\Model\Option', ['getType', '__wakeup'], [], '', false); $option->expects($this->exactly(2))->method('getType')->will($this->returnValue('checkbox')); $this->assertEquals( @@ -55,7 +55,7 @@ class BundleTest extends \PHPUnit_Framework_TestCase public function testGetOptionHtml() { - $option = $this->getMock('\Magento\Bundle\Model\Option', ['getType'], [], '', false); + $option = $this->getMock('\Magento\Bundle\Model\Option', ['getType', '__wakeup'], [], '', false); $option->expects($this->exactly(1))->method('getType')->will($this->returnValue('checkbox')); $optionBlock = $this->getMock( diff --git a/dev/tests/unit/testsuite/Magento/Captcha/Helper/DataTest.php b/dev/tests/unit/testsuite/Magento/Captcha/Helper/DataTest.php index 9b2ffd345e8..edc6baad51a 100644 --- a/dev/tests/unit/testsuite/Magento/Captcha/Helper/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Captcha/Helper/DataTest.php @@ -194,8 +194,10 @@ class DataTest extends \PHPUnit_Framework_TestCase { $website = $this->getMock( 'Magento\Core\Model\Website', - array('getCode'), - array(), '', false + array('getCode', '__wakeup'), + array(), + '', + false ); $website->expects($this->any()) diff --git a/dev/tests/unit/testsuite/Magento/Captcha/Model/DefaultTest.php b/dev/tests/unit/testsuite/Magento/Captcha/Model/DefaultTest.php index 8806fdca255..990d86615e9 100644 --- a/dev/tests/unit/testsuite/Magento/Captcha/Model/DefaultTest.php +++ b/dev/tests/unit/testsuite/Magento/Captcha/Model/DefaultTest.php @@ -310,8 +310,10 @@ class DefaultTest extends \PHPUnit_Framework_TestCase { $resourceModel = $this->getMock( 'Magento\Captcha\Model\Resource\Log', - array('countAttemptsByRemoteAddress', 'countAttemptsByUserLogin', 'logAttempt'), - array(), '', false + array('countAttemptsByRemoteAddress', 'countAttemptsByUserLogin', 'logAttempt', '__wakeup'), + array(), + '', + false ); $resourceModel->expects($this->any()) diff --git a/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php index a1177ceb625..990fe9ee274 100644 --- a/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Captcha/Model/ObserverTest.php @@ -209,8 +209,13 @@ class ObserverTest extends \PHPUnit_Framework_TestCase */ protected function _getResourceModelStub() { - $resourceModel = $this->getMock('Magento\Captcha\Model\Resource\Log', - array('deleteUserAttempts', 'deleteOldAttempts'), array(), '', false); + $resourceModel = $this->getMock( + 'Magento\Captcha\Model\Resource\Log', + array('deleteUserAttempts', 'deleteOldAttempts', '__wakeup'), + array(), + '', + false + ); return $resourceModel; } diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/OptionsTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/OptionsTest.php index ed604d4582c..843fe1c2a02 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/OptionsTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Composite/Fieldset/OptionsTest.php @@ -60,7 +60,7 @@ class OptionsTest extends \PHPUnit_Framework_TestCase { $layout = $this->getMock('Magento\Core\Model\Layout', array('getChildName', 'getBlock', 'renderElement'), array(), '', false); - $context = $this->_objectHelper->getObject('Magento\View\Block\Template\Context', array( + $context = $this->_objectHelper->getObject('Magento\View\Element\Template\Context', array( 'layout' => $layout )); $optionFactoryMock = $this->getMock('Magento\Catalog\Model\Product\Option\ValueFactory', array('create'), diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/WeightTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/WeightTest.php index 3ca7789496c..3c18354156c 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/WeightTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Adminhtml/Product/Helper/Form/WeightTest.php @@ -49,9 +49,9 @@ class WeightTest extends \PHPUnit_Framework_TestCase $collectionFactory = $this->getMock('Magento\Data\Form\Element\CollectionFactory', array('create'), array(), '', false); - $session = $this->getMock('\Magento\Core\Model\Session', array(), array(), '', false); + $formKey = $this->getMock('Magento\Data\Form\FormKey', array(), array(), '', false); - $form = new \Magento\Data\Form($session, $factory, $collectionFactory); + $form = new \Magento\Data\Form($factory, $collectionFactory, $formKey); $helper = $this->getMock('Magento\Catalog\Helper\Product', array('getTypeSwitcherControlLabel'), array(), '', false, false diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php index 8aa067b73ec..525d7a7c904 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/View/OptionsTest.php @@ -59,7 +59,7 @@ class OptionsTest extends \PHPUnit_Framework_TestCase { $layout = $this->getMock('Magento\Core\Model\Layout', array('getChildName', 'getBlock', 'renderElement'), array(), '', false); - $context = $this->_objectHelper->getObject('Magento\View\Block\Template\Context', array( + $context = $this->_objectHelper->getObject('Magento\View\Element\Template\Context', array( 'layout' => $layout )); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/View/TabsTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/View/TabsTest.php index 3b4d6ed2965..6d8af78cc4b 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/View/TabsTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Block/Product/View/TabsTest.php @@ -28,7 +28,7 @@ class TabsTest extends \PHPUnit_Framework_TestCase { public function testAddTab() { - $tabBlock = $this->getMock('Magento\View\Block\Template', array(), array(), '', false); + $tabBlock = $this->getMock('Magento\View\Element\Template', array(), array(), '', false); $tabBlock->expects($this->once()) ->method('setTemplate') ->with('template') diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Helper/UrlTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Helper/UrlTest.php index 1f78d584d29..f7a16776351 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Helper/UrlTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Helper/UrlTest.php @@ -41,7 +41,11 @@ class UrlTest extends \PHPUnit_Framework_TestCase $this->_configMock = $this->getMockBuilder('Magento\Core\Model\Config') ->disableOriginalConstructor()->getMock(); $storeManager = $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false); - $this->_urlHelper = new \Magento\Catalog\Helper\Product\Url($contextMock, $this->_configMock, $storeManager); + $this->_urlHelper = new \Magento\Catalog\Helper\Product\Url( + $contextMock, + $storeManager, + $this->_configMock + ); } /** diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Backend/SortbyTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Backend/SortbyTest.php index 183a5d506c9..d0a1fba4ce7 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Backend/SortbyTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Category/Attribute/Backend/SortbyTest.php @@ -47,8 +47,14 @@ class SortbyTest extends \PHPUnit_Framework_TestCase 'coreStoreConfig' => $coreStoreConfig ) ); - $attribute = $this->getMockForAbstractClass('Magento\Eav\Model\Entity\Attribute\AbstractAttribute', - array(), '', false, true, true, array('getName') + $attribute = $this->getMockForAbstractClass( + 'Magento\Eav\Model\Entity\Attribute\AbstractAttribute', + array(), + '', + false, + true, + true, + array('getName', '__wakeup') ); $attribute->expects($this->any()) ->method('getName') diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Observer/ReindexTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Observer/ReindexTest.php index dbb928312e0..88479d8113e 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Observer/ReindexTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Observer/ReindexTest.php @@ -45,7 +45,7 @@ class ReindexTest extends \PHPUnit_Framework_TestCase $fulltextReindex = $this->getMock( 'Magento\CatalogSearch\Model\Resource\Fulltext', - array('rebuildIndex'), + array('rebuildIndex', '__wakeup'), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Plugin/QuoteItemProductOptionTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Plugin/QuoteItemProductOptionTest.php index 370ee143cf2..c5311a6b6a9 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Plugin/QuoteItemProductOptionTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Plugin/QuoteItemProductOptionTest.php @@ -64,7 +64,13 @@ class QuoteItemProductOptionTest extends \PHPUnit_Framework_TestCase $this->_invocationChainMock->expects($this->once())->method('proceed') ->will($this->returnValue($this->_orderItemMock)); - $itemOption = $this->getMock('Magento\Sales\Model\Quote\Item\Option', array('getCode'), array(), '', false); + $itemOption = $this->getMock( + 'Magento\Sales\Model\Quote\Item\Option', + array('getCode', '__wakeup'), + array(), + '', + false + ); $this->_quoteItemMock->expects($this->exactly(2))->method('getOptions') ->will($this->returnValue(array($itemOption, $itemOption))); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractTest.php index 38a1e588417..5b5af716814 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/Groupprice/AbstractTest.php @@ -82,7 +82,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $attribute = $this->getMock( 'Magento\Eav\Model\Entity\Attribute\AbstractAttribute', - array('getBackendTable', 'isStatic', 'getAttributeId', 'getName'), + array('getBackendTable', 'isStatic', 'getAttributeId', 'getName', '__wakeup'), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php index 2774cee7ce0..4f50e4b899f 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/MediaTest.php @@ -46,8 +46,13 @@ class MediaTest extends \PHPUnit_Framework_TestCase $fileStorageDb = $this->getMock('Magento\Core\Helper\File\Storage\Database', array(), array(), '', false); $coreData = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); - $resource = $this->getMock('Magento\Catalog\Model\Resource\Product\Attribute\Backend\Media', - array('getMainTable'), array(), '', false); + $resource = $this->getMock( + 'Magento\Catalog\Model\Resource\Product\Attribute\Backend\Media', + array('getMainTable', '__wakeup'), + array(), + '', + false + ); $resource->expects($this->any()) ->method('getMainTable') ->will($this->returnValue('table')); @@ -73,7 +78,7 @@ class MediaTest extends \PHPUnit_Framework_TestCase $attribute = $this->getMock( 'Magento\Eav\Model\Entity\Attribute\AbstractAttribute', - array('getBackendTable', 'isStatic', 'getAttributeId', 'getName'), + array('getBackendTable', 'isStatic', 'getAttributeId', 'getName', '__wakeup'), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/StockTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/StockTest.php index 50d8bdd0a52..175e8ea10b2 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/StockTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Attribute/Backend/StockTest.php @@ -49,8 +49,13 @@ class StockTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_objectHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_inventory = $this->getMock('Magento\CatalogInventory\Model\Stock\Item', - array('getIsInStock', 'getQty', 'loadByProduct'), array(), '', false); + $this->_inventory = $this->getMock( + 'Magento\CatalogInventory\Model\Stock\Item', + array('getIsInStock', 'getQty', 'loadByProduct', '__wakeup'), + array(), + '', + false + ); $stockItemFactory = $this->getMock('Magento\CatalogInventory\Model\Stock\ItemFactory', array('create'), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Indexer/FlatTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Indexer/FlatTest.php index 7ac0602a052..a9449ee8244 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Indexer/FlatTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Product/Indexer/FlatTest.php @@ -50,8 +50,12 @@ class FlatTest extends \PHPUnit_Framework_TestCase $this->_model = $objectManagerHelper->getObject('Magento\Catalog\Model\Product\Indexer\Flat', array( 'flatIndexerFactory' => $indexerFactoryMock, )); - $this->_event = $this->getMock('Magento\Index\Model\Event', - array('getFlatHelper', 'getEntity', 'getType', 'getDataObject'), array(), '', false + $this->_event = $this->getMock( + 'Magento\Index\Model\Event', + array('getFlatHelper', 'getEntity', 'getType', 'getDataObject', '__wakeup'), + array(), + '', + false ); } @@ -100,7 +104,7 @@ class FlatTest extends \PHPUnit_Framework_TestCase if ($attributeValue) { $attributeValue = $this->getMockBuilder('Magento\Catalog\Model\Resource\Eav\Attribute') ->disableOriginalConstructor() - ->setMethods(array('getData', 'getOrigData')) + ->setMethods(array('getData', 'getOrigData', '__wakeup')) ->getMock(); } $this->_event->expects($this->any()) diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php index 138452d2b37..2e3ec39ad81 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/AbstractTest.php @@ -44,7 +44,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase foreach ($codes as $code) { $mock = $this->getMock( 'Magento\Eav\Model\Entity\Attribute\AbstractAttribute', - array('isInSet', 'getBackend'), + array('isInSet', 'getBackend', '__wakeup'), array(), '', false @@ -68,7 +68,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $code = 'test_attr'; $set = 10; - $object = $this->getMock('Magento\Catalog\Model\Product', null, array(), '', false); + $object = $this->getMock('Magento\Catalog\Model\Product', array('__wakeup'), array(), '', false); $object->setData(array( 'test_attr' => 'test_attr', @@ -84,7 +84,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $attribute = $this->getMock( 'Magento\Eav\Model\Entity\Attribute\AbstractAttribute', - array('isInSet', 'getBackend'), + array('isInSet', 'getBackend', '__wakeup'), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Category/FlatTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Category/FlatTest.php index d719604cd7a..6ccf1fb9566 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Category/FlatTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Category/FlatTest.php @@ -46,7 +46,7 @@ class FlatTest extends \PHPUnit_Framework_TestCase protected function _getModelMock(array $methods = array()) { return $this->getMockBuilder('Magento\Catalog\Model\Resource\Category\Flat') - ->setMethods($methods) + ->setMethods(array_merge($methods, array('__wakeup'))) ->disableOriginalConstructor() ->getMock(); } @@ -65,7 +65,7 @@ class FlatTest extends \PHPUnit_Framework_TestCase public function testCreateTableInvokesDdlOperationsIfTheyAreAllowed() { - $model = $model = $this->_getModelMock(array('_createTable', '_getWriteAdapter')); + $model = $this->_getModelMock(array('_createTable', '_getWriteAdapter')); // Pretend that no transactions have been started $this->_dbAdapterMock->expects($this->any())->method('getTransactionLevel')->will($this->returnValue(0)); diff --git a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProductUpdaterTest.php b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProductUpdaterTest.php index 0719019c215..ba599224c78 100644 --- a/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProductUpdaterTest.php +++ b/dev/tests/unit/testsuite/Magento/Catalog/Model/Resource/Product/Collection/AssociatedProductUpdaterTest.php @@ -43,7 +43,7 @@ class AssociatedProductUpdaterTest extends \PHPUnit_Framework_TestCase ->getMock(); $stockItem = $this->getMockBuilder('Magento\CatalogInventory\Model\Resource\Stock\Item') ->disableOriginalConstructor() - ->setMethods(array('addCatalogInventoryToProductCollection')) + ->setMethods(array('addCatalogInventoryToProductCollection', '__wakeup')) ->getMock(); $stockItem->expects($this->any()) ->method('addCatalogInventoryToProductCollection') diff --git a/dev/tests/unit/testsuite/Magento/CatalogInventory/Model/Adminhtml/Stock/ItemTest.php b/dev/tests/unit/testsuite/Magento/CatalogInventory/Model/Adminhtml/Stock/ItemTest.php index 251662537eb..21056c57cfe 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogInventory/Model/Adminhtml/Stock/ItemTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogInventory/Model/Adminhtml/Stock/ItemTest.php @@ -43,11 +43,11 @@ class ItemTest extends \PHPUnit_Framework_TestCase ); $this->_model = new \Magento\CatalogInventory\Model\Adminhtml\Stock\Item( + $this->getMock('Magento\Core\Model\Context', array(), array(), '', false), + $this->getMock('Magento\Core\Model\Registry', array(), array(), '', false), $this->getMock('Magento\Customer\Model\Session', array(), array(), '', false), $this->getMock('Magento\Index\Model\Indexer', array(), array(), '', false), $this->getMock('Magento\CatalogInventory\Model\Stock\Status', array(), array(), '', false), - $this->getMock('Magento\Core\Model\Context', array(), array(), '', false), - $this->getMock('Magento\Core\Model\Registry', array(), array(), '', false), $this->getMock('Magento\CatalogInventory\Helper\Data', array(), array(), '', false), $this->getMock('Magento\CatalogInventory\Helper\Minsaleqty', array(), array(), '', false), $this->getMock('Magento\Core\Model\Store\Config', array(), array(), '', false), diff --git a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/EngineProviderTest.php b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/EngineProviderTest.php index a9ddb3f98f9..9d01180886f 100644 --- a/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/EngineProviderTest.php +++ b/dev/tests/unit/testsuite/Magento/CatalogSearch/Model/Resource/EngineProviderTest.php @@ -57,8 +57,13 @@ class EngineProviderTest extends \PHPUnit_Framework_TestCase public function testGetPositive() { - $engineMock = $this->getMock('Magento\CatalogSearch\Model\Resource\Fulltext\Engine', - array('test'), array(), '', false); + $engineMock = $this->getMock( + 'Magento\CatalogSearch\Model\Resource\Fulltext\Engine', + array('test', '__wakeup'), + array(), + '', + false + ); $engineMock->expects($this->once()) ->method('test') ->will($this->returnValue(true)); @@ -78,8 +83,8 @@ class EngineProviderTest extends \PHPUnit_Framework_TestCase public function testGetNegative() { - $engineMock = $this->getMock('Magento\CatalogSearch\Model\Resource\Fulltext\Engine', - array('test'), array(), '', false); + $engineMock = $this->getMock( + 'Magento\CatalogSearch\Model\Resource\Fulltext\Engine', array('test', '__wakeup'), array(), '', false); $engineMock->expects($this->never()) ->method('test'); diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/AbstractTest.php index 681b7689ef9..378fd069b1c 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/AbstractTest.php @@ -35,7 +35,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase public function testGetItemRenderer() { - $renderer = $this->getMock('Magento\View\Block\AbstractBlock', array('setRenderedBlock'), array(), '', false); + $renderer = $this->getMock('Magento\View\Element\AbstractBlock', array('setRenderedBlock'), array(), '', false); $layout = $this->getMock('Magento\Core\Model\Layout', array( 'getChildName', 'getBlock' ), array(), '', false); @@ -93,7 +93,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase public function testPrepareLayout() { - $childBlock = $this->getMock('Magento\View\Block\AbstractBlock', array(), array(), '', false); + $childBlock = $this->getMock('Magento\View\Element\AbstractBlock', array(), array(), '', false); /** @var $layout \Magento\View\LayoutInterface */ $layout = $this->getMock('Magento\Core\Model\Layout', array( 'createBlock', 'getChildName', 'setChild' diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/Item/RendererTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/Item/RendererTest.php index 53e585155f2..b301c6abed8 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/Item/RendererTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/Item/RendererTest.php @@ -39,11 +39,21 @@ class RendererTest extends \PHPUnit_Framework_TestCase $configManager = $this->getMock('Magento\View\ConfigInterface', array(), array(), '', false); $configManager->expects($this->any())->method('getViewConfig')->will($this->returnValue($configView)); - $product = $this->getMock('Magento\Catalog\Model\Product', array('isConfigurable'), array(), '', false); + $product = $this->getMock( + 'Magento\Catalog\Model\Product', + array('isConfigurable', '__wakeup'), + array(), + '', + false + ); $product->expects($this->any())->method('isConfigurable')->will($this->returnValue(true)); $childProduct = $this->getMock( - 'Magento\Catalog\Model\Product', array('getThumbnail', 'getDataByKey'), array(), '', false + 'Magento\Catalog\Model\Product', + array('getThumbnail', 'getDataByKey', '__wakeup'), + array(), + '', + false ); $childProduct->expects($this->any())->method('getThumbnail')->will($this->returnValue('/_/_/__green.gif')); diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/LinkTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/LinkTest.php index 5897ff1bbce..8f5aa3a9adb 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/LinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/LinkTest.php @@ -48,7 +48,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase ->getMock(); $context = $this->_objectManagerHelper->getObject( - 'Magento\View\Block\Template\Context', + 'Magento\View\Element\Template\Context', array('urlBuilder' => $urlBuilder) ); $link = $this->_objectManagerHelper->getObject( @@ -76,9 +76,9 @@ class LinkTest extends \PHPUnit_Framework_TestCase ->getMock(); $helperFactory->expects($this->any())->method('get')->will($this->returnValue($helper)); - /** @var \Magento\View\Block\Template\Context $context */ + /** @var \Magento\View\Element\Template\Context $context */ $context = $this->_objectManagerHelper->getObject( - 'Magento\View\Block\Template\Context', + 'Magento\View\Element\Template\Context', array( 'helperFactory' => $helperFactory ) @@ -114,9 +114,9 @@ class LinkTest extends \PHPUnit_Framework_TestCase ->getMock(); $helperFactory->expects($this->any())->method('get')->will($this->returnValue($helper)); - /** @var \Magento\View\Block\Template\Context $context */ + /** @var \Magento\View\Element\Template\Context $context */ $context = $this->_objectManagerHelper->getObject( - 'Magento\View\Block\Template\Context', + 'Magento\View\Element\Template\Context', array( 'helperFactory' => $helperFactory ) diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php index 40e41cefafa..4ab46c3e4ea 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/Cart/SidebarTest.php @@ -35,7 +35,7 @@ class SidebarTest extends \PHPUnit_Framework_TestCase public function testDeserializeRenders() { - $childBlock = $this->getMock('Magento\View\Block\AbstractBlock', array(), array(), '', false); + $childBlock = $this->getMock('Magento\View\Element\AbstractBlock', array(), array(), '', false); /** @var $layout \Magento\View\LayoutInterface */ $layout = $this->getMock('Magento\Core\Model\Layout', array( 'createBlock', 'getChildName', 'setChild' diff --git a/dev/tests/unit/testsuite/Magento/Checkout/Block/LinkTest.php b/dev/tests/unit/testsuite/Magento/Checkout/Block/LinkTest.php index 539b18ed1de..04e521b5b44 100644 --- a/dev/tests/unit/testsuite/Magento/Checkout/Block/LinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Checkout/Block/LinkTest.php @@ -44,7 +44,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase $urlBuilder->expects($this->once())->method('getUrl')->with($path)->will($this->returnValue($url . $path)); $context = $this->_objectManagerHelper->getObject( - 'Magento\View\Block\Template\Context', + 'Magento\View\Element\Template\Context', array('urlBuilder' => $urlBuilder) ); $link = $this->_objectManagerHelper->getObject( @@ -77,9 +77,9 @@ class LinkTest extends \PHPUnit_Framework_TestCase ->setMethods(array('isOutputEnabled')) ->getMock(); - /** @var \Magento\View\Block\Template\Context $context */ + /** @var \Magento\View\Element\Template\Context $context */ $context = $this->_objectManagerHelper->getObject( - 'Magento\View\Block\Template\Context', + 'Magento\View\Element\Template\Context', array('helperFactory' => $helperFactory) ); diff --git a/dev/tests/unit/testsuite/Magento/Cms/Model/Page/UrlrewriteTest.php b/dev/tests/unit/testsuite/Magento/Cms/Model/Page/UrlrewriteTest.php index 009fe75c042..c810348fb4f 100644 --- a/dev/tests/unit/testsuite/Magento/Cms/Model/Page/UrlrewriteTest.php +++ b/dev/tests/unit/testsuite/Magento/Cms/Model/Page/UrlrewriteTest.php @@ -48,7 +48,7 @@ class UrlrewriteTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_model = $this->getMockBuilder('Magento\Cms\Model\Page\Urlrewrite') - ->setMethods(array('getResourceModelInstance')) + ->setMethods(array('getResourceModelInstance', '__wakeup')) ->disableOriginalConstructor() ->getMock(); $this->_cmsPage = new \Magento\Object(array( diff --git a/dev/tests/unit/testsuite/Magento/Code/Reader/ArgumentsReaderTest.php b/dev/tests/unit/testsuite/Magento/Code/Reader/ArgumentsReaderTest.php index b34b28d1d74..dff309a0fd0 100644 --- a/dev/tests/unit/testsuite/Magento/Code/Reader/ArgumentsReaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Code/Reader/ArgumentsReaderTest.php @@ -68,7 +68,7 @@ class ArgumentsReaderTest extends \PHPUnit_Framework_TestCase 'position' => 3, 'type' => null, 'isOptional' => true, - 'default' => '\ClassWithAllArgumentTypes::DEFAULT_VALUE' + 'default' => "'Const Value'" ), 'optionalNumValue' => array( 'name' => 'optionalNumValue', @@ -135,7 +135,7 @@ class ArgumentsReaderTest extends \PHPUnit_Framework_TestCase 'position' => 3, 'type' => null, 'isOptional' => true, - 'default' => '\ClassWithAllArgumentTypes::DEFAULT_VALUE' + 'default' => "'Const Value'" ), 'optionalNumValue' => array( 'name' => 'optionalNumValue', diff --git a/dev/tests/unit/testsuite/Magento/Code/Validator/ArgumentSequenceTest.php b/dev/tests/unit/testsuite/Magento/Code/Validator/ArgumentSequenceTest.php index 38dad380586..2d92c87e8dc 100644 --- a/dev/tests/unit/testsuite/Magento/Code/Validator/ArgumentSequenceTest.php +++ b/dev/tests/unit/testsuite/Magento/Code/Validator/ArgumentSequenceTest.php @@ -52,52 +52,20 @@ class ArgumentSequenceTest extends \PHPUnit_Framework_TestCase $this->assertTrue($this->_validator->validate('\ArgumentSequence\ValidChildClass')); } - /** - * @dataProvider invalidSequenceDataProvider - */ - public function testInvalidSequence($className, $expectedSequence) - { - $message = 'Incorrect argument sequence in class %s in ' . $this->_fixturePath . PHP_EOL - . 'Required: %s' . PHP_EOL; - $message = sprintf($message, $className, $expectedSequence); - try { - $this->_validator->validate($className); - } catch (\Magento\Code\ValidationException $exception) { - $this->assertStringStartsWith($message, $exception->getMessage()); - return; - } - $this->fail('Failed asserting that exception of type "\Magento\Code\ValidationException" is thrown'); - } - - /** - * @return array - */ - public function invalidSequenceDataProvider() + public function testInvalidSequence() { $expectedSequence = '$contextObject, $parentRequiredObject, $parentRequiredScalar, ' . '$childRequiredObject, $childRequiredScalar, $parentOptionalObject, $data, $parentOptionalScalar, ' . '$childOptionalObject, $childOptionalScalar'; - $rule04 = '$contextObject, $parentRequiredObject, $parentRequiredScalar, $childRequiredObject, $argument, ' + $actualSequence = '$contextObject, $childRequiredObject, $parentRequiredObject, $parentRequiredScalar, ' . '$childRequiredScalar, $parentOptionalObject, $data, $parentOptionalScalar, ' . '$childOptionalObject, $childOptionalScalar'; - $rule06 = '$contextObject, $parentRequiredObject, $parentRequiredScalar, $childRequiredObject, ' - . '$childRequiredScalar, $parentOptionalObject, $data, $parentOptionalScalar, ' - . '$childOptionalObject, $argument, $childOptionalScalar'; - - return array( - 'Rule 01' => array('\ArgumentSequence\InvalidChildClassRule01', $expectedSequence), - 'Rule 02' => array('\ArgumentSequence\InvalidChildClassRule02', $expectedSequence), - 'Rule 03' => array('\ArgumentSequence\InvalidChildClassRule03', $expectedSequence), - 'Rule 04' => array('\ArgumentSequence\InvalidChildClassRule04', $rule04), - 'Rule 05' => array('\ArgumentSequence\InvalidChildClassRule05', $expectedSequence), - 'Rule 06' => array('\ArgumentSequence\InvalidChildClassRule06', $rule06), - 'Rule 07' => array('\ArgumentSequence\InvalidChildClassRule07', $expectedSequence), - 'Rule 08' => array('\ArgumentSequence\InvalidChildClassRule08', $expectedSequence), - 'Rule 09' => array('\ArgumentSequence\InvalidChildClassRule09', $expectedSequence), - 'Rule 10' => array('\ArgumentSequence\InvalidChildClassRule10', $expectedSequence), - ); + $message = 'Incorrect argument sequence in class %s in ' . $this->_fixturePath . PHP_EOL + . 'Required: %s' . PHP_EOL . 'Actual : %s' . PHP_EOL; + $message = sprintf($message, '\ArgumentSequence\InvalidChildClass', $expectedSequence, $actualSequence); + $this->setExpectedException('\Magento\Code\ValidationException', $message); + $this->_validator->validate('\ArgumentSequence\InvalidChildClass'); } -} - \ No newline at end of file +} \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Code/Validator/_files/ClassesForArgumentSequence.php b/dev/tests/unit/testsuite/Magento/Code/Validator/_files/ClassesForArgumentSequence.php index 101fc25e364..56a4f3db2ba 100644 --- a/dev/tests/unit/testsuite/Magento/Code/Validator/_files/ClassesForArgumentSequence.php +++ b/dev/tests/unit/testsuite/Magento/Code/Validator/_files/ClassesForArgumentSequence.php @@ -24,21 +24,6 @@ */ namespace ArgumentSequence; -/** - * Constructor Arguments Sequence Rules: - * - * 01. Parent Required Object Arguments - * 02. Parent Required Scalar Arguments - * 03. Child Required Object Arguments - * 04. Child Required Scalar Arguments - * 05. Parent Optional Object Arguments - * 06. Parent Optional Scalar Arguments - * 07. Child Optional Object Arguments - * 08. Child Optional Scalar Arguments - * 09. Context object must go first - * 10. Optional parameter with name data must go first among all optional scalar arguments - */ - class ContextObject implements \Magento\ObjectManager\ContextInterface { @@ -128,287 +113,7 @@ class ValidChildClass extends ParentClass } } -//Rule 01. Parent Required Object Arguments must go first -class InvalidChildClassRule01 extends ParentClass -{ - protected $childRequiredObject; - protected $childRequiredScalar; - protected $childOptionalObject; - protected $childOptionalScalar; - - /** - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - ContextObject $contextObject, - array $parentRequiredScalar, - ParentRequiredObject $parentRequiredObject, - ChildRequiredObject $childRequiredObject, - array $childRequiredScalar, - ParentOptionalObject $parentOptionalObject = null, - array $data = array(), - array $parentOptionalScalar = array(), - ChildOptionalObject $childOptionalObject = null, - array $childOptionalScalar = array() - ) { - $this->childRequiredObject = $childRequiredObject; - $this->childRequiredScalar = $childRequiredScalar; - $this->childOptionalObject = $childOptionalObject; - $this->childOptionalScalar = $childOptionalScalar; - - parent::__construct( - $contextObject, - $parentRequiredObject, - $parentRequiredScalar, - $parentOptionalObject, - $data, - $parentOptionalScalar - ); - } -} - -// Rule 02. Parent Required Scalar Arguments must go after Parent Required Object Arguments -class InvalidChildClassRule02 extends ParentClass -{ - protected $childRequiredObject; - protected $childRequiredScalar; - protected $childOptionalObject; - protected $childOptionalScalar; - - /** - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - ContextObject $contextObject, - ParentRequiredObject $parentRequiredObject, - ChildRequiredObject $childRequiredObject, - array $parentRequiredScalar, - array $childRequiredScalar, - ParentOptionalObject $parentOptionalObject = null, - array $data = array(), - array $parentOptionalScalar = array(), - ChildOptionalObject $childOptionalObject = null, - array $childOptionalScalar = array() - ) { - $this->childRequiredObject = $childRequiredObject; - $this->childRequiredScalar = $childRequiredScalar; - $this->childOptionalObject = $childOptionalObject; - $this->childOptionalScalar = $childOptionalScalar; - - parent::__construct( - $contextObject, - $parentRequiredObject, - $parentRequiredScalar, - $parentOptionalObject, - $data, - $parentOptionalScalar - ); - } -} - -//Rule 03. Child Required Object Arguments must go after Parent Required Scalar Arguments -class InvalidChildClassRule03 extends ParentClass -{ - protected $childRequiredObject; - protected $childRequiredScalar; - protected $childOptionalObject; - protected $childOptionalScalar; - - /** - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - ContextObject $contextObject, - ParentRequiredObject $parentRequiredObject, - array $parentRequiredScalar, - array $childRequiredScalar, - ChildRequiredObject $childRequiredObject, - ParentOptionalObject $parentOptionalObject = null, - array $data = array(), - array $parentOptionalScalar = array(), - ChildOptionalObject $childOptionalObject = null, - array $childOptionalScalar = array() - ) { - $this->childRequiredObject = $childRequiredObject; - $this->childRequiredScalar = $childRequiredScalar; - $this->childOptionalObject = $childOptionalObject; - $this->childOptionalScalar = $childOptionalScalar; - - parent::__construct( - $contextObject, - $parentRequiredObject, - $parentRequiredScalar, - $parentOptionalObject, - $data, - $parentOptionalScalar - ); - } -} - -//Rule 04. Child Required Scalar Arguments must go after Child Required Object Arguments -class InvalidChildClassRule04 extends ParentClass -{ - protected $childRequiredObject; - protected $childRequiredScalar; - protected $childOptionalObject; - protected $childOptionalScalar; - protected $argument; - - /** - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - ContextObject $contextObject, - ParentRequiredObject $parentRequiredObject, - array $parentRequiredScalar, - ChildRequiredObject $childRequiredObject, - array $childRequiredScalar, - ChildRequiredObject $argument, - ParentOptionalObject $parentOptionalObject = null, - array $data = array(), - array $parentOptionalScalar = array(), - ChildOptionalObject $childOptionalObject = null, - array $childOptionalScalar = array() - ) { - $this->childRequiredObject = $childRequiredObject; - $this->childRequiredScalar = $childRequiredScalar; - $this->childOptionalObject = $childOptionalObject; - $this->childOptionalScalar = $childOptionalScalar; - $this->argument = $argument; - - parent::__construct( - $contextObject, - $parentRequiredObject, - $parentRequiredScalar, - $parentOptionalObject, - $data, - $parentOptionalScalar - ); - } -} - -//Rule 05. Parent Optional Object Arguments must go after Child Required Scalar Arguments -class InvalidChildClassRule05 extends ParentClass -{ - protected $childRequiredObject; - protected $childRequiredScalar; - protected $childOptionalObject; - protected $childOptionalScalar; - - /** - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - ContextObject $contextObject, - ParentRequiredObject $parentRequiredObject, - array $parentRequiredScalar, - ChildRequiredObject $childRequiredObject, - array $childRequiredScalar, - array $parentOptionalScalar = array(), - ParentOptionalObject $parentOptionalObject = null, - array $data = array(), - ChildOptionalObject $childOptionalObject = null, - array $childOptionalScalar = array() - ) { - $this->childRequiredObject = $childRequiredObject; - $this->childRequiredScalar = $childRequiredScalar; - $this->childOptionalObject = $childOptionalObject; - $this->childOptionalScalar = $childOptionalScalar; - - parent::__construct( - $contextObject, - $parentRequiredObject, - $parentRequiredScalar, - $parentOptionalObject, - $data, - $parentOptionalScalar - ); - } -} - -//Rule 06. Parent Optional Scalar Arguments must go after Parent Optional Object Arguments -class InvalidChildClassRule06 extends ParentClass -{ - protected $childRequiredObject; - protected $childRequiredScalar; - protected $childOptionalObject; - protected $childOptionalScalar; - protected $argument; - - /** - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - ContextObject $contextObject, - ParentRequiredObject $parentRequiredObject, - array $parentRequiredScalar, - ChildRequiredObject $childRequiredObject, - array $childRequiredScalar, - ParentOptionalObject $parentOptionalObject = null, - array $data = array(), - array $parentOptionalScalar = array(), - ChildOptionalObject $childOptionalObject = null, - array $childOptionalScalar = array(), - ChildOptionalObject $argument = null - ) { - $this->childRequiredObject = $childRequiredObject; - $this->childRequiredScalar = $childRequiredScalar; - $this->childOptionalObject = $childOptionalObject; - $this->childOptionalScalar = $childOptionalScalar; - $this->argument = $argument; - - parent::__construct( - $contextObject, - $parentRequiredObject, - $parentRequiredScalar, - $parentOptionalObject, - $data, - $parentOptionalScalar - ); - } -} - -//Rule 07. Child Optional Object Arguments must go after Parent Optional Scalar Arguments -class InvalidChildClassRule07 extends ParentClass -{ - protected $childRequiredObject; - protected $childRequiredScalar; - protected $childOptionalObject; - protected $childOptionalScalar; - - /** - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - ContextObject $contextObject, - ParentRequiredObject $parentRequiredObject, - array $parentRequiredScalar, - ChildRequiredObject $childRequiredObject, - array $childRequiredScalar, - ParentOptionalObject $parentOptionalObject = null, - array $data = array(), - array $parentOptionalScalar = array(), - array $childOptionalScalar = array(), - ChildOptionalObject $childOptionalObject = null - ) { - $this->childRequiredObject = $childRequiredObject; - $this->childRequiredScalar = $childRequiredScalar; - $this->childOptionalObject = $childOptionalObject; - $this->childOptionalScalar = $childOptionalScalar; - - parent::__construct( - $contextObject, - $parentRequiredObject, - $parentRequiredScalar, - $parentOptionalObject, - $data, - $parentOptionalScalar - ); - } -} - -//Rule 08. Child Optional Scalar Arguments must go after Child Optional Object Arguments -class InvalidChildClassRule08 extends ParentClass +class InvalidChildClass extends ParentClass { protected $childRequiredObject; protected $childRequiredScalar; @@ -420,48 +125,9 @@ class InvalidChildClassRule08 extends ParentClass */ public function __construct( ContextObject $contextObject, - ParentRequiredObject $parentRequiredObject, - array $parentRequiredScalar, ChildRequiredObject $childRequiredObject, - array $childRequiredScalar, - ParentOptionalObject $parentOptionalObject = null, - array $data = array(), - ChildOptionalObject $childOptionalObject = null, - array $childOptionalScalar = array(), - array $parentOptionalScalar = array() - ) { - $this->childRequiredObject = $childRequiredObject; - $this->childRequiredScalar = $childRequiredScalar; - $this->childOptionalObject = $childOptionalObject; - $this->childOptionalScalar = $childOptionalScalar; - - parent::__construct( - $contextObject, - $parentRequiredObject, - $parentRequiredScalar, - $parentOptionalObject, - $data, - $parentOptionalScalar - ); - } -} - -//Rule 09. Context object must go first -class InvalidChildClassRule09 extends ParentClass -{ - protected $childRequiredObject; - protected $childRequiredScalar; - protected $childOptionalObject; - protected $childOptionalScalar; - - /** - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( ParentRequiredObject $parentRequiredObject, - ContextObject $contextObject, array $parentRequiredScalar, - ChildRequiredObject $childRequiredObject, array $childRequiredScalar, ParentOptionalObject $parentOptionalObject = null, array $data = array(), @@ -474,45 +140,6 @@ class InvalidChildClassRule09 extends ParentClass $this->childOptionalObject = $childOptionalObject; $this->childOptionalScalar = $childOptionalScalar; - parent::__construct( - $contextObject, - $parentRequiredObject, - $parentRequiredScalar, - $parentOptionalObject, - $data, - $parentOptionalScalar - ); - } -} - -// Rule 10. Optional parameter with name data must go first among all optional scalar arguments -class InvalidChildClassRule10 extends ParentClass -{ - protected $childRequiredObject; - protected $childRequiredScalar; - protected $childOptionalObject; - protected $childOptionalScalar; - - /** - * @SuppressWarnings(PHPMD.ExcessiveParameterList) - */ - public function __construct( - ContextObject $contextObject, - ParentRequiredObject $parentRequiredObject, - array $parentRequiredScalar, - ChildRequiredObject $childRequiredObject, - array $childRequiredScalar, - ParentOptionalObject $parentOptionalObject = null, - array $parentOptionalScalar = array(), - array $data = array(), - ChildOptionalObject $childOptionalObject = null, - array $childOptionalScalar = array() - ) { - $this->childRequiredObject = $childRequiredObject; - $this->childRequiredScalar = $childRequiredScalar; - $this->childOptionalObject = $childOptionalObject; - $this->childOptionalScalar = $childOptionalScalar; - parent::__construct( $contextObject, $parentRequiredObject, diff --git a/dev/tests/unit/testsuite/Magento/Core/App/Action/FormKeyValidatorTest.php b/dev/tests/unit/testsuite/Magento/Core/App/Action/FormKeyValidatorTest.php index e19d146681c..c597f863789 100644 --- a/dev/tests/unit/testsuite/Magento/Core/App/Action/FormKeyValidatorTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/App/Action/FormKeyValidatorTest.php @@ -35,7 +35,7 @@ class FormKeyValidatorTest extends \PHPUnit_Framework_TestCase /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_sessionMock; + protected $_formKeyMock; /** * @var \PHPUnit_Framework_MockObject_MockObject @@ -44,10 +44,10 @@ class FormKeyValidatorTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_sessionMock = $this->getMock('Magento\Core\Model\Session', array('getFormKey'), array(), '', false); + $this->_formKeyMock = $this->getMock('\Magento\Data\Form\FormKey', array('getFormKey'), array(), '', false); $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); $this->_model = new \Magento\Core\App\Action\FormKeyValidator( - $this->_sessionMock + $this->_formKeyMock ); } @@ -63,7 +63,7 @@ class FormKeyValidatorTest extends \PHPUnit_Framework_TestCase ->method('getParam') ->with('form_key', null) ->will($this->returnValue($formKey)); - $this->_sessionMock->expects($this->once())->method('getFormKey')->will($this->returnValue('formKey')); + $this->_formKeyMock->expects($this->once())->method('getFormKey')->will($this->returnValue('formKey')); $this->assertEquals($expected, $this->_model->validate($this->_requestMock)); } @@ -74,4 +74,4 @@ class FormKeyValidatorTest extends \PHPUnit_Framework_TestCase 'formKeyNotEqualToFormKeyInSession' => array('formKeySession', false) ); } -} \ No newline at end of file +} diff --git a/dev/tests/unit/testsuite/Magento/Page/Block/SwitchTest.php b/dev/tests/unit/testsuite/Magento/Core/Block/SwitchTest.php similarity index 93% rename from dev/tests/unit/testsuite/Magento/Page/Block/SwitchTest.php rename to dev/tests/unit/testsuite/Magento/Core/Block/SwitchTest.php index eddacc7c28c..a0ac5e86610 100644 --- a/dev/tests/unit/testsuite/Magento/Page/Block/SwitchTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Block/SwitchTest.php @@ -19,18 +19,18 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Page + * @package Magento_Theme * @subpackage unit_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block; +namespace Magento\Core\Block; class SwitchTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Page\Block\Switcher + * @var \Magento\Core\Block\Switcher */ protected $_block; @@ -50,7 +50,7 @@ class SwitchTest extends \PHPUnit_Framework_TestCase $helper = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_block = $helper->getObject( - 'Magento\Page\Block\Switcher', array('storeManager' => $this->_storeManagerMock) + 'Magento\Core\Block\Switcher', array('storeManager' => $this->_storeManagerMock) ); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Helper/CookieTest.php b/dev/tests/unit/testsuite/Magento/Core/Helper/CookieTest.php index aa3af8956e2..e746f131c7d 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Helper/CookieTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Helper/CookieTest.php @@ -32,32 +32,31 @@ class CookieTest extends \PHPUnit_Framework_TestCase /** * @var \Magento\Core\Helper\Cookie */ - protected $_object = null; + protected $_object; - protected function setUp() - { - $this->_object = new \Magento\Core\Helper\Cookie( - $this->getMock('Magento\App\Helper\Context', array(), array(), '', false, false), - $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false, false), - $this->getMock('Magento\Core\Model\Cookie', array(), array(), '', false, false), - array( - 'current_store' => $this->_getStoreStub(), - 'cookie_model' => $this->_getCookieStub(array(1 => 1)), - 'website' => $this->_getWebsiteStub(), - ) - ); - } + /** + * @var \Magento\App\Request\Http + */ + protected $_request; + + /** + * @var \Magento\Core\Helper\Context + */ + protected $_context; public function testIsUserNotAllowSaveCookie() { + $this->_initMock()->_getCookieStub(array(1 => 1)); $this->assertFalse($this->_object->isUserNotAllowSaveCookie()); + $request = $this->getMock('\Magento\App\Request\Http', array('getCookie'), array(), '', false, false); + $request->expects($this->any())->method('getCookie')->will($this->returnValue(json_encode(array()))); + $context = $this->getMock('Magento\App\Helper\Context', array('getRequest'), array(), '', false, false); + $context->expects($this->once())->method('getRequest')->will($this->returnValue($request)); $this->_object = new \Magento\Core\Helper\Cookie( - $this->getMock('Magento\App\Helper\Context', array(), array(), '', false, false), + $context, $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false, false), - $this->getMock('Magento\Core\Model\Cookie', array(), array(), '', false, false), array( 'current_store' => $this->_getStoreStub(), - 'cookie_model' => $this->_getCookieStub(array()), 'website' => $this->_getWebsiteStub(), ) ); @@ -66,6 +65,7 @@ class CookieTest extends \PHPUnit_Framework_TestCase public function testGetAcceptedSaveCookiesWebsiteIds() { + $this->_initMock()->_getCookieStub(array(1 => 1)); $this->assertEquals( $this->_object->getAcceptedSaveCookiesWebsiteIds(), json_encode(array(1 => 1)) @@ -74,22 +74,41 @@ class CookieTest extends \PHPUnit_Framework_TestCase public function testGetCookieRestrictionLifetime() { + $this->_request = $this->getMock('\Magento\App\Request\Http', array('getCookie'), + array(), '', false, false); + $this->_context = $this->getMock('Magento\App\Helper\Context', array('getRequest'), array(), '', false, false); + $this->_context->expects($this->once())->method('getRequest')->will($this->returnValue($this->_request)); $storeStub = $this->_getStoreStub(); $storeStub->expects($this->once()) ->method('getConfig') ->will($this->returnCallback('Magento\\Core\\Helper\\CookieTest::getConfigMethodStub')) ->with($this->equalTo('web/cookie/cookie_restriction_lifetime')); $this->_object = new \Magento\Core\Helper\Cookie( - $this->getMock('Magento\App\Helper\Context', array(), array(), '', false, false), + $this->_context, $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false, false), - $this->getMock('Magento\Core\Model\Cookie', array(), array(), '', false, false), array( 'current_store' => $storeStub, - 'cookie_model' => $this->_getCookieStub(array(1 => 1)), 'website' => $this->_getWebsiteStub() ) ); - $this->assertEquals($this->_object->getCookieRestrictionLifetime(), 60*60*24*365); + $this->assertEquals($this->_object->getCookieRestrictionLifetime(), 60 * 60 * 24 * 365); + } + + protected function _initMock() + { + $this->_request = $this->getMock('\Magento\App\Request\Http', array('getCookie'), + array(), '', false, false); + $this->_context = $this->getMock('Magento\App\Helper\Context', array('getRequest'), array(), '', false, false); + $this->_context->expects($this->once())->method('getRequest')->will($this->returnValue($this->_request)); + $this->_object = new \Magento\Core\Helper\Cookie( + $this->_context, + $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false, false), + array( + 'current_store' => $this->_getStoreStub(), + 'website' => $this->_getWebsiteStub(), + ) + ); + return $this; } /** @@ -110,17 +129,13 @@ class CookieTest extends \PHPUnit_Framework_TestCase /** * Create cookie model stub * @param array $cookieString - * @return \Magento\Core\Model\Cookie + * @return \Magento\Stdlib\Cookie */ protected function _getCookieStub($cookieString = array()) { - $cookieMock = $this->getMock('Magento\Core\Model\Cookie', array(), array(), '', false); - - $cookieMock->expects($this->any()) - ->method('get') + $this->_request->expects($this->any()) + ->method('getCookie') ->will($this->returnValue(json_encode($cookieString))); - - return $cookieMock; } /** @@ -150,7 +165,7 @@ class CookieTest extends \PHPUnit_Framework_TestCase $defaultConfig = array( 'web/cookie/cookie_restriction' => 1, - 'web/cookie/cookie_restriction_lifetime' => 60*60*24*365, + 'web/cookie/cookie_restriction_lifetime' => 60 * 60 * 24 * 365, ); if (array_key_exists($hashName, $defaultConfig)) { diff --git a/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php index 64a9d2ac9dc..5adf6aa6db4 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Helper/ThemeTest.php @@ -155,8 +155,8 @@ class ThemeTest extends \PHPUnit_Framework_TestCase { return array( array( - '<block class="Magento\Page\Block\Html\Head" name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + '<block class="Magento\Theme\Block\Html\Head" name="head"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments><argument name="file" xsi:type="string">test1.css</argument></arguments> </block> </block>', @@ -169,8 +169,8 @@ class ThemeTest extends \PHPUnit_Framework_TestCase ) ), array( - '<block class="Magento\Page\Block\Html\Head" name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + '<block class="Magento\Theme\Block\Html\Head" name="head"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments> <argument name="file" xsi:type="string">Magento_Core::test3.css</argument> </arguments> @@ -186,7 +186,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase ), array( '<referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments><argument name="file" xsi:type="string">test21.css</argument></arguments> </block> </referenceBlock>', @@ -200,7 +200,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase ), array( '<referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments> <argument name="file" xsi:type="string">Magento_Core::test23.css</argument> </arguments> @@ -216,7 +216,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase ), array( '<block type="Some_Block_Class"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments> <argument name="file" xsi:type="string">Magento_Core::test23.css</argument> </arguments> @@ -227,7 +227,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase ), array( '<block type="Some_Block_Class"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments> <argument name="file" xsi:type="string">Magento_Core::test23.css</argument> </arguments> @@ -237,7 +237,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase ), array( '<referenceBlock name="some_block_name"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments><argument name="file" xsi:type="string">test23.css</argument></arguments> </block> </referenceBlock>', @@ -245,7 +245,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase ), array( '<referenceBlock name="some_block_name"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments> <argument name="file" xsi:type="string">Magento_Core::test23.css</argument> </arguments> @@ -254,39 +254,39 @@ class ThemeTest extends \PHPUnit_Framework_TestCase array(), ), array( - '<block class="Magento\Page\Block\Html\Head" name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + '<block class="Magento\Theme\Block\Html\Head" name="head"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments><argument name="file" xsi:type="string">test.css</argument></arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments> <argument name="file" xsi:type="string">Magento_Core::test.css</argument> </arguments> </block> </block> <referenceBlock name="head"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments><argument name="file" xsi:type="string">testh.css</argument></arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments><argument name="file" xsi:type="string">Magento_Core::test.css</argument></arguments> </block> </referenceBlock> <block type="Some_Block_Class"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments><argument name="file" xsi:type="string">testa.css</argument></arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments> <argument name="file" xsi:type="string">Magento_Core::testa.css</argument> </arguments> </block> </block> <referenceBlock name="some_block_name"> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments><argument name="file" xsi:type="string">testb.css</argument></arguments> </block> - <block class="Magento\Page\Block\Html\Head\Css" name="magento-loader-js"> + <block class="Magento\Theme\Block\Html\Head\Css" name="magento-loader-js"> <arguments> <argument name="file" xsi:type="string">Magento_Core::testb.css</argument> </arguments> diff --git a/dev/tests/unit/testsuite/Magento/Core/Helper/Url/RewriteTest.php b/dev/tests/unit/testsuite/Magento/Core/Helper/Url/RewriteTest.php index 1523dc5bf81..5fc9af9f23f 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Helper/Url/RewriteTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Helper/Url/RewriteTest.php @@ -32,28 +32,6 @@ namespace Magento\Core\Helper\Url; class RewriteTest extends \PHPUnit_Framework_TestCase { - /** - * Initialize helper - */ - protected function setUp() - { - $optionsModel = new \Magento\Core\Model\Source\Urlrewrite\Options(); - - $coreRegisterMock = $this->getMock('Magento\Core\Model\Registry'); - $coreRegisterMock->expects($this->any()) - ->method('registry') - ->with('_singleton/Magento_Core_Model_Source_Urlrewrite_Options') - ->will($this->returnValue($optionsModel)); - - $objectManagerMock = $this->getMockBuilder('Magento\ObjectManager')->getMock(); - $objectManagerMock->expects($this->any()) - ->method('get') - ->with('Magento\Core\Model\Registry') - ->will($this->returnValue($coreRegisterMock)); - - \Magento\App\ObjectManager::setInstance($objectManagerMock); - } - /** * Test hasRedirectOptions * diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/SynchronizationTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/SynchronizationTest.php index f890078402c..225d124577a 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/SynchronizationTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/File/Storage/SynchronizationTest.php @@ -59,8 +59,13 @@ class SynchronizationTest extends \PHPUnit_Framework_TestCase { $this->_storageFactoryMock = $this->getMock('Magento\Core\Model\File\Storage\DatabaseFactory', array('create'), array(), '', false); - $this->_storageMock = $this->getMock('Magento\Core\Model\File\Storage\Database', - array('getContent', 'getId', 'loadByFilename'), array(), '', false); + $this->_storageMock = $this->getMock( + 'Magento\Core\Model\File\Storage\Database', + array('getContent', 'getId', 'loadByFilename', '__wakeup'), + array(), + '', + false + ); $this->_storageFactoryMock ->expects($this->once()) ->method('create') diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php index 658d07f0148..e1f9eedc4b9 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/MergeTest.php @@ -29,7 +29,7 @@ class MergeTest extends \PHPUnit_Framework_TestCase /** * Fixture XML instruction(s) to be used in tests */ - const FIXTURE_LAYOUT_XML = '<block class="Magento\View\Block\Template" template="fixture.phtml"/>'; + const FIXTURE_LAYOUT_XML = '<block class="Magento\View\Element\Template" template="fixture.phtml"/>'; /** * @var \Magento\Core\Model\Layout\Merge @@ -186,8 +186,8 @@ class MergeTest extends \PHPUnit_Framework_TestCase $this->assertEquals($handles, $this->_model->getHandles()); $expectedResult = ' <root> - <block class="Magento\View\Block\Template" template="fixture_template_one.phtml"/> - <block class="Magento\View\Block\Template" template="fixture_template_two.phtml"/> + <block class="Magento\View\Element\Template" template="fixture_template_one.phtml"/> + <block class="Magento\View\Element\Template" template="fixture_template_two.phtml"/> </root> '; $actualResult = '<root>' . $this->_model->asString() . '</root>'; diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_one.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_one.xml index 13ecf2a8dfa..1f2f769d678 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_one.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_one.xml @@ -24,5 +24,5 @@ */ --> <layout> - <block class="Magento\View\Block\Template" template="fixture_template_one.phtml"/> + <block class="Magento\View\Element\Template" template="fixture_template_one.phtml"/> </layout> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_two.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_two.xml index ce411351d14..10a48bd1e90 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_two.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/layout/fixture_handle_two.xml @@ -24,5 +24,5 @@ */ --> <layout> - <block class="Magento\View\Block\Template" template="fixture_template_two.phtml"/> + <block class="Magento\View\Element\Template" template="fixture_template_two.phtml"/> </layout> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/merged.xml b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/merged.xml index 872794f93bf..12163aa69bd 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/merged.xml +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Layout/_files/merged.xml @@ -42,10 +42,10 @@ <container name="content" as="content" label="Main Content Area"/> </handle> <handle id="fixture_handle_one"> - <block class="Magento\View\Block\Template" template="fixture_template_one.phtml"/> + <block class="Magento\View\Element\Template" template="fixture_template_one.phtml"/> </handle> <handle id="fixture_handle_two"> - <block class="Magento\View\Block\Template" template="fixture_template_two.phtml"/> + <block class="Magento\View\Element\Template" template="fixture_template_two.phtml"/> </handle> <handle id="not_a_page_type" label="Handle that Is Not a Page Type"/> <handle id="page_empty" label="All Empty Layout Pages" design_abstraction="page_layout"/> diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php index dfe9433e28f..2e68a04e3fc 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/ObserverTest.php @@ -106,11 +106,12 @@ class ObserverTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($themeMock)) ; - $this->_assetsMock = $this->getMock('Magento\Core\Model\Page\Asset\Collection'); + $this->_assetsMock = $this->getMock('Magento\View\Asset\GroupedCollection', + array(), array(), '', false, false); $this->_configMock = $this->getMock('Magento\Core\Model\ConfigInterface', array(), array(), '', false, false); - $this->_assetFactory = $this->getMock('Magento\Core\Model\Page\Asset\PublicFileFactory', + $this->_assetFactory = $this->getMock('Magento\View\Asset\PublicFileFactory', array('create'), array(), '', false); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); @@ -119,7 +120,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase array( 'cacheFrontendPool' => $this->_frontendPoolMock, 'design' => $designMock, - 'page' => new \Magento\Core\Model\Page($this->_assetsMock), + 'assets' => $this->_assetsMock, 'config' => $this->_configMock, 'assetFileFactory' => $this->_assetFactory ) @@ -155,7 +156,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase public function testApplyThemeCustomization() { - $asset = new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/test.css'); + $asset = new \Magento\View\Asset\Remote('http://127.0.0.1/test.css'); $file = $this->getMock('Magento\Core\Model\Theme\File', array(), array(), '', false); $fileService = $this->getMock('Magento\View\Design\Theme\Customization\File\Css', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Link/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Link/CollectionTest.php index f31f926ac64..185ddbb68e1 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Link/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Link/CollectionTest.php @@ -50,11 +50,12 @@ class CollectionTest extends \Magento\Core\Model\Resource\Layout\AbstractTestCas $eventManager = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); return new \Magento\Core\Model\Resource\Layout\Link\Collection( - $eventManager, + $this->getMock('Magento\Core\Model\EntityFactory', array(), array(), '', false), $this->getMock('Magento\Logger', array(), array(), '', false), $this->getMockForAbstractClass('Magento\Data\Collection\Db\FetchStrategyInterface'), - $this->getMock('Magento\Core\Model\EntityFactory', array(), array(), '', false), + $eventManager, $this->getMock('Magento\Stdlib\DateTime', null, array(), '', true), + null, $this->_getResource($select) ); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Update/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Update/CollectionTest.php index dcedd355146..8c511fd6d6d 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Update/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Layout/Update/CollectionTest.php @@ -41,11 +41,12 @@ class CollectionTest $eventManager = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); return new \Magento\Core\Model\Resource\Layout\Update\Collection( - $eventManager, + $this->getMock('Magento\Core\Model\EntityFactory', array(), array(), '', false), $this->getMock('Magento\Logger', array(), array(), '', false), $this->getMockForAbstractClass('Magento\Data\Collection\Db\FetchStrategyInterface'), - $this->getMock('Magento\Core\Model\EntityFactory', array(), array(), '', false), + $eventManager, $this->getMock('Magento\Stdlib\DateTime', null, array(), '', true), + null, $this->_getResource($select) ); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Setup/MigrationTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Setup/MigrationTest.php index e296da35ad5..1616cd8b892 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Setup/MigrationTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Resource/Setup/MigrationTest.php @@ -178,10 +178,10 @@ class MigrationTest extends \PHPUnit_Framework_TestCase $setupModel = new \Magento\Core\Model\Resource\Setup\Migration( $contextMock, + 'core_setup', $this->getMock('Magento\Filesystem', array(), array(), '', false), $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false), $this->getMock('Magento\App\Dir', array(), array(), '', false), - 'core_setup', '' ); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Session/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Session/ConfigTest.php new file mode 100644 index 00000000000..76632ce7096 --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Session/ConfigTest.php @@ -0,0 +1,492 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +/** + * Test class for \Magento\Core\Model\Session\Config + */ +namespace Magento\Core\Model\Session; + +class ConfigTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Core\Model\Session\Config + */ + protected $config; + + /** + * @var \Magento\Core\Model\Store\Config + */ + protected $_configMock; + + /** + * @var \Magento\Core\Model\StoreManagerInterface + */ + protected $_storeManagerMock; + + /** + * @var \Magento\Stdlib\String + */ + protected $_stringHelperMock; + + /** + * @var \Magento\App\RequestInterface + */ + protected $_requestMock; + + /** + * @var \Magento\App\State + */ + protected $_appState; + + /** + * @var \Magento\App\Dir + */ + protected $_dir; + + protected function setUp() + { + $this->_configMock = $this->getMock('Magento\Core\Model\Store\Config', array(), array(), '', false, false); + $this->_storeManagerMock = $this->getMock('\Magento\Core\Model\StoreManager', array('getStore'), + array(), '', false, false); + $storeMock = $this->getMock('\Magento\Core\Model\Store', array('isAdmin', '__wakeup'), array(), + '', false, false); + $this->_storeManagerMock->expects($this->atLeastOnce())->method('getStore') + ->will($this->returnValue($storeMock)); + + $this->_stringHelperMock = $this->getMock('\Magento\Stdlib\String', array(), array(), '', + false, false); + $this->_requestMock = $this->getMock('\Magento\App\Request\Http', + array('getBasePath', 'isSecure', 'getHttpHost'), array(), '', false, false); + $this->_requestMock->expects($this->atLeastOnce())->method('getBasePath')->will($this->returnValue('/')); + $this->_requestMock->expects($this->atLeastOnce()) + ->method('getHttpHost')->will($this->returnValue('init.host')); + $this->_appState = $this->getMock('\Magento\App\State', array('isInstalled'), array(), '', false, false); + $this->_appState->expects($this->atLeastOnce())->method('isInstalled')->will($this->returnValue(true)); + $this->_dir = $this->getMock('\Magento\App\Dir', array(), array(), '', false, false); + + $this->config = new \Magento\Core\Model\Session\Config( + $this->_configMock, + $this->_storeManagerMock, + $this->_stringHelperMock, + $this->_requestMock, + $this->_appState, + $this->_dir, + __DIR__ + ); + } + + public function testSetOptionsWrongType() + { + $this->setExpectedException('\InvalidArgumentException', + 'Parameter provided to Magento\Core\Model\Session\Config::setOptions must be an array or Traversable'); + $this->config->setOptions(''); + } + + public function testSetOptionsWrongOption() + { + $this->setExpectedException('\InvalidArgumentException', + '"session.0" is not a valid sessions-related ini setting.'); + + $this->config->setOptions(array('lol')); + } + + /** + * @dataProvider optionsProvider + */ + public function testSetOptionsTranslatesUnderscoreSeparatedKeys($option, $getter, $value) + { + $options = array($option => $value); + $this->config->setOptions($options); + $this->assertSame($value, $this->config->$getter()); + } + + public function optionsProvider() + { + return array( + array( + 'save_path', + 'getSavePath', + __DIR__, + ), + array( + 'name', + 'getName', + 'FOOBAR', + ), + array( + 'save_handler', + 'getSaveHandler', + 'user', + ), + array( + 'gc_probability', + 'getGcProbability', + 42, + ), + array( + 'gc_divisor', + 'getGcDivisor', + 3, + ), + array( + 'gc_maxlifetime', + 'getGcMaxlifetime', + 180, + ), + array( + 'serialize_handler', + 'getSerializeHandler', + 'php_binary', + ), + array( + 'cookie_lifetime', + 'getCookieLifetime', + 180, + ), + array( + 'cookie_path', + 'getCookiePath', + '/foo/bar', + ), + array( + 'cookie_domain', + 'getCookieDomain', + 'framework.zend.com', + ), + array( + 'cookie_secure', + 'getCookieSecure', + true, + ), + array( + 'cookie_httponly', + 'getCookieHttpOnly', + true, + ), + array( + 'use_cookies', + 'getUseCookies', + false, + ), + array( + 'use_only_cookies', + 'getUseOnlyCookies', + true, + ), + array( + 'referer_check', + 'getRefererCheck', + 'foobar', + ), + array( + 'entropy_file', + 'getEntropyFile', + __FILE__, + ), + array( + 'entropy_length', + 'getEntropyLength', + 42, + ), + array( + 'cache_limiter', + 'getCacheLimiter', + 'private', + ), + array( + 'cache_expire', + 'getCacheExpire', + 42, + ), + array( + 'use_trans_sid', + 'getUseTransSid', + true, + ), + array( + 'hash_function', + 'getHashFunction', + 'md5', + ), + array( + 'hash_bits_per_character', + 'getHashBitsPerCharacter', + 5, + ), + array( + 'url_rewriter_tags', + 'getUrlRewriterTags', + 'a=href', + ), + ); + } + + public function testGetOptions() + { + $appStateProperty = new \ReflectionProperty('Magento\Core\Model\Session\Config', 'options'); + $appStateProperty->setAccessible(true); + $original = $appStateProperty->getValue($this->config); + $valueForTest = array('test' => 'test2'); + $appStateProperty->setValue($this->config, $valueForTest); + $this->assertEquals($valueForTest, $this->config->getOptions()); + $this->assertEquals($valueForTest, $this->config->toArray()); + $appStateProperty->setValue($this->config, $original); + $this->assertEquals($original, $this->config->getOptions()); + $this->assertEquals($original, $this->config->toArray()); + } + + public function testHasOption() + { + $appStateProperty = new \ReflectionProperty('Magento\Core\Model\Session\Config', 'options'); + $appStateProperty->setAccessible(true); + $original = $appStateProperty->getValue($this->config); + $valueForTest = array('session.test' => 'test2'); + $appStateProperty->setValue($this->config, $valueForTest); + $this->assertTrue($this->config->hasOption('test')); + $this->assertFalse($this->config->hasOption('no_set')); + $appStateProperty->setValue($this->config, $original); + } + + public function testNameIsMutable() + { + $this->config->setName('FOOBAR'); + $this->assertEquals('FOOBAR', $this->config->getName()); + } + + public function testNameAltersIniSetting() + { + $this->config->setName('FOOBAR'); + $this->assertEquals('FOOBAR', ini_get('session.name')); + } + + public function testSaveHandlerDefaultsToIniSettings() + { + $this->assertSame( + ini_get('session.save_handler'), + $this->config->getSaveHandler(), + var_export($this->config->toArray(), 1) + ); + } + + public function testSaveHandlerIsMutable() + { + $this->config->setSaveHandler('user'); + $this->assertEquals('user', $this->config->getSaveHandler()); + } + + public function testCookieLifetimeDefaultsToIniSettings() + { + $this->assertSame((int)ini_get('session.cookie_lifetime'), $this->config->getCookieLifetime()); + } + + public function testCookieLifetimeIsMutable() + { + $this->config->setCookieLifetime(20); + $this->assertEquals(20, $this->config->getCookieLifetime()); + } + + public function testCookieLifetimeAltersIniSetting() + { + $this->config->setCookieLifetime(24); + $this->assertEquals(24, ini_get('session.cookie_lifetime')); + } + + public function testCookieLifetimeCanBeZero() + { + $this->config->setCookieLifetime(0); + $this->assertEquals(0, ini_get('session.cookie_lifetime')); + } + + public function testSettingInvalidCookieLifetimeRaisesException() + { + $this->setExpectedException('\InvalidArgumentException', 'Invalid cookie_lifetime; must be numeric'); + $this->config->setCookieLifetime('foobar_bogus'); + } + + public function testSettingInvalidCookieLifetimeRaisesException2() + { + $this->setExpectedException( + '\InvalidArgumentException', + 'Invalid cookie_lifetime; must be a positive integer or zero' + ); + $this->config->setCookieLifetime(-1); + } + + public function testWrongMethodCall() + { + $this->setExpectedException( + '\BadMethodCallException', + 'Method "methodThatNotExist" does not exist in Magento\Core\Model\Session\Config' + ); + $this->config->methodThatNotExist(); + } + + public function testRememberMeSecondsDefaultsToTwoWeeks() + { + $this->assertEquals(1209600, $this->config->getRememberMeSeconds()); + } + + public function testRememberMeSecondsIsMutable() + { + $this->config->setRememberMeSeconds(604800); + $this->assertEquals(604800, $this->config->getRememberMeSeconds()); + } + + public function testCookieSecureDefaultsToIniSettings() + { + $this->assertSame((bool) ini_get('session.cookie_secure'), $this->config->getCookieSecure()); + } + + public function testCookieSecureIsMutable() + { + $value = ini_get('session.cookie_secure') ? false : true; + $this->config->setCookieSecure($value); + $this->assertEquals($value, $this->config->getCookieSecure()); + } + + public function testCookieSecureAltersIniSetting() + { + $value = ini_get('session.cookie_secure') ? false : true; + $this->config->setCookieSecure($value); + $this->assertEquals($value, ini_get('session.cookie_secure')); + } + + public function testCookieDomainDefaultsToIniSettings() + { + $this->assertSame(ini_get('session.cookie_domain'), $this->config->getCookieDomain()); + } + + public function testCookieDomainIsMutable() + { + $this->config->setCookieDomain('example.com'); + $this->assertEquals('example.com', $this->config->getCookieDomain()); + } + + public function testCookieDomainCanBeEmpty() + { + $this->config->setCookieDomain(''); + $this->assertEquals('', $this->config->getCookieDomain()); + } + + public function testCookieDomainAltersIniSetting() + { + $this->config->setCookieDomain('localhost'); + $this->assertEquals('localhost', ini_get('session.cookie_domain')); + } + + public function testSettingInvalidCookieDomainRaisesException() + { + $this->setExpectedException('\InvalidArgumentException', 'Invalid cookie domain: must be a string'); + $this->config->setCookieDomain(24); + } + + public function testSettingInvalidCookieDomainRaisesException2() + { + $this->setExpectedException( + '\InvalidArgumentException', + 'does not match the expected structure for a DNS hostname' + ); + $this->config->setCookieDomain('D:\\WINDOWS\\System32\\drivers\\etc\\hosts'); + } + + public function testCookieHttpOnlyDefaultsToIniSettings() + { + $this->assertSame((bool) ini_get('session.cookie_httponly'), $this->config->getCookieHttpOnly()); + } + + public function testCookieHttpOnlyIsMutable() + { + $value = ini_get('session.cookie_httponly') ? false : true; + $this->config->setCookieHttpOnly($value); + $this->assertEquals($value, $this->config->getCookieHttpOnly()); + } + + public function testCookieHttpOnlyAltersIniSetting() + { + $value = ini_get('session.cookie_httponly') ? false : true; + $this->config->setCookieHttpOnly($value); + $this->assertEquals($value, ini_get('session.cookie_httponly')); + } + + public function testUseCookiesDefaultsToIniSettings() + { + $this->assertSame((bool) ini_get('session.use_cookies'), $this->config->getUseCookies()); + } + + public function testUseCookiesIsMutable() + { + $value = ini_get('session.use_cookies') ? false : true; + $this->config->setUseCookies($value); + $this->assertEquals($value, (bool) $this->config->getUseCookies()); + } + + public function testUseCookiesAltersIniSetting() + { + $value = ini_get('session.use_cookies') ? false : true; + $this->config->setUseCookies($value); + $this->assertEquals($value, (bool) ini_get('session.use_cookies')); + } + + public function testUseOnlyCookiesDefaultsToIniSettings() + { + $this->assertSame((bool) ini_get('session.use_only_cookies'), $this->config->getUseOnlyCookies()); + } + + public function testUseOnlyCookiesIsMutable() + { + $value = ini_get('session.use_only_cookies') ? false : true; + $this->config->setOption('use_only_cookies', $value); + $this->assertEquals($value, (bool) $this->config->getOption('use_only_cookies')); + } + + public function testUseOnlyCookiesAltersIniSetting() + { + $value = ini_get('session.use_only_cookies') ? false : true; + $this->config->setOption('use_only_cookies', $value); + $this->assertEquals($value, (bool) ini_get('session.use_only_cookies')); + } + + public function testRefererCheckDefaultsToIniSettings() + { + $this->assertSame(ini_get('session.referer_check'), $this->config->getRefererCheck()); + } + + public function testRefererCheckIsMutable() + { + $this->config->setOption('referer_check', 'FOOBAR'); + $this->assertEquals('FOOBAR', $this->config->getOption('referer_check')); + } + + public function testRefererCheckMayBeEmpty() + { + $this->config->setOption('referer_check', ''); + $this->assertEquals('', $this->config->getOption('referer_check')); + } + + public function testRefererCheckAltersIniSetting() + { + $this->config->setOption('referer_check', 'BARBAZ'); + $this->assertEquals('BARBAZ', ini_get('session.referer_check')); + } +} diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Store/Storage/DefaultTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Store/Storage/DefaultTest.php index 6759bc39523..90112e94d79 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Store/Storage/DefaultTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Store/Storage/DefaultTest.php @@ -66,10 +66,21 @@ class DefaultTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_websiteMock = $this->getMock('Magento\Core\Model\Website', - array('getCode', 'getId'), array(), '', false, false); + $this->_websiteMock = $this->getMock( + 'Magento\Core\Model\Website', + array('getCode', 'getId', '__wakeup'), + array(), + '', + false, + false + ); $this->_groupMock = $this->getMock('Magento\Core\Model\Store\Group', - array('getCode', 'getId'), array(), '', false, false); + array('getCode', 'getId', '__wakeup'), + array(), + '', + false, + false + ); $this->_storeFactoryMock = $this->getMock('Magento\Core\Model\StoreFactory', array('create'), array(), '', false, false); $this->_websiteFactoryMock = $this->getMock('Magento\Core\Model\Website\Factory', diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Store/StorageFactoryTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Store/StorageFactoryTest.php index bc1a3078196..c36deed83c4 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Store/StorageFactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Store/StorageFactoryTest.php @@ -137,7 +137,7 @@ class StorageFactoryTest extends \PHPUnit_Framework_TestCase $store->expects($this->at(0)) ->method('getConfig') - ->with($this->equalTo(\Magento\Core\Model\Session\AbstractSession::XML_PATH_USE_FRONTEND_SID)) + ->with($this->equalTo(\Magento\Core\Model\Session\SidResolver::XML_PATH_USE_FRONTEND_SID)) ->will($this->returnValue(true)); $store->expects($this->at(1)) diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php index 32ee23dde2e..d3525534ca1 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/ThemeTest.php @@ -93,7 +93,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase public function testIsVirtual($type, $isVirtual) { /** @var $themeModel \Magento\Core\Model\Theme */ - $themeModel = $this->getMock('Magento\Core\Model\Theme', null, array(), '', false); + $themeModel = $this->getMock('Magento\Core\Model\Theme', array('__wakeup'), array(), '', false); $themeModel->setType($type); $this->assertEquals($isVirtual, $themeModel->isVirtual()); } @@ -119,7 +119,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase public function testIsPhysical($type, $isPhysical) { /** @var $themeModel \Magento\Core\Model\Theme */ - $themeModel = $this->getMock('Magento\Core\Model\Theme', null, array(), '', false); + $themeModel = $this->getMock('Magento\Core\Model\Theme', array('__wakeup'), array(), '', false); $themeModel->setType($type); $this->assertEquals($isPhysical, $themeModel->isPhysical()); } @@ -145,7 +145,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase public function testIsVisible($type, $isVisible) { /** @var $themeModel \Magento\Core\Model\Theme */ - $themeModel = $this->getMock('Magento\Core\Model\Theme', null, array(), '', false); + $themeModel = $this->getMock('Magento\Core\Model\Theme', array('__wakeup'), array(), '', false); $themeModel->setType($type); $this->assertEquals($isVisible, $themeModel->isVisible()); } @@ -173,7 +173,7 @@ class ThemeTest extends \PHPUnit_Framework_TestCase public function testIsDeletable($themeType, $isDeletable) { /** @var $themeModel \Magento\Core\Model\Theme */ - $themeModel = $this->getMock('Magento\Core\Model\Theme', array('getType'), array(), '', false); + $themeModel = $this->getMock('Magento\Core\Model\Theme', array('getType', '__wakeup'), array(), '', false); $themeModel->expects($this->once()) ->method('getType') ->will($this->returnValue($themeType)); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Url/SecurityInfoTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/Url/SecurityInfoTest.php index 20d8e52524b..7aac3ac12ef 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Url/SecurityInfoTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/Url/SecurityInfoTest.php @@ -38,7 +38,13 @@ class SecurityInfoTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_storeMock = $this->getMock('Magento\Core\Model\Store', array('getConfig'), array(), '', false); + $this->_storeMock = $this->getMock( + 'Magento\Core\Model\Store', + array('getConfig', '__wakeup'), + array(), + '', + false + ); $storeManagerMock = $this->getMock('Magento\Core\Model\StoreManagerInterface'); $storeManagerMock->expects($this->any())->method('getStore')->will($this->returnValue($this->_storeMock)); $this->_model = new \Magento\Core\Model\Url\SecurityInfo( diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/UrlTest.php b/dev/tests/unit/testsuite/Magento/Core/Model/UrlTest.php index d441a51ab29..6b4ae428765 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/UrlTest.php +++ b/dev/tests/unit/testsuite/Magento/Core/Model/UrlTest.php @@ -76,9 +76,15 @@ class UrlTest extends \PHPUnit_Framework_TestCase $controllerName = 'controllerName'; $actionName = 'actionName'; - $requestMock = $this->getMockForAbstractClass('Magento\App\Request\Http', - array(), '', false, false, true, - array('getRequestedRouteName', 'getRequestedControllerName', 'getRequestedActionName')); + $requestMock = $this->getMockForAbstractClass( + 'Magento\App\Request\Http', + array(), + '', + false, + false, + true, + array('getRequestedRouteName', 'getRequestedControllerName', 'getRequestedActionName') + ); $requestMock->expects($this->once())->method('getRequestedRouteName') ->will($this->returnValue($moduleFrontName)); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/AuthorizationLinkTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/AuthorizationLinkTest.php index c8024168d82..d5746f6a959 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/AuthorizationLinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/AuthorizationLinkTest.php @@ -63,7 +63,7 @@ class AuthorizationLinkTest extends \PHPUnit_Framework_TestCase ->setMethods(array('getLogoutUrl', 'getLoginUrl')) ->getMock(); - $context = $this->_objectManager->getObject('Magento\View\Block\Template\Context'); + $context = $this->_objectManager->getObject('Magento\View\Element\Template\Context'); $context->getHelperFactory()->expects($this->any())->method('get')->will($this->returnValue($this->_helper)); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/LinkTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/LinkTest.php index 31f0814bafb..fe239fc6599 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/LinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/LinkTest.php @@ -50,7 +50,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase ->getMock(); $context = $objectManager->getObject( - 'Magento\View\Block\Template\Context', + 'Magento\View\Element\Template\Context', array( 'layout' => $layout, 'helperFactory' => $helperFactory diff --git a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/RegisterLinkTest.php b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/RegisterLinkTest.php index 61a3a5bd932..4be0dd7f73d 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Block/Account/RegisterLinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Block/Account/RegisterLinkTest.php @@ -44,7 +44,7 @@ class RegisterLinkTest extends \PHPUnit_Framework_TestCase public function testToHtml() { - $context = $this->_objectManager->getObject('Magento\View\Block\Template\Context'); + $context = $this->_objectManager->getObject('Magento\View\Element\Template\Context'); $session = $this->getMockBuilder('Magento\Customer\Model\Session') ->disableOriginalConstructor() ->setMethods(array('isLoggedIn')) @@ -75,7 +75,7 @@ class RegisterLinkTest extends \PHPUnit_Framework_TestCase $helper->expects($this->any())->method('getRegisterUrl')->will($this->returnValue('register url')); - $context = $this->_objectManager->getObject('Magento\View\Block\Template\Context'); + $context = $this->_objectManager->getObject('Magento\View\Element\Template\Context'); $context->getHelperFactory()->expects($this->once())->method('get')->will($this->returnValue($helper)); diff --git a/dev/tests/unit/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php b/dev/tests/unit/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php index d32dec75c4b..c65d91f80a4 100644 --- a/dev/tests/unit/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php +++ b/dev/tests/unit/testsuite/Magento/Customer/Controller/Adminhtml/IndexTest.php @@ -234,7 +234,9 @@ class IndexTest extends \PHPUnit_Framework_TestCase protected function _getCustomerMock($customerId, $returnId = null) { $customerMock = $this->getMock('Magento\Customer\Model\Customer', - array('setResetPasswordUrl', 'changeResetPasswordLinkToken', 'sendPasswordReminderEmail', 'load', 'getId'), + array('setResetPasswordUrl', 'changeResetPasswordLinkToken', 'sendPasswordReminderEmail', 'load', + 'getId', '__wakeup', + ), array(), '', false); $customerMock->expects($this->any()) ->method('load') diff --git a/dev/tests/unit/testsuite/Magento/Data/Collection/DbTest.php b/dev/tests/unit/testsuite/Magento/Data/Collection/DbTest.php index dde697b6e56..18750b33e53 100644 --- a/dev/tests/unit/testsuite/Magento/Data/Collection/DbTest.php +++ b/dev/tests/unit/testsuite/Magento/Data/Collection/DbTest.php @@ -39,7 +39,7 @@ class DbTest extends \PHPUnit_Framework_TestCase $fetchStrategy = $this->getMockForAbstractClass('Magento\Data\Collection\Db\FetchStrategyInterface'); $entityFactory = $this->getMock('Magento\Core\Model\EntityFactory', array(), array(), '', false); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); - $this->_collection = new \Magento\Data\Collection\Db($logger, $fetchStrategy, $entityFactory); + $this->_collection = new \Magento\Data\Collection\Db($entityFactory, $logger, $fetchStrategy); } protected function tearDown() @@ -256,7 +256,7 @@ class DbTest extends \PHPUnit_Framework_TestCase $collection = $this->getMock( 'Magento\Data\Collection\Db', array('_logQuery'), - array($logger, $fetchStrategy, $entityFactory) + array($entityFactory, $logger, $fetchStrategy) ); $collection->setFlag('log_query', $logFlag); $collection->expects($this->exactly($expectedCalls))->method('_logQuery'); diff --git a/dev/tests/unit/testsuite/Magento/Data/FormTest.php b/dev/tests/unit/testsuite/Magento/Data/FormTest.php index 6abaafa466f..9012514f195 100644 --- a/dev/tests/unit/testsuite/Magento/Data/FormTest.php +++ b/dev/tests/unit/testsuite/Magento/Data/FormTest.php @@ -43,7 +43,7 @@ class FormTest extends \PHPUnit_Framework_TestCase /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_sessionMock; + protected $_formKeyMock; /** * @var \Magento\Data\Form @@ -57,17 +57,17 @@ class FormTest extends \PHPUnit_Framework_TestCase $this->_factoryCollectionMock = $this->getMock('Magento\Data\Form\Element\CollectionFactory', array('create'), array(), '', false); $this->_factoryCollectionMock->expects($this->any())->method('create')->will($this->returnValue(array())); - $this->_sessionMock = $this->getMock( - 'Magento\Core\Model\Session', array('getFormKey'), array(), '', false + $this->_formKeyMock = $this->getMock( + 'Magento\Data\Form\FormKey', array('getFormKey'), array(), '', false ); - $this->_form = new Form($this->_sessionMock, $this->_factoryElementMock, $this->_factoryCollectionMock); + $this->_form = new Form($this->_factoryElementMock, $this->_factoryCollectionMock, $this->_formKeyMock); } public function testFormKeyUsing() { $formKey = 'form-key'; - $this->_sessionMock->expects($this->once())->method('getFormKey')->will($this->returnValue($formKey)); + $this->_formKeyMock->expects($this->once())->method('getFormKey')->will($this->returnValue($formKey)); $this->_form->setUseContainer(true); $this->_form->setMethod('post'); diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php index 01924ffe60d..695c6d048bb 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/CustomTest.php @@ -58,8 +58,13 @@ class CustomTest extends \PHPUnit_Framework_TestCase { $this->_urlBuilder = $this->getMock('Magento\Backend\Model\Url', array(), array(), '', false); $this->_themeContext = $this->getMock('Magento\DesignEditor\Model\Theme\Context', array(), array(), '', false); - $this->_theme = $this->getMock('Magento\Core\Model\Theme', array('getId', 'getCustomization'), array(), - '', false); + $this->_theme = $this->getMock( + 'Magento\Core\Model\Theme', + array('getId', 'getCustomization', '__wakeup'), + array(), + '', + false + ); $this->_theme->expects($this->any())->method('getId')->will($this->returnValue(self::TEST_THEME_ID)); $this->_themeContext->expects($this->any())->method('getEditableTheme') ->will($this->returnValue($this->_theme)); diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/JsTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/JsTest.php index a07306dea0b..b6e7d655da8 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/JsTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Block/Adminhtml/Editor/Tools/Code/JsTest.php @@ -58,8 +58,13 @@ class JsTest extends \PHPUnit_Framework_TestCase { $this->_urlBuilder = $this->getMock('Magento\Backend\Model\Url', array(), array(), '', false); $this->_themeContext = $this->getMock('Magento\DesignEditor\Model\Theme\Context', array(), array(), '', false); - $this->_theme = $this->getMock('Magento\Core\Model\Theme', array('getId', 'getCustomization'), array(), '', - false); + $this->_theme = $this->getMock( + 'Magento\Core\Model\Theme', + array('getId', 'getCustomization', '__wakeup'), + array(), + '', + false + ); $this->_theme->expects($this->any())->method('getId')->will($this->returnValue(self::TEST_THEME_ID)); $this->_themeContext->expects($this->any())->method('getEditableTheme') ->will($this->returnValue($this->_theme)); diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php index 4db0da00ef9..80db9fd1176 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Controller/Adminhtml/System/Design/EditorTest.php @@ -68,12 +68,17 @@ class EditorTest extends \PHPUnit_Framework_TestCase $layoutMock->expects($this->any())->method('generateXml')->will($this->returnSelf()); $layoutMock->expects($this->any())->method('getNode') ->will($this->returnValue(new \Magento\Simplexml\Element('<root />'))); - $blockMessage = $this->getMock('Magento\View\Block\Messages', + $blockMessage = $this->getMock('Magento\View\Element\Messages', array('addMessages', 'setEscapeMessageFlag', 'addStorageType'), array(), '', false); $layoutMock->expects($this->any())->method('getMessagesBlock')->will($this->returnValue($blockMessage)); - $blockMock = $this->getMock('Magento\View\Block\Template', array('setActive', 'getMenuModel', 'getParentItems'), - array(), '', false); + $blockMock = $this->getMock( + 'Magento\View\Element\Template', + array('setActive', 'getMenuModel', 'getParentItems'), + array(), + '', + false + ); $blockMock->expects($this->any())->method('getMenuModel')->will($this->returnSelf()); $blockMock->expects($this->any())->method('getParentItems')->will($this->returnValue(array())); diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Plugin/ThemeCopyServiceTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Plugin/ThemeCopyServiceTest.php index 975e694c11b..9d0e7b8e15a 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Plugin/ThemeCopyServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Plugin/ThemeCopyServiceTest.php @@ -58,10 +58,20 @@ class ThemeCopyServiceTest extends \PHPUnit_Framework_TestCase ->method('getId') ->will($this->returnValue($targetThemeId)); - $sourceChangeMock = $this->getMock('Magento\DesignEditor\Model\Theme\Change', - array('getId', 'getChangeTime', 'loadByThemeId'), array(), '', false); - $targetChangeMock = $this->getMock('Magento\DesignEditor\Model\Theme\Change', - array('setThemeId', 'setChangeTime', 'loadByThemeId', 'save'), array(), '', false); + $sourceChangeMock = $this->getMock( + 'Magento\DesignEditor\Model\Theme\Change', + array('getId', 'getChangeTime', 'loadByThemeId', '__wakeup'), + array(), + '', + false + ); + $targetChangeMock = $this->getMock( + 'Magento\DesignEditor\Model\Theme\Change', + array('setThemeId', 'setChangeTime', 'loadByThemeId', 'save', '__wakeup'), + array(), + '', + false + ); $this->_factoryMock->expects($this->at(0)) ->method('create') ->will($this->returnValue($sourceChangeMock)); diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php index 175e5dc6f72..79bf2e2878b 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/StateTest.php @@ -165,7 +165,7 @@ class StateTest extends \PHPUnit_Framework_TestCase ->method('getConfig') ->will($this->returnValue($configMock)); - $this->_theme = $this->getMock('Magento\Core\Model\Theme', array('getId'), array(), '', false); + $this->_theme = $this->getMock('Magento\Core\Model\Theme', array('getId', '__wakeup'), array(), '', false); $this->_theme->expects($this->any()) ->method('getId') ->will($this->returnValue(self::THEME_ID)); diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Theme/ContextTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Theme/ContextTest.php index c8c92420c87..e967a79dfc2 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Theme/ContextTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Theme/ContextTest.php @@ -57,8 +57,13 @@ class ContextTest extends \PHPUnit_Framework_TestCase { $this->_themeFactory = $this->getMock('Magento\Core\Model\ThemeFactory', array('create'), array(), '', false); - $this->_theme = $this->getMock('Magento\Core\Model\Theme', - array('load', 'getId', 'getType', 'getDomainModel', 'isVirtual'), array(), '', false); + $this->_theme = $this->getMock( + 'Magento\Core\Model\Theme', + array('load', 'getId', 'getType', 'getDomainModel', 'isVirtual', '__wakeup'), + array(), + '', + false + ); $this->_themeFactory->expects($this->any())->method('create')->will($this->returnValue($this->_theme)); $this->_copyService = $this->getMock('Magento\Core\Model\Theme\CopyService', array('copy'), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Url/NavigationModeTest.php b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Url/NavigationModeTest.php index fe3e60eecb6..7a2cffdf6d8 100644 --- a/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Url/NavigationModeTest.php +++ b/dev/tests/unit/testsuite/Magento/DesignEditor/Model/Url/NavigationModeTest.php @@ -46,46 +46,11 @@ class NavigationModeTest extends \PHPUnit_Framework_TestCase */ protected $_designHelperMock; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_coreHelperMock; - /** * @var \PHPUnit_Framework_MockObject_MockObject */ protected $_requestMock; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_storeConfigMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_appMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_storeManagerMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_sessionMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_configInterfaceMock; - - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_securityInfoMock; - /** * @var array */ @@ -93,34 +58,20 @@ class NavigationModeTest extends \PHPUnit_Framework_TestCase protected function setUp() { + $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); + $this->_designHelperMock = $this->getMock('Magento\DesignEditor\Helper\Data', array(), array(), '', false); $this->_requestMock = $this->getMock('Magento\App\Request\Http', array(), array(), '', false); - $this->_storeConfigMock = $this->getMock('Magento\Core\Model\Store\Config', array(), array(), '', false); - $this->_appMock = $this->getMock('Magento\Core\Model\App', array(), array(), '', false); - $this->_storeManagerMock = $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false); - $this->_sessionMock = $this->getMock('Magento\Core\Model\Session', array(), array(), '', false); - $this->_configInterfaceMock = $this->getMock('\Magento\App\Route\ConfigInterface'); - $this->_securityInfoMock = $this->getMock('Magento\Core\Model\Url\SecurityInfoInterface'); - $this->_requestMock->expects($this->any()) ->method('getAlias') ->will($this->returnValueMap(array( array('editorMode', 'navigation'), array('themeId', 1)))); - $this->_model = new \Magento\DesignEditor\Model\Url\NavigationMode( - $this->_configInterfaceMock, - $this->_requestMock, - $this->_securityInfoMock, - $this->_designHelperMock, - $this->_storeConfigMock, - $this->_appMock, - $this->_storeManagerMock, - $this->_sessionMock, - 'string', - $this->_testData - ); - $this->_model->setRequest($this->_requestMock); + $this->_model = $objectManagerHelper->getObject('Magento\DesignEditor\Model\Url\NavigationMode', array( + 'helper' => $this->_designHelperMock, + 'data' => $this->_testData + )); } public function testConstruct() @@ -135,9 +86,12 @@ class NavigationModeTest extends \PHPUnit_Framework_TestCase ->method('getFrontName') ->will($this->returnValue(self::FRONT_NAME)); - $store = $this->getMock('Magento\Core\Model\Store', + $store = $this->getMock( + 'Magento\Core\Model\Store', array('getBaseUrl', 'isAdmin', 'isAdminUrlSecure', 'isFrontUrlSecure', '__sleep', '__wakeup'), - array(), '', false + array(), + '', + false ); $store->expects($this->any()) ->method('getBaseUrl') diff --git a/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php index fe4276e5fcc..ded9653faf8 100644 --- a/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Directory/Model/Resource/Country/CollectionTest.php @@ -42,9 +42,14 @@ class CollectionTest extends \PHPUnit_Framework_TestCase ->method('select') ->will($this->returnValue($select)); - $resource = $this->getMockForAbstractClass('Magento\Core\Model\Resource\Db\AbstractDb', array(), '', - false, true, - true, array('getReadConnection', 'getMainTable', 'getTable')); + $resource = $this->getMockForAbstractClass('Magento\Core\Model\Resource\Db\AbstractDb', + array(), + '', + false, + true, + true, + array('getReadConnection', 'getMainTable', 'getTable', '__wakeup') + ); $resource->expects($this->any()) ->method('getReadConnection') ->will($this->returnValue($connection)); diff --git a/dev/tests/unit/testsuite/Magento/Downloadable/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Downloadable/Model/ObserverTest.php index 6c32beb739d..99ae3d3bd18 100644 --- a/dev/tests/unit/testsuite/Magento/Downloadable/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Downloadable/Model/ObserverTest.php @@ -72,9 +72,23 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $this->_observer = null; } + /** + * @return \PHPUnit_Framework_MockObject_MockObject|\Magento\Catalog\Model\Product + */ + protected function getProductMock() + { + return $this->getMock( + 'Magento\Catalog\Model\Product', + array('getTypeId', 'getTypeInstance', '__wakeup'), + array(), + '', + false + ); + } + public function testDuplicateProductNotDownloadable() { - $currentProduct = $this->getMock('Magento\Catalog\Model\Product', array('getTypeId'), array(), '', false); + $currentProduct = $this->getProductMock(); $currentProduct->expects($this->once()) ->method('getTypeId') @@ -89,13 +103,11 @@ class ObserverTest extends \PHPUnit_Framework_TestCase public function testDuplicateProductEmptyLinks() { - $currentProduct = $this->getMock('Magento\Catalog\Model\Product', - array('getTypeId', 'getTypeInstance'), array(), '', false); + $currentProduct = $this->getProductMock(); $currentProduct->expects($this->once()) ->method('getTypeId') ->will($this->returnValue(\Magento\Downloadable\Model\Product\Type::TYPE_DOWNLOADABLE)); - $newProduct = $this->getMock('Magento\Catalog\Model\Product', - array('getTypeId', 'getTypeInstance'), array(), '', false); + $newProduct = $this->getProductMock(); $typeInstance = $this->getMock('Magento\Downloadable\Model\Product\Type', array('getLinks', 'getSamples'), array(), '', false); @@ -119,14 +131,12 @@ class ObserverTest extends \PHPUnit_Framework_TestCase public function testDuplicateProductTypeFile() { - $currentProduct = $this->getMock('Magento\Catalog\Model\Product', - array('getTypeId', 'getTypeInstance'), array(), '', false); + $currentProduct = $this->getProductMock(); $currentProduct->expects($this->once()) ->method('getTypeId') ->will($this->returnValue(\Magento\Downloadable\Model\Product\Type::TYPE_DOWNLOADABLE)); - $newProduct = $this->getMock('Magento\Catalog\Model\Product', - array('getTypeId', 'getTypeInstance'), array(), '', false); + $newProduct = $this->getProductMock(); $links = $this->_getLinks(); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php index 8fd68ba7339..0480ecbd69b 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AbstractTest.php @@ -64,9 +64,9 @@ class AbstractTest extends \PHPUnit_Framework_TestCase */ public function testCompareAttributes($attribute1Sort, $attribute2Sort, $expected) { - $attribute1 = $this->getMock('Magento\Eav\Model\Entity\Attribute', null, array(), '', false); + $attribute1 = $this->getMock('Magento\Eav\Model\Entity\Attribute', array('__wakeup'), array(), '', false); $attribute1->setAttributeSetInfo(array(0 => $attribute1Sort)); - $attribute2 = $this->getMock('Magento\Eav\Model\Entity\Attribute', null, array(), '', false); + $attribute2 = $this->getMock('Magento\Eav\Model\Entity\Attribute', array('__wakeup'), array(), '', false); $attribute2->setAttributeSetInfo(array(0 => $attribute2Sort)); $this->assertEquals($expected, $this->_model->attributesCompare($attribute1, $attribute2)); } @@ -122,7 +122,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase foreach ($codes as $code) { $mock = $this->getMock( 'Magento\Eav\Model\Entity\Attribute\AbstractAttribute', - array('getBackend', 'getBackendTable'), + array('getBackend', 'getBackendTable', '__wakeup'), array(), '', false @@ -207,7 +207,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase { $attribute = $this->getMock( 'Magento\Eav\Model\Entity\Attribute\AbstractAttribute', - array('getBackend', 'getBackendTable', 'isInSet', 'getApplyTo', 'getAttributeCode'), + array('getBackend', 'getBackendTable', 'isInSet', 'getApplyTo', 'getAttributeCode', '__wakeup'), array(), '', false @@ -240,7 +240,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase */ public function testSave($attributeCode, $attributeSetId, $productData, $productOrigData) { - $object = $this->getMock('Magento\Catalog\Model\Product', array('getOrigData'), array(), '', false); + $object = $this->getMock('Magento\Catalog\Model\Product', array('getOrigData', '__wakeup'), array(), '', false); $object->setEntityTypeId(1); $object->setData($productData); $object->expects($this->any()) diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/AbstractTest.php index 2b8782b3559..3e4a6c52850 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/AbstractTest.php @@ -51,7 +51,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase $attribute = $this->getMock( 'Magento\Eav\Model\Entity\Attribute\AbstractAttribute', - array('getBackendTable', 'isStatic', 'getAttributeId'), + array('getBackendTable', 'isStatic', 'getAttributeId', '__wakeup'), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/ArrayTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/ArrayTest.php index 1f223d433f3..c2cf8854e25 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/ArrayTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/Attribute/Backend/ArrayTest.php @@ -42,7 +42,11 @@ class ArrayTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_attribute = $this->getMock( - 'Magento\Eav\Model\Entity\Attribute', array('getAttributeCode'), array(), '', false + 'Magento\Eav\Model\Entity\Attribute', + array('getAttributeCode', '__wakeup'), + array(), + '', + false ); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $this->_model = new \Magento\Eav\Model\Entity\Attribute\Backend\ArrayBackend($logger); diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AttributeTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AttributeTest.php index 08a49caa8de..46acab42c38 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AttributeTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Entity/AttributeTest.php @@ -37,7 +37,7 @@ class AttributeTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_model = $this->getMock('Magento\Eav\Model\Entity\Attribute', null, array(), '', false); + $this->_model = $this->getMock('Magento\Eav\Model\Entity\Attribute', array('__wakeup'), array(), '', false); } protected function tearDown() diff --git a/dev/tests/unit/testsuite/Magento/Eav/Model/Validator/Attribute/DataTest.php b/dev/tests/unit/testsuite/Magento/Eav/Model/Validator/Attribute/DataTest.php index 73f7f65edd5..7f09d2578ed 100644 --- a/dev/tests/unit/testsuite/Magento/Eav/Model/Validator/Attribute/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Eav/Model/Validator/Attribute/DataTest.php @@ -344,7 +344,7 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function _getAttributeMock($attributeData) { $attribute = $this->getMockBuilder('Magento\Eav\Model\Attribute') - ->setMethods(array('getAttributeCode', 'getDataModel', 'getFrontendInput')) + ->setMethods(array('getAttributeCode', 'getDataModel', 'getFrontendInput', '__wakeup')) ->disableOriginalConstructor() ->getMock(); if (isset($attributeData['attribute_code'])) { @@ -407,7 +407,7 @@ class DataTest extends \PHPUnit_Framework_TestCase protected function _getEntityMock() { $entity = $this->getMockBuilder('Magento\Core\Model\AbstractModel') - ->setMethods(array('getAttribute', 'getResource', 'getEntityType')) + ->setMethods(array('getAttribute', 'getResource', 'getEntityType', '__wakeup')) ->disableOriginalConstructor() ->getMock(); return $entity; diff --git a/dev/tests/unit/testsuite/Magento/GiftMessage/Model/Plugin/QuoteItemTest.php b/dev/tests/unit/testsuite/Magento/GiftMessage/Model/Plugin/QuoteItemTest.php index ec0feeab932..2a1941ee065 100644 --- a/dev/tests/unit/testsuite/Magento/GiftMessage/Model/Plugin/QuoteItemTest.php +++ b/dev/tests/unit/testsuite/Magento/GiftMessage/Model/Plugin/QuoteItemTest.php @@ -44,14 +44,14 @@ class QuoteItemTest extends \PHPUnit_Framework_TestCase { $this->_orderItemMock = $this->getMock( 'Magento\Sales\Model\Order\Item', - array('setGiftMessageId', 'setGiftMessageAvailable'), + array('setGiftMessageId', 'setGiftMessageAvailable', '__wakeup'), array(), '', false ); $this->_quoteItemMock = $this->getMock( 'Magento\Sales\Model\Quote\Item', - array('getGiftMessageId', 'getStoreId'), + array('getGiftMessageId', 'getStoreId', '__wakeup'), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/FormTest.php b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/FormTest.php index fff6cf6c246..b8fcc00d0e1 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/FormTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Helper/FormTest.php @@ -50,8 +50,13 @@ class FormTest extends \PHPUnit_Framework_TestCase $this->_formMock = $this->getMock('Magento\Data\Form', array('setFieldNameSuffix', 'addFieldset'), array(), '', false); $this->_fieldsetMock = $this->getMock('Magento\Data\Form\Element\Fieldset', array(), array(), '', false); - $this->_experimentCodeMock = $this->getMock('Magento\GoogleOptimizer\Model\Code', - array('getExperimentScript', 'getCodeId'), array(), '', false); + $this->_experimentCodeMock = $this->getMock( + 'Magento\GoogleOptimizer\Model\Code', + array('getExperimentScript', 'getCodeId', '__wakeup'), + array(), + '', + false + ); $context = $this->getMock('Magento\App\Helper\Context', array(), array(), '', false); $data = array( 'context' => $context diff --git a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Product/DeleteTest.php b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Product/DeleteTest.php index 32d218f524f..05e88b9ea91 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Product/DeleteTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleOptimizer/Model/Observer/Product/DeleteTest.php @@ -49,7 +49,13 @@ class DeleteTest extends \PHPUnit_Framework_TestCase $event = $this->getMock('Magento\Event', array('getProduct'), array(), '', false); $this->_eventObserverMock = $this->getMock('Magento\Event\Observer', array(), array(), '', false); $this->_eventObserverMock->expects($this->once())->method('getEvent')->will($this->returnValue($event)); - $product = $this->getMock('Magento\Catalog\Model\Product', array('getId', 'getStoreId'), array(), '', false); + $product = $this->getMock( + 'Magento\Catalog\Model\Product', + array('getId', 'getStoreId', '__wakeup'), + array(), + '', + false + ); $product->expects($this->once())->method('getId')->will($this->returnValue($entityId)); $product->expects($this->once())->method('getStoreId')->will($this->returnValue($storeId)); $event->expects($this->once())->method('getProduct')->will($this->returnValue($product)); diff --git a/dev/tests/unit/testsuite/Magento/GoogleShopping/Block/SiteVerificationTest.php b/dev/tests/unit/testsuite/Magento/GoogleShopping/Block/SiteVerificationTest.php index 23f579bd305..9cb57ad1e21 100644 --- a/dev/tests/unit/testsuite/Magento/GoogleShopping/Block/SiteVerificationTest.php +++ b/dev/tests/unit/testsuite/Magento/GoogleShopping/Block/SiteVerificationTest.php @@ -43,7 +43,7 @@ class SiteVerificationTest extends \PHPUnit_Framework_TestCase ->method('escapeHtml') ->with('Valor & Honor')->will($this->returnValue('Valor & Honor')); - $context = $objectHelper->getObject('Magento\View\Block\Context', array( + $context = $objectHelper->getObject('Magento\View\Element\Context', array( 'escaper' => $escaper )); diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/AbstractEavTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/AbstractEavTest.php index 2767be13ba5..a5bbb35b23b 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/AbstractEavTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Export/Entity/AbstractEavTest.php @@ -87,8 +87,13 @@ class AbstractEavTest extends \PHPUnit_Framework_TestCase $testAttributeOptions = array('value' => 'option'); /** @var $testAttribute \Magento\Eav\Model\Entity\Attribute */ $testAttribute = $this->getMockForAbstractClass( - 'Magento\Eav\Model\Entity\Attribute\AbstractAttribute', array(), '', - false + 'Magento\Eav\Model\Entity\Attribute\AbstractAttribute', + array(), + '', + false, + false, + false, + array('__wakeup') ); $testAttribute->setAttributeCode($testAttributeCode); @@ -100,9 +105,16 @@ class AbstractEavTest extends \PHPUnit_Framework_TestCase ->method('getAttributeOptions') ->will($this->returnValue($testAttributeOptions)); - /** @var $item \Magento\Core\Model\AbstractModel|PHPUnit_Framework_MockObject_MockObject */ - $item = $this->getMockForAbstractClass('Magento\Core\Model\AbstractModel', array(), '', false, true, true, - array('getData')); + /** @var $item \Magento\Core\Model\AbstractModel|\PHPUnit_Framework_MockObject_MockObject */ + $item = $this->getMockForAbstractClass( + 'Magento\Core\Model\AbstractModel', + array(), + '', + false, + true, + true, + array('getData', '__wakeup') + ); $item->expects($this->any()) ->method('getData') ->will($this->returnValue($testAttributeValue)); diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/AbstractTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/AbstractTest.php index 166aee5eb89..cb4b41fb09c 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/AbstractTest.php @@ -55,33 +55,6 @@ class AbstractTest extends \PHPUnit_Framework_TestCase parent::tearDown(); } - /** - * Create mock for data helper and push it to registry - * - * @return \Magento\ImportExport\Helper\Data|\PHPUnit_Framework_MockObject_MockObject - */ - protected function _createDataHelperMock() - { - /** @var $helper \Magento\ImportExport\Helper\Data */ - $helper = $this->getMock('Magento\ImportExport\Helper\Data', array(), array(), '', false); - - $coreRegisterMock = $this->getMock('Magento\Core\Model\Registry'); - $coreRegisterMock->expects($this->any()) - ->method('registry') - ->with('_helper/Magento\ImportExport\Helper\Data') - ->will($this->returnValue($helper)); - - $objectManagerMock = $this->getMockBuilder('Magento\ObjectManager')->getMock(); - $objectManagerMock->expects($this->any()) - ->method('get') - ->with('Magento\Core\Model\Registry') - ->will($this->returnValue($coreRegisterMock)); - - \Magento\App\ObjectManager::setInstance($objectManagerMock); - - return $helper; - } - /** * Create source adapter mock and set it into model object which tested in this class * @@ -111,7 +84,6 @@ class AbstractTest extends \PHPUnit_Framework_TestCase */ public function testValidateDataEmptyColumnName() { - $this->_createDataHelperMock(); $this->_createSourceAdapterMock(array('')); $this->_model->validateData(); } @@ -125,7 +97,6 @@ class AbstractTest extends \PHPUnit_Framework_TestCase */ public function testValidateDataColumnNameWithWhitespaces() { - $this->_createDataHelperMock(); $this->_createSourceAdapterMock(array(' ')); $this->_model->validateData(); } @@ -139,7 +110,6 @@ class AbstractTest extends \PHPUnit_Framework_TestCase */ public function testValidateDataAttributeNames() { - $this->_createDataHelperMock(); $this->_createSourceAdapterMock(array('_test1')); $this->_model->validateData(); } @@ -158,7 +128,6 @@ class AbstractTest extends \PHPUnit_Framework_TestCase */ public function testIsAttributeValid($attrCode, array $attrParams, array $rowData, $rowNum, $expectedResult) { - $this->_createDataHelperMock(); $this->_createSourceAdapterMock(array('_test1')); $this->assertEquals($expectedResult, $this->_model->isAttributeValid($attrCode, $attrParams, $rowData, $rowNum)); diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/CustomerTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/CustomerTest.php index d8e060e223f..f4ac7586968 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/CustomerTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Eav/CustomerTest.php @@ -127,7 +127,7 @@ class CustomerTest extends \PHPUnit_Framework_TestCase // mock to imitate data source model $dataSourceModelMock = $this->getMock( 'Magento\ImportExport\Model\Resource\Import\Data', - array('getNextBunch'), + array('getNextBunch', '__wakeup'), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Product/OptionTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Product/OptionTest.php index 9d5b2c7b9b1..ac85b3261de 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Product/OptionTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Import/Entity/Product/OptionTest.php @@ -457,7 +457,7 @@ class OptionTest extends \PHPUnit_Framework_TestCase $optionCollection = $this->getMock( 'Magento\Data\Collection\Db', array('reset', 'addProductToFilter', 'getSelect', 'getNewEmptyItem'), - array($logger, $fetchStrategy, $entityFactory) + array($entityFactory, $logger, $fetchStrategy) ); $select = $this->getMock('Zend_Db_Select', array('join', 'where'), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/CollectionByPagesIteratorTest.php b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/CollectionByPagesIteratorTest.php index f0a3fcdd13a..4fb56f193b5 100644 --- a/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/CollectionByPagesIteratorTest.php +++ b/dev/tests/unit/testsuite/Magento/ImportExport/Model/Resource/CollectionByPagesIteratorTest.php @@ -68,7 +68,7 @@ class CollectionByPagesIteratorTest extends \PHPUnit_Framework_TestCase /** @var $collectionMock \Magento\Data\Collection\Db|PHPUnit_Framework_MockObject_MockObject */ $collectionMock = $this->getMock('Magento\Data\Collection\Db', array('clear', 'setPageSize', 'setCurPage', 'count', 'getLastPageNumber', 'getSelect'), - array($logger, $fetchStrategy, $entityFactory) + array($entityFactory, $logger, $fetchStrategy) ); $collectionMock->expects($this->any()) diff --git a/dev/tests/unit/testsuite/Magento/Index/App/IndexerTest.php b/dev/tests/unit/testsuite/Magento/Index/App/IndexerTest.php index f5ac7aaf87f..a5d890d2c5a 100644 --- a/dev/tests/unit/testsuite/Magento/Index/App/IndexerTest.php +++ b/dev/tests/unit/testsuite/Magento/Index/App/IndexerTest.php @@ -61,8 +61,13 @@ class IndexerTest extends \PHPUnit_Framework_TestCase */ public function testExecute($value) { - $process = $this->getMock('Magento\Index\Model\Process', - array('getIndexer', 'reindexEverything'), array(), '', false); + $process = $this->getMock( + 'Magento\Index\Model\Process', + array('getIndexer', 'reindexEverything', '__wakeup'), + array(), + '', + false + ); $indexer = $this->getMock('Magento\Index\Model\Indexer', array('getProcessesCollection'), array(), '', false); $indexerInterface = $this->getMock('Magento\Index\Model\IndexerInterface'); diff --git a/dev/tests/unit/testsuite/Magento/Index/Model/ProcessTest.php b/dev/tests/unit/testsuite/Magento/Index/Model/ProcessTest.php index 08bddb6b1df..502328f9a20 100644 --- a/dev/tests/unit/testsuite/Magento/Index/Model/ProcessTest.php +++ b/dev/tests/unit/testsuite/Magento/Index/Model/ProcessTest.php @@ -112,7 +112,12 @@ class ProcessTest extends \PHPUnit_Framework_TestCase $resource = $this->getMockForAbstractClass( 'Magento\Core\Model\Resource\Db\AbstractDb', - array(), '', false, false, true, array('getIdFieldName') + array(), + '', + false, + false, + true, + array('getIdFieldName', '__wakeup') ); $resource->expects($this->any())->method('getIdFieldName')->will($this->returnValue('process_id')); $helper = new \Magento\TestFramework\Helper\ObjectManager($this); diff --git a/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php b/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php index d3bf14aa121..bfba89de081 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Controller/Adminhtml/IntegrationTest.php @@ -26,7 +26,6 @@ namespace Magento\Integration\Controller\Adminhtml; use Magento\Integration\Block\Adminhtml\Integration\Edit\Tab\Info; -use Magento\Integration\Controller\Adminhtml\Integration; class IntegrationTest extends \PHPUnit_Framework_TestCase { @@ -82,7 +81,9 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\TestFramework\Helper\ObjectManager $objectManagerHelper */ $this->_objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_setMageObjectManager(); + $this->_mockObjectManager = $this->getMockBuilder('Magento\ObjectManager') + ->disableOriginalConstructor() + ->getMock(); // Initialize mocks which are used in several test cases $this->_mockApp = $this->getMockBuilder('Magento\Core\Model\App') ->setMethods(array('getConfig')) @@ -166,6 +167,10 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase // put data in session, the magic function getFormData is called so, must match __call method name $this->_mockBackendModSess->expects($this->any()) ->method('__call')->will($this->returnValue(array('name' => 'nonExistentInt'))); + + $invalidIdException = new \Magento\Integration\Exception($exceptionMessage); + $this->_mockIntegrationSvc->expects($this->any()) + ->method('get')->will($this->throwException($invalidIdException)); $this->_verifyLoadAndRenderLayout(); $integrationContr = $this->_createIntegrationController(); $integrationContr->editAction(); @@ -249,18 +254,6 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase $integrationContr->saveAction(); } - /** - * Makes sure that Mage has a mock object manager set. - * - */ - protected function _setMageObjectManager() - { - $this->_mockObjectManager = $this->getMockBuilder('Magento\ObjectManager') - ->disableOriginalConstructor() - ->getMock(); - \Magento\App\ObjectManager::setInstance($this->_mockObjectManager); - } - /** * Creates the IntegrationController to test. * @@ -285,6 +278,10 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase $menuMock = $this->getMockBuilder('Magento\Backend\Model\Menu') ->disableOriginalConstructor() ->getMock(); + $loggerMock = $this->getMockBuilder('Magento\Logger') + ->disableOriginalConstructor() + ->getMock(); + $loggerMock->expects($this->any())->method('logException')->will($this->returnSelf()); $menuMock->expects($this->any())->method('getParentItems')->will($this->returnValue(array())); $blockMock->expects($this->any())->method('getMenuModel')->will($this->returnValue($menuMock)); $layoutMock->expects($this->any())->method('getMessagesBlock')->will($this->returnValue($blockMock)); @@ -307,6 +304,7 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase 'context' => $this->_mockBackendCntCtxt, 'integrationService' => $this->_mockIntegrationSvc, 'registry' => $this->_mockRegistry, + 'logger' => $loggerMock ); /** Create IntegrationController to test */ $integrationContr = $this->_objectManagerHelper @@ -347,8 +345,8 @@ class IntegrationTest extends \PHPUnit_Framework_TestCase Info::DATA_NAME => 'nameTest', Info::DATA_ID => '1', Info::DATA_EMAIL => 'test@magento.com', - Info::DATA_AUTHENTICATION => 1, - Info::DATA_ENDPOINT => 'http://magento.ll/endpoint' + Info::DATA_ENDPOINT => 'http://magento.ll/endpoint', + Info::DATA_SETUP_TYPE => 0 ); } } diff --git a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/XsdTest.php b/dev/tests/unit/testsuite/Magento/Integration/Model/Config/XsdTest.php index 54997c2963e..59ab1cd6f0f 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/XsdTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Model/Config/XsdTest.php @@ -62,29 +62,21 @@ class XsdTest extends \PHPUnit_Framework_TestCase /** Valid configurations */ 'valid' => array( '<integrations> - <integration id="TestIntegration"> - <name>Test Integration</name> + <integration name="TestIntegration"> <email>test-integration@magento.com</email> - <authentication type="oauth"> - <endpoint_url>https://endpoint.url</endpoint_url> - </authentication> + <endpoint_url>https://endpoint.url</endpoint_url> </integration> </integrations>', array() ), 'valid with several entities' => array( '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> + <integration name="TestIntegration1"> <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> + <endpoint_url>http://endpoint.url</endpoint_url> </integration> - <integration id="TestIntegration2"> - <name>Test Integration 2</name> + <integration name="TestIntegration2"> <email>test-integration2@magento.com</email> - <authentication type="manual"/> </integration> </integrations>', array() @@ -97,67 +89,25 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'empty integration' => array( '<integrations> - <integration id="TestIntegration" /> + <integration name="TestIntegration" /> </integrations>', - array("Element 'integration': Missing child element(s). Expected is ( name ).") - ), - 'integration without name' => array( - '<integrations> - <integration id="TestIntegration1"> - <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> - </integration> - </integrations>', - array("Element 'email': This element is not expected. Expected is ( name ).") + array("Element 'integration': Missing child element(s). Expected is ( email ).") ), 'integration without email' => array( '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> + <integration name="TestIntegration1"> + <endpoint_url>http://endpoint.url</endpoint_url> </integration> </integrations>', - array("Element 'authentication': This element is not expected. Expected is ( email ).") - ), - 'integration without authentication' => array( - '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> - <email>test-integration1@magento.com</email> - </integration> - </integrations>', - array("Element 'integration': Missing child element(s). Expected is ( authentication ).") + array("Element 'endpoint_url': This element is not expected. Expected is ( email ).") ), /** Empty nodes */ - 'empty name' => array( - '<integrations> - <integration id="TestIntegration1"> - <name></name> - <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> - </integration> - </integrations>', - array( - "Element 'name': [facet 'minLength'] The value has a length of '0';" - . " this underruns the allowed minimum length of '2'.", - "Element 'name': '' is not a valid value of the atomic type 'integrationNameType'." - ) - ), 'empty email' => array( '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> + <integration name="TestIntegration1"> <email></email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> + <endpoint_url>http://endpoint.url</endpoint_url> </integration> </integrations>', array( @@ -166,24 +116,11 @@ class XsdTest extends \PHPUnit_Framework_TestCase "Element 'email': '' is not a valid value of the atomic type 'emailType'." ) ), - 'authentication is empty' => array( - '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> - <email>test-integration1@magento.com</email> - <authentication type="manual"/> - </integration> - </integrations>', - array() - ), 'endpoint_url is empty' => array( '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> + <integration name="TestIntegration1"> <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url></endpoint_url> - </authentication> + <endpoint_url></endpoint_url> </integration> </integrations>', array( @@ -200,12 +137,9 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'irrelevant node in root' => array( '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> + <integration name="TestIntegration1"> <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> + <endpoint_url>http://endpoint.url</endpoint_url> </integration> <invalid/> </integrations>', @@ -213,12 +147,9 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'irrelevant node in integration' => array( '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> + <integration name="TestIntegration1"> <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> + <endpoint_url>http://endpoint.url</endpoint_url> <invalid/> </integration> </integrations>', @@ -226,13 +157,10 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'irrelevant node in authentication' => array( '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> + <integration name="TestIntegration1"> <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - <invalid/> - </authentication> + <endpoint_url>http://endpoint.url</endpoint_url> + <invalid/> </integration> </integrations>', array("Element 'invalid': This element is not expected.") @@ -241,148 +169,73 @@ class XsdTest extends \PHPUnit_Framework_TestCase /** Excessive attributes */ 'invalid attribute in root' => array( '<integrations invalid="invalid"> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> + <integration name="TestIntegration1"> <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> + <endpoint_url>http://endpoint.url</endpoint_url> </integration> </integrations>', array("Element 'integrations', attribute 'invalid': The attribute 'invalid' is not allowed.") ), 'invalid attribute in integration' => array( '<integrations> - <integration id="TestIntegration1" invalid="invalid"> - <name>Test Integration 1</name> + <integration name="TestIntegration1" invalid="invalid"> <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> + <endpoint_url>http://endpoint.url</endpoint_url> </integration> </integrations>', array("Element 'integration', attribute 'invalid': The attribute 'invalid' is not allowed.") ), - 'invalid attribute in name' => array( - '<integrations> - <integration id="TestIntegration1"> - <name invalid="invalid">Test Integration 1</name> - <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> - </integration> - </integrations>', - array("Element 'name', attribute 'invalid': The attribute 'invalid' is not allowed.") - ), 'invalid attribute in email' => array( '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> + <integration name="TestIntegration1"> <email invalid="invalid">test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> + <endpoint_url>http://endpoint.url</endpoint_url> </integration> </integrations>', array("Element 'email', attribute 'invalid': The attribute 'invalid' is not allowed.") ), - 'invalid attribute in authentication' => array( - '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> - <email>test-integration1@magento.com</email> - <authentication type="oauth" invalid="invalid"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> - </integration> - </integrations>', - array("Element 'authentication', attribute 'invalid': The attribute 'invalid' is not allowed.") - ), 'invalid attribute in endpoint_url' => array( '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> + <integration name="TestIntegration1"> <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url invalid="invalid">http://endpoint.url</endpoint_url> - </authentication> + <endpoint_url invalid="invalid">http://endpoint.url</endpoint_url> </integration> </integrations>', array("Element 'endpoint_url', attribute 'invalid': The attribute 'invalid' is not allowed.") ), /** Missing or empty required attributes */ - 'integration without id' => array( + 'integration without name' => array( '<integrations> <integration> - <name>Test Integration 1</name> <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> + <endpoint_url>http://endpoint.url</endpoint_url> </integration> </integrations>', - array("Element 'integration': The attribute 'id' is required but missing.") + array("Element 'integration': The attribute 'name' is required but missing.") ), - 'integration with empty id' => array( + 'integration with empty name' => array( '<integrations> - <integration id=""> - <name>Test Integration 1</name> + <integration name=""> <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> + <endpoint_url>http://endpoint.url</endpoint_url> </integration> </integrations>', array ( - "Element 'integration', attribute 'id': [facet 'minLength'] The value '' has a length of '0'; " + "Element 'integration', attribute 'name': [facet 'minLength'] The value '' has a length of '0'; " . "this underruns the allowed minimum length of '2'.", - "Element 'integration', attribute 'id': " - . "'' is not a valid value of the atomic type 'integrationIdType'." + "Element 'integration', attribute 'name': " + . "'' is not a valid value of the atomic type 'integrationNameType'." ) ), - 'no authentication type' => array( - '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> - <email>test-integration1@magento.com</email> - <authentication> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> - </integration> - </integrations>', - array("Element 'authentication': The attribute 'type' is required but missing.") - ), /** Invalid values */ - 'invalid authentication type' => array( - '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> - <email>test-integration1@magento.com</email> - <authentication type="invalid"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> - </integration> - </integrations>', - array - ( - "Element 'authentication', attribute 'type': [facet 'enumeration'] The value 'invalid' is not " - . "an element of the set {'oauth', 'manual'}.", - "Element 'authentication', attribute 'type': 'invalid' " - . "is not a valid value of the atomic type 'authenticationTypeType'." - ) - ), 'invalid email' => array( '<integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> + <integration name="TestIntegration1"> <email>invalid</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.url</endpoint_url> - </authentication> + <endpoint_url>http://endpoint.url</endpoint_url> </integration> </integrations>', array("Element 'email': [facet 'pattern'] The value 'invalid' " diff --git a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/_files/integration.php b/dev/tests/unit/testsuite/Magento/Integration/Model/Config/_files/integration.php index 88b4dfa40a9..0ceac5204a7 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/_files/integration.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Model/Config/_files/integration.php @@ -23,18 +23,10 @@ */ return array( 'TestIntegration1' => array( - 'name' => 'Test Integration 1', 'email' => 'test-integration1@magento.com', - 'authentication' => array( - 'type' => 'oauth', - 'endpoint_url' => 'http://endpoint.com' - ) + 'endpoint_url' => 'http://endpoint.com' ), 'TestIntegration2' => array( - 'name' => 'Test Integration 2', - 'email' => 'test-integration2@magento.com', - 'authentication' => array( - 'type' => 'manual' - ) + 'email' => 'test-integration2@magento.com' ), ); diff --git a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/_files/integration.xml b/dev/tests/unit/testsuite/Magento/Integration/Model/Config/_files/integration.xml index b88d4f43c4e..bd9569b0a2f 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/_files/integration.xml +++ b/dev/tests/unit/testsuite/Magento/Integration/Model/Config/_files/integration.xml @@ -24,16 +24,11 @@ */ --> <integrations> - <integration id="TestIntegration1"> - <name>Test Integration 1</name> + <integration name="TestIntegration1"> <email>test-integration1@magento.com</email> - <authentication type="oauth"> - <endpoint_url>http://endpoint.com</endpoint_url> - </authentication> + <endpoint_url>http://endpoint.com</endpoint_url> </integration> - <integration id="TestIntegration2"> - <name>Test Integration 2</name> + <integration name="TestIntegration2"> <email>test-integration2@magento.com</email> - <authentication type="manual"/> </integration> </integrations> diff --git a/dev/tests/unit/testsuite/Magento/Integration/Model/Integration/FactoryTest.php b/dev/tests/unit/testsuite/Magento/Integration/Model/Integration/FactoryTest.php index ada36294463..19bcf71c8e2 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Model/Integration/FactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Model/Integration/FactoryTest.php @@ -33,12 +33,11 @@ class FactoryTest extends \PHPUnit_Framework_TestCase $mockObjectManager = $this->getMockBuilder('Magento\ObjectManager') ->disableOriginalConstructor() ->getMock(); - \Magento\App\ObjectManager::setInstance($mockObjectManager); + $data = array( Info::DATA_NAME => 'nameTest', Info::DATA_ID => '1', Info::DATA_EMAIL => 'test@magento.com', - Info::DATA_AUTHENTICATION => 1, Info::DATA_ENDPOINT => 'http://magento.ll/endpoint' ); $mockIntegration = $this->getMockBuilder('Magento\Integration\Model\Integration') diff --git a/dev/tests/unit/testsuite/Magento/Integration/Model/Integration/Source/AuthenticationTest.php b/dev/tests/unit/testsuite/Magento/Integration/Model/Integration/Source/AuthenticationTest.php deleted file mode 100644 index a676b7857ec..00000000000 --- a/dev/tests/unit/testsuite/Magento/Integration/Model/Integration/Source/AuthenticationTest.php +++ /dev/null @@ -1,40 +0,0 @@ -<?php -/** - * Magento - * - * NOTICE OF LICENSE - * - * This source file is subject to the Open Software License (OSL 3.0) - * that is bundled with this package in the file LICENSE.txt. - * It is also available through the world-wide-web at this URL: - * http://opensource.org/licenses/osl-3.0.php - * If you did not receive a copy of the license and are unable to - * obtain it through the world-wide-web, please send an email - * to license@magentocommerce.com so we can send you a copy immediately. - * - * DISCLAIMER - * - * Do not edit or add to this file if you wish to upgrade Magento to newer - * versions in the future. If you wish to customize Magento for your - * needs please refer to http://www.magentocommerce.com for more information. - * - * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) - * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) - */ -namespace Magento\Integration\Model\Integration\Source; - -class AuthenticationTest extends \PHPUnit_Framework_TestCase -{ - public function testToOptionArray() - { - /** @var \Magento\Integration\Model\Integration\Source\Authentication */ - $authSource = new \Magento\Integration\Model\Integration\Source\Authentication(); - /** @var array */ - $expectedAuthArr = array( - \Magento\Integration\Model\Integration::AUTHENTICATION_OAUTH => __('OAuth'), - \Magento\Integration\Model\Integration::AUTHENTICATION_MANUAL => __('Manual'), - ); - $authArr = $authSource->toOptionArray(); - $this->assertEquals($expectedAuthArr, $authArr, "Authentication source arrays don't match"); - } -} diff --git a/dev/tests/unit/testsuite/Magento/Integration/Model/ManagerTest.php b/dev/tests/unit/testsuite/Magento/Integration/Model/ManagerTest.php new file mode 100644 index 00000000000..56f3cdaa8ce --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Integration/Model/ManagerTest.php @@ -0,0 +1,139 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Integration\Model; + +use Magento\Integration\Model\Integration; + +/** + * Class to test Integration Manager + */ +class ManagerTest extends \PHPUnit_Framework_TestCase +{ + /** + * Integration service + * + * @var \Magento\Integration\Service\IntegrationV1Interface + */ + protected $_integrationServiceMock; + + /** + * Integration config + * + * @var \Magento\Integration\Model\Config + */ + protected $_integrationConfigMock; + + /** + * Integration config + * + * @var \Magento\Integration\Model\Manager + */ + protected $_integrationManager; + + public function setUp() + { + $this->_integrationConfigMock = $this->getMockBuilder('\Magento\Integration\Model\Config') + ->disableOriginalConstructor() + ->setMethods(['getIntegrations'])->getMock(); + + $this->_integrationServiceMock = $this->getMockBuilder('\Magento\Integration\Service\IntegrationV1') + ->disableOriginalConstructor() + ->setMethods(['findByName', 'update', 'create'])->getMock(); + + $this->_integrationManager = new \Magento\Integration\Model\Manager( + $this->_integrationConfigMock, + $this->_integrationServiceMock + ); + } + + public function tearDown() + { + unset($this->_integrationConfigMock); + unset($this->_integrationServiceMock); + unset($this->_integrationManager); + } + + public function testProcessIntegrationConfigNoIntegrations() + { + $this->_integrationConfigMock->expects($this->never()) + ->method('getIntegrations'); + $this->_integrationManager->processIntegrationConfig(array()); + } + + public function testProcessIntegrationConfigSuccess() + { + $this->_integrationConfigMock->expects($this->once()) + ->method('getIntegrations') + ->will( + $this->returnValue( + array( + 'TestIntegration1' => array( + 'email' => 'test-integration1@magento.com', + 'endpoint_url' => 'http://endpoint.com' + ), + 'TestIntegration2' => array( + 'email' => 'test-integration2@magento.com' + ), + ) + ) + ); + $intLookupData1 = array( + Integration::ID => 1, + Integration::NAME => 'TestIntegration1', + Integration::SETUP_TYPE => 1, + ); + + $intUpdateData1 = array( + Integration::ID => 1, + Integration::NAME => 'TestIntegration1', + Integration::EMAIL => 'test-integration1@magento.com', + Integration::ENDPOINT => 'http://endpoint.com', + Integration::SETUP_TYPE => 1, + ); + + $integrationsData2 = array( + Integration::NAME => 'TestIntegration2', + Integration::EMAIL => 'test-integration2@magento.com', + Integration::SETUP_TYPE => 1, + ); + + $this->_integrationServiceMock->expects($this->at(0)) + ->method('findByName') + ->with('TestIntegration1') + ->will($this->returnValue($intLookupData1)); + $this->_integrationServiceMock->expects($this->once()) + ->method('create') + ->with($integrationsData2); + + $this->_integrationServiceMock->expects($this->at(2)) + ->method('findByName') + ->with('TestIntegration2') + ->will($this->returnValue(array())); + $this->_integrationServiceMock->expects($this->once()) + ->method('update') + ->with($intUpdateData1); + + $this->_integrationManager->processIntegrationConfig(array('TestIntegration1', 'TestIntegration2')); + } +} \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Integration/Service/IntegrationV1Test.php b/dev/tests/unit/testsuite/Magento/Integration/Service/IntegrationV1Test.php index 17cc02476d7..8db1c1718b8 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Service/IntegrationV1Test.php +++ b/dev/tests/unit/testsuite/Magento/Integration/Service/IntegrationV1Test.php @@ -61,7 +61,6 @@ class IntegrationV1Test extends \PHPUnit_Framework_TestCase 'getId', 'getName', 'getEmail', - 'getAuthentication', 'getEndpoint', 'load', 'loadByName', @@ -74,14 +73,23 @@ class IntegrationV1Test extends \PHPUnit_Framework_TestCase 'integration_id' => self::VALUE_INTEGRATION_ID, 'name' => self::VALUE_INTEGRATION_NAME, 'email' => self::VALUE_INTEGRATION_EMAIL, - 'authentication' => 1, 'endpoint' => self::VALUE_INTEGRATION_ENDPOINT ); $this->_integrationFactory->expects($this->any()) ->method('create') ->will($this->returnValue($this->_integrationMock)); + + $authorizationMock = $this->getMock('Magento\Authz\Service\AuthorizationV1Interface'); + $userIdentifierFactory = $this->getMockBuilder('Magento\Authz\Model\UserIdentifier\Factory') + ->disableOriginalConstructor()->getMock(); + $userIdentifier = $this->getMockBuilder('Magento\Authz\Model\UserIdentifier')->disableOriginalConstructor() + ->getMock(); + $userIdentifierFactory->expects($this->any())->method('create')->will($this->returnValue($userIdentifier)); + $this->_service = new \Magento\Integration\Service\IntegrationV1( - $this->_integrationFactory + $this->_integrationFactory, + $authorizationMock, + $userIdentifierFactory ); $this->_emptyIntegrationMock = $this->getMockBuilder('Magento\Integration\Model\Integration') ->disableOriginalConstructor() @@ -91,7 +99,6 @@ class IntegrationV1Test extends \PHPUnit_Framework_TestCase 'getId', 'getName', 'getEmail', - 'getAuthentication', 'getEndpoint', 'load', 'loadByName', @@ -183,7 +190,6 @@ class IntegrationV1Test extends \PHPUnit_Framework_TestCase 'integration_id' => self::VALUE_INTEGRATION_ID, 'name' => self::VALUE_INTEGRATION_ANOTHER_NAME, 'email' => self::VALUE_INTEGRATION_EMAIL, - 'authentication' => 1, 'endpoint' => self::VALUE_INTEGRATION_ENDPOINT ); $this->_integrationMock->expects($this->any()) @@ -214,7 +220,6 @@ class IntegrationV1Test extends \PHPUnit_Framework_TestCase 'integration_id' => self::VALUE_INTEGRATION_ID, 'name' => self::VALUE_INTEGRATION_ANOTHER_NAME, 'email' => self::VALUE_INTEGRATION_EMAIL, - 'authentication' => 1, 'endpoint' => self::VALUE_INTEGRATION_ENDPOINT ); $this->_service->update($integrationData); @@ -265,9 +270,6 @@ class IntegrationV1Test extends \PHPUnit_Framework_TestCase $this->_integrationMock->expects($this->any()) ->method('getEmail') ->will($this->returnValue(self::VALUE_INTEGRATION_EMAIL)); - $this->_integrationMock->expects($this->any()) - ->method('getAuthentication') - ->will($this->returnValue('1')); $this->_integrationMock->expects($this->any()) ->method('getEndpoint') ->will($this->returnValue(self::VALUE_INTEGRATION_ENDPOINT)); @@ -292,7 +294,6 @@ class IntegrationV1Test extends \PHPUnit_Framework_TestCase 'getId', 'getName', 'getEmail', - 'getAuthentication', 'getEndpoint', 'load', 'loadByName', @@ -310,12 +311,9 @@ class IntegrationV1Test extends \PHPUnit_Framework_TestCase $integrationMock->expects($this->any()) ->method('getEmail') ->will($this->returnValue(self::VALUE_INTEGRATION_EMAIL)); - $integrationMock->expects($this->any()) - ->method('getAuthentication') - ->will($this->returnValue('1')); $integrationMock->expects($this->any()) ->method('getEndpoint') ->will($this->returnValue(self::VALUE_INTEGRATION_ENDPOINT)); return $integrationMock; } -} \ No newline at end of file +} diff --git a/dev/tests/unit/testsuite/Magento/Newsletter/Model/TemplateTest.php b/dev/tests/unit/testsuite/Magento/Newsletter/Model/TemplateTest.php index 249b8c3e624..6f11d81f0fb 100644 --- a/dev/tests/unit/testsuite/Magento/Newsletter/Model/TemplateTest.php +++ b/dev/tests/unit/testsuite/Magento/Newsletter/Model/TemplateTest.php @@ -80,8 +80,8 @@ class TemplateTest extends \PHPUnit_Framework_TestCase /** @var \Magento\Newsletter\Model\Template $model */ $model = $this->getMock('Magento\Newsletter\Model\Template', array('_init'), array( - $design, $context, $registry, $storeManager, $request, $filter, $storeConfig, $templateFactory, - $appEmulation, $filterManager, $data, + $context, $design, $registry, $appEmulation, $storeManager, $request, $filter, $storeConfig, + $templateFactory, $filterManager, $data, )); $result = $model->getProcessedTemplate(); diff --git a/dev/tests/unit/testsuite/Magento/Payment/Block/Form/ContainerTest.php b/dev/tests/unit/testsuite/Magento/Payment/Block/Form/ContainerTest.php index b712704096f..5b596fa4eec 100644 --- a/dev/tests/unit/testsuite/Magento/Payment/Block/Form/ContainerTest.php +++ b/dev/tests/unit/testsuite/Magento/Payment/Block/Form/ContainerTest.php @@ -38,8 +38,8 @@ class ContainerTest extends \PHPUnit_Framework_TestCase public function testSetMethodFormTemplate() { $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $childBlockA = $objectManagerHelper->getObject('Magento\View\Block\Template'); - $childBlockB = $objectManagerHelper->getObject('Magento\View\Block\Template'); + $childBlockA = $objectManagerHelper->getObject('Magento\View\Element\Template'); + $childBlockB = $objectManagerHelper->getObject('Magento\View\Element\Template'); $func = function ($blockName) use ($childBlockA, $childBlockB) { switch ($blockName) { diff --git a/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php b/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php index e4b5f3c8204..08e9d1665fc 100644 --- a/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Payment/Block/Info/ContainerAbstractTest.php @@ -48,7 +48,7 @@ class ContainerAbstractTest extends \PHPUnit_Framework_TestCase ->method('getPaymentInfo') ->will($this->returnValue($paymentInfo)); - $childBlock = $objectManagerHelper->getObject('Magento\View\Block\Template'); + $childBlock = $objectManagerHelper->getObject('Magento\View\Element\Template'); $block->expects($this->atLeastOnce()) ->method('getChildBlock') ->with('payment.info.checkmo') diff --git a/dev/tests/unit/testsuite/Magento/Payment/Model/Config/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Payment/Model/Config/ConverterTest.php index ff28ef60780..058111f9347 100644 --- a/dev/tests/unit/testsuite/Magento/Payment/Model/Config/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Payment/Model/Config/ConverterTest.php @@ -28,7 +28,7 @@ namespace Magento\Payment\Model\Config; class ConverterTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Page\Model\Config\Converter + * @var \Magento\Payment\Model\Config\Converter */ protected $_model; diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Helper/CheckoutTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Helper/CheckoutTest.php index 3349a7d7454..243f513be02 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Helper/CheckoutTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Helper/CheckoutTest.php @@ -73,7 +73,7 @@ class CheckoutTest extends \PHPUnit_Framework_TestCase { $order = $this->getMockBuilder('Magento\Sales\Model\Order') ->disableOriginalConstructor() - ->setMethods(array_merge(array('getId'), $mockMethods)) + ->setMethods(array_merge(array('getId', '__wakeup'), $mockMethods)) ->getMock(); $order->expects($this->once()) ->method('getId') @@ -134,7 +134,7 @@ class CheckoutTest extends \PHPUnit_Framework_TestCase { $quote = $this->getMockBuilder('Magento\Sales\Model\Quote') ->disableOriginalConstructor() - ->setMethods(array('getId', 'save', 'setIsActive', 'setReservedOrderId', 'load')) + ->setMethods(array('getId', 'save', 'setIsActive', 'setReservedOrderId', 'load', '__wakeup')) ->getMock(); $order = $this->_getOrderMock($hasOrderId); $this->_session->expects($this->once()) diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowadvancedTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowadvancedTest.php index 002d8857f5c..ada7c70ceed 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowadvancedTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowadvancedTest.php @@ -86,7 +86,7 @@ class PayflowadvancedTest extends \PHPUnit_Framework_TestCase ->getMock(); $payment = $this->getMockBuilder('Magento\Sales\Model\Order\Payment') ->disableOriginalConstructor() - ->setMethods(array('getOrder')) + ->setMethods(array('getOrder', '__wakeup')) ->getMock(); $payment->expects($this->any()) ->method('getOrder') diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowlinkTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowlinkTest.php index 37a1faa6709..aa4c3846395 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowlinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Model/PayflowlinkTest.php @@ -86,7 +86,7 @@ class PayflowlinkTest extends \PHPUnit_Framework_TestCase ->getMock(); $payment = $this->getMockBuilder('Magento\Sales\Model\Order\Payment') ->disableOriginalConstructor() - ->setMethods(array('getOrder')) + ->setMethods(array('getOrder', '__wakeup')) ->getMock(); $payment->expects($this->any()) ->method('getOrder') diff --git a/dev/tests/unit/testsuite/Magento/Paypal/Model/ProTest.php b/dev/tests/unit/testsuite/Magento/Paypal/Model/ProTest.php index b13fedc23ff..c986ed85efd 100644 --- a/dev/tests/unit/testsuite/Magento/Paypal/Model/ProTest.php +++ b/dev/tests/unit/testsuite/Magento/Paypal/Model/ProTest.php @@ -60,7 +60,7 @@ class ProTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($isReviewRequired)); $payment = $this->getMockBuilder('Magento\Payment\Model\Info') ->disableOriginalConstructor() - ->setMethods(array('getAdditionalInformation')) + ->setMethods(array('getAdditionalInformation', '__wakeup')) ->getMock(); $payment->expects($this->once()) ->method('getAdditionalInformation') diff --git a/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/PriceTest.php b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/PriceTest.php index ba99f19bbd1..e7a3582960d 100644 --- a/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/PriceTest.php +++ b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/PriceTest.php @@ -52,7 +52,7 @@ class PriceTest extends \PHPUnit_Framework_TestCase $product = $this->getMockBuilder('Magento\Catalog\Model\Product') ->disableOriginalConstructor() - ->setMethods(array('getCanShowPrice', 'getId')) + ->setMethods(array('getCanShowPrice', 'getId', '__wakeup')) ->getMock(); $product->expects($this->once())->method('getId')->will($this->returnValue(1)); $product->expects($this->once())->method('getCanShowPrice')->will($this->returnValue(true)); diff --git a/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/StockTest.php b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/StockTest.php index 46826d1d853..8711f02aa72 100644 --- a/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/StockTest.php +++ b/dev/tests/unit/testsuite/Magento/ProductAlert/Block/Product/View/StockTest.php @@ -55,7 +55,7 @@ class StockTest extends \PHPUnit_Framework_TestCase $product = $this->getMockBuilder('Magento\Catalog\Model\Product') ->disableOriginalConstructor() - ->setMethods(array('isAvailable', 'getId')) + ->setMethods(array('isAvailable', 'getId', '__wakeup')) ->getMock(); $product->expects($this->once())->method('getId')->will($this->returnValue(1)); $product->expects($this->once())->method('isAvailable')->will($this->returnValue(false)); diff --git a/dev/tests/unit/testsuite/Magento/Review/Helper/Action/PagerTest.php b/dev/tests/unit/testsuite/Magento/Review/Helper/Action/PagerTest.php index 2f13b9467e2..ce36183531b 100644 --- a/dev/tests/unit/testsuite/Magento/Review/Helper/Action/PagerTest.php +++ b/dev/tests/unit/testsuite/Magento/Review/Helper/Action/PagerTest.php @@ -52,7 +52,7 @@ class PagerTest extends \PHPUnit_Framework_TestCase $contextMock = $this->getMock( 'Magento\App\Helper\Context', array('getTranslator', 'getModuleManager', 'getRequest'), array(), '', false ); - $this->_helper = new \Magento\Review\Helper\Action\Pager($sessionMock, $contextMock); + $this->_helper = new \Magento\Review\Helper\Action\Pager($contextMock, $sessionMock); $this->_helper->setStorageId('reviews'); } diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Items/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Items/AbstractTest.php index 7338fc89d52..e68822b8800 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Items/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Items/AbstractTest.php @@ -35,7 +35,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase public function testGetItemRenderer() { - $renderer = $this->getMock('Magento\View\Block\AbstractBlock', array(), array(), '', false); + $renderer = $this->getMock('Magento\View\Element\AbstractBlock', array(), array(), '', false); $layout = $this->getMock('Magento\Core\Model\Layout', array( 'getChildName', 'getBlock', 'getGroupChildNames' ), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Items/GridTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Items/GridTest.php index 02b0fe44410..2b51bd240f8 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Items/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Create/Items/GridTest.php @@ -53,7 +53,7 @@ class GridTest extends \PHPUnit_Framework_TestCase $quoteMock = $this->getMockBuilder('Magento\Sales\Model\Quote') ->disableOriginalConstructor() - ->setMethods(array('getStore')) + ->setMethods(array('getStore', '__wakeup')) ->getMock(); $storeMock = $this->getMockBuilder('Magento\Core\Model\Store') @@ -148,7 +148,7 @@ class GridTest extends \PHPUnit_Framework_TestCase { $product = $this->getMockBuilder('Magento\Catalog\Model\Product') ->disableOriginalConstructor() - ->setMethods(array('getTierPrice')) + ->setMethods(array('getTierPrice', '__wakeup')) ->getMock(); $product->expects($this->once()) ->method('getTierPrice') diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Invoice/ViewTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Invoice/ViewTest.php index 18ca19f515c..04ed7a59e9c 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Invoice/ViewTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Invoice/ViewTest.php @@ -54,7 +54,7 @@ class ViewTest extends \PHPUnit_Framework_TestCase // Create invoice mock $invoice = $this->getMockBuilder('Magento\Sales\Model\Order\Invoice') ->disableOriginalConstructor() - ->setMethods(array('getOrder')) + ->setMethods(array('getOrder', '__wakeup')) ->getMock(); $invoice->expects($this->once()) ->method('getOrder') diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Totals/TaxTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Totals/TaxTest.php index 42774d7bfa7..b90f3787d95 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Totals/TaxTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Adminhtml/Order/Totals/TaxTest.php @@ -88,7 +88,7 @@ class TaxTest extends \PHPUnit_Framework_TestCase protected function _getSalesOrderMock() { $orderMock = $this->getMockBuilder('Magento\Sales\Model\Order') - ->setMethods(array('getItemsCollection')) + ->setMethods(array('getItemsCollection', '__wakeup')) ->disableOriginalConstructor() ->getMock(); $orderMock->expects($this->any()) diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Guest/LinkTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Guest/LinkTest.php index 5988517e3a5..017fc7de15c 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Guest/LinkTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Guest/LinkTest.php @@ -35,7 +35,7 @@ class LinkTest extends \PHPUnit_Framework_TestCase { $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $context = $objectManagerHelper->getObject('Magento\View\Block\Template\Context'); + $context = $objectManagerHelper->getObject('Magento\View\Element\Template\Context'); $session = $this->getMockBuilder('Magento\Customer\Model\Session') ->disableOriginalConstructor() ->setMethods(array('isLoggedIn')) diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Items/AbstractTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Items/AbstractTest.php index d3b8d4a6885..ab6e3215411 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Items/AbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Items/AbstractTest.php @@ -35,7 +35,7 @@ class AbstractTest extends \PHPUnit_Framework_TestCase public function testGetItemRenderer() { - $renderer = $this->getMock('Magento\View\Block\AbstractBlock', array('setRenderedBlock'), array(), '', false); + $renderer = $this->getMock('Magento\View\Element\AbstractBlock', array('setRenderedBlock'), array(), '', false); $layout = $this->getMock('Magento\Core\Model\Layout', array( 'getChildName', 'getBlock' ), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/GridTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/GridTest.php index ba8e503405f..ce6a5197bc9 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/GridTest.php @@ -45,7 +45,7 @@ class GridTest extends \PHPUnit_Framework_TestCase { $customer = $this->getMockBuilder('Magento\Customer\Model\Customer') ->disableOriginalConstructor() - ->setMethods(array('getId')) + ->setMethods(array('getId', '__wakeup')) ->getMock(); $customer->expects($this->once())->method('getId')->will($this->returnValue(1)); $registry = $this->getMockBuilder('Magento\Core\Model\Registry') @@ -61,7 +61,7 @@ class GridTest extends \PHPUnit_Framework_TestCase ->getMock(); $collectionElement = $this->getMockBuilder('Magento\Sales\Model\Recurring\Profile') ->disableOriginalConstructor() - ->setMethods(array('setStore', 'setLocale', 'renderData', 'getReferenceId')) + ->setMethods(array('setStore', 'setLocale', 'renderData', 'getReferenceId', '__wakeup')) ->getMock(); $collectionElement->expects($this->once())->method('setStore') ->with($store) @@ -84,7 +84,7 @@ class GridTest extends \PHPUnit_Framework_TestCase $profile = $this->getMockBuilder('Magento\Sales\Model\Recurring\Profile') ->disableOriginalConstructor() - ->setMethods(array('getCollection', 'getFieldLabel')) + ->setMethods(array('getCollection', 'getFieldLabel', '__wakeup')) ->getMock(); $profile->expects($this->once())->method('getCollection') ->will($this->returnValue($collection)); @@ -111,7 +111,7 @@ class GridTest extends \PHPUnit_Framework_TestCase 'locale' => $locale ) ); - $pagerBlock = $this->getMockBuilder('Magento\Page\Block\Html\Pager') + $pagerBlock = $this->getMockBuilder('Magento\Theme\Block\Html\Pager') ->disableOriginalConstructor() ->setMethods(array('setCollection')) ->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/Related/Orders/GridTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/Related/Orders/GridTest.php index cac8ad08258..c95c113d3e1 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/Related/Orders/GridTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/Related/Orders/GridTest.php @@ -47,7 +47,8 @@ class GridTest extends \PHPUnit_Framework_TestCase $customer->expects($this->once())->method('getId')->will($this->returnValue(1)); $store = $this->getMock('Magento\Core\Model\Store', array(), array(), '', false); $args = array( - 'getIncrementId', 'getCreatedAt', 'getCustomerName', 'getBaseGrandTotal', 'getStatusLabel', 'getId' + 'getIncrementId', 'getCreatedAt', 'getCustomerName', 'getBaseGrandTotal', 'getStatusLabel', 'getId', + '__wakeup' ); $collectionElement = $this->getMock('Magento\Sales\Model\Recurring\Profile', $args, array(), '', false); $collectionElement->expects($this->once())->method('getIncrementId') @@ -96,7 +97,7 @@ class GridTest extends \PHPUnit_Framework_TestCase 'helperFactory' => $helperFactory ) ); - $pagerBlock = $this->getMockBuilder('Magento\Page\Block\Html\Pager') + $pagerBlock = $this->getMockBuilder('Magento\Theme\Block\Html\Pager') ->disableOriginalConstructor() ->setMethods(array('setCollection')) ->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/AddressTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/AddressTest.php index 03393dc30a8..b22c6591614 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/AddressTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/AddressTest.php @@ -52,7 +52,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase $this->_profile = $this->getMockBuilder('Magento\Sales\Model\Recurring\Profile') ->disableOriginalConstructor() - ->setMethods(array('setStore', 'setLocale', 'getData', 'getInfoValue')) + ->setMethods(array('setStore', 'setLocale', 'getData', 'getInfoValue', '__wakeup')) ->getMock(); $this->_profile->expects($this->once())->method('setStore')->will($this->returnValue($this->_profile)); $this->_profile->expects($this->once())->method('setLocale')->will($this->returnValue($this->_profile)); @@ -97,7 +97,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase $this->_profile->expects($this->once())->method('getInfoValue')->will($this->returnValue('1')); $this->_block->setAddressType('shipping'); - $parentBlock = $this->getMockBuilder('Magento\View\Block\Template') + $parentBlock = $this->getMockBuilder('Magento\View\Element\Template') ->disableOriginalConstructor() ->setMethods(array('unsetChild')) ->getMock(); @@ -121,7 +121,7 @@ class AddressTest extends \PHPUnit_Framework_TestCase { $address = $this->getMockBuilder('Magento\Sales\Model\Order\Address') ->disableOriginalConstructor() - ->setMethods(array('format')) + ->setMethods(array('format', '__wakeup')) ->getMock(); $this->_addressFactory->expects($this->once())->method('create')->will($this->returnValue($address)); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/DataTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/DataTest.php index b01006c5aef..537eb14d7eb 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/DataTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/DataTest.php @@ -47,7 +47,7 @@ class DataTest extends \PHPUnit_Framework_TestCase $this->_profile = $this->getMockBuilder('Magento\Sales\Model\Recurring\Profile') ->disableOriginalConstructor() - ->setMethods(array('setStore', 'setLocale', 'canFetchUpdate')) + ->setMethods(array('setStore', 'setLocale', 'canFetchUpdate', '__wakeup')) ->getMock(); $this->_profile->expects($this->once())->method('setStore')->will($this->returnValue($this->_profile)); $this->_profile->expects($this->once())->method('setLocale')->will($this->returnValue($this->_profile)); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/FeesTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/FeesTest.php index f3a733bb537..a29aed34996 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/FeesTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/FeesTest.php @@ -47,7 +47,7 @@ class FeesTest extends \PHPUnit_Framework_TestCase $this->_profile = $this->getMockBuilder('Magento\Sales\Model\Recurring\Profile') ->disableOriginalConstructor() - ->setMethods(array('setStore', 'setLocale', 'getFieldLabel')) + ->setMethods(array('setStore', 'setLocale', 'getFieldLabel', '__wakeup')) ->getMock(); $this->_profile->expects($this->once())->method('setStore')->will($this->returnValue($this->_profile)); $this->_profile->expects($this->once())->method('setLocale')->will($this->returnValue($this->_profile)); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ItemTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ItemTest.php index 1450fd0f4ff..c6df3bc001e 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ItemTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ItemTest.php @@ -47,7 +47,7 @@ class ItemTest extends \PHPUnit_Framework_TestCase $this->_profile = $this->getMockBuilder('Magento\Sales\Model\Recurring\Profile') ->disableOriginalConstructor() - ->setMethods(array('setStore', 'setLocale', 'getFieldLabel')) + ->setMethods(array('setStore', 'setLocale', 'getFieldLabel', '__wakeup')) ->getMock(); $this->_profile->expects($this->once())->method('setStore')->will($this->returnValue($this->_profile)); $this->_profile->expects($this->once())->method('setLocale')->will($this->returnValue($this->_profile)); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ReferenceTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ReferenceTest.php index 29697bc156c..89adbd0f56e 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ReferenceTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ReferenceTest.php @@ -47,7 +47,7 @@ class ReferenceTest extends \PHPUnit_Framework_TestCase $this->_profile = $this->getMockBuilder('Magento\Sales\Model\Recurring\Profile') ->disableOriginalConstructor() - ->setMethods(array('setStore', 'setLocale', 'getFieldLabel', 'renderData')) + ->setMethods(array('setStore', 'setLocale', 'getFieldLabel', 'renderData', '__wakeup')) ->getMock(); $this->_profile->expects($this->once())->method('setStore')->will($this->returnValue($this->_profile)); $this->_profile->expects($this->once())->method('setLocale')->will($this->returnValue($this->_profile)); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ScheduleTest.php b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ScheduleTest.php index 353dc8e651d..c2b691ba298 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ScheduleTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Block/Recurring/Profile/View/ScheduleTest.php @@ -47,7 +47,7 @@ class ScheduleTest extends \PHPUnit_Framework_TestCase $this->_profile = $this->getMockBuilder('Magento\Sales\Model\Recurring\Profile') ->disableOriginalConstructor() - ->setMethods(array('setStore', 'setLocale', 'getFieldLabel', 'renderData')) + ->setMethods(array('setStore', 'setLocale', 'getFieldLabel', 'renderData', '__wakeup')) ->getMock(); $this->_profile->expects($this->once())->method('setStore')->will($this->returnValue($this->_profile)); $this->_profile->expects($this->once())->method('setLocale')->will($this->returnValue($this->_profile)); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreditmemoTest.php b/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreditmemoTest.php index 6df67c45521..216cf67dc70 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreditmemoTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Controller/Adminhtml/Order/CreditmemoTest.php @@ -100,7 +100,11 @@ class CreditmemoTest extends \PHPUnit_Framework_TestCase ->method('getParam')->will($this->returnValue(null)); $creditmemoMock = $this->getMock( - 'Magento\Sales\Model\Order\Creditmemo', array('load', 'getGrandTotal'), array(), '', false + 'Magento\Sales\Model\Order\Creditmemo', + array('load', 'getGrandTotal', '__wakeup'), + array(), + '', + false ); $creditmemoMock->expects($this->once())->method('load') ->with($this->equalTo($creditmemoId))->will($this->returnSelf()); @@ -131,8 +135,13 @@ class CreditmemoTest extends \PHPUnit_Framework_TestCase $this->_requestMock->expects($this->any()) ->method('getParam')->will($this->returnValue(null)); - $creditmemoMock = $this->getMock('Magento\Sales\Model\Order\Creditmemo', - array('load', 'getGrandTotal', 'getAllowZeroGrandTotal'), array(), '', false); + $creditmemoMock = $this->getMock( + 'Magento\Sales\Model\Order\Creditmemo', + array('load', 'getGrandTotal', 'getAllowZeroGrandTotal', '__wakeup'), + array(), + '', + false + ); $creditmemoMock->expects($this->once())->method('load') ->with($this->equalTo($creditmemoId))->will($this->returnSelf()); $creditmemoMock->expects($this->once())->method('getGrandTotal')->will($this->returnValue('0')); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Billing/Agreement/OrdersUpdaterTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Billing/Agreement/OrdersUpdaterTest.php index 400b1b7c6e7..5ed9903fc14 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Billing/Agreement/OrdersUpdaterTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Billing/Agreement/OrdersUpdaterTest.php @@ -61,7 +61,7 @@ class OrdersUpdaterTest extends \PHPUnit_Framework_TestCase $this->_agreementMock = $this->getMock( 'Magento\Sales\Model\Billing\Agreement', - array('getId'), + array('getId', '__wakeup'), array(), '', false diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/CatalogProductQuoteTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/CatalogProductQuoteTest.php index 32ff1413261..f600ca6014b 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/CatalogProductQuoteTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/CatalogProductQuoteTest.php @@ -65,7 +65,13 @@ class CatalogProductQuoteTest extends \PHPUnit_Framework_TestCase */ public function testSaveProduct($productId, $productStatus) { - $productMock = $this->getMock('Magento\Catalog\Model\Product', array('getId', 'getStatus'), array(), '', false); + $productMock = $this->getMock( + 'Magento\Catalog\Model\Product', + array('getId', 'getStatus', '__wakeup'), + array(), + '', + false + ); $this->_eventMock->expects($this->once())->method('getProduct')->will($this->returnValue($productMock)); $productMock->expects($this->once())->method('getId')->will($this->returnValue($productId)); $productMock->expects($this->once())->method('getStatus')->will($this->returnValue($productStatus)); @@ -96,7 +102,13 @@ class CatalogProductQuoteTest extends \PHPUnit_Framework_TestCase public function testSubtractQtyFromQuotes() { - $productMock = $this->getMock('Magento\Catalog\Model\Product', array('getId', 'getStatus'), array(), '', false); + $productMock = $this->getMock( + 'Magento\Catalog\Model\Product', + array('getId', 'getStatus', '__wakeup'), + array(), + '', + false + ); $this->_eventMock->expects($this->once())->method('getProduct')->will($this->returnValue($productMock)); $this->_quoteMock->expects($this->once())->method('substractProductFromQuotes')->with($productMock); $this->_model->subtractQtyFromQuotes($this->_observerMock); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/CustomerQuoteTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/CustomerQuoteTest.php index 26b67fae98a..184737bc3ba 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/CustomerQuoteTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Backend/CustomerQuoteTest.php @@ -63,8 +63,12 @@ class CustomerQuoteTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_quoteMock = $this->getMock('Magento\Sales\Model\Quote', - array('setWebsite', 'loadByCustomer', 'getId', 'setCustomerGroupId', 'collectTotals'), array(), '', false + $this->_quoteMock = $this->getMock( + 'Magento\Sales\Model\Quote', + array('setWebsite', 'loadByCustomer', 'getId', 'setCustomerGroupId', 'collectTotals', '__wakeup'), + array(), + '', + false ); $this->_observerMock = $this->getMock('Magento\Event\Observer', array(), array(), '', false); $this->_storeManagerMock = $this->getMock('Magento\Core\Model\StoreManager', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotalsTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotalsTest.php new file mode 100644 index 00000000000..24424eaef5c --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/CollectTotalsTest.php @@ -0,0 +1,263 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Model\Observer\Frontend\Quote\Address; + +class CollectTotalsTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Sales\Model\Observer\Frontend\Quote\Address\CollectTotals + */ + protected $model; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $customerAddressMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $customerDataMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteAddressMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $customerMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $vatValidatorMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $observerMock; + + protected function setUp() + { + $this->storeMock = $this->getMock('Magento\Core\Model\Store', array(), array(), '', false); + $this->customerMock = $this->getMock( + 'Magento\Customer\Model\Customer', + array( + 'getStore', + 'getDisableAutoGroupChange', + 'getId', + 'setGroupId', + '__wakeup', + ), + array(), + '', + false + ); + $this->customerAddressMock = $this->getMock('Magento\Customer\Helper\Address', array(), array(), '', false); + $this->customerDataMock = $this->getMock('Magento\Customer\Helper\Data', array(), array(), '', false); + $this->vatValidatorMock = $this->getMock('Magento\Sales\Model\Observer\Frontend\Quote\Address\VatValidator', + array(), array(), '', false + ); + $this->observerMock = $this->getMock('\Magento\Event\Observer', array('getQuoteAddress'), array(), '', false); + + $this->quoteAddressMock = $this->getMock('Magento\Sales\Model\Quote\Address', + array( + 'getCountryId', + 'getVatId', + 'getQuote', + 'setPrevQuoteCustomerGroupId', + '__wakeup' + ), + array(), + '', + false, + false + ); + + + $this->quoteMock = $this->getMock('Magento\Sales\Model\Quote', + array( + 'setCustomerGroupId', + 'getCustomerGroupId', + 'getCustomer', + '__wakeup', + ), + array(), + '', + false + ); + $this->observerMock->expects($this->any()) + ->method('getQuoteAddress')->will($this->returnValue($this->quoteAddressMock)); + + $this->quoteAddressMock->expects($this->any())->method('getQuote')->will($this->returnValue($this->quoteMock)); + + $this->quoteMock->expects($this->any())->method('getCustomer')->will($this->returnValue($this->customerMock)); + + $this->customerMock->expects($this->any())->method('getStore')->will($this->returnValue($this->storeMock)); + + $this->model = new \Magento\Sales\Model\Observer\Frontend\Quote\Address\CollectTotals( + $this->customerAddressMock, + $this->customerDataMock, + $this->vatValidatorMock + ); + } + + public function testDispatchWithDisableAutoGroupChange() + { + $this->customerMock->expects($this->once()) + ->method('getDisableAutoGroupChange') + ->will($this->returnValue(true)); + + $this->model->dispatch($this->observerMock); + } + + public function testDispatchWithDisableVatValidator() + { + $this->customerMock->expects($this->once()) + ->method('getDisableAutoGroupChange')->will($this->returnValue(false)); + + $this->vatValidatorMock->expects($this->once()) + ->method('isEnabled') + ->with($this->quoteAddressMock, $this->storeMock) + ->will($this->returnValue(false)); + $this->model->dispatch($this->observerMock); + } + + public function testDispatchWithCustomerCountryNotInEUAndNotLoggedCustomerInGroup() + { + $this->customerMock->expects($this->once()) + ->method('getDisableAutoGroupChange')->will($this->returnValue(false)); + + $this->vatValidatorMock->expects($this->once()) + ->method('isEnabled') + ->with($this->quoteAddressMock, $this->storeMock) + ->will($this->returnValue(true)); + + $this->quoteAddressMock->expects($this->once()) + ->method('getCountryId')->will($this->returnValue('customerCountryCode')); + $this->quoteAddressMock->expects($this->once()) + ->method('getVatId')->will($this->returnValue('vatId')); + + $this->customerDataMock->expects($this->once()) + ->method('isCountryInEU') + ->with('customerCountryCode') + ->will($this->returnValue(false)); + + $this->customerMock->expects($this->once())->method('getId')->will($this->returnValue(null)); + + $this->quoteAddressMock->expects($this->never())->method('setPrevQuoteCustomerGroupId'); + $this->customerMock->expects($this->never()) + ->method('setGroupId'); + $this->quoteMock->expects($this->never()) + ->method('setCustomerGroupId'); + + $this->model->dispatch($this->observerMock); + } + + public function testDispatchWithDefaultCustomerGroupId() + { + $this->customerMock->expects($this->once()) + ->method('getDisableAutoGroupChange')->will($this->returnValue(false)); + + $this->vatValidatorMock->expects($this->once()) + ->method('isEnabled') + ->with($this->quoteAddressMock, $this->storeMock) + ->will($this->returnValue(true)); + + $this->quoteAddressMock->expects($this->once()) + ->method('getCountryId')->will($this->returnValue('customerCountryCode')); + $this->quoteAddressMock->expects($this->once()) + ->method('getVatId')->will($this->returnValue(null)); + + $this->quoteMock->expects($this->once()) + ->method('getCustomerGroupId')->will($this->returnValue('customerGroupId')); + + $this->customerMock->expects($this->once())->method('getId')->will($this->returnValue('1')); + $this->customerDataMock->expects($this->once()) + ->method('getDefaultCustomerGroupId')->will($this->returnValue('defaultCustomerGroupId')); + + $this->quoteAddressMock->expects($this->once())->method('setPrevQuoteCustomerGroupId')->with('customerGroupId'); + $this->customerMock->expects($this->once()) + ->method('setGroupId')->with('defaultCustomerGroupId'); + $this->quoteMock->expects($this->once()) + ->method('setCustomerGroupId')->with('defaultCustomerGroupId'); + + $this->model->dispatch($this->observerMock); + } + + public function testDispatchWithCustomerCountryInEU() + { + $this->customerMock->expects($this->once()) + ->method('getDisableAutoGroupChange')->will($this->returnValue(false)); + + $this->vatValidatorMock->expects($this->once()) + ->method('isEnabled') + ->with($this->quoteAddressMock, $this->storeMock) + ->will($this->returnValue(true)); + + $this->quoteAddressMock->expects($this->once()) + ->method('getCountryId')->will($this->returnValue('customerCountryCode')); + $this->quoteAddressMock->expects($this->once()) + ->method('getVatId')->will($this->returnValue('vatID')); + + $this->customerDataMock->expects($this->once()) + ->method('isCountryInEU') + ->with('customerCountryCode') + ->will($this->returnValue(true)); + + $this->quoteMock->expects($this->once()) + ->method('getCustomerGroupId')->will($this->returnValue('customerGroupId')); + + $validationResult = array('some' => 'result'); + $this->vatValidatorMock->expects($this->once()) + ->method('validate')->with($this->quoteAddressMock, $this->storeMock) + ->will($this->returnValue($validationResult)); + + $this->customerDataMock->expects($this->once())->method('getCustomerGroupIdBasedOnVatNumber') + ->with('customerCountryCode', $validationResult, $this->storeMock) + ->will($this->returnValue('customerGroupId')); + + $this->quoteAddressMock->expects($this->once())->method('setPrevQuoteCustomerGroupId')->with('customerGroupId'); + $this->customerMock->expects($this->once()) + ->method('setGroupId')->with('customerGroupId'); + $this->quoteMock->expects($this->once()) + ->method('setCustomerGroupId')->with('customerGroupId'); + + $this->model->dispatch($this->observerMock); + } +} + diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidatorTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidatorTest.php new file mode 100644 index 00000000000..a039ee0e4ae --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Observer/Frontend/Quote/Address/VatValidatorTest.php @@ -0,0 +1,235 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Sales\Model\Observer\Frontend\Quote\Address; + +class VatValidatorTest extends \PHPUnit_Framework_TestCase +{ + /** + * @var \Magento\Sales\Model\Observer\Frontend\Quote\Address\VatValidator + */ + protected $model; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $customerAddressMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $customerDataMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $quoteAddressMock; + + /** + * @var \PHPUnit_Framework_MockObject_MockObject + */ + protected $storeMock; + + /** + * @var array + */ + protected $testData; + + /** + * @var \Magento\Object + */ + protected $validationResult; + + protected function setUp() + { + $this->customerAddressMock = $this->getMock('Magento\Customer\Helper\Address', array(), array(), '', false); + $this->customerDataMock = $this->getMock('Magento\Customer\Helper\Data', array(), array(), '', false); + $this->customerDataMock->expects($this->any()) + ->method('getMerchantCountryCode')->will($this->returnValue('merchantCountryCode')); + $this->customerDataMock->expects($this->any()) + ->method('getMerchantVatNumber')->will($this->returnValue('merchantVatNumber')); + + $this->storeMock = $this->getMock('Magento\Core\Model\Store', array(), array(), '', false); + + $this->quoteAddressMock = $this->getMock('Magento\Sales\Model\Quote\Address', + array( + 'getCountryId', + 'getVatId', + 'getValidatedCountryCode', + 'getValidatedVatNumber', + 'getVatIsValid', + 'getVatRequestId', + 'getVatRequestDate', + 'getVatRequestSuccess', + 'getAddressType', + 'save', + '__wakeup' + ), + array(), + '', + false, + false + ); + + $this->testData = array( + 'is_valid' => true, + 'request_identifier' => 'test_request_identifier', + 'request_date' => 'test_request_date', + 'request_success' => true, + ); + + $this->quoteAddressMock->expects($this->any()) + ->method('getVatIsValid')->will($this->returnValue($this->testData['is_valid'])); + $this->quoteAddressMock->expects($this->any()) + ->method('getVatRequestId')->will($this->returnValue($this->testData['request_identifier'])); + $this->quoteAddressMock->expects($this->any()) + ->method('getVatRequestDate')->will($this->returnValue($this->testData['request_date'])); + $this->quoteAddressMock->expects($this->any()) + ->method('getVatRequestSuccess')->will($this->returnValue($this->testData['request_success'])); + $this->quoteAddressMock->expects($this->any()) + ->method('getCountryId')->will($this->returnValue('en')); + $this->quoteAddressMock->expects($this->any()) + ->method('getVatId')->will($this->returnValue('testVatID')); + + $this->validationResult = new \Magento\Object($this->testData); + + $this->model = new \Magento\Sales\Model\Observer\Frontend\Quote\Address\VatValidator( + $this->customerAddressMock, $this->customerDataMock + ); + } + + public function testValidateWithDisabledValidationOnEachTransaction() + { + $this->customerDataMock->expects($this->never())->method('checkVatNumber'); + + $this->customerAddressMock->expects($this->once()) + ->method('getValidateOnEachTransaction') + ->with($this->storeMock) + ->will($this->returnValue(false)); + + $this->quoteAddressMock->expects($this->any()) + ->method('getValidatedCountryCode')->will($this->returnValue('en')); + + $this->quoteAddressMock->expects($this->any()) + ->method('getValidatedVatNumber')->will($this->returnValue('testVatID')); + + $this->quoteAddressMock->expects($this->never())->method('save'); + + $this->assertEquals($this->validationResult, $this->model->validate($this->quoteAddressMock, $this->storeMock)); + } + + public function testValidateWithEnabledValidationOnEachTransaction() + { + $this->customerDataMock->expects($this->once()) + ->method('checkVatNumber') + ->with('en', 'testVatID', 'merchantCountryCode', 'merchantVatNumber') + ->will($this->returnValue($this->validationResult)); + + $this->customerAddressMock->expects($this->once()) + ->method('getValidateOnEachTransaction') + ->with($this->storeMock) + ->will($this->returnValue(true)); + + $this->quoteAddressMock->expects($this->any()) + ->method('getValidatedCountryCode')->will($this->returnValue('en')); + + $this->quoteAddressMock->expects($this->any()) + ->method('getValidatedVatNumber')->will($this->returnValue('testVatID')); + + $this->quoteAddressMock->expects($this->once())->method('save'); + + $this->assertEquals($this->validationResult, $this->model->validate($this->quoteAddressMock, $this->storeMock)); + } + + public function testValidateWithDifferentCountryIdAndValidatedCountryCode() + { + $this->customerDataMock->expects($this->once()) + ->method('checkVatNumber') + ->with('en', 'testVatID', 'merchantCountryCode', 'merchantVatNumber') + ->will($this->returnValue($this->validationResult)); + + $this->customerAddressMock->expects($this->once()) + ->method('getValidateOnEachTransaction') + ->with($this->storeMock) + ->will($this->returnValue(false)); + + $this->quoteAddressMock->expects($this->any()) + ->method('getValidatedCountryCode')->will($this->returnValue('someCountryCode')); + + $this->quoteAddressMock->expects($this->any()) + ->method('getVatId')->will($this->returnValue('testVatID')); + + $this->quoteAddressMock->expects($this->once())->method('save'); + + $this->assertEquals($this->validationResult, $this->model->validate($this->quoteAddressMock, $this->storeMock)); + } + + public function testValidateWithDifferentVatNumberAndValidatedVatNumber() + { + $this->customerDataMock->expects($this->once()) + ->method('checkVatNumber') + ->with('en', 'testVatID', 'merchantCountryCode', 'merchantVatNumber') + ->will($this->returnValue($this->validationResult)); + + $this->customerAddressMock->expects($this->once()) + ->method('getValidateOnEachTransaction') + ->with($this->storeMock) + ->will($this->returnValue(false)); + + $this->quoteAddressMock->expects($this->any()) + ->method('getValidatedCountryCode')->will($this->returnValue('en')); + + $this->quoteAddressMock->expects($this->any()) + ->method('getVatId')->will($this->returnValue('someVatID')); + + + $this->quoteAddressMock->expects($this->once())->method('save'); + + $this->assertEquals($this->validationResult, $this->model->validate($this->quoteAddressMock, $this->storeMock)); + } + + public function testIsEnabledWithBillingTaxCalculationAddressType() + { + $this->customerAddressMock->expects($this->any()) + ->method('isVatValidationEnabled')->will($this->returnValue(true)); + + $this->customerAddressMock->expects($this->any()) + ->method('getTaxCalculationAddressType') + ->will($this->returnValue(\Magento\Customer\Model\Address\AbstractAddress::TYPE_BILLING)); + + $this->quoteAddressMock->expects($this->any()) + ->method('getAddressType') + ->will($this->returnValue(\Magento\Customer\Model\Address\AbstractAddress::TYPE_SHIPPING)); + + $this->model->isEnabled($this->quoteAddressMock, $this->storeMock); + } + + public function testIsEnabledWithEnabledVatValidation() + { + $this->customerAddressMock->expects($this->any()) + ->method('isVatValidationEnabled')->will($this->returnValue(true)); + $this->model->isEnabled($this->quoteAddressMock, $this->storeMock); + } +} + diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Invoice/Total/ShippingTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Invoice/Total/ShippingTest.php index 4362ee2283e..6eced5a48d0 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Invoice/Total/ShippingTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Invoice/Total/ShippingTest.php @@ -116,14 +116,19 @@ class ShippingTest extends \PHPUnit_Framework_TestCase ); $orderConstructorArgs = $objectManager->getConstructArguments('Magento\Sales\Model\Order', $arguments); /** @var $order \Magento\Sales\Model\Order|PHPUnit_Framework_MockObject_MockObject */ - $order = $this->getMock('Magento\Sales\Model\Order', array('_init', 'getInvoiceCollection'), - $orderConstructorArgs, '', false); + $order = $this->getMock( + 'Magento\Sales\Model\Order', + array('_init', 'getInvoiceCollection', '__wakeup'), + $orderConstructorArgs, + '', + false + ); $order->setData('shipping_amount', $orderShipping); $order->expects($this->any()) ->method('getInvoiceCollection') ->will($this->returnValue($this->_getInvoiceCollection($prevInvoicesData))); /** @var $invoice \Magento\Sales\Model\Order\Invoice|PHPUnit_Framework_MockObject_MockObject */ - $invoice = $this->getMock('Magento\Sales\Model\Order\Invoice', array('_init'), array(), '', false); + $invoice = $this->getMock('Magento\Sales\Model\Order\Invoice', array('_init', '__wakeup'), array(), '', false); $invoice->setData('shipping_amount', $invoiceShipping); $invoice->setOrder($order); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceTest.php index 9c2fa133eed..a1727cad4f7 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/InvoiceTest.php @@ -49,11 +49,11 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase $helperManager = new \Magento\TestFramework\Helper\ObjectManager($this); $this->_orderMock = $this->getMockBuilder('Magento\Sales\Model\Order') ->disableOriginalConstructor() - ->setMethods(array('getPayment')) + ->setMethods(array('getPayment', '__wakeup')) ->getMock(); $this->_paymentMock = $this->getMockBuilder('Magento\Sales\Model\Order\Payment') ->disableOriginalConstructor() - ->setMethods(array('canVoid')) + ->setMethods(array('canVoid', '__wakeup')) ->getMock(); $arguments = array( @@ -94,7 +94,7 @@ class InvoiceTest extends \PHPUnit_Framework_TestCase { $this->_orderMock->expects($this->once())->method('getPayment')->will($this->returnValue($this->_paymentMock)); $this->_paymentMock->expects($this->once()) - ->method('canVoid') + ->method('canVoid', '__wakeup') ->with($this->equalTo($this->_model)) ->will($this->returnValue($canVoid)); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Shipment/TrackTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Shipment/TrackTest.php index b4f7e29ec9e..88ab0308225 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Shipment/TrackTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Order/Shipment/TrackTest.php @@ -66,7 +66,13 @@ class TrackTest extends \PHPUnit_Framework_TestCase array('id' => $storeId) ); - $shipmentMock = $this->getMock('Magento\Sales\Model\Order\Shipment', array('getStore'), array(), '', false); + $shipmentMock = $this->getMock( + 'Magento\Sales\Model\Order\Shipment', + array('getStore', '__wakeup'), + array(), + '', + false + ); $shipmentMock->expects($this->once()) ->method('getStore') ->will($this->returnValue($storeObject)); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/OrderTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/OrderTest.php index a2e73671fe3..0298e9b2141 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/OrderTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/OrderTest.php @@ -43,7 +43,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase $items = array(); if (!$allInvoiced) { $item = $this->getMockBuilder('Magento\Sales\Model\Order\Item') - ->setMethods(array('getQtyToInvoice', 'isDeleted')) + ->setMethods(array('getQtyToInvoice', 'isDeleted', '__wakeup')) ->disableOriginalConstructor() ->getMock(); $item->expects($this->any()) @@ -102,7 +102,7 @@ class OrderTest extends \PHPUnit_Framework_TestCase /** @var $order \Magento\Sales\Model\Order */ $order = $this->getMockBuilder('Magento\Sales\Model\Order') ->disableOriginalConstructor() - ->setMethods(null) + ->setMethods(array('__wakeup')) ->getMock(); foreach ($actionFlags as $action => $flag) { $order->setActionFlag($action, $flag); diff --git a/dev/tests/unit/testsuite/Magento/Sales/Model/Quote/ItemTest.php b/dev/tests/unit/testsuite/Magento/Sales/Model/Quote/ItemTest.php index 99a6ca912a9..e3f0b246a4c 100644 --- a/dev/tests/unit/testsuite/Magento/Sales/Model/Quote/ItemTest.php +++ b/dev/tests/unit/testsuite/Magento/Sales/Model/Quote/ItemTest.php @@ -36,13 +36,24 @@ class ItemTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_model = $this->getMock('Magento\Sales\Model\Quote\Item', null, array(), '', false); + $this->_model = $this->getMock( + 'Magento\Sales\Model\Quote\Item', + array('__wakeup'), + array(), + '', + false + ); } public function testGetAddress() { - $quote = $this->getMock('Magento\Sales\Model\Quote', - array('getShippingAddress', 'getBillingAddress'), array(), '', false); + $quote = $this->getMock( + 'Magento\Sales\Model\Quote', + array('getShippingAddress', 'getBillingAddress', '__wakeup'), + array(), + '', + false + ); $quote->expects($this->once()) ->method('getShippingAddress') ->will($this->returnValue('shipping')); diff --git a/dev/tests/unit/testsuite/Magento/SalesRule/Model/ValidatorTest.php b/dev/tests/unit/testsuite/Magento/SalesRule/Model/ValidatorTest.php index b135822c454..9b974423b49 100644 --- a/dev/tests/unit/testsuite/Magento/SalesRule/Model/ValidatorTest.php +++ b/dev/tests/unit/testsuite/Magento/SalesRule/Model/ValidatorTest.php @@ -36,8 +36,13 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_model = $this->getMock('Magento\SalesRule\Model\Validator', - array('_getRules', '_getItemOriginalPrice', '_getItemBaseOriginalPrice'), array(), '', false); + $this->_model = $this->getMock( + 'Magento\SalesRule\Model\Validator', + array('_getRules', '_getItemOriginalPrice', '_getItemBaseOriginalPrice', '__wakeup'), + array(), + '', + false + ); $this->_model->expects($this->any()) ->method('_getRules') ->will($this->returnValue(array())); @@ -55,18 +60,36 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase protected function _getQuoteItemMock() { $fixturePath = __DIR__ . DIRECTORY_SEPARATOR . '_files' . DIRECTORY_SEPARATOR; - $itemDownloadable = $this->getMock('Magento\Sales\Model\Quote\Item', array('getAddress'), array(), '', false); + $itemDownloadable = $this->getMock( + 'Magento\Sales\Model\Quote\Item', + array('getAddress', '__wakeup'), + array(), + '', + false + ); $itemDownloadable->expects($this->any()) ->method('getAddress') ->will($this->returnValue(new \stdClass())); - $itemSimple = $this->getMock('Magento\Sales\Model\Quote\Item', array('getAddress'), array(), '', false); + $itemSimple = $this->getMock( + 'Magento\Sales\Model\Quote\Item', + array('getAddress', '__wakeup'), + array(), + '', + false + ); $itemSimple->expects($this->any()) ->method('getAddress') ->will($this->returnValue(new \stdClass())); /** @var $quote \Magento\Sales\Model\Quote */ - $quote = $this->getMock('Magento\Sales\Model\Quote', array('hasNominalItems'), array(), '', false); + $quote = $this->getMock( + 'Magento\Sales\Model\Quote', + array('hasNominalItems', '__wakeup'), + array(), + '', + false + ); $quote->expects($this->any()) ->method('hasNominalItems') ->will($this->returnValue(false)); @@ -102,7 +125,7 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase public function testProcessFreeShipping() { - $item = $this->getMock('Magento\Sales\Model\Quote\Item', array('getAddress'), array(), '', false); + $item = $this->getMock('Magento\Sales\Model\Quote\Item', array('getAddress', '__wakeup'), array(), '', false); $item->expects($this->once()) ->method('getAddress') ->will($this->returnValue(true)); @@ -114,14 +137,14 @@ class ValidatorTest extends \PHPUnit_Framework_TestCase public function testProcess() { - $item = $this->getMock('Magento\Sales\Model\Quote\Item', array('getAddress'), array(), '', false); + $item = $this->getMock('Magento\Sales\Model\Quote\Item', array('getAddress', '__wakeup'), array(), '', false); $item->expects($this->once()) ->method('getAddress') ->will($this->returnValue(true)); $item->setDiscountCalculationPrice(-1); $item->setCalculationPrice(1); - $quote = $this->getMock('Magento\Sales\Model\Quote', null, array(), '', false); + $quote = $this->getMock('Magento\Sales\Model\Quote', array('__wakeup'), array(), '', false); $item->setQuote($quote); $this->assertInstanceOf('Magento\SalesRule\Model\Validator', $this->_model->process($item)); diff --git a/dev/tests/unit/testsuite/Magento/Sitemap/Model/SitemapTest.php b/dev/tests/unit/testsuite/Magento/Sitemap/Model/SitemapTest.php index c54ca17ba32..b955d043a4a 100644 --- a/dev/tests/unit/testsuite/Magento/Sitemap/Model/SitemapTest.php +++ b/dev/tests/unit/testsuite/Magento/Sitemap/Model/SitemapTest.php @@ -106,7 +106,9 @@ class SitemapTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue('0.25')); $this->_resourceMock = $this->getMockBuilder('Magento\Sitemap\Model\Resource\Sitemap') - ->setMethods(array('_construct', 'beginTransaction', 'rollBack', 'save', 'addCommitCallback', 'commit')) + ->setMethods(array( + '_construct', 'beginTransaction', 'rollBack', 'save', 'addCommitCallback', 'commit', '__wakeup' + )) ->disableOriginalConstructor() ->getMock(); $this->_resourceMock->expects($this->any()) diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/FactoryTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/FactoryTest.php index 8a7b0b789cf..e818babe0e8 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/FactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/FactoryTest.php @@ -38,7 +38,13 @@ class FactoryTest extends \PHPUnit_Framework_TestCase */ public function testCreate($classType, $className, $classTypeMock) { - $classMock = $this->getMock('Magento\Tax\Model\ClassModel', array('getClassType', 'getId'), array(), '', false); + $classMock = $this->getMock( + 'Magento\Tax\Model\ClassModel', + array('getClassType', 'getId', '__wakeup'), + array(), + '', + false + ); $classMock->expects($this->once())->method('getClassType')->will($this->returnValue($classType)); $classMock->expects($this->once())->method('getId')->will($this->returnValue(1)); @@ -73,7 +79,13 @@ class FactoryTest extends \PHPUnit_Framework_TestCase public function testCreateWithWrongClassType() { $wrongClassType = 'TYPE'; - $classMock = $this->getMock('Magento\Tax\Model\ClassModel', array('getClassType', 'getId'), array(), '', false); + $classMock = $this->getMock( + 'Magento\Tax\Model\ClassModel', + array('getClassType', 'getId', '__wakeup'), + array(), + '', + false + ); $classMock->expects($this->once())->method('getClassType')->will($this->returnValue($wrongClassType)); $objectManager = $this->getMock('Magento\ObjectManager', array(), array(), '', false); diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php index 55112a0b723..d7b7850786e 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/CustomerTest.php @@ -43,7 +43,7 @@ class CustomerTest extends \PHPUnit_Framework_TestCase ->will($this->returnSelf()); $customerGroupMock = $this->getMockBuilder('Magento\Customer\Model\Group') - ->setMethods(array('getCollection')) + ->setMethods(array('getCollection', '__wakeup')) ->disableOriginalConstructor() ->getMock(); $customerGroupMock->expects($this->once()) diff --git a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/ProductTest.php b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/ProductTest.php index 9ef48155816..209cf91e8cd 100644 --- a/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/ProductTest.php +++ b/dev/tests/unit/testsuite/Magento/Tax/Model/TaxClass/Type/ProductTest.php @@ -43,7 +43,7 @@ class ProductTest extends \PHPUnit_Framework_TestCase ->will($this->returnSelf()); $productMock = $this->getMockBuilder('Magento\Catalog\Model\Product') - ->setMethods(array('getCollection')) + ->setMethods(array('getCollection', '__wakeup')) ->disableOriginalConstructor() ->getMock(); $productMock->expects($this->once()) diff --git a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/CopyRuleTest.php b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/CopyRuleTest.php index 0e01dc54dcd..751f20ba196 100644 --- a/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/CopyRuleTest.php +++ b/dev/tests/unit/testsuite/Magento/Test/Tools/View/Generator/CopyRuleTest.php @@ -57,9 +57,9 @@ class CopyRuleTest extends \PHPUnit_Framework_TestCase 'Magento\Core\Model\Theme\Collection', array('isLoaded'), array( + $this->getMock('Magento\Core\Model\EntityFactory', array(), array(), '', false), $this->_filesystem, - new \Magento\App\Dir(__DIR__), - $this->getMock('Magento\Core\Model\EntityFactory', array(), array(), '', false) + new \Magento\App\Dir(__DIR__) ) ); $this->_themeCollection->expects($this->any())->method('isLoaded')->will($this->returnValue(true)); diff --git a/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Tab/JsTest.php b/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Tab/JsTest.php index 36cc3f092bd..8d97d749f4a 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Tab/JsTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/Tab/JsTest.php @@ -98,7 +98,13 @@ class JsTest extends \PHPUnit_Framework_TestCase { $themeId = 2; $uploadUrl = 'upload_url'; - $themeMock = $this->getMock('Magento\Core\Model\Theme', array('isVirtual', 'getId'), array(), '', false); + $themeMock = $this->getMock( + 'Magento\Core\Model\Theme', + array('isVirtual', 'getId', '__wakeup'), + array(), + '', + false + ); $themeMock->expects($this->any()) ->method('getId') ->will($this->returnValue($themeId)); diff --git a/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/TabAbstractTest.php b/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/TabAbstractTest.php index 16776965251..03a9eb09a50 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/TabAbstractTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Block/Adminhtml/System/Design/Theme/TabAbstractTest.php @@ -40,7 +40,6 @@ class TabAbstractTest extends \PHPUnit_Framework_TestCase 'Magento\Theme\Block\Adminhtml\System\Design\Theme\Edit\AbstractTab', array( $this->getMock('Magento\Backend\Block\Template\Context', array(), array(), '', false), - $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false), $this->getMock('Magento\Core\Model\Registry', array(), array(), '', false), $this->getMock('Magento\Data\FormFactory', array(), array(), '', false), $this->getMock('Magento\ObjectManager', array(), array(), '', false) @@ -76,7 +75,13 @@ class TabAbstractTest extends \PHPUnit_Framework_TestCase */ public function testCanShowTab($isVirtual, $themeId, $result) { - $themeMock = $this->getMock('Magento\Core\Model\Theme', array('isVirtual', 'getId'), array(), '', false); + $themeMock = $this->getMock( + 'Magento\Core\Model\Theme', + array('isVirtual', 'getId', '__wakeup'), + array(), + '', + false + ); $themeMock->expects($this->any()) ->method('isVirtual') ->will($this->returnValue($isVirtual)); diff --git a/dev/tests/unit/testsuite/Magento/Page/Block/Html/HeadTest.php b/dev/tests/unit/testsuite/Magento/Theme/Block/Html/HeadTest.php similarity index 77% rename from dev/tests/unit/testsuite/Magento/Page/Block/Html/HeadTest.php rename to dev/tests/unit/testsuite/Magento/Theme/Block/Html/HeadTest.php index 86043d417a0..98065cf2eac 100644 --- a/dev/tests/unit/testsuite/Magento/Page/Block/Html/HeadTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Block/Html/HeadTest.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Html; +namespace Magento\Theme\Block\Html; class HeadTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Page\Block\Html\Head + * @var \Magento\Theme\Block\Html\Head */ protected $_block; @@ -44,13 +44,13 @@ class HeadTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_objectManager = $this->getMock('Magento\ObjectManager'); - $this->_pageAssets = $this->getMock('Magento\Page\Model\Asset\GroupedCollection', array(), array(), '', false); + $this->_pageAssets = $this->getMock('Magento\View\Asset\GroupedCollection', array(), array(), '', false); $objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); $arguments = $objectManagerHelper->getConstructArguments( - 'Magento\Page\Block\Html\Head', - array('page' => new \Magento\Core\Model\Page($this->_pageAssets), 'objectManager' => $this->_objectManager) + 'Magento\Theme\Block\Html\Head', + array('assets' => $this->_pageAssets, 'objectManager' => $this->_objectManager) ); - $this->_block = $objectManagerHelper->getObject('Magento\Page\Block\Html\Head', $arguments); + $this->_block = $objectManagerHelper->getObject('Magento\Theme\Block\Html\Head', $arguments); } protected function tearDown() @@ -66,13 +66,13 @@ class HeadTest extends \PHPUnit_Framework_TestCase ->method('add') ->with( 'link/http://127.0.0.1/test.rss', - $this->isInstanceOf('Magento\Core\Model\Page\Asset\Remote'), + $this->isInstanceOf('Magento\View\Asset\Remote'), array('attributes' => 'rel="alternate" type="application/rss+xml" title="RSS Feed"') ); - $assetRemoteFile = $this->getMock('Magento\Core\Model\Page\Asset\Remote', array(), array(), '', false); + $assetRemoteFile = $this->getMock('Magento\View\Asset\Remote', array(), array(), '', false); $this->_objectManager->expects($this->once('')) ->method('create') - ->with('Magento\Core\Model\Page\Asset\Remote') + ->with('Magento\View\Asset\Remote') ->will($this->returnValue($assetRemoteFile)); $this->_block->addRss('RSS Feed', 'http://127.0.0.1/test.rss'); diff --git a/dev/tests/unit/testsuite/Magento/Page/Block/Html/HeaderTest.php b/dev/tests/unit/testsuite/Magento/Theme/Block/Html/HeaderTest.php similarity index 92% rename from dev/tests/unit/testsuite/Magento/Page/Block/Html/HeaderTest.php rename to dev/tests/unit/testsuite/Magento/Theme/Block/Html/HeaderTest.php index 8dbcd39381d..a0b89aaabb6 100644 --- a/dev/tests/unit/testsuite/Magento/Page/Block/Html/HeaderTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Block/Html/HeaderTest.php @@ -19,18 +19,18 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Page + * @package Magento_Theme * @subpackage unit_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Html; +namespace Magento\Theme\Block\Html; class HeaderTest extends \PHPUnit_Framework_TestCase { /** - * @covers \Magento\Page\Block\Html\Header::getLogoSrc + * @covers \Magento\Theme\Block\Html\Header::getLogoSrc */ public function testGetLogoSrc() { @@ -70,7 +70,7 @@ class HeaderTest extends \PHPUnit_Framework_TestCase 'helperFactory' => $helperFactory, 'dirs' => $dirsMock ); - $block = $objectManager->getObject('Magento\Page\Block\Html\Header', $arguments); + $block = $objectManager->getObject('Magento\Theme\Block\Html\Header', $arguments); $this->assertEquals('http://localhost/pub/media/logo/default/image.gif', $block->getLogoSrc()); } diff --git a/dev/tests/unit/testsuite/Magento/Page/Block/Html/_files/logo/default/image.gif b/dev/tests/unit/testsuite/Magento/Theme/Block/Html/_files/logo/default/image.gif similarity index 100% rename from dev/tests/unit/testsuite/Magento/Page/Block/Html/_files/logo/default/image.gif rename to dev/tests/unit/testsuite/Magento/Theme/Block/Html/_files/logo/default/image.gif diff --git a/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php b/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php index ff39622f61f..5d3e8dcac83 100644 --- a/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Controller/Adminhtml/System/Design/ThemeTest.php @@ -86,8 +86,13 @@ class ThemeTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($jsOrder)); $this->_request->expects($this->once(5))->method('getPost')->will($this->returnValue(true)); - $themeMock = $this->getMock('Magento\Core\Model\Theme', - array('save', 'load', 'setCustomization', 'getThemeImage'), array(), '', false); + $themeMock = $this->getMock( + 'Magento\Core\Model\Theme', + array('save', 'load', 'setCustomization', 'getThemeImage', '__wakeup'), + array(), + '', + false + ); $themeImage = $this->getMock('Magento\Core\Model\Theme\Image', array(), array(), '', false); $themeMock->expects($this->any())->method('getThemeImage')->will($this->returnValue($themeImage)); diff --git a/dev/tests/unit/testsuite/Magento/Page/Model/Config/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/ConverterTest.php similarity index 89% rename from dev/tests/unit/testsuite/Magento/Page/Model/Config/ConverterTest.php rename to dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/ConverterTest.php index a1f31327850..ca29da1452c 100644 --- a/dev/tests/unit/testsuite/Magento/Page/Model/Config/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/ConverterTest.php @@ -1,6 +1,6 @@ <?php /** - * \Magento\Page\Model\Config\Converter + * \Magento\Theme\Model\Layout\Config\Converter * * Magento * @@ -23,12 +23,12 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Model\Config; +namespace Magento\Theme\Model\Layout\Config; class ConverterTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Page\Model\Config\Converter + * @var \Magento\Theme\Model\Layout\Config\Converter */ protected $_model; @@ -37,7 +37,7 @@ class ConverterTest extends \PHPUnit_Framework_TestCase public function setUp() { - $this->_model = new \Magento\Page\Model\Config\Converter(); + $this->_model = new \Magento\Theme\Model\Layout\Config\Converter(); } public function testConvert() diff --git a/dev/tests/unit/testsuite/Magento/Page/Model/Config/_files/page_layouts.xml b/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/_files/page_layouts.xml similarity index 96% rename from dev/tests/unit/testsuite/Magento/Page/Model/Config/_files/page_layouts.xml rename to dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/_files/page_layouts.xml index 6eb01698ca1..4ffc35ef5f1 100644 --- a/dev/tests/unit/testsuite/Magento/Page/Model/Config/_files/page_layouts.xml +++ b/dev/tests/unit/testsuite/Magento/Theme/Model/Layout/Config/_files/page_layouts.xml @@ -24,7 +24,7 @@ */ --> <page_layouts xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Page/etc/page_layouts.xsd"> + xsi:noNamespaceSchemaLocation="../../../../../../../../../app/code/Magento/Theme/etc/page_layouts.xsd"> <layouts default="one_column"> <layout id="empty"> <label translate="true">Empty</label> diff --git a/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RoleTest.php b/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RoleTest.php index d880f0771c2..f9553d1c5ce 100644 --- a/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RoleTest.php +++ b/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RoleTest.php @@ -101,12 +101,12 @@ class RoleTest extends \PHPUnit_Framework_TestCase ))); - $this->_groupFactoryMock->expects($this->once())->method('create')->with(array('roleId' => 'G1')); - $this->_roleFactoryMock->expects($this->once())->method('create')->with(array('roleId' => 'U1')); + $this->_groupFactoryMock->expects($this->once())->method('create')->with(array('roleId' => '1')); + $this->_roleFactoryMock->expects($this->once())->method('create')->with(array('roleId' => '2')); $aclMock = $this->getMock('Magento\Acl'); $aclMock->expects($this->at(0))->method('addRole')->with($this->anything(), null); - $aclMock->expects($this->at(2))->method('addRole')->with($this->anything(), 'G1'); + $aclMock->expects($this->at(2))->method('addRole')->with($this->anything(), '1'); $this->_model->populateAcl($aclMock); } @@ -116,16 +116,16 @@ class RoleTest extends \PHPUnit_Framework_TestCase $this->_adapterMock->expects($this->once()) ->method('fetchAll') ->will($this->returnValue(array( - array('role_id' => 1, 'role_type' => 'U', 'parent_id' => 1, 'user_id' => 1), + array('role_id' => 1, 'role_type' => 'U', 'parent_id' => 2, 'user_id' => 3), ))); $this->_roleFactoryMock->expects($this->never())->method('getModelInstance'); $this->_groupFactoryMock->expects($this->never())->method('getModelInstance'); $aclMock = $this->getMock('Magento\Acl'); - $aclMock->expects($this->at(0))->method('hasRole')->with('U1') + $aclMock->expects($this->at(0))->method('hasRole')->with('1') ->will($this->returnValue(true)); - $aclMock->expects($this->at(1))->method('addRoleParent')->with('U1', 'G1'); + $aclMock->expects($this->at(1))->method('addRoleParent')->with('1', '2'); $this->_model->populateAcl($aclMock); } diff --git a/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RuleTest.php b/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RuleTest.php index 686423505db..69b641dc8c2 100644 --- a/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RuleTest.php +++ b/dev/tests/unit/testsuite/Magento/User/Model/Acl/Loader/RuleTest.php @@ -72,12 +72,11 @@ class RuleTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue(array( array( 'role_id' => 1, - 'role_type' => 'G', 'resource_id' => 'Magento_Adminhtml::all', 'permission' => 'allow' ), - array('role_id' => 2, 'role_type' => 'U', 'resource_id' => 1, 'permission' => 'allow'), - array('role_id' => 3, 'role_type' => 'U', 'resource_id' => 1, 'permission' => 'deny'), + array('role_id' => 2, 'resource_id' => 1, 'permission' => 'allow'), + array('role_id' => 3, 'resource_id' => 1, 'permission' => 'deny'), ))); $this->_resourceMock->expects($this->once()) @@ -86,10 +85,10 @@ class RuleTest extends \PHPUnit_Framework_TestCase $aclMock = $this->getMock('Magento\Acl'); $aclMock->expects($this->any())->method('has')->will($this->returnValue(true)); - $aclMock->expects($this->at(1))->method('allow')->with('G1', null, null); - $aclMock->expects($this->at(2))->method('allow')->with('G1', 'Magento_Adminhtml::all', null); - $aclMock->expects($this->at(4))->method('allow')->with('U2', 1, null); - $aclMock->expects($this->at(6))->method('deny')->with('U3', 1, null); + $aclMock->expects($this->at(1))->method('allow')->with('1', null, null); + $aclMock->expects($this->at(2))->method('allow')->with('1', 'Magento_Adminhtml::all', null); + $aclMock->expects($this->at(4))->method('allow')->with('2', 1, null); + $aclMock->expects($this->at(6))->method('deny')->with('3', 1, null); $this->_model->populateAcl($aclMock); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/CollectionTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/CollectionTest.php similarity index 80% rename from dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/CollectionTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/CollectionTest.php index 57342ba5d7e..72c92b89733 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/CollectionTest.php @@ -25,30 +25,30 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset; +namespace Magento\View\Asset; class CollectionTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Page\Asset\Collection + * @var \Magento\View\Asset\Collection */ protected $_object; /** - * @var \Magento\Core\Model\Page\Asset\AssetInterface + * @var \Magento\View\Asset\AssetInterface */ protected $_asset; protected function setUp() { - $this->_object = new \Magento\Core\Model\Page\Asset\Collection(); - $this->_asset = new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/magento/test.css'); + $this->_object = new \Magento\View\Asset\Collection(); + $this->_asset = new \Magento\View\Asset\Remote('http://127.0.0.1/magento/test.css'); $this->_object->add('asset', $this->_asset); } public function testAdd() { - $assetNew = new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/magento/test.js'); + $assetNew = new \Magento\View\Asset\Remote('http://127.0.0.1/magento/test.js'); $this->_object->add('asset_new', $assetNew); $this->assertSame(array('asset' => $this->_asset, 'asset_new' => $assetNew), $this->_object->getAll()); } @@ -67,7 +67,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase public function testAddOverrideExisting() { - $assetOverridden = new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/magento/test_overridden.css'); + $assetOverridden = new \Magento\View\Asset\Remote('http://127.0.0.1/magento/test_overridden.css'); $this->_object->add('asset', $assetOverridden); $this->assertSame(array('asset' => $assetOverridden), $this->_object->getAll()); } diff --git a/dev/tests/unit/testsuite/Magento/Page/Model/Asset/GroupedCollectionTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/GroupedCollectionTest.php similarity index 78% rename from dev/tests/unit/testsuite/Magento/Page/Model/Asset/GroupedCollectionTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/GroupedCollectionTest.php index 58c9350129a..cce880eb020 100644 --- a/dev/tests/unit/testsuite/Magento/Page/Model/Asset/GroupedCollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/GroupedCollectionTest.php @@ -18,38 +18,35 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page - * @subpackage unit_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Model\Asset; +namespace Magento\View\Asset; class GroupedCollectionTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Page\Model\Asset\GroupedCollection + * @var \Magento\View\Asset\GroupedCollection */ protected $_object; /** - * @var \Magento\Core\Model\Page\Asset\AssetInterface + * @var \Magento\View\Asset\AssetInterface */ protected $_asset; protected function setUp() { - $objectManager = $this->getMock('Magento\ObjectManager'); - $objectManager - ->expects($this->any()) + $factory = $this->getMock('Magento\View\Asset\PropertyGroupFactory', + array(), array(), '', false, false); + $factory = $this->getMock('Magento\View\Asset\PropertyGroupFactory', + array(), array(), '', false, false); + $factory->expects($this->any()) ->method('create') - ->with('Magento\Page\Model\Asset\PropertyGroup') - ->will($this->returnCallback(array($this, 'createAssetGroup'))) - ; - $this->_object = new \Magento\Page\Model\Asset\GroupedCollection($objectManager); - $this->_asset = new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/magento/test.css'); + ->will($this->returnCallback(array($this, 'createAssetGroup'))); + $this->_object = new \Magento\View\Asset\GroupedCollection($factory); + $this->_asset = new \Magento\View\Asset\Remote('http://127.0.0.1/magento/test.css'); $this->_object->add('asset', $this->_asset); } @@ -62,14 +59,12 @@ class GroupedCollectionTest extends \PHPUnit_Framework_TestCase /** * Return newly created asset group. Used as a stub for object manger's creation operation. * - * @param string $class * @param array $arguments - * @return \Magento\Page\Model\Asset\PropertyGroup - * @SuppressWarnings(PHPMD.UnusedFormalParameter) + * @return \Magento\View\Asset\PropertyGroup */ - public function createAssetGroup($class, array $arguments) + public function createAssetGroup(array $arguments) { - return new \Magento\Page\Model\Asset\PropertyGroup($arguments['properties']); + return new \Magento\View\Asset\PropertyGroup($arguments['properties']); } /** @@ -82,9 +77,9 @@ class GroupedCollectionTest extends \PHPUnit_Framework_TestCase { $this->assertInternalType('array', $actualGroupObjects); $actualGroups = array(); - /** @var $actualGroup \Magento\Page\Model\Asset\PropertyGroup */ + /** @var $actualGroup \Magento\View\Asset\PropertyGroup */ foreach ($actualGroupObjects as $actualGroup) { - $this->assertInstanceOf('Magento\Page\Model\Asset\PropertyGroup', $actualGroup); + $this->assertInstanceOf('Magento\View\Asset\PropertyGroup', $actualGroup); $actualGroups[] = array( 'properties' => $actualGroup->getProperties(), 'assets' => $actualGroup->getAll(), @@ -95,7 +90,7 @@ class GroupedCollectionTest extends \PHPUnit_Framework_TestCase public function testAdd() { - $assetNew = new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/magento/test_new.css'); + $assetNew = new \Magento\View\Asset\Remote('http://127.0.0.1/magento/test_new.css'); $this->_object->add('asset_new', $assetNew, array('test_property' => 'test_value')); $this->assertEquals(array('asset' => $this->_asset, 'asset_new' => $assetNew), $this->_object->getAll()); } @@ -108,9 +103,9 @@ class GroupedCollectionTest extends \PHPUnit_Framework_TestCase public function testGetGroups() { - $cssAsset = new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/style.css', 'css'); - $jsAsset = new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/script.js', 'js'); - $jsAssetAllowingMerge = $this->getMockForAbstractClass('Magento\Core\Model\Page\Asset\MergeableInterface'); + $cssAsset = new \Magento\View\Asset\Remote('http://127.0.0.1/style.css', 'css'); + $jsAsset = new \Magento\View\Asset\Remote('http://127.0.0.1/script.js', 'js'); + $jsAssetAllowingMerge = $this->getMockForAbstractClass('Magento\View\Asset\MergeableInterface'); $jsAssetAllowingMerge->expects($this->any())->method('getContentType')->will($this->returnValue('js')); // assets with identical properties should be grouped together diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeServiceTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MergeServiceTest.php similarity index 62% rename from dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeServiceTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/MergeServiceTest.php index feca73ae398..1f7f705a5dc 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MergeServiceTest.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset; +namespace Magento\View\Asset; class MergeServiceTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Page\Asset\MergeService + * @var \Magento\View\Asset\MergeService */ protected $_object; @@ -39,7 +39,7 @@ class MergeServiceTest extends \PHPUnit_Framework_TestCase /** * @var \PHPUnit_Framework_MockObject_MockObject */ - protected $_storeConfig; + protected $_config; /** * @var \PHPUnit_Framework_MockObject_MockObject @@ -59,16 +59,14 @@ class MergeServiceTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_objectManager = $this->getMockForAbstractClass('Magento\ObjectManager', array('create')); - $this->_storeConfig = $this->getMock( - 'Magento\Core\Model\Store\Config', array('getConfigFlag'), array(), '', false - ); + $this->_config = $this->getMock('Magento\View\Asset\ConfigInterface', array(), array(), '', false); $this->_filesystem = $this->getMock('Magento\Filesystem', array(), array(), '', false); $this->_dirs = $this->getMock('Magento\App\Dir', array(), array(), '', false); $this->_state = $this->getMock('Magento\App\State', array(), array(), '', false); - $this->_object = new \Magento\Core\Model\Page\Asset\MergeService( + $this->_object = new \Magento\View\Asset\MergeService( $this->_objectManager, - $this->_storeConfig, + $this->_config, $this->_filesystem, $this->_dirs, $this->_state @@ -87,40 +85,34 @@ class MergeServiceTest extends \PHPUnit_Framework_TestCase /** * @param array $assets * @param string $contentType - * @param string $storeConfigPath * @param string $appMode * @param string $mergeStrategy * @dataProvider getMergedAssetsDataProvider */ - public function testGetMergedAssets(array $assets, $contentType, $storeConfigPath, $appMode, $mergeStrategy) + public function testGetMergedAssets(array $assets, $contentType, $appMode, $mergeStrategy) { - $mergedAsset = $this->getMock('Magento\Core\Model\Page\Asset\AssetInterface'); - $this->_storeConfig - ->expects($this->any()) - ->method('getConfigFlag') - ->will($this->returnValueMap(array( - array($storeConfigPath, null, true), - ))) - ; + $mergedAsset = $this->getMock('Magento\View\Asset\AssetInterface'); + $this->_config->expects($this->once()) + ->method('isMergeCssFiles') + ->will($this->returnValue(true)); + $this->_config->expects($this->once()) + ->method('isMergeJsFiles') + ->will($this->returnValue(true)); $mergeStrategyMock = $this->getMock($mergeStrategy, array(), array(), '', false); - $this->_objectManager - ->expects($this->once()) + $this->_objectManager->expects($this->once()) ->method('create') ->with( - 'Magento\Core\Model\Page\Asset\Merged', + 'Magento\View\Asset\Merged', array('assets' => $assets, 'mergeStrategy' => $mergeStrategyMock) ) - ->will($this->returnValue($mergedAsset)) - ; + ->will($this->returnValue($mergedAsset)); - $this->_objectManager - ->expects($this->once()) + $this->_objectManager->expects($this->once()) ->method('get') ->with($mergeStrategy) - ->will($this->returnValue($mergeStrategyMock)) - ; + ->will($this->returnValue($mergeStrategyMock)); $this->_state ->expects($this->once()) ->method('getMode') @@ -131,55 +123,49 @@ class MergeServiceTest extends \PHPUnit_Framework_TestCase public static function getMergedAssetsDataProvider() { $jsAssets = array( - new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/magento/script_one.js'), - new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/magento/script_two.js') + new \Magento\View\Asset\Remote('http://127.0.0.1/magento/script_one.js'), + new \Magento\View\Asset\Remote('http://127.0.0.1/magento/script_two.js') ); $cssAssets = array( - new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/magento/style_one.css'), - new \Magento\Core\Model\Page\Asset\Remote('http://127.0.0.1/magento/style_two.css') + new \Magento\View\Asset\Remote('http://127.0.0.1/magento/style_one.css'), + new \Magento\View\Asset\Remote('http://127.0.0.1/magento/style_two.css') ); return array( 'js production mode' => array( $jsAssets, \Magento\View\Publisher::CONTENT_TYPE_JS, - \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_JS_FILES, \Magento\App\State::MODE_PRODUCTION, - 'Magento\Core\Model\Page\Asset\MergeStrategy\FileExists' + 'Magento\View\Asset\MergeStrategy\FileExists' ), 'css production mode' => array( $cssAssets, \Magento\View\Publisher::CONTENT_TYPE_CSS, - \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_CSS_FILES, \Magento\App\State::MODE_PRODUCTION, - 'Magento\Core\Model\Page\Asset\MergeStrategy\FileExists' + 'Magento\View\Asset\MergeStrategy\FileExists' ), 'js default mode' => array( $jsAssets, \Magento\View\Publisher::CONTENT_TYPE_JS, - \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_JS_FILES, \Magento\App\State::MODE_DEFAULT, - 'Magento\Core\Model\Page\Asset\MergeStrategy\Checksum' + 'Magento\View\Asset\MergeStrategy\Checksum' ), 'css default mode' => array( $cssAssets, \Magento\View\Publisher::CONTENT_TYPE_CSS, - \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_CSS_FILES, \Magento\App\State::MODE_DEFAULT, - 'Magento\Core\Model\Page\Asset\MergeStrategy\Checksum' + 'Magento\View\Asset\MergeStrategy\Checksum' ), 'js developer mode' => array( $jsAssets, \Magento\View\Publisher::CONTENT_TYPE_JS, - \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_JS_FILES, \Magento\App\State::MODE_DEVELOPER, - 'Magento\Core\Model\Page\Asset\MergeStrategy\Checksum' + 'Magento\View\Asset\MergeStrategy\Checksum' ), 'css developer mode' => array( $cssAssets, \Magento\View\Publisher::CONTENT_TYPE_CSS, - \Magento\Core\Model\Page\Asset\MergeService::XML_PATH_MERGE_CSS_FILES, \Magento\App\State::MODE_DEVELOPER, - 'Magento\Core\Model\Page\Asset\MergeStrategy\Checksum' + 'Magento\View\Asset\MergeStrategy\Checksum' ), ); } @@ -191,20 +177,11 @@ class MergeServiceTest extends \PHPUnit_Framework_TestCase ->with(\Magento\App\Dir::PUB_VIEW_CACHE) ->will($this->returnValue('/pub/cache')); - $mergedDir = '/pub/cache/' . \Magento\Core\Model\Page\Asset\Merged::PUBLIC_MERGE_DIR; + $mergedDir = '/pub/cache/' . \Magento\View\Asset\Merged::PUBLIC_MERGE_DIR; $this->_filesystem->expects($this->once()) ->method('delete') ->with($mergedDir, null); - $mediaStub = $this->getMock('Magento\Core\Helper\File\Storage\Database', array(), array(), '', false); - $mediaStub->expects($this->once()) - ->method('deleteFolder') - ->with($mergedDir); - $this->_objectManager->expects($this->once()) - ->method('get') - ->with('Magento\Core\Helper\File\Storage\Database') - ->will($this->returnValue($mediaStub)); - $this->_object->cleanMergedJsCss(); } } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/ChecksumTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/ChecksumTest.php similarity index 94% rename from dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/ChecksumTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/ChecksumTest.php index 303298ea8f8..bcd6e0a5285 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/ChecksumTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/ChecksumTest.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset\MergeStrategy; +namespace Magento\View\Asset\MergeStrategy; class ChecksumTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Page\Asset\MergeStrategy\Checksum + * @var \Magento\View\Asset\MergeStrategy\Checksum */ protected $_object; @@ -68,9 +68,9 @@ class ChecksumTest extends \PHPUnit_Framework_TestCase ) )); - $this->_strategy = $this->getMock('Magento\Core\Model\Page\Asset\MergeStrategyInterface'); + $this->_strategy = $this->getMock('Magento\View\Asset\MergeStrategyInterface'); - $this->_object = new \Magento\Core\Model\Page\Asset\MergeStrategy\Checksum($this->_strategy, + $this->_object = new \Magento\View\Asset\MergeStrategy\Checksum($this->_strategy, $this->_filesystem); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/DirectTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/DirectTest.php similarity index 94% rename from dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/DirectTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/DirectTest.php index b1454e518a0..3b37cd1f296 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/DirectTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/DirectTest.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset\MergeStrategy; +namespace Magento\View\Asset\MergeStrategy; class DirectTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Page\Asset\MergeStrategy\Direct + * @var \Magento\View\Asset\MergeStrategy\Direct */ protected $_object; @@ -52,7 +52,7 @@ class DirectTest extends \PHPUnit_Framework_TestCase $this->_filesystem = $this->getMock('Magento\Filesystem', array(), array(), '', false); $this->_dirs = $this->getMock('Magento\App\Dir', array(), array(), '', false); - $this->_object = new \Magento\Core\Model\Page\Asset\MergeStrategy\Direct( + $this->_object = new \Magento\View\Asset\MergeStrategy\Direct( $this->_filesystem, $this->_dirs, $this->_cssUrlResolver ); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/FileExistsTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/FileExistsTest.php similarity index 89% rename from dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/FileExistsTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/FileExistsTest.php index 9c3b558cfaf..5945405b4d8 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergeStrategy/FileExistsTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MergeStrategy/FileExistsTest.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset\MergeStrategy; +namespace Magento\View\Asset\MergeStrategy; class FileExistsTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Page\Asset\MergeStrategy\FileExists + * @var \Magento\View\Asset\MergeStrategy\FileExists */ protected $_object; @@ -54,9 +54,9 @@ class FileExistsTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_filesystem = $this->getMock('Magento\Filesystem', array(), array(), '', false); - $this->_strategy = $this->getMock('Magento\Core\Model\Page\Asset\MergeStrategyInterface'); + $this->_strategy = $this->getMock('Magento\View\Asset\MergeStrategyInterface'); - $this->_object = new \Magento\Core\Model\Page\Asset\MergeStrategy\FileExists( + $this->_object = new \Magento\View\Asset\MergeStrategy\FileExists( $this->_strategy, $this->_filesystem ); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergedTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MergedTest.php similarity index 84% rename from dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergedTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/MergedTest.php index fa4f329c34e..afe75154f68 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MergedTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MergedTest.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset; +namespace Magento\View\Asset; class MergedTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Page\Asset\Merged + * @var \Magento\View\Asset\Merged */ protected $_object; @@ -63,12 +63,12 @@ class MergedTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_assetJsOne = $this->getMockForAbstractClass('Magento\Core\Model\Page\Asset\MergeableInterface'); + $this->_assetJsOne = $this->getMockForAbstractClass('Magento\View\Asset\MergeableInterface'); $this->_assetJsOne->expects($this->any())->method('getContentType')->will($this->returnValue('js')); $this->_assetJsOne->expects($this->any())->method('getSourceFile') ->will($this->returnValue('/pub/script_one.js')); - $this->_assetJsTwo = $this->getMockForAbstractClass('Magento\Core\Model\Page\Asset\MergeableInterface'); + $this->_assetJsTwo = $this->getMockForAbstractClass('Magento\View\Asset\MergeableInterface'); $this->_assetJsTwo->expects($this->any())->method('getContentType')->will($this->returnValue('js')); $this->_assetJsTwo->expects($this->any())->method('getSourceFile') ->will($this->returnValue('/pub/script_two.js')); @@ -77,13 +77,13 @@ class MergedTest extends \PHPUnit_Framework_TestCase $this->_dirs = $this->getMock('Magento\App\Dir', array(), array(), '', false); - $this->_mergeStrategy = $this->getMock('Magento\Core\Model\Page\Asset\MergeStrategyInterface'); + $this->_mergeStrategy = $this->getMock('Magento\View\Asset\MergeStrategyInterface'); $this->_objectManager = $this->getMockForAbstractClass( 'Magento\ObjectManager', array(), '', true, true, true, array('create') ); - $this->_object = new \Magento\Core\Model\Page\Asset\Merged( + $this->_object = new \Magento\View\Asset\Merged( $this->_objectManager, $this->_logger, $this->_dirs, $this->_mergeStrategy, array($this->_assetJsOne, $this->_assetJsTwo) ); @@ -95,19 +95,19 @@ class MergedTest extends \PHPUnit_Framework_TestCase */ public function testConstructorNothingToMerge() { - $this->_object = new \Magento\Core\Model\Page\Asset\Merged( + $this->_object = new \Magento\View\Asset\Merged( $this->_objectManager, $this->_logger, $this->_dirs, $this->_mergeStrategy, array() ); } /** * @expectedException \InvalidArgumentException - * @expectedExceptionMessage Asset has to implement \Magento\Core\Model\Page\Asset\MergeableInterface. + * @expectedExceptionMessage Asset has to implement \Magento\View\Asset\MergeableInterface. */ public function testConstructorRequireMergeInterface() { - $assetUrl = new \Magento\Core\Model\Page\Asset\Remote('http://example.com/style.css', 'css'); - $this->_object = new \Magento\Core\Model\Page\Asset\Merged( + $assetUrl = new \Magento\View\Asset\Remote('http://example.com/style.css', 'css'); + $this->_object = new \Magento\View\Asset\Merged( $this->_objectManager, $this->_logger, $this->_dirs, $this->_mergeStrategy, array($this->_assetJsOne, $assetUrl) ); @@ -119,11 +119,11 @@ class MergedTest extends \PHPUnit_Framework_TestCase */ public function testConstructorIncompatibleContentTypes() { - $assetCss = $this->getMockForAbstractClass('Magento\Core\Model\Page\Asset\MergeableInterface'); + $assetCss = $this->getMockForAbstractClass('Magento\View\Asset\MergeableInterface'); $assetCss->expects($this->any())->method('getContentType')->will($this->returnValue('css')); $assetCss->expects($this->any())->method('getSourceFile')->will($this->returnValue('style.css')); - $this->_object = new \Magento\Core\Model\Page\Asset\Merged( + $this->_object = new \Magento\View\Asset\Merged( $this->_objectManager, $this->_logger, $this->_dirs, $this->_mergeStrategy, array($this->_assetJsOne, $assetCss) ); @@ -146,11 +146,11 @@ class MergedTest extends \PHPUnit_Framework_TestCase ->with($publicFiles, $mergedFile, 'js') ->will($this->returnValue(null)); - $mergedAsset = $this->getMockForAbstractClass('Magento\Core\Model\Page\Asset\MergeableInterface'); + $mergedAsset = $this->getMockForAbstractClass('Magento\View\Asset\MergeableInterface'); $this->_objectManager ->expects($this->once()) ->method('create') - ->with('Magento\Core\Model\Page\Asset\PublicFile', array('file' => $mergedFile, 'contentType' => 'js')) + ->with('Magento\View\Asset\PublicFile', array('file' => $mergedFile, 'contentType' => 'js')) ->will($this->returnValue($mergedAsset)) ; @@ -162,12 +162,12 @@ class MergedTest extends \PHPUnit_Framework_TestCase public function testIteratorInterfaceMergeFailure() { $mergeError = new \Exception('File not found'); - $assetBroken = $this->getMockForAbstractClass('Magento\Core\Model\Page\Asset\MergeableInterface'); + $assetBroken = $this->getMockForAbstractClass('Magento\View\Asset\MergeableInterface'); $assetBroken->expects($this->any())->method('getContentType')->will($this->returnValue('js')); $assetBroken->expects($this->any())->method('getSourceFile') ->will($this->throwException($mergeError)); - $this->_object = new \Magento\Core\Model\Page\Asset\Merged( + $this->_object = new \Magento\View\Asset\Merged( $this->_objectManager, $this->_logger, $this->_dirs, $this->_mergeStrategy, array($this->_assetJsOne, $this->_assetJsTwo, $assetBroken) ); diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MinifiedTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MinifiedTest.php similarity index 92% rename from dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MinifiedTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/MinifiedTest.php index 12e2f573576..04a8987f5a1 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MinifiedTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MinifiedTest.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset; +namespace Magento\View\Asset; class MinifiedTest extends \PHPUnit_Framework_TestCase { @@ -32,7 +32,7 @@ class MinifiedTest extends \PHPUnit_Framework_TestCase const ORIGINAL_URL = 'http://localhost/original.js'; /** - * @var \Magento\Core\Model\Page\Asset\LocalInterface|PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\Asset\LocalInterface|PHPUnit_Framework_MockObject_MockObject */ protected $_asset; @@ -52,14 +52,14 @@ class MinifiedTest extends \PHPUnit_Framework_TestCase protected $_logger; /** - * @var \Magento\Core\Model\Page\Asset\Minified + * @var \Magento\View\Asset\Minified */ protected $_model; protected function setUp() { $this->_asset = $this->getMockForAbstractClass( - 'Magento\Core\Model\Page\Asset\LocalInterface', + 'Magento\View\Asset\LocalInterface', array(), '', false @@ -68,7 +68,7 @@ class MinifiedTest extends \PHPUnit_Framework_TestCase $this->_viewUrl = $this->getMock('Magento\View\Url', array(), array(), '', false); $this->_logger = $this->getMock('Magento\Logger', array(), array(), '', false); - $this->_model = new \Magento\Core\Model\Page\Asset\Minified($this->_asset, $this->_minifier, $this->_viewUrl, + $this->_model = new \Magento\View\Asset\Minified($this->_asset, $this->_minifier, $this->_viewUrl, $this->_logger ); } diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MinifyServiceTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/MinifyServiceTest.php similarity index 69% rename from dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MinifyServiceTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/MinifyServiceTest.php index dc5eae08819..71549b54e78 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/MinifyServiceTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/MinifyServiceTest.php @@ -22,14 +22,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset; +namespace Magento\View\Asset; class MinifyServiceTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Store\Config|\PHPUnit_Framework_MockObject_MockObject + * @var \Magento\View\Asset\ConfigInterface|\PHPUnit_Framework_MockObject_MockObject */ - protected $_storeConfig; + protected $_config; /** * @var \Magento\ObjectManager|\PHPUnit_Framework_MockObject_MockObject @@ -37,7 +37,7 @@ class MinifyServiceTest extends \PHPUnit_Framework_TestCase protected $_objectManager; /** - * @var \Magento\Core\Model\Page\Asset\MinifyService + * @var \Magento\View\Asset\MinifyService */ protected $_model; @@ -48,33 +48,33 @@ class MinifyServiceTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_storeConfig = $this->getMock('Magento\Core\Model\Store\Config', array(), array(), '', false); + $this->_config = $this->getMock('Magento\View\Asset\ConfigInterface', array(), array(), '', false); $dirs = $this->getMock('Magento\App\Dir', array(), array(), '', false); $this->_objectManager = $this->getMock('Magento\ObjectManager'); $this->_appState = $this->getMock('Magento\App\State', array(), array(), '', false); - $this->_model = new \Magento\Core\Model\Page\Asset\MinifyService($this->_storeConfig, $this->_objectManager, + $this->_model = new \Magento\View\Asset\MinifyService($this->_config, $this->_objectManager, $dirs, $this->_appState); } public function testGetAssets() { - $assetOne = $this->getMockForAbstractClass('Magento\Core\Model\Page\Asset\LocalInterface'); + $assetOne = $this->getMockForAbstractClass('Magento\View\Asset\LocalInterface'); $assetOne->expects($this->once()) ->method('getContentType') ->will($this->returnValue('js')); - $assetTwo = $this->getMockForAbstractClass('Magento\Core\Model\Page\Asset\LocalInterface'); + $assetTwo = $this->getMockForAbstractClass('Magento\View\Asset\LocalInterface'); $assetTwo->expects($this->once()) ->method('getContentType') ->will($this->returnValue('js')); - $this->_storeConfig->expects($this->once()) - ->method('getConfigFlag') - ->with('dev/js/minify_files') + $this->_config->expects($this->once()) + ->method('isAssetMinification') + ->with('js') ->will($this->returnValue(true)); - $this->_storeConfig->expects($this->once()) - ->method('getConfig') - ->with('dev/js/minify_adapter') + $this->_config->expects($this->once()) + ->method('getAssetMinificationAdapter') + ->with('js') ->will($this->returnValue('Magento\Code\Minifier\AdapterInterface')); $self = $this; @@ -89,23 +89,23 @@ class MinifyServiceTest extends \PHPUnit_Framework_TestCase $minifiedAssets = $this->_model->getAssets(array($assetOne, $assetTwo)); $this->assertCount(2, $minifiedAssets); $this->assertNotSame($minifiedAssets[0], $minifiedAssets[1]); - $this->assertInstanceOf('Magento\Core\Model\Page\Asset\Minified', $minifiedAssets[0]); - $this->assertInstanceOf('Magento\Core\Model\Page\Asset\Minified', $minifiedAssets[1]); + $this->assertInstanceOf('Magento\View\Asset\Minified', $minifiedAssets[0]); + $this->assertInstanceOf('Magento\View\Asset\Minified', $minifiedAssets[1]); } public function testGetAssetsDisabled() { - $asset = $this->getMockForAbstractClass('Magento\Core\Model\Page\Asset\LocalInterface'); + $asset = $this->getMockForAbstractClass('Magento\View\Asset\LocalInterface'); $asset->expects($this->once()) ->method('getContentType') ->will($this->returnValue('js')); - $this->_storeConfig->expects($this->once()) - ->method('getConfigFlag') - ->with('dev/js/minify_files') + $this->_config->expects($this->once()) + ->method('isAssetMinification') + ->with('js') ->will($this->returnValue(false)); - $this->_storeConfig->expects($this->never()) - ->method('getConfig'); + $this->_config->expects($this->never()) + ->method('getAssetMinificationAdapter'); $minifiedAssets = $this->_model->getAssets(array($asset)); $this->assertCount(1, $minifiedAssets); @@ -113,19 +113,24 @@ class MinifyServiceTest extends \PHPUnit_Framework_TestCase } /** - * @expectedException \Magento\Core\Exception + * @expectedException \Magento\Exception * @expectedExceptionMessage Minification adapter is not specified for 'js' content type */ public function testGetAssetsNoAdapterDefined() { - $this->_storeConfig->expects($this->once()) - ->method('getConfigFlag') - ->with('dev/js/minify_files') - ->will($this->returnValue(true)); - $asset = $this->getMockForAbstractClass('Magento\Core\Model\Page\Asset\LocalInterface'); + $asset = $this->getMockForAbstractClass('Magento\View\Asset\LocalInterface'); $asset->expects($this->once()) ->method('getContentType') ->will($this->returnValue('js')); + + $this->_config->expects($this->once()) + ->method('isAssetMinification') + ->with('js') + ->will($this->returnValue(true)); + $this->_config->expects($this->once()) + ->method('getAssetMinificationAdapter') + ->with('js'); + $this->_model->getAssets(array($asset)); } @@ -140,18 +145,18 @@ class MinifyServiceTest extends \PHPUnit_Framework_TestCase ->method('getMode') ->will($this->returnValue($mode)); - $asset = $this->getMockForAbstractClass('Magento\Core\Model\Page\Asset\LocalInterface'); + $asset = $this->getMockForAbstractClass('Magento\View\Asset\LocalInterface'); $asset->expects($this->once()) ->method('getContentType') ->will($this->returnValue('js')); - $this->_storeConfig->expects($this->once()) - ->method('getConfigFlag') - ->with('dev/js/minify_files') + $this->_config->expects($this->once()) + ->method('isAssetMinification') + ->with('js') ->will($this->returnValue(true)); - $this->_storeConfig->expects($this->once()) - ->method('getConfig') - ->with('dev/js/minify_adapter') + $this->_config->expects($this->once()) + ->method('getAssetMinificationAdapter') + ->with('js') ->will($this->returnValue('Magento\Code\Minifier\AdapterInterface')); $this->_objectManager->expects($this->at(1)) diff --git a/dev/tests/unit/testsuite/Magento/Page/Model/Asset/PropertyGroupTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/PropertyGroupTest.php similarity index 83% rename from dev/tests/unit/testsuite/Magento/Page/Model/Asset/PropertyGroupTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/PropertyGroupTest.php index c20e7d4f63b..8d3f476026b 100644 --- a/dev/tests/unit/testsuite/Magento/Page/Model/Asset/PropertyGroupTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/PropertyGroupTest.php @@ -18,25 +18,22 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page - * @subpackage unit_tests * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Model\Asset; +namespace Magento\View\Asset; class PropertyGroupTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Page\Model\Asset\PropertyGroup + * @var \Magento\View\Asset\PropertyGroup */ protected $_object; protected function setUp() { - $this->_object = new \Magento\Page\Model\Asset\PropertyGroup(array('test_property' => 'test_value')); + $this->_object = new \Magento\View\Asset\PropertyGroup(array('test_property' => 'test_value')); } public function testGetProperties() diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/PublicFileTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/PublicFileTest.php similarity index 90% rename from dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/PublicFileTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/PublicFileTest.php index da5dee940f6..dc2ffa39604 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/PublicFileTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/PublicFileTest.php @@ -25,12 +25,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset; +namespace Magento\View\Asset; class PublicFileTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Page\Asset\PublicFile + * @var \Magento\View\Asset\PublicFile */ protected $_object; @@ -42,7 +42,7 @@ class PublicFileTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_viewUrl = $this->getMock('Magento\View\Url', array(), array(), '', false); - $this->_object = new \Magento\Core\Model\Page\Asset\PublicFile($this->_viewUrl, 'test/style.css', 'css'); + $this->_object = new \Magento\View\Asset\PublicFile($this->_viewUrl, 'test/style.css', 'css'); } public function testGetUrl() diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/RemoteTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/RemoteTest.php similarity index 87% rename from dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/RemoteTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/RemoteTest.php index b1d8a3e0bfe..abc51ab4150 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/RemoteTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/RemoteTest.php @@ -25,18 +25,18 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset; +namespace Magento\View\Asset; class RemoteTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Page\Asset\Remote + * @var \Magento\View\Asset\Remote */ protected $_object; protected function setUp() { - $this->_object = new \Magento\Core\Model\Page\Asset\Remote('https://127.0.0.1/magento/test/style.css', 'css'); + $this->_object = new \Magento\View\Asset\Remote('https://127.0.0.1/magento/test/style.css', 'css'); } public function testGetUrl() diff --git a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/ViewFileTest.php b/dev/tests/unit/testsuite/Magento/View/Asset/ViewFileTest.php similarity index 89% rename from dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/ViewFileTest.php rename to dev/tests/unit/testsuite/Magento/View/Asset/ViewFileTest.php index 597d88b17a2..524800eb4a7 100644 --- a/dev/tests/unit/testsuite/Magento/Core/Model/Page/Asset/ViewFileTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Asset/ViewFileTest.php @@ -25,12 +25,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Core\Model\Page\Asset; +namespace Magento\View\Asset; class ViewFileTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\Core\Model\Page\Asset\ViewFile + * @var \Magento\View\Asset\ViewFile */ protected $_object; @@ -42,7 +42,7 @@ class ViewFileTest extends \PHPUnit_Framework_TestCase protected function setUp() { $this->_viewUrl = $this->getMock('Magento\View\Url', array(), array(), '', false); - $this->_object = new \Magento\Core\Model\Page\Asset\ViewFile($this->_viewUrl, 'test/script.js', 'js'); + $this->_object = new \Magento\View\Asset\ViewFile($this->_viewUrl, 'test/script.js', 'js'); } /** @@ -51,7 +51,7 @@ class ViewFileTest extends \PHPUnit_Framework_TestCase */ public function testConstructorException() { - new \Magento\Core\Model\Page\Asset\ViewFile($this->_viewUrl, '', 'unknown'); + new \Magento\View\Asset\ViewFile($this->_viewUrl, '', 'unknown'); } public function testGetUrl() diff --git a/dev/tests/unit/testsuite/Magento/View/Block/AbstractBlockTest.php b/dev/tests/unit/testsuite/Magento/View/Element/AbstractBlockTest.php similarity index 87% rename from dev/tests/unit/testsuite/Magento/View/Block/AbstractBlockTest.php rename to dev/tests/unit/testsuite/Magento/View/Element/AbstractBlockTest.php index 91bf9816c48..41dad65bb3a 100644 --- a/dev/tests/unit/testsuite/Magento/View/Block/AbstractBlockTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Element/AbstractBlockTest.php @@ -25,7 +25,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block; +namespace Magento\View\Element; class AbstractBlockTest extends \PHPUnit_Framework_TestCase { @@ -37,8 +37,8 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase */ public function testGetUiId($expectedResult, $nameInLayout, $methodArguments) { - /** @var $block \Magento\View\Block\AbstractBlock|PHPUnit_Framework_MockObject_MockObject */ - $block = $this->getMockForAbstractClass('Magento\View\Block\AbstractBlock', array(), '', false); + /** @var $block \Magento\View\Element\AbstractBlock|PHPUnit_Framework_MockObject_MockObject */ + $block = $this->getMockForAbstractClass('Magento\View\Element\AbstractBlock', array(), '', false); $block->setNameInLayout($nameInLayout); $this->assertEquals( @@ -86,13 +86,13 @@ class AbstractBlockTest extends \PHPUnit_Framework_TestCase $configManager = $this->getMock('Magento\View\ConfigInterface', array(), array(), '', false); $configManager->expects($this->exactly(2))->method('getViewConfig')->will($this->returnValue($config)); - /** @var $block \Magento\View\Block\AbstractBlock|PHPUnit_Framework_MockObject_MockObject */ + /** @var $block \Magento\View\Element\AbstractBlock|PHPUnit_Framework_MockObject_MockObject */ $params = array( 'viewConfig' => $configManager, ); $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $block = $this->getMockForAbstractClass('Magento\View\Block\AbstractBlock', - $helper->getConstructArguments('Magento\View\Block\AbstractBlock', $params), + $block = $this->getMockForAbstractClass('Magento\View\Element\AbstractBlock', + $helper->getConstructArguments('Magento\View\Element\AbstractBlock', $params), uniqid('Magento\\Core\\Block\\AbstractBlock\\') ); diff --git a/dev/tests/unit/testsuite/Magento/Page/Block/Link/CurrentTest.php b/dev/tests/unit/testsuite/Magento/View/Element/Html/Link/CurrentTest.php similarity index 86% rename from dev/tests/unit/testsuite/Magento/Page/Block/Link/CurrentTest.php rename to dev/tests/unit/testsuite/Magento/View/Element/Html/Link/CurrentTest.php index 3c65c60a9ac..58eba8c9f17 100644 --- a/dev/tests/unit/testsuite/Magento/Page/Block/Link/CurrentTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Element/Html/Link/CurrentTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Link; +namespace Magento\View\Element\Html\Link; class CurrentTest extends \PHPUnit_Framework_TestCase { @@ -63,9 +63,9 @@ class CurrentTest extends \PHPUnit_Framework_TestCase ->with($path) ->will($this->returnValue($url)); - /** @var \Magento\Page\Block\Link\Current $link */ + /** @var \Magento\View\Element\Html\Link\Current $link */ $link = $this->_objectManager->getObject( - '\Magento\Page\Block\Link\Current', + '\Magento\View\Element\Html\Link\Current', array('urlBuilder' => $this->_urlBuilderMock) ); @@ -76,8 +76,8 @@ class CurrentTest extends \PHPUnit_Framework_TestCase public function testIsCurrentIfIsset() { - /** @var \Magento\Page\Block\Link\Current $link */ - $link = $this->_objectManager->getObject('\Magento\Page\Block\Link\Current'); + /** @var \Magento\View\Element\Html\Link\Current $link */ + $link = $this->_objectManager->getObject('\Magento\View\Element\Html\Link\Current'); $link->setCurrent(true); $this->assertTrue($link->IsCurrent()); } @@ -101,8 +101,8 @@ class CurrentTest extends \PHPUnit_Framework_TestCase ->will($this->returnValue($url)); $this->_requestMock->expects($this->once())->method('getControllerName')->will($this->returnValue('b')); - /** @var \Magento\Page\Block\Link\Current $link */ - $link = $this->_objectManager->getObject('\Magento\Page\Block\Link\Current', + /** @var \Magento\View\Element\Html\Link\Current $link */ + $link = $this->_objectManager->getObject('\Magento\View\Element\Html\Link\Current', array( 'urlBuilder' => $this->_urlBuilderMock, 'request' => $this->_requestMock, @@ -118,8 +118,8 @@ class CurrentTest extends \PHPUnit_Framework_TestCase $this->_urlBuilderMock->expects($this->at(1))->method('getUrl')->will($this->returnValue('2')); - /** @var \Magento\Page\Block\Link\Current $link */ - $link = $this->_objectManager->getObject('\Magento\Page\Block\Link\Current', + /** @var \Magento\View\Element\Html\Link\Current $link */ + $link = $this->_objectManager->getObject('\Magento\View\Element\Html\Link\Current', array( 'urlBuilder' => $this->_urlBuilderMock, 'request' => $this->_requestMock diff --git a/dev/tests/unit/testsuite/Magento/Page/Block/LinksTest.php b/dev/tests/unit/testsuite/Magento/View/Element/Html/LinksTest.php similarity index 81% rename from dev/tests/unit/testsuite/Magento/Page/Block/LinksTest.php rename to dev/tests/unit/testsuite/Magento/View/Element/Html/LinksTest.php index dc1a9e5d45c..a35366fbc85 100644 --- a/dev/tests/unit/testsuite/Magento/Page/Block/LinksTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Element/Html/LinksTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block; +namespace Magento\View\Element\Html; class LinksTest extends \PHPUnit_Framework_TestCase { @@ -30,22 +30,22 @@ class LinksTest extends \PHPUnit_Framework_TestCase */ protected $_objectManagerHelper; - /** @var \Magento\Page\Block\Links */ + /** @var \Magento\View\Element\Html\Links */ protected $_block; - /** @var \Magento\View\Block\Template\Context */ + /** @var \Magento\View\Element\Template\Context */ protected $_context; protected function setUp() { $this->_objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - /** @var \Magento\View\Block\Template\Context $context */ - $this->_context = $this->_objectManagerHelper->getObject('Magento\View\Block\Template\Context'); + /** @var \Magento\View\Element\Template\Context $context */ + $this->_context = $this->_objectManagerHelper->getObject('Magento\View\Element\Template\Context'); - /** @var \Magento\Page\Block\Links $block */ + /** @var \Magento\View\Element\Html\Links $block */ $this->_block = $this->_objectManagerHelper->getObject( - 'Magento\Page\Block\Links', + 'Magento\View\Element\Html\Links', array( 'context' => $this->_context, ) @@ -72,8 +72,8 @@ class LinksTest extends \PHPUnit_Framework_TestCase $this->_context->getLayout()->expects($this->once())->method('renderElement')->with($name) ->will($this->returnValue($blockHtml)); - /** @var \Magento\View\Block\AbstractBlock $link */ - $link = $this->getMockBuilder('Magento\View\Block\AbstractBlock')->disableOriginalConstructor()->getMock(); + /** @var \Magento\View\Element\AbstractBlock $link */ + $link = $this->getMockBuilder('Magento\View\Element\AbstractBlock')->disableOriginalConstructor()->getMock(); $link->expects($this->once()) ->method('getNameInLayout') ->will($this->returnValue($name)); diff --git a/dev/tests/unit/testsuite/Magento/View/Block/TemplateTest.php b/dev/tests/unit/testsuite/Magento/View/Element/TemplateTest.php similarity index 96% rename from dev/tests/unit/testsuite/Magento/View/Block/TemplateTest.php rename to dev/tests/unit/testsuite/Magento/View/Element/TemplateTest.php index 3c7f25bdf37..c2840102d78 100644 --- a/dev/tests/unit/testsuite/Magento/View/Block/TemplateTest.php +++ b/dev/tests/unit/testsuite/Magento/View/Element/TemplateTest.php @@ -25,12 +25,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block; +namespace Magento\View\Element; class TemplateTest extends \PHPUnit_Framework_TestCase { /** - * @var \Magento\View\Block\Template + * @var \Magento\View\Element\Template */ protected $_block; @@ -72,7 +72,7 @@ class TemplateTest extends \PHPUnit_Framework_TestCase $appState = $this->getMock('Magento\App\State', array('getAreaCode'), array(), '', false); $appState->expects($this->any())->method('getAreaCode')->will($this->returnValue('frontend')); $helper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_block = $helper->getObject('Magento\View\Block\Template', array( + $this->_block = $helper->getObject('Magento\View\Element\Template', array( 'filesystem' => $this->_filesystem, 'enginePool' => $this->_templateEngine, 'viewFileSystem' => $this->_viewFileSystem, diff --git a/dev/tests/unit/testsuite/Magento/View/TemplateEngine/PhpTest.php b/dev/tests/unit/testsuite/Magento/View/TemplateEngine/PhpTest.php index 6a2811489f8..3f536204516 100644 --- a/dev/tests/unit/testsuite/Magento/View/TemplateEngine/PhpTest.php +++ b/dev/tests/unit/testsuite/Magento/View/TemplateEngine/PhpTest.php @@ -46,7 +46,7 @@ class PhpTest extends \PHPUnit_Framework_TestCase */ public function testRender() { - $blockMock = $this->getMockBuilder('Magento\View\Block\Template') + $blockMock = $this->getMockBuilder('Magento\View\Element\Template') ->setMethods(array('testMethod')) ->disableOriginalConstructor()->getMock(); @@ -75,7 +75,7 @@ class PhpTest extends \PHPUnit_Framework_TestCase */ public function testRenderException() { - $blockMock = $this->getMockBuilder('Magento\View\Block\Template') + $blockMock = $this->getMockBuilder('Magento\View\Element\Template') ->setMethods(array('testMethod')) ->disableOriginalConstructor()->getMock(); diff --git a/dev/tests/unit/testsuite/Magento/View/Url/_files/result.css b/dev/tests/unit/testsuite/Magento/View/Url/_files/result.css index 5150f24884f..83bdd9999df 100644 --- a/dev/tests/unit/testsuite/Magento/View/Url/_files/result.css +++ b/dev/tests/unit/testsuite/Magento/View/Url/_files/result.css @@ -32,4 +32,4 @@ ol {background: url(http://example.com/absolute.gif);} li {background: url("https://example.com/absolute.gif");} ol.valid {background: url(../../referenced/dir/Namespace_Module::absolute_valid_module.gif)} /* theme file modular */ -ol.favicon {background: url(../../referenced/dir/Magento_Page::favicon.ico)} /* base file */ +ol.favicon {background: url(../../referenced/dir/Magento_Theme::favicon.ico)} /* base file */ diff --git a/dev/tests/unit/testsuite/Magento/View/Url/_files/source.css b/dev/tests/unit/testsuite/Magento/View/Url/_files/source.css index b11e2538e04..37ef8fe8170 100644 --- a/dev/tests/unit/testsuite/Magento/View/Url/_files/source.css +++ b/dev/tests/unit/testsuite/Magento/View/Url/_files/source.css @@ -32,4 +32,4 @@ ol {background: url(http://example.com/absolute.gif);} li {background: url("https://example.com/absolute.gif");} ol.valid {background: url(Namespace_Module::absolute_valid_module.gif)} /* theme file modular */ -ol.favicon {background: url(Magento_Page::favicon.ico)} /* base file */ +ol.favicon {background: url(Magento_Theme::favicon.ico)} /* base file */ diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/TabsTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/TabsTest.php index b033f1f1057..e3066fd54f8 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/TabsTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Block/Adminhtml/Role/Edit/TabsTest.php @@ -92,9 +92,9 @@ class TabsTest extends \PHPUnit_Framework_TestCase { $this->_block->setApiRole($apiRole); - $mainBlock = $this->_helper->getObject('Magento\View\Block\Text'); - $resourceBlock = $this->_helper->getObject('Magento\View\Block\Text'); - $userBlock = $this->_helper->getObject('Magento\View\Block\Text'); + $mainBlock = $this->_helper->getObject('Magento\View\Element\Text'); + $resourceBlock = $this->_helper->getObject('Magento\View\Element\Text'); + $userBlock = $this->_helper->getObject('Magento\View\Element\Text'); $this->_layout->expects($this->any()) ->method('getBlock') diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/RoleTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/RoleTest.php index 8a2f99a9f2a..1717286cf8b 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/RoleTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/RoleTest.php @@ -109,7 +109,7 @@ class RoleTest extends \PHPUnit_Framework_TestCase $collection = $this->getMock( 'Magento\Webapi\Model\Resource\Acl\Role\Collection', array('_initSelect', 'setModel'), - array($eventManager, $logger, $fetchStrategy, $entityFactory, $this->_roleService) + array($entityFactory, $logger, $fetchStrategy, $eventManager, null, $this->_roleService) ); $collection->expects($this->any())->method('setModel')->with('Magento\Webapi\Model\Resource\Acl\Role'); diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/RuleTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/RuleTest.php index 3553d4dcb84..981d84710ed 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/RuleTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/RuleTest.php @@ -124,7 +124,7 @@ class RuleTest extends \PHPUnit_Framework_TestCase $collection = $this->getMock( 'Magento\Webapi\Model\Resource\Acl\Rule\Collection', array('_initSelect', 'setModel', 'getSelect'), - array($eventManager, $logger, $fetchStrategy, $entityFactory, $this->_ruleResource) + array($entityFactory, $logger, $fetchStrategy, $eventManager, null, $this->_ruleResource) ); $collection->expects($this->any())->method('setModel')->with('Magento\Webapi\Model\Resource\Acl\Role'); $collection->expects($this->any()) diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/UserTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/UserTest.php index 3ceb8777111..90dfa12a5cd 100644 --- a/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/UserTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Acl/UserTest.php @@ -155,7 +155,7 @@ class UserTest extends \PHPUnit_Framework_TestCase $collection = $this->getMock( 'Magento\Webapi\Model\Resource\Acl\User\Collection', array('_initSelect', 'setModel'), - array($eventManager, $logger, $fetchStrategy, $entityFactory, $this->_userService) + array($entityFactory, $logger, $fetchStrategy, $eventManager, null, $this->_userService) ); $collection->expects($this->any())->method('setModel')->with('Magento\Webapi\Model\Acl\User'); diff --git a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/ConverterTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/ConverterTest.php similarity index 93% rename from dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/ConverterTest.php rename to dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/ConverterTest.php index 8e25700a6ee..6da78364e66 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/ConverterTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/ConverterTest.php @@ -21,9 +21,9 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Integration\Model\Config\Api; +namespace Magento\Webapi\Model\Config\Integration; -use \Magento\Integration\Model\Config\Api\Converter; +use \Magento\Webapi\Model\Config\Integration\Converter; /** * Test for conversion of integration API XML config into array representation. diff --git a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/XsdTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/XsdTest.php similarity index 88% rename from dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/XsdTest.php rename to dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/XsdTest.php index 2540117b084..5e67cf3cfd7 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/XsdTest.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/XsdTest.php @@ -21,7 +21,7 @@ * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Integration\Model\Config\Api; +namespace Magento\Webapi\Model\Config\Integration; /** * Test for validation rules implemented by XSD schema for API integration configuration. @@ -35,7 +35,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase protected function setUp() { - $this->_schemaFile = BP . '/app/code/Magento/Integration/etc/integration/api.xsd'; + $this->_schemaFile = BP . '/app/code/Magento/Webapi/etc/integration/api.xsd'; } /** @@ -62,7 +62,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase /** Valid configurations */ 'valid' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> <resource name="Magento_Customer::manage" /> <resource name="Magento_Customer::online" /> @@ -73,13 +73,13 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'valid with several entities' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> <resource name="Magento_Customer::manage" /> <resource name="Magento_Customer::online" /> </resources> </integration> - <integration id="TestIntegration2"> + <integration name="TestIntegration2"> <resources> <resource name="Magento_Catalog::product_read" /> </resources> @@ -95,13 +95,13 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'empty integration' => array( '<integrations> - <integration id="TestIntegration" /> + <integration name="TestIntegration" /> </integrations>', array("Element 'integration': Missing child element(s). Expected is ( resources ).") ), 'empty resources' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> </resources> </integration> @@ -116,7 +116,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase /** Excessive nodes */ 'irrelevant node in root' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> <resource name="Magento_Customer::manage" /> <resource name="Magento_Customer::online" /> @@ -128,7 +128,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'irrelevant node in integration' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> <resource name="Magento_Customer::manage" /> <resource name="Magento_Customer::online" /> @@ -140,7 +140,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'irrelevant node in resources' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> <resource name="Magento_Customer::manage" /> <resource name="Magento_Customer::online" /> @@ -152,7 +152,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'irrelevant node in resource' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> <resource name="Magento_Customer::manage" /> <resource name="Magento_Customer::online"> @@ -170,7 +170,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase /** Excessive attributes */ 'invalid attribute in root' => array( '<integrations invalid="invalid"> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> <resource name="Magento_Customer::manage" /> <resource name="Magento_Customer::online" /> @@ -181,7 +181,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'invalid attribute in integration' => array( '<integrations> - <integration id="TestIntegration1" invalid="invalid"> + <integration name="TestIntegration1" invalid="invalid"> <resources> <resource name="Magento_Customer::manage" /> <resource name="Magento_Customer::online" /> @@ -192,7 +192,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'invalid attribute in resources' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources invalid="invalid"> <resource name="Magento_Customer::manage" /> <resource name="Magento_Customer::online" /> @@ -203,7 +203,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'invalid attribute in resource' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> <resource name="Magento_Customer::manage" invalid="invalid" /> <resource name="Magento_Customer::online" /> @@ -214,7 +214,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), /** Missing or empty required attributes */ - 'integration without id' => array( + 'integration without name' => array( '<integrations> <integration> <resources> @@ -223,11 +223,11 @@ class XsdTest extends \PHPUnit_Framework_TestCase </resources> </integration> </integrations>', - array("Element 'integration': The attribute 'id' is required but missing.") + array("Element 'integration': The attribute 'name' is required but missing.") ), - 'integration with empty id' => array( + 'integration with empty name' => array( '<integrations> - <integration id=""> + <integration name=""> <resources> <resource name="Magento_Customer::manage" /> <resource name="Magento_Customer::online" /> @@ -236,15 +236,15 @@ class XsdTest extends \PHPUnit_Framework_TestCase </integrations>', array ( - "Element 'integration', attribute 'id': [facet 'minLength'] The value '' has a length of '0'; " + "Element 'integration', attribute 'name': [facet 'minLength'] The value '' has a length of '0'; " . "this underruns the allowed minimum length of '2'.", - "Element 'integration', attribute 'id': " - . "'' is not a valid value of the atomic type 'integrationIdType'." + "Element 'integration', attribute 'name': " + . "'' is not a valid value of the atomic type 'integrationNameType'." ) ), 'resource without name' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> <resource name="Magento_Customer::manage" /> <resource /> @@ -255,7 +255,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase ), 'resource with empty name' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> <resource name="Magento_Customer::manage" /> <resource name="" /> @@ -273,7 +273,7 @@ class XsdTest extends \PHPUnit_Framework_TestCase /** Invalid values */ 'resource with invalid name' => array( '<integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <resources> <resource name="Magento_Customer::online" /> <resource name="customer_manage" /> diff --git a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/_files/api.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/_files/api.php similarity index 89% rename from dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/_files/api.php rename to dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/_files/api.php index 4f82ce8be29..62dee206b4b 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/_files/api.php +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/_files/api.php @@ -26,13 +26,13 @@ return array( 'resources' => array( 'Magento_Customer::manage', 'Magento_Customer::online', - 'Magento_Customer::order_statuses_read', - 'Magento_SalesHistory::history' + 'Magento_Sales::capture', + 'Magento_SalesRule::quote' ) ), 'TestIntegration2' => array( 'resources' => array( - 'Magento_Catalog::product_read', + 'Magento_Catalog::product_read' ) ), ); diff --git a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/_files/api.xml b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/_files/api.xml similarity index 87% rename from dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/_files/api.xml rename to dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/_files/api.xml index bd3b83e6a4d..8fc3c0df061 100644 --- a/dev/tests/unit/testsuite/Magento/Integration/Model/Config/Api/_files/api.xml +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Config/Integration/_files/api.xml @@ -24,17 +24,17 @@ */ --> <integrations> - <integration id="TestIntegration1"> + <integration name="TestIntegration1"> <!-- List of API resources required by the integration. These are resource ids defined in etc/acl.xml of modules and subsequently mapped to web APIs in webapi.xml. --> <resources> <resource name="Magento_Customer::manage" /> <resource name="Magento_Customer::online" /> - <resource name="Magento_Customer::order_statuses_read" /> - <resource name="Magento_SalesHistory::history" /> + <resource name="Magento_Sales::capture" /> + <resource name="Magento_SalesRule::quote" /> </resources> </integration> - <integration id="TestIntegration2"> + <integration name="TestIntegration2"> <resources> <resource name="Magento_Catalog::product_read" /> </resources> diff --git a/dev/tests/unit/testsuite/Magento/Webapi/Model/Plugin/SetupTest.php b/dev/tests/unit/testsuite/Magento/Webapi/Model/Plugin/SetupTest.php new file mode 100644 index 00000000000..bb019df395f --- /dev/null +++ b/dev/tests/unit/testsuite/Magento/Webapi/Model/Plugin/SetupTest.php @@ -0,0 +1,182 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Webapi\Model\Plugin; + +use Magento\Authz\Model\UserIdentifier; +use Magento\Integration\Model\Integration; + +class SetupTest extends \PHPUnit_Framework_TestCase +{ + /** + * API Integration config + * + * @var \Magento\Webapi\Model\IntegrationConfig + */ + protected $_integrationConfigMock; + + /** + * Integration service mock + * + * @var \Magento\Integration\Service\IntegrationV1Interface + */ + protected $_integrationServiceMock; + + /** + * Authorization service mock + * + * @var \Magento\Authz\Service\AuthorizationV1 + */ + protected $_authzServiceMock; + + /** + * Mock for UserIdentifier Factory + * + * @var \Magento\Authz\Model\UserIdentifier\Factory + */ + protected $_userIdentifierFactoryMock; + + /** + * API setup plugin + * + * @var \Magento\Webapi\Model\Plugin\Setup + */ + protected $_apiSetupPlugin; + + public function setUp() + { + $this->_integrationConfigMock = $this->getMockBuilder('\Magento\Webapi\Model\IntegrationConfig') + ->disableOriginalConstructor() + ->setMethods(['getIntegrations'])->getMock(); + + $this->_integrationServiceMock = $this->getMockBuilder('\Magento\Integration\Service\IntegrationV1') + ->disableOriginalConstructor() + ->setMethods(['findByName'])->getMock(); + + $this->_authzServiceMock = $this->getMockBuilder('\Magento\Authz\Service\AuthorizationV1') + ->disableOriginalConstructor() + ->setMethods(['grantPermissions'])->getMock(); + + $this->_userIdentifierFactoryMock = $this->getMockBuilder('\Magento\Authz\Model\UserIdentifier\Factory') + ->disableOriginalConstructor() + ->setMethods(['create'])->getMock(); + + $this->_apiSetupPlugin = new \Magento\Webapi\Model\Plugin\Setup( + $this->_integrationConfigMock, + $this->_authzServiceMock, + $this->_integrationServiceMock, + $this->_userIdentifierFactoryMock + ); + } + + public function testAfterInitIntegrationProcessingNoIntegrations() + { + $this->_integrationConfigMock->expects($this->never()) + ->method('getIntegrations'); + $this->_integrationServiceMock->expects($this->never()) + ->method('findByName'); + $this->_authzServiceMock->expects($this->never()) + ->method('grantPermissions'); + $this->_userIdentifierFactoryMock->expects($this->never()) + ->method('create'); + $this->_apiSetupPlugin->afterInitIntegrationProcessing(array()); + } + + public function testAfterInitIntegrationProcessingSuccess() + { + $testIntegration1Resource = array( + 'Magento_Customer::manage', + 'Magento_Customer::online', + 'Magento_Sales::create', + 'Magento_SalesRule::quote' + ); + $testIntegration2Resource = array( + 'Magento_Catalog::product_read' + ); + $this->_integrationConfigMock->expects($this->once()) + ->method('getIntegrations') + ->will( + $this->returnValue( + array( + 'TestIntegration1' => array( + 'resources' => $testIntegration1Resource + ), + 'TestIntegration2' => array( + 'resources' => $testIntegration2Resource + ), + ) + ) + ); + + $integrationsData1 = array( + Integration::ID => 1, + Integration::NAME => 'TestIntegration1', + Integration::EMAIL => 'test-integration1@magento.com', + Integration::ENDPOINT => 'http://endpoint.com', + Integration::SETUP_TYPE => 1, + ); + + $integrationsData2 = array( + Integration::ID => 2, + Integration::NAME => 'TestIntegration2', + Integration::EMAIL => 'test-integration2@magento.com', + Integration::SETUP_TYPE => 1, + ); + + $this->_integrationServiceMock->expects($this->at(0)) + ->method('findByName') + ->with('TestIntegration1') + ->will($this->returnValue($integrationsData1)); + + $this->_integrationServiceMock->expects($this->at(1)) + ->method('findByName') + ->with('TestIntegration2') + ->will($this->returnValue($integrationsData2)); + + $userIdentifierMock1 = $this->getMockBuilder('\Magento\Authz\Model\UserIdentifier') + ->disableOriginalConstructor() + ->getMock(); + $this->_userIdentifierFactoryMock->expects($this->at(0)) + ->method('create') + ->with(UserIdentifier::USER_TYPE_INTEGRATION, 1) + ->will($this->returnValue($userIdentifierMock1)); + + $userIdentifierMock2 = $this->getMockBuilder('\Magento\Authz\Model\UserIdentifier') + ->disableOriginalConstructor() + ->getMock(); + $this->_userIdentifierFactoryMock->expects($this->at(1)) + ->method('create') + ->with(UserIdentifier::USER_TYPE_INTEGRATION, 2) + ->will($this->returnValue($userIdentifierMock2)); + + $this->_authzServiceMock->expects($this->at(0)) + ->method('grantPermissions') + ->with($userIdentifierMock1, $testIntegration1Resource); + $this->_authzServiceMock->expects($this->at(1)) + ->method('grantPermissions') + ->with($userIdentifierMock2, $testIntegration2Resource); + + $this->_apiSetupPlugin->afterInitIntegrationProcessing(array('TestIntegration1', 'TestIntegration2')); + + } +} \ No newline at end of file diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Registration/Create/FormTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Registration/Create/FormTest.php index 43e6f92d7e8..3ed8ac7b65b 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Registration/Create/FormTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Registration/Create/FormTest.php @@ -35,9 +35,6 @@ class FormTest extends \Magento\Test\Block\Adminhtml /** @var \PHPUnit_Framework_MockObject_MockObject */ private $_formFactoryMock; - /** @var \PHPUnit_Framework_MockObject_MockObject */ - private $_coreData; - /** @var \PHPUnit_Framework_MockObject_MockObject */ private $_dataFormMock; @@ -51,7 +48,6 @@ class FormTest extends \Magento\Test\Block\Adminhtml { parent::setUp(); $this->_registry = new \Magento\Core\Model\Registry(); - $this->_coreData = $this->_makeMock('Magento\Core\Helper\Data'); $this->_formFactoryMock = $this->getMock('Magento\Data\FormFactory', array('create'), array(), '', false, false); @@ -64,7 +60,6 @@ class FormTest extends \Magento\Test\Block\Adminhtml $arguments = array( $this->_context, - $this->_coreData, $this->_registry, $this->_formFactoryMock, ); diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Subscription/Edit/FormTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Subscription/Edit/FormTest.php index e6215d2369a..991b7431b5f 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Subscription/Edit/FormTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Subscription/Edit/FormTest.php @@ -38,9 +38,6 @@ class FormTest extends \Magento\Test\Block\Adminhtml /** @var \Magento\Core\Model\Registry */ private $_registry; - /** @var \Magento\Core\Helper\Data */ - protected $_coreData; - /** @var \PHPUnit_Framework_MockObject_MockObject */ private $_formatMock; @@ -64,7 +61,6 @@ class FormTest extends \Magento\Test\Block\Adminhtml $this->_formFactoryMock = $this->getMock('Magento\Data\FormFactory', array('create'), array(), '', false, false); $this->_registry = new \Magento\Core\Model\Registry(); - $this->_coreData = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); $this->_formatMock = $this->_makeMock('Magento\Webhook\Model\Source\Format'); $this->_authenticationMock = $this->_makeMock('Magento\Webhook\Model\Source\Authentication'); $this->_hookMock = $this->_makeMock('Magento\Webhook\Model\Source\Hook'); @@ -85,7 +81,6 @@ class FormTest extends \Magento\Test\Block\Adminhtml // Arguments passed to UUT's constructor $arguments = array( $this->_context, - $this->_coreData, $this->_registry, $this->_formFactoryMock, $this->_formatMock, diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Subscription/EditTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Subscription/EditTest.php index 7e464d6bcda..1eae04230b7 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Subscription/EditTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Block/Adminhtml/Subscription/EditTest.php @@ -35,15 +35,6 @@ class EditTest extends \Magento\Test\Block\Adminhtml /** @var \Magento\Webhook\Block\Adminhtml\Subscription\Edit */ private $_block; - /** @var \Magento\Core\Helper\Data */ - protected $_coreData; - - protected function setUp() - { - parent::setUp(); - $this->_coreData = $this->getMock('Magento\Core\Helper\Data', array(), array(), '', false); - } - public function testGetHeaderTestExisting() { $subscriptionData = array( @@ -56,7 +47,6 @@ class EditTest extends \Magento\Test\Block\Adminhtml $subscriptionData); $this->_block = new \Magento\Webhook\Block\Adminhtml\Subscription\Edit( $this->_context, - $this->_coreData, $this->_registry ); $this->assertEquals('Edit Subscription', $this->_block->getHeaderText()); @@ -71,7 +61,6 @@ class EditTest extends \Magento\Test\Block\Adminhtml $this->_registry = new \Magento\Core\Model\Registry(); $this->_block = new \Magento\Webhook\Block\Adminhtml\Subscription\Edit( $this->_context, - $this->_coreData, $this->_registry ); diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Controller/Adminhtml/Webhook/RegistrationTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Controller/Adminhtml/Webhook/RegistrationTest.php index b776a6536f7..681e9f3b34b 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Controller/Adminhtml/Webhook/RegistrationTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Controller/Adminhtml/Webhook/RegistrationTest.php @@ -77,7 +77,9 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\TestFramework\Helper\ObjectManager $objectManagerHelper */ $this->_objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_setMageObjectManager(); + $this->_mockObjectManager = $this->getMockBuilder('Magento\ObjectManager') + ->disableOriginalConstructor() + ->getMock(); $this->_mockBackendHlpData = $this->getMockBuilder('Magento\Backend\Helper\Data') ->disableOriginalConstructor() @@ -296,18 +298,6 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase $registrationContr->succeededAction(); } - /** - * Makes sure that Mage has a mock object manager set. - * - */ - protected function _setMageObjectManager() - { - $this->_mockObjectManager = $this->getMockBuilder('Magento\ObjectManager') - ->disableOriginalConstructor() - ->getMock(); - \Magento\App\ObjectManager::setInstance($this->_mockObjectManager); - } - /** * Creates the RegistrationController to test. * @return \Magento\Webhook\Controller\Adminhtml\Webhook\Registration @@ -324,7 +314,7 @@ class RegistrationTest extends \PHPUnit_Framework_TestCase $layoutMock->expects($this->any())->method('getUpdate')->will($this->returnValue($layoutMergeMock)); $testElement = new \Magento\Simplexml\Element('<test>test</test>'); $layoutMock->expects($this->never())->method('getNode')->will($this->returnValue($testElement)); - $blockMock = $this->getMockBuilder('Magento\View\Block\AbstractBlock') + $blockMock = $this->getMockBuilder('Magento\View\Element\AbstractBlock') ->disableOriginalConstructor() ->getMock(); $layoutMock->expects($this->any())->method('getMessagesBlock')->will($this->returnValue($blockMock)); diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Controller/Adminhtml/Webhook/SubscriptionTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Controller/Adminhtml/Webhook/SubscriptionTest.php index cdc4b1b2d6a..4507de7b301 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Controller/Adminhtml/Webhook/SubscriptionTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Controller/Adminhtml/Webhook/SubscriptionTest.php @@ -80,7 +80,9 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase { /** @var \Magento\TestFramework\Helper\ObjectManager $objectManagerHelper */ $this->_objectManagerHelper = new \Magento\TestFramework\Helper\ObjectManager($this); - $this->_setMageObjectManager(); + $this->_mockObjectManager = $this->getMockBuilder('Magento\ObjectManager') + ->disableOriginalConstructor() + ->getMock(); // Initialize mocks which are used in several test cases $this->_mockApp = $this->getMockBuilder('Magento\Core\Model\App') @@ -524,18 +526,6 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase $subscriptionContr->activateAction(); } - /** - * Makes sure that Mage has a mock object manager set. - * - */ - protected function _setMageObjectManager() - { - $this->_mockObjectManager = $this->getMockBuilder('Magento\ObjectManager') - ->disableOriginalConstructor() - ->getMock(); - \Magento\App\ObjectManager::setInstance($this->_mockObjectManager); - } - /** * Creates the SubscriptionController to test. * diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Model/JobTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Model/JobTest.php index 17556974299..931e8d0af63 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Model/JobTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Model/JobTest.php @@ -67,10 +67,10 @@ class JobTest extends \PHPUnit_Framework_TestCase $this->_job = $this->getMockBuilder('Magento\Webhook\Model\Job') ->setConstructorArgs(array( - $this->_mockEventFactory, - $this->_mockSubscrFactory, $this->_mockContext, $coreRegistry, + $this->_mockEventFactory, + $this->_mockSubscrFactory, $dateTime )) ->setMethods(array('_init', 'save')) @@ -107,10 +107,10 @@ class JobTest extends \PHPUnit_Framework_TestCase $this->_job = $this->getMockBuilder('Magento\Webhook\Model\Job') ->setConstructorArgs(array( - $this->_mockEventFactory, - $this->_mockSubscrFactory, $this->_mockContext, $coreRegistry, + $this->_mockEventFactory, + $this->_mockSubscrFactory, $dateTime, null, null, @@ -145,10 +145,10 @@ class JobTest extends \PHPUnit_Framework_TestCase $this->_job = $this->getMockBuilder('Magento\Webhook\Model\Job') ->setConstructorArgs(array( - $this->_mockEventFactory, - $this->_mockSubscrFactory, $this->_mockContext, $coreRegistry, + $this->_mockEventFactory, + $this->_mockSubscrFactory, $dateTime, null, null, @@ -185,10 +185,10 @@ class JobTest extends \PHPUnit_Framework_TestCase $this->_job = $this->getMockBuilder('Magento\Webhook\Model\Job') ->setConstructorArgs(array( - $this->_mockEventFactory, - $this->_mockSubscrFactory, $this->_mockContext, $coreRegistry, + $this->_mockEventFactory, + $this->_mockSubscrFactory, $dateTime, null, null, @@ -224,10 +224,10 @@ class JobTest extends \PHPUnit_Framework_TestCase $this->_job = $this->getMockBuilder('Magento\Webhook\Model\Job') ->setConstructorArgs(array( - $this->_mockEventFactory, - $this->_mockSubscrFactory, $this->_mockContext, $coreRegistry, + $this->_mockEventFactory, + $this->_mockSubscrFactory, $dateTime, null, null, @@ -263,10 +263,10 @@ class JobTest extends \PHPUnit_Framework_TestCase $this->_job = $this->getMockBuilder('Magento\Webhook\Model\Job') ->setConstructorArgs(array( - $this->_mockEventFactory, - $this->_mockSubscrFactory, $this->_mockContext, $coreRegistry, + $this->_mockEventFactory, + $this->_mockSubscrFactory, $dateTime, null, null, @@ -329,10 +329,10 @@ class JobTest extends \PHPUnit_Framework_TestCase $this->_job = $this->getMockBuilder('Magento\Webhook\Model\Job') ->setConstructorArgs(array( - $this->_mockEventFactory, - $this->_mockSubscrFactory, $this->_mockContext, $coreRegistry, + $this->_mockEventFactory, + $this->_mockSubscrFactory, $dateTime )) ->setMethods(array('_init', 'save', 'getRetryCount', 'setUpdatedAt', 'setStatus')) @@ -366,10 +366,10 @@ class JobTest extends \PHPUnit_Framework_TestCase $this->_job = $this->getMockBuilder('Magento\Webhook\Model\Job') ->setConstructorArgs(array( - $this->_mockEventFactory, - $this->_mockSubscrFactory, $this->_mockContext, $coreRegistry, + $this->_mockEventFactory, + $this->_mockSubscrFactory, $dateTime, )) ->setMethods(array('_init', 'save', 'getRetryCount', 'setStatus')) diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Model/ObserverTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Model/ObserverTest.php index b68955413fd..4c80860d1fe 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Model/ObserverTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Model/ObserverTest.php @@ -71,7 +71,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $mockSubscription = $this->getMockBuilder('Magento\Webhook\Model\Subscription') ->disableOriginalConstructor() - ->setMethods(array('setStatus', 'save')) + ->setMethods(array('setStatus', 'save', '__wakeup')) ->getMock(); $this->_subscriptionSet->expects($this->once()) @@ -98,7 +98,7 @@ class ObserverTest extends \PHPUnit_Framework_TestCase $mockSubscription = $this->getMockBuilder('Magento\Webhook\Model\Subscription') ->disableOriginalConstructor() - ->setMethods(array('setStatus', 'save')) + ->setMethods(array('setStatus', 'save', '__wakeup')) ->getMock(); $this->_subscriptionSet->expects($this->once()) diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Event/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Event/CollectionTest.php index 4072a08393f..0a90fae8b1b 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Event/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Event/CollectionTest.php @@ -54,7 +54,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $collection = new \Magento\Webhook\Model\Resource\Event\Collection( - $eventManager, $logger, $mockFetchStrategy, $entityFactory, $dateTime, $mockResourceEvent + $entityFactory, $logger, $mockFetchStrategy, $eventManager, $dateTime, null, $mockResourceEvent ); $this->assertInstanceOf('Magento\Webhook\Model\Resource\Event\Collection', $collection); $this->assertEquals('Magento\Webhook\Model\Resource\Event', $collection->getResourceModelName()); diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Job/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Job/CollectionTest.php index b927e29df75..dda694597fe 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Job/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Job/CollectionTest.php @@ -53,7 +53,7 @@ class CollectionTest extends \PHPUnit_Framework_TestCase $logger = $this->getMock('Magento\Logger', array(), array(), '', false); $collection = new \Magento\Webhook\Model\Resource\Job\Collection( - $eventManager, $logger, $mockFetchStrategy, $entityFactory, $dateTime, $mockResourceEvent + $entityFactory, $logger, $mockFetchStrategy, $eventManager, $dateTime, null, $mockResourceEvent ); $this->assertInstanceOf('Magento\Webhook\Model\Resource\Job\Collection', $collection); $this->assertEquals('Magento\Webhook\Model\Resource\Job', $collection->getResourceModelName()); diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Subscription/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Subscription/CollectionTest.php index 665476dd034..0e68de55f89 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Subscription/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Subscription/CollectionTest.php @@ -77,9 +77,6 @@ class CollectionTest extends \PHPUnit_Framework_TestCase ->method('select') ->will($this->returnValue($this->_selectMock)); - $subscriptionMock = $this->_makeMock('Magento\Webhook\Model\Subscription'); - $eventMgrMock = $this->_makeMock('Magento\Event\ManagerInterface'); - // Arguments to collection constructor $this->_eventManager = $this->getMock('Magento\Event\ManagerInterface', array(), array(), '', false); $this->_fetchStrategyMock = $this->_makeMock('Magento\Data\Collection\Db\FetchStrategyInterface'); @@ -89,21 +86,6 @@ class CollectionTest extends \PHPUnit_Framework_TestCase ->method('getReadConnection') ->will($this->returnValue($this->_connectionMock)); $this->_entityFactory = $this->getMock('Magento\Core\Model\EntityFactory', array(), array(), '', false); - // Mock object manager - $createReturnMap = array( - array('Magento\Webhook\Model\Resource\Subscription', array(), $this->_resourceMock), - array('Magento\Webhook\Model\Subscription', array(), $subscriptionMock) - ); - $getReturnMap = array( - array('Magento\Event\ManagerInterface', $eventMgrMock), - ); - $mockObjectManager = $this->_setMageObjectManager(); - $mockObjectManager->expects($this->any()) - ->method('create') - ->will($this->returnValueMap($createReturnMap)); - $mockObjectManager->expects($this->any()) - ->method('get') - ->will($this->returnValueMap($getReturnMap)); } public function testInitialization() @@ -278,11 +260,12 @@ class CollectionTest extends \PHPUnit_Framework_TestCase { return $this->getMock('Magento\Webhook\Model\Resource\Subscription\Collection', $methods, array( - $this->_endpointResMock, - $this->_eventManager, + $this->_entityFactory, $this->_loggerMock, $this->_fetchStrategyMock, - $this->_entityFactory, + $this->_eventManager, + $this->_endpointResMock, + null, $this->_resourceMock ), '', true); } @@ -299,19 +282,4 @@ class CollectionTest extends \PHPUnit_Framework_TestCase ->disableOriginalConstructor() ->getMock(); } - - /** - * Makes sure that Mage has a mock object manager set, and returns that instance. - * - * @return \PHPUnit_Framework_MockObject_MockObject - */ - protected function _setMageObjectManager() - { - $mockObjectManager = $this->getMockBuilder('Magento\ObjectManager') - ->disableOriginalConstructor() - ->getMock(); - \Magento\App\ObjectManager::setInstance($mockObjectManager); - - return $mockObjectManager; - } } diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Subscription/Grid/CollectionTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Subscription/Grid/CollectionTest.php index 5d516d00c1e..9b83ebb593d 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Subscription/Grid/CollectionTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Model/Resource/Subscription/Grid/CollectionTest.php @@ -56,7 +56,9 @@ class CollectionTest extends \PHPUnit_Framework_TestCase $entityFactory = $this->getMock('Magento\Core\Model\EntityFactory', array(), array(), '', false); $logger = $this->getMock('Magento\Logger', array(), array(), '', false); new \Magento\Webhook\Model\Resource\Subscription\Grid\Collection( - $configMock, $endpointResMock, $eventManager, $logger, $fetchStrategyMock, $entityFactory, $resourceMock); + $entityFactory, $logger, $fetchStrategyMock, + $eventManager, $endpointResMock, $configMock, null, $resourceMock + ); } /** diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Model/Subscription/ConfigTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Model/Subscription/ConfigTest.php index bb335fd42a5..d9a98418850 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Model/Subscription/ConfigTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Model/Subscription/ConfigTest.php @@ -165,7 +165,7 @@ class ConfigTest extends \PHPUnit_Framework_TestCase // of the magic methods, since they weren't explicitly defined. $methods = array('setData', 'getData', 'unsetData', 'save', 'setName', 'setTopics', 'setFormat', 'setEndpointUrl', 'getAuthenticationOptions', 'unsetAuthenticationOption', - 'setAuthenticationType'); + 'setAuthenticationType', '__wakeup'); $mock = $this->getMockBuilder('Magento\Webhook\Model\Subscription') ->disableOriginalConstructor() ->setMethods($methods) diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Model/SubscriptionTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Model/SubscriptionTest.php index 565ed6c92bb..bcf4362f09d 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Model/SubscriptionTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Model/SubscriptionTest.php @@ -79,7 +79,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase $this->_subscription = $this->getMockBuilder('Magento\Webhook\Model\Subscription') ->setMethods(array('_init', '_hasModelChanged', '_getResource')) - ->setConstructorArgs(array($this->_mockEndpoint, $this->_mockContext, $coreRegistry, $dateTime)) + ->setConstructorArgs(array($this->_mockContext, $coreRegistry, $this->_mockEndpoint, $dateTime)) ->getMock(); $subscriptionResource = $this->getMockBuilder('Magento\Webhook\Model\Resource\Subscription') @@ -129,7 +129,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase $this->_subscription = $this->getMockBuilder('Magento\Webhook\Model\Subscription') ->setMethods(array('_init', '_hasModelChanged', '_getResource')) - ->setConstructorArgs(array($this->_mockEndpoint, $this->_mockContext, $coreRegistry, $dateTime)) + ->setConstructorArgs(array($this->_mockContext, $coreRegistry, $this->_mockEndpoint, $dateTime)) ->getMock(); $this->_subscription->setTopics(array('restricted', 'allowed')); @@ -151,7 +151,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase 'setRegistrationMechanism', 'getEndpointId', 'setEndpointId', 'setUpdatedAt', 'hasDataChanges', '_init', '_hasModelChanged', '_getResource') ) - ->setConstructorArgs(array($this->_mockEndpoint, $this->_mockContext, $coreRegistry, $dateTime)) + ->setConstructorArgs(array($this->_mockContext, $coreRegistry, $this->_mockEndpoint, $dateTime)) ->getMock(); $mockResource = $this->getMockBuilder('Magento\Webhook\Model\Resource\Subscription') @@ -189,7 +189,7 @@ class SubscriptionTest extends \PHPUnit_Framework_TestCase array('hasStatus', 'setStatus', 'hasRegistrationMechanism', 'setRegistrationMechanism', 'getEndpointId', 'setEndpointId', 'setUpdatedAt', 'hasDataChanges', '_init', '_hasModelChanged', '_getResource') ) - ->setConstructorArgs(array($this->_mockEndpoint, $this->_mockContext, $coreRegistry, $dateTime)) + ->setConstructorArgs(array($this->_mockContext, $coreRegistry, $this->_mockEndpoint, $dateTime)) ->getMock(); $mockResource = $this->getMockBuilder('Magento\Webhook\Model\Resource\Subscription') diff --git a/dev/tests/unit/testsuite/Magento/Webhook/Model/Webapi/User/FactoryTest.php b/dev/tests/unit/testsuite/Magento/Webhook/Model/Webapi/User/FactoryTest.php index b7e91da96ff..22c4579a6c9 100644 --- a/dev/tests/unit/testsuite/Magento/Webhook/Model/Webapi/User/FactoryTest.php +++ b/dev/tests/unit/testsuite/Magento/Webhook/Model/Webapi/User/FactoryTest.php @@ -181,7 +181,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase // Mock Role $this->_mockRole = $this->getMockBuilder('Magento\Webapi\Model\Acl\Role') - ->setMethods(array('load', 'save', 'getId', 'setRoleName', 'delete')) + ->setMethods(array('load', 'save', 'getId', 'setRoleName', 'delete', '__wakeup')) ->disableOriginalConstructor() ->getMock(); $this->_mockRole->expects($this->once()) @@ -202,7 +202,7 @@ class FactoryTest extends \PHPUnit_Framework_TestCase // Mock Rule $this->_mockRule = $this->getMockBuilder('Magento\Webapi\Model\Acl\Rule') ->disableOriginalConstructor() - ->setMethods(array('setRoleId', 'setResources', 'saveResources')) + ->setMethods(array('setRoleId', 'setResources', 'saveResources', '__wakeup')) ->getMock(); $this->_mockRule->expects($this->once()) ->method('setRoleId') @@ -220,9 +220,10 @@ class FactoryTest extends \PHPUnit_Framework_TestCase // Mock User $this->_mockUser = $this->getMockBuilder('Magento\Webapi\Model\Acl\User') ->disableOriginalConstructor() - ->setMethods( - array('setRoleId', 'setApiKey', 'setSecret', 'setCompanyName', 'setContactEmail', 'save', 'getId') - ) + ->setMethods(array( + 'setRoleId', 'setApiKey', 'setSecret', 'setCompanyName', 'setContactEmail', 'save', 'getId', + '__wakeup' + )) ->getMock(); $this->_mockUser->expects($this->once()) ->method('setRoleId') diff --git a/dev/tests/unit/testsuite/Magento/Wishlist/Block/Item/ConfigureTest.php b/dev/tests/unit/testsuite/Magento/Wishlist/Block/Item/ConfigureTest.php index 25cbb1029f2..c7674a99bc0 100644 --- a/dev/tests/unit/testsuite/Magento/Wishlist/Block/Item/ConfigureTest.php +++ b/dev/tests/unit/testsuite/Magento/Wishlist/Block/Item/ConfigureTest.php @@ -40,11 +40,6 @@ class ConfigureTest extends \PHPUnit_Framework_TestCase */ protected $_mockRegistry; - /** - * @var \PHPUnit_Framework_MockObject_MockObject - */ - protected $_mockCoreData; - /** * @var \PHPUnit_Framework_MockObject_MockObject */ @@ -60,10 +55,7 @@ class ConfigureTest extends \PHPUnit_Framework_TestCase $this->_mockWishlistData = $this->getMockBuilder('Magento\Wishlist\Helper\Data') ->disableOriginalConstructor() ->getMock(); - $this->_mockCoreData = $this->getMockBuilder('Magento\Core\Helper\Data') - ->disableOriginalConstructor() - ->getMock(); - $this->_mockContext = $this->getMockBuilder('Magento\View\Block\Template\Context') + $this->_mockContext = $this->getMockBuilder('Magento\View\Element\Template\Context') ->disableOriginalConstructor() ->getMock(); $this->_mockRegistry = $this->getMockBuilder('Magento\Core\Model\Registry') @@ -72,9 +64,9 @@ class ConfigureTest extends \PHPUnit_Framework_TestCase $this->_model = new \Magento\Wishlist\Block\Item\Configure( $this->_mockContext, - $this->_mockCoreData, $this->_mockWishlistData, - $this->_mockRegistry); + $this->_mockRegistry + ); } public function testGetProduct() diff --git a/dev/tools/Magento/Tools/View/generator.php b/dev/tools/Magento/Tools/View/generator.php index 296d130b414..0e7e953b1e0 100644 --- a/dev/tools/Magento/Tools/View/generator.php +++ b/dev/tools/Magento/Tools/View/generator.php @@ -68,7 +68,7 @@ try { $dirs = new \Magento\App\Dir($config->getSourceDir()); $objectManager = new \Magento\ObjectManager\ObjectManager(); $entityFactory = new Magento\Core\Model\EntityFactory($objectManager); - $themes = new \Magento\Core\Model\Theme\Collection($filesystem, $dirs, $entityFactory); + $themes = new \Magento\Core\Model\Theme\Collection($entityFactory, $filesystem, $dirs); $themes->setItemObjectClass('\Magento\Tools\View\Generator\ThemeLight'); $themes->addDefaultPattern('*'); diff --git a/dev/tools/layout/processors/headBlocks.xsl b/dev/tools/layout/processors/headBlocks.xsl index 72ebbfc105a..8e643e403a2 100644 --- a/dev/tools/layout/processors/headBlocks.xsl +++ b/dev/tools/layout/processors/headBlocks.xsl @@ -41,8 +41,8 @@ <block> <xsl:attribute name="class"> <xsl:choose> - <xsl:when test="@method = 'addJs' ">Magento\Page\Block\Html\Head\Script</xsl:when> - <xsl:when test="@method = 'addCss'">Magento\Page\Block\Html\Head\Css</xsl:when> + <xsl:when test="@method = 'addJs' ">Magento\Theme\Block\Html\Head\Script</xsl:when> + <xsl:when test="@method = 'addCss'">Magento\Theme\Block\Html\Head\Css</xsl:when> </xsl:choose> </xsl:attribute> <xsl:attribute name="name"> diff --git a/lib/Magento/Acl/Resource/Provider.php b/lib/Magento/Acl/Resource/Provider.php index a563542c366..0df5d776b41 100644 --- a/lib/Magento/Acl/Resource/Provider.php +++ b/lib/Magento/Acl/Resource/Provider.php @@ -35,24 +35,16 @@ class Provider implements \Magento\Acl\Resource\ProviderInterface */ protected $_resourceTreeBuilder; - /** - * @var \Magento\App\State - */ - protected $_appState; - /** * @param \Magento\Config\ReaderInterface $configReader * @param \Magento\Acl\Resource\TreeBuilder $resourceTreeBuilder - * @param \Magento\App\State $appState */ public function __construct( \Magento\Config\ReaderInterface $configReader, - \Magento\Acl\Resource\TreeBuilder $resourceTreeBuilder, - \Magento\App\State $appState + \Magento\Acl\Resource\TreeBuilder $resourceTreeBuilder ) { $this->_configReader = $configReader; $this->_resourceTreeBuilder = $resourceTreeBuilder; - $this->_appState = $appState; } /** @@ -60,7 +52,8 @@ class Provider implements \Magento\Acl\Resource\ProviderInterface */ public function getAclResources() { - $aclResourceConfig = $this->_configReader->read($this->_appState->getAreaCode()); + // TODO: As soon as all acl.xml files are moved to global scope, default ('global') scope should be used + $aclResourceConfig = $this->_configReader->read('adminhtml'); if (!empty($aclResourceConfig['config']['acl']['resources'])) { return $this->_resourceTreeBuilder->build($aclResourceConfig['config']['acl']['resources']); } diff --git a/lib/Magento/App/Request/Http.php b/lib/Magento/App/Request/Http.php index c22adc7edc8..45c18f67dc5 100644 --- a/lib/Magento/App/Request/Http.php +++ b/lib/Magento/App/Request/Http.php @@ -250,6 +250,8 @@ class Http extends \Zend_Controller_Request_Http implements \Magento\App\Request /** * Retrieve HTTP HOST * + * @todo getHttpHost should return only string (currently method return boolean value too) + * * @param bool $trimPort * @return string */ diff --git a/lib/Magento/Code/Reader/ArgumentsReader.php b/lib/Magento/Code/Reader/ArgumentsReader.php index 751ddd2eeb9..144c4c4f14d 100644 --- a/lib/Magento/Code/Reader/ArgumentsReader.php +++ b/lib/Magento/Code/Reader/ArgumentsReader.php @@ -58,10 +58,7 @@ class ArgumentsReader if ($parameter->isOptional()) { if ($parameter->isDefaultValueAvailable()) { $value = $parameter->getDefaultValue(); - if ($parameter->isDefaultValueConstant()) { - $const = $parameter->getDefaultValueConstantName(); - $default = strpos($const, 'self::') === 0 ? $const : '\\' . $const; - } elseif (true == is_array($value)) { + if (true == is_array($value)) { $default = $this->_varExportMin($value); } elseif (true == is_int($value)) { $default = $value; @@ -96,6 +93,11 @@ class ArgumentsReader */ public function getParentCall(\ReflectionClass $class, array $classArguments) { + /** Skip native PHP types */ + if (!$class->getFileName()) { + return null; + } + $trimFunction = function (&$value) { $value = trim($value, PHP_EOL . ' $'); }; @@ -107,17 +109,19 @@ class ArgumentsReader $source = file($class->getFileName()); $content = implode('', array_slice($source, $start, $length)); - $pattern = '/parent::__construct\(([a-zA-Z0-9_$, ' . PHP_EOL . ']*)\);/'; + $pattern = '/parent::__construct\(([ ' . PHP_EOL . ']*[$]{1}[a-zA-Z0-9_]*,)*[ ' . PHP_EOL . ']*' + . '([$]{1}[a-zA-Z0-9_]*){1}[' . PHP_EOL . ' ]*\);/'; if (!preg_match($pattern, $content, $matches)) { return null; } - $arguments = $matches[1]; + $arguments = $matches[0]; if (!trim($arguments)) { return null; } + $arguments = substr(trim($arguments), 20, -2); $arguments = explode(',', $arguments); array_walk($arguments, $trimFunction); diff --git a/lib/Magento/Code/Validator/ArgumentSequence.php b/lib/Magento/Code/Validator/ArgumentSequence.php index a572b5e4146..347979964f7 100644 --- a/lib/Magento/Code/Validator/ArgumentSequence.php +++ b/lib/Magento/Code/Validator/ArgumentSequence.php @@ -30,9 +30,6 @@ use Magento\Code\ValidationException; class ArgumentSequence implements ValidatorInterface { - const TYPE_OBJECT = 'object'; - const TYPE_SCALAR = 'scalar'; - const REQUIRED = 'required'; const OPTIONAL = 'optional'; @@ -45,7 +42,15 @@ class ArgumentSequence implements ValidatorInterface * List of allowed type to validate * @var array */ - protected $_allowedTypes = array('\Magento\App\Action\Action', '\Magento\View\Element\BlockInterface'); + protected $_allowedTypes = array( + '\Magento\App\Action\Action', + '\Magento\View\Element\BlockInterface', + '\Magento\App\Helper\AbstractHelper', + '\Magento\Module\Updater\SetupInterface', + '\Magento\Core\Model\Resource\AbstractResource', + '\Magento\Core\Model\AbstractModel', + '\Magento\Data\Collection', + ); /** * @var array @@ -89,15 +94,19 @@ class ArgumentSequence implements ValidatorInterface $parentClass = '\\' . $parentClass; } - if (isset($this->_cache[$parentClass])) { - $parentArguments = $this->_cache[$parentClass]; - } else { - $parentArguments = $this->_argumentsReader->getConstructorArguments($parent, false, true); + $parentCall = $this->_argumentsReader->getParentCall($class, array()); + + if ($parentCall) { + $parentArguments = isset($this->_cache[$parentClass]) + ? $this->_cache[$parentClass] + : $this->_argumentsReader->getConstructorArguments($parent, false, true); } } $requiredSequence = $this->_buildsSequence($classArguments, $parentArguments); - $this->_cache[$className] = $requiredSequence; + if (!empty($requiredSequence)) { + $this->_cache[$className] = $requiredSequence; + } if (false == $this->_checkArgumentSequence($classArguments, $requiredSequence)) { throw new ValidationException( @@ -136,8 +145,26 @@ class ArgumentSequence implements ValidatorInterface */ protected function _checkArgumentSequence(array $actualSequence, array $requiredSequence) { - $actual = array_keys($actualSequence); - $required = array_keys($requiredSequence); + $actualArgumentSequence = array(); + $requiredArgumentSequence = array(); + + foreach ($actualSequence as $name => $argument) { + if (false == $argument['isOptional']) { + $actualArgumentSequence[$name] = $argument; + } else { + break; + } + } + + foreach ($requiredSequence as $name => $argument) { + if (false == $argument['isOptional']) { + $requiredArgumentSequence[$name] = $argument; + } else { + break; + } + } + $actual = array_keys($actualArgumentSequence); + $required = array_keys($requiredArgumentSequence); return $actual === $required; } @@ -150,120 +177,47 @@ class ArgumentSequence implements ValidatorInterface */ protected function _buildsSequence(array $classArguments, array $parentArguments = array()) { + $output = array(); if (empty($classArguments)) { - return $classArguments; + return $output; } $classArgumentList = $this->_sortArguments($classArguments); $parentArgumentList = $this->_sortArguments($parentArguments); - $requiredToOptionalObject = array(); - $requiredToOptionalScalar = array(); - $output = array(); - - /** - * Argument Sequence Matrix - * 1 2 3 - * 1. P.R.O C.O.O C.R.O - * 2. P.R.S C.O.S C.R.S - * 3. P.O.O C.R.O C.O.O - * 4. P.O.S C.R.S C.O.S - * - * where code X.Y.Z - * X - parent (P) / child (C) - * Y - required (R) / optional (O) - * Z - object (O) / scalar (S) - */ - - // 1. Parent Required Object Arguments - foreach ($parentArgumentList[self::REQUIRED][self::TYPE_OBJECT] as $name => $argument) { - if (isset($classArgumentList[self::OPTIONAL][self::TYPE_OBJECT][$name])) { - // 1.2 - $requiredToOptionalObject[$name] = $classArgumentList[self::OPTIONAL][self::TYPE_OBJECT][$name]; - } elseif (isset($classArgumentList[self::REQUIRED][self::TYPE_OBJECT][$name])) { - // 1.3 - $output[$name] = $classArgumentList[self::REQUIRED][self::TYPE_OBJECT][$name]; - } else { - // 1.1 - $output[$name] = $argument; - } - } - - // 2. Parent Required Scalar Arguments - foreach ($parentArgumentList[self::REQUIRED][self::TYPE_SCALAR] as $name => $argument) { - if (isset($classArgumentList[self::OPTIONAL][self::TYPE_SCALAR][$name])) { - // 2.2 - $requiredToOptionalScalar[$name] = $classArgumentList[self::OPTIONAL][self::TYPE_SCALAR][$name]; - } elseif (isset($classArgumentList[self::REQUIRED][self::TYPE_SCALAR][$name])) { - // 2.3 - $output[$name] = $classArgumentList[self::REQUIRED][self::TYPE_SCALAR][$name]; + $migrated = array(); + foreach ($parentArgumentList[self::REQUIRED] as $name => $argument) { + if (!isset($classArgumentList[self::OPTIONAL][$name])) { + $output[$name] = isset($classArgumentList[self::REQUIRED][$name]) + ? $classArgumentList[self::REQUIRED][$name] + : $argument;; } else { - // 2.1 - $output[$name] = $argument; + $migrated[$name] = $classArgumentList[self::OPTIONAL][$name]; } } - // 1.3 Child Required Object Arguments - foreach ($classArgumentList[self::REQUIRED][self::TYPE_OBJECT] as $name => $argument) { + foreach ($classArgumentList[self::REQUIRED] as $name => $argument) { if (!isset($output[$name])) { $output[$name] = $argument; } } - // 2.3 Child Required Scalar Arguments - foreach ($classArgumentList[self::REQUIRED][self::TYPE_SCALAR] as $name => $argument) { + /** Use parent required argument that become optional in child class */ + foreach ($migrated as $name => $argument) { if (!isset($output[$name])) { $output[$name] = $argument; } } - // 1.2 Optional Object. Parent Required Object Arguments that become Optional in Child Class - foreach ($requiredToOptionalObject as $name => $argument) { - $output[$name] = $argument; - } - - // 2.2 Optional Scalar. Parent Required Scalar Arguments that become Optional in Child Class - foreach ($requiredToOptionalScalar as $name => $argument) { - $output[$name] = $argument; - } - - // 3. Parent Optional Object Arguments - foreach ($parentArgumentList[self::OPTIONAL][self::TYPE_OBJECT] as $name => $argument) { - if (isset($classArgumentList[self::OPTIONAL][self::TYPE_OBJECT][$name])) { - // 3.3 Use Child Optional Object - $output[$name] = $classArgumentList[self::OPTIONAL][self::TYPE_OBJECT][$name]; - } elseif (!isset($output[$name])) { - // 3.2 Check whether this argument wasn't processed in Step 1.2 or 1.3 - $output[$name] = $argument; - } else { - // 3.1 Use Parent Optional Object Argument - $output[$name] = $argument; - } - } - - // 4. Parent Optional Scalar Arguments - foreach ($parentArgumentList[self::OPTIONAL][self::TYPE_SCALAR] as $name => $argument) { - if (isset($classArgumentList[self::OPTIONAL][self::TYPE_SCALAR][$name])) { - // 4.3 Use Child Optional Scalar - $output[$name] = $classArgumentList[self::OPTIONAL][self::TYPE_SCALAR][$name]; - } elseif (!isset($output[$name])) { - // 4.2 Check whether this argument wasn't processed in Step 2.2 or 2.3 - $output[$name] = $argument; - } else { - // 4.1 Use Parent Optional Scalar Argument - $output[$name] = $argument; - } - } - - // 3.3 Child Optional Object Arguments - foreach ($classArgumentList[self::OPTIONAL][self::TYPE_OBJECT] as $name => $argument) { + foreach ($parentArgumentList[self::OPTIONAL] as $name => $argument) { if (!isset($output[$name])) { - $output[$name] = $argument; + $output[$name] = isset($classArgumentList[self::OPTIONAL][$name]) + ? $classArgumentList[self::OPTIONAL][$name] + : $argument; } } - // 4.3 Child Optional Scalar Arguments - foreach ($classArgumentList[self::OPTIONAL][self::TYPE_SCALAR] as $name => $argument) { + foreach ($classArgumentList[self::OPTIONAL] as $name => $argument) { if (!isset($output[$name])) { $output[$name] = $argument; } @@ -280,80 +234,23 @@ class ArgumentSequence implements ValidatorInterface */ protected function _sortArguments($arguments) { - $requiredObject = array(); - $requiredScalar = array(); - $optionalObject = array(); - $optionalScalar = array(); - - foreach ($arguments as $argument) { - if ($argument['type'] && $argument['type'] != 'array') { - if ($argument['isOptional']) { - $optionalObject[$argument['name']] = $argument; - } else { - $requiredObject[$argument['name']] = $argument; - } + $required = array(); + $optional = array(); + + foreach ($arguments as $name => $argument) { + if ($argument['isOptional']) { + $optional[$name] = $argument; } else { - if ($argument['isOptional']) { - $optionalScalar[$argument['name']] = $argument; - } else { - $requiredScalar[$argument['name']] = $argument; - } + $required[$name] = $argument; } } - $requiredObject = $this->_sortObjectType($requiredObject); - $optionalScalar = $this->_sortScalarType($optionalScalar); - return array( - self::REQUIRED => array( - self::TYPE_OBJECT => $requiredObject, - self::TYPE_SCALAR => $requiredScalar - ), - self::OPTIONAL => array( - self::TYPE_OBJECT => $optionalObject, - self::TYPE_SCALAR => $optionalScalar - ), + self::REQUIRED => $required, + self::OPTIONAL => $optional, ); } - /** - * Sort arguments by context object - * - * @param array $argumentList - * @return array - */ - protected function _sortObjectType(array $argumentList) - { - $context = array(); - foreach ($argumentList as $name => $argument) { - if ($this->_isContextType($argument['type'])) { - $context[$name] = $argument; - unset($argumentList[$name]); - break; - } - } - return array_merge($context, $argumentList); - } - - /** - * Sort arguments by arguments name - * - * @param array $argumentList - * @return array - */ - protected function _sortScalarType(array $argumentList) - { - $data = array(); - foreach ($argumentList as $name => $argument) { - if ($argument['name'] == 'data') { - $data[$name] = $argument; - unset($argumentList[$name]); - break; - } - } - return array_merge($data, $argumentList); - } - /** * Check whether arguments list contains an only context argument * diff --git a/lib/Magento/Data/Collection/Db.php b/lib/Magento/Data/Collection/Db.php index 14ef48df1de..6f9bb5a2509 100644 --- a/lib/Magento/Data/Collection/Db.php +++ b/lib/Magento/Data/Collection/Db.php @@ -102,21 +102,21 @@ class Db extends \Magento\Data\Collection private $_fetchStrategy; /** + * @param \Magento\Data\Collection\EntityFactoryInterface $entityFactory * @param \Magento\Logger $logger * @param \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy - * @param \Magento\Data\Collection\EntityFactoryInterface $entityFactory - * @param null $conn + * @param mixed $connection */ public function __construct( + \Magento\Data\Collection\EntityFactoryInterface $entityFactory, \Magento\Logger $logger, \Magento\Data\Collection\Db\FetchStrategyInterface $fetchStrategy, - \Magento\Data\Collection\EntityFactoryInterface $entityFactory, - $conn = null + $connection = null ) { parent::__construct($entityFactory); $this->_fetchStrategy = $fetchStrategy; - if (!is_null($conn)) { - $this->setConnection($conn); + if (!is_null($connection)) { + $this->setConnection($connection); } $this->_logger = $logger; } diff --git a/lib/Magento/Data/Form.php b/lib/Magento/Data/Form.php index e52eaefa9fc..6e4ed4c86f4 100644 --- a/lib/Magento/Data/Form.php +++ b/lib/Magento/Data/Form.php @@ -26,8 +26,6 @@ namespace Magento\Data; -use \Magento\Core\Model\Session; - class Form extends \Magento\Data\Form\AbstractForm { /** @@ -37,13 +35,6 @@ class Form extends \Magento\Data\Form\AbstractForm */ protected $_allElements; - /** - * Session instance - * - * @var \Magento\Core\Model\Session\AbstractSession - */ - protected $_session; - /** * form elements index * @@ -51,48 +42,30 @@ class Form extends \Magento\Data\Form\AbstractForm */ protected $_elementsIndex; + /** + * @var Form\FormKey + */ + protected $formKey; + static protected $_defaultElementRenderer; static protected $_defaultFieldsetRenderer; static protected $_defaultFieldsetElementRenderer; /** - * @param Session $session * @param Form\Element\Factory $factoryElement * @param Form\Element\CollectionFactory $factoryCollection + * @param Form\FormKey $formKey * @param array $attributes */ public function __construct( - Session $session, \Magento\Data\Form\Element\Factory $factoryElement, \Magento\Data\Form\Element\CollectionFactory $factoryCollection, + \Magento\Data\Form\FormKey $formKey, $attributes = array() ) { - $this->_session = $session; parent::__construct($factoryElement, $factoryCollection, $attributes); $this->_allElements = $this->_factoryCollection->create(array('container' => $this)); - } - - /** - * Set session instance - * - * @param \Magento\Core\Model\Session $session - * @return \Magento\Data\Form - */ - public function setSession(Session $session) - { - $this->_session = $session; - return $this; - } - - /** - * Get session instance - * - * @return \Magento\Core\Model\Session\AbstractSession - * @throws \Magento\Exception - */ - protected function _getSession() - { - return $this->_session; + $this->formKey = $formKey; } public static function setElementRenderer(\Magento\Data\Form\Element\Renderer\RendererInterface $renderer = null) @@ -319,9 +292,9 @@ class Form extends \Magento\Data\Form\AbstractForm if ($useContainer) { $html .= '<form ' . $this->serialize($this->getHtmlAttributes()) . '>'; $html .= '<div>'; - if (strtolower($this->getData('method')) == 'post' && null !== $this->_getSession()) { + if (strtolower($this->getData('method')) == 'post') { $html .= '<input name="form_key" type="hidden" value="' - . $this->_getSession()->getFormKey() + . $this->formKey->getFormKey() . '" />'; } $html .= '</div>'; diff --git a/lib/Magento/Data/Form/Element/AbstractElement.php b/lib/Magento/Data/Form/Element/AbstractElement.php index e9367941c18..ca7a3954648 100644 --- a/lib/Magento/Data/Form/Element/AbstractElement.php +++ b/lib/Magento/Data/Form/Element/AbstractElement.php @@ -226,7 +226,7 @@ abstract class AbstractElement extends \Magento\Data\Form\AbstractForm protected function _getUiId($suffix = null) { - if ($this->_renderer instanceof \Magento\View\Block\AbstractBlock) { + if ($this->_renderer instanceof \Magento\View\Element\AbstractBlock) { return $this->_renderer->getUiId($this->getType(), $this->getName(), $suffix); } else { return ' data-ui-id="form-element-' . $this->getName() . ($suffix ? : '') . '"'; diff --git a/lib/Magento/Data/Form/FormKey.php b/lib/Magento/Data/Form/FormKey.php new file mode 100644 index 00000000000..32e9c84585c --- /dev/null +++ b/lib/Magento/Data/Form/FormKey.php @@ -0,0 +1,72 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Data + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Data\Form; + +class FormKey +{ + /** + * Form key + */ + const FORM_KEY = '_form_key'; + + /** + * @var \Magento\Math\Random + */ + protected $mathRandom; + + /** + * @var \Magento\Core\Model\Session\AbstractSession + */ + protected $session; + + /** + * @todo Abstract session will be moved into libraries. Dependency from core module will be replaced. + * + * @param \Magento\Math\Random $mathRandom + * @param \Magento\Core\Model\Session\AbstractSession $session + */ + public function __construct( + \Magento\Math\Random $mathRandom, + \Magento\Core\Model\Session\AbstractSession $session + ) { + $this->mathRandom = $mathRandom; + $this->session = $session; + } + + /** + * Retrieve Session Form Key + * + * @return string A 16 bit unique key for forms + */ + public function getFormKey() + { + if (!$this->session->getData(self::FORM_KEY)) { + $this->session->setData(self::FORM_KEY, $this->mathRandom->getRandomString(16)); + } + return $this->session->getData(self::FORM_KEY); + } +} diff --git a/lib/Magento/Json/Decoder.php b/lib/Magento/Json/Decoder.php new file mode 100644 index 00000000000..faa45f4beaf --- /dev/null +++ b/lib/Magento/Json/Decoder.php @@ -0,0 +1,40 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Json; + +/** + * @package Magento\Json + */ +class Decoder implements DecoderInterface +{ + /** + * @param string $data + * @return mixed + */ + public function decode($data) + { + return \Zend_Json::decode($data); + } +} \ No newline at end of file diff --git a/lib/Magento/Json/DecoderInterface.php b/lib/Magento/Json/DecoderInterface.php new file mode 100644 index 00000000000..d9a881cb8ca --- /dev/null +++ b/lib/Magento/Json/DecoderInterface.php @@ -0,0 +1,38 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Json; + +/** + * Json decoder + * + * @package Magento\Json + */ +interface DecoderInterface +{ + /** + * @param string $data + * @return mixed + */ + public function decode($data); +} diff --git a/app/code/Magento/Page/Block/Links.php b/lib/Magento/Json/Encoder.php similarity index 62% rename from app/code/Magento/Page/Block/Links.php rename to lib/Magento/Json/Encoder.php index d0d7f83a99c..361c73f663f 100644 --- a/app/code/Magento/Page/Block/Links.php +++ b/lib/Magento/Json/Encoder.php @@ -22,32 +22,41 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block; +namespace Magento\Json; + +use Magento\TranslateInterface; /** - * Links list block + * @package Magento\Json */ -class Links extends \Magento\View\Block\Template +class Encoder implements EncoderInterface { - /** @var string */ - protected $_template = 'Magento_Page::links.phtml'; + /** + * Translator + * + * @var TranslateInterface + */ + protected $translator; /** - * @return \Magento\Page\Block\Link[] + * @param TranslateInterface $translator */ - public function getLinks() + public function __construct(TranslateInterface $translator) { - return $this->_layout->getChildBlocks($this->getNameInLayout()); + $this->translator = $translator; } /** - * Render Block - * - * @param \Magento\View\Block\AbstractBlock $link + * @param mixed $data * @return string */ - public function renderLink(\Magento\View\Block\AbstractBlock $link) + public function encode($data) { - return $this->_layout->renderElement($link->getNameInLayout()); + $json = \Zend_Json::encode($data); + if ($this->translator->isAllowed()) { + $this->translator->processResponseBody($json, true); + } + + return $json; } -} +} \ No newline at end of file diff --git a/lib/Magento/Json/EncoderInterface.php b/lib/Magento/Json/EncoderInterface.php new file mode 100644 index 00000000000..63f7f7645b9 --- /dev/null +++ b/lib/Magento/Json/EncoderInterface.php @@ -0,0 +1,38 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ +namespace Magento\Json; + +/** + * Json encoder + * + * @package Magento\Json + */ +interface EncoderInterface +{ + /** + * @param mixed $data + * @return string + */ + public function encode($data); +} diff --git a/lib/Magento/Module/FrontController/Plugin/Install.php b/lib/Magento/Module/FrontController/Plugin/Install.php index ad4393c9870..a3fe543b379 100644 --- a/lib/Magento/Module/FrontController/Plugin/Install.php +++ b/lib/Magento/Module/FrontController/Plugin/Install.php @@ -1,6 +1,6 @@ <?php /** - * Application installation plugin. Should be used b applications that require module install/upgrade. + * Application installation plugin. Should be used by applications that require module install/upgrade. * * Magento * diff --git a/lib/Magento/Oauth/Helper/Oauth.php b/lib/Magento/Oauth/Helper/Oauth.php index 5dcd2c2980f..d2f4283d057 100644 --- a/lib/Magento/Oauth/Helper/Oauth.php +++ b/lib/Magento/Oauth/Helper/Oauth.php @@ -60,7 +60,6 @@ class Oauth /** * @param \Magento\Math\Random $mathRandom - * @internal param \Magento\Core\Helper\Data $coreData */ public function __construct(\Magento\Math\Random $mathRandom) { diff --git a/app/code/Magento/Page/Helper/Html.php b/lib/Magento/Session/Config/ConfigInterface.php similarity index 82% rename from app/code/Magento/Page/Helper/Html.php rename to lib/Magento/Session/Config/ConfigInterface.php index 8eb193d743a..e3b892274f7 100644 --- a/app/code/Magento/Page/Helper/Html.php +++ b/lib/Magento/Session/Config/ConfigInterface.php @@ -1,5 +1,7 @@ <?php /** + * Session config interface + * * Magento * * NOTICE OF LICENSE @@ -19,19 +21,13 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Page + * @package \Magento\Sesstion * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ - -/** - * Html helper - * - * @author Magento Core Team <core@magentocommerce.com> - */ -namespace Magento\Page\Helper; -class Html extends \Magento\App\Helper\AbstractHelper +namespace Magento\Session\Config; + +interface ConfigInterface extends \Zend\Session\Config\ConfigInterface { - } diff --git a/app/code/Magento/Core/Model/Page.php b/lib/Magento/Session/SidResolverInterface.php similarity index 63% rename from app/code/Magento/Core/Model/Page.php rename to lib/Magento/Session/SidResolverInterface.php index a28493d3dd0..7fc6d9601a2 100644 --- a/app/code/Magento/Core/Model/Page.php +++ b/lib/Magento/Session/SidResolverInterface.php @@ -1,5 +1,7 @@ <?php /** + * SID resolver interface + * * Magento * * NOTICE OF LICENSE @@ -19,38 +21,31 @@ * needs please refer to http://www.magentocommerce.com for more information. * * @category Magento - * @package Magento_Core + * @package \Magento\Sesstion * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -/** - * Value object carrying page properties - */ -namespace Magento\Core\Model; +namespace Magento\Session; -class Page +interface SidResolverInterface { /** - * @var \Magento\Core\Model\Page\Asset\Collection + * Session ID in query param */ - private $_assets; + const SESSION_ID_QUERY_PARAM = 'SID'; /** - * @param \Magento\Core\Model\Page\Asset\Collection $assets + * @param \Magento\Core\Model\Session\AbstractSession $session + * @return string */ - public function __construct(\Magento\Core\Model\Page\Asset\Collection $assets) - { - $this->_assets = $assets; - } + public function getSid(\Magento\Core\Model\Session\AbstractSession $session); /** - * Retrieve collection of assets linked to a page + * Get session id query param * - * @return \Magento\Core\Model\Page\Asset\Collection + * @param \Magento\Core\Model\Session\AbstractSession $session + * @return string */ - public function getAssets() - { - return $this->_assets; - } + public function getSessionIdQueryParam(\Magento\Core\Model\Session\AbstractSession $session); } diff --git a/lib/Magento/Stdlib/Cookie.php b/lib/Magento/Stdlib/Cookie.php new file mode 100644 index 00000000000..03e70a8ee63 --- /dev/null +++ b/lib/Magento/Stdlib/Cookie.php @@ -0,0 +1,117 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @category Magento + * @package Magento_Core + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\Stdlib; + +/** + * Core cookie model + */ +class Cookie +{ + /** + * @var \Magento\App\RequestInterface + */ + protected $httpRequest; + + /** + * @param \Magento\App\RequestInterface $request + */ + public function __construct( + \Magento\App\RequestInterface $request + ) { + $this->httpRequest = $request; + } + + /** + * Set cookie + * + * @param string $name The cookie name + * @param string $value The cookie value + * @param int $period Lifetime period + * @param string $path + * @param string $domain + * @param bool|int|string $secure + * @param bool|string $httponly + * @return \Magento\Stdlib\Cookie + */ + public function set($name, $value, $period = null, $path = null, $domain = null, $secure = null, $httponly = null) + { + /** + * Check headers sent + */ + if (headers_sent()) { + return $this; + } + + if ($period === true) { + $period = 3600 * 24 * 365; + } + + if ($period == 0) { + $expire = 0; + } else { + $expire = time() + $period; + } + + setcookie($name, $value, $expire, $path, $domain, $secure, $httponly); + + return $this; + } + + /** + * Postpone cookie expiration time if cookie value defined + * + * @param string $name The cookie name + * @param int $period Lifetime period + * @param string $path + * @param string $domain + * @param bool|int|string $secure + * @param string|bool $httponly + * @return \Magento\Stdlib\Cookie + */ + public function renew($name, $period = null, $path = null, $domain = null, $secure = null, $httponly = null) + { + if ($period === null) { + return $this; + } + $value = $this->httpRequest->getCookie($name, false); + if ($value !== false) { + $this->set($name, $value, $period, $path, $domain, $secure, $httponly); + } + return $this; + } + + /** + * Retrieve cookie or false if not exists + * + * @param string $name The cookie name + * @return mixed + */ + public function get($name = null) + { + return $this->httpRequest->getCookie($name, false); + } +} diff --git a/app/code/Magento/Core/Model/Page/Asset/AssetInterface.php b/lib/Magento/View/Asset/AssetInterface.php similarity index 92% rename from app/code/Magento/Core/Model/Page/Asset/AssetInterface.php rename to lib/Magento/View/Asset/AssetInterface.php index 2ed430ac160..a55de2730ae 100644 --- a/app/code/Magento/Core/Model/Page/Asset/AssetInterface.php +++ b/lib/Magento/View/Asset/AssetInterface.php @@ -18,17 +18,15 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * Interface of a resource linked to a page */ -namespace Magento\Core\Model\Page\Asset; - interface AssetInterface { /** diff --git a/app/code/Magento/Core/Model/Page/Asset/Collection.php b/lib/Magento/View/Asset/Collection.php similarity index 73% rename from app/code/Magento/Core/Model/Page/Asset/Collection.php rename to lib/Magento/View/Asset/Collection.php index 1d57bf876ad..a6411f67fdd 100644 --- a/app/code/Magento/Core/Model/Page/Asset/Collection.php +++ b/lib/Magento/View/Asset/Collection.php @@ -18,33 +18,31 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * List of page asset instances associated with unique identifiers */ -namespace Magento\Core\Model\Page\Asset; - class Collection { /** - * @var \Magento\Core\Model\Page\Asset\AssetInterface[] + * @var AssetInterface[] */ - private $_assets = array(); + protected $assets = array(); /** * Add an instance, identified by a unique identifier, to the list * * @param string $identifier - * @param \Magento\Core\Model\Page\Asset\AssetInterface $asset + * @param AssetInterface $asset */ - public function add($identifier, \Magento\Core\Model\Page\Asset\AssetInterface $asset) + public function add($identifier, AssetInterface $asset) { - $this->_assets[$identifier] = $asset; + $this->assets[$identifier] = $asset; } /** @@ -55,7 +53,7 @@ class Collection */ public function has($identifier) { - return isset($this->_assets[$identifier]); + return isset($this->assets[$identifier]); } /** @@ -65,16 +63,16 @@ class Collection */ public function remove($identifier) { - unset($this->_assets[$identifier]); + unset($this->assets[$identifier]); } /** * Retrieve all items in the collection * - * @return \Magento\Core\Model\Page\Asset\AssetInterface[] + * @return AssetInterface[] */ public function getAll() { - return $this->_assets; + return $this->assets; } } diff --git a/lib/Magento/View/Asset/ConfigInterface.php b/lib/Magento/View/Asset/ConfigInterface.php new file mode 100644 index 00000000000..174a4f1d9da --- /dev/null +++ b/lib/Magento/View/Asset/ConfigInterface.php @@ -0,0 +1,61 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\View\Asset; + +/** + * View asset configuration interface + */ +interface ConfigInterface +{ + /** + * Check whether merging of CSS files is on + * + * @return bool + */ + public function isMergeCssFiles(); + + /** + * Check whether merging of JavScript files is on + * + * @return bool + */ + public function isMergeJsFiles(); + + /** + * Check whether asset minification is on for specified content type + * + * @param string $contentType + * @return bool + */ + public function isAssetMinification($contentType); + + /** + * Get asset minification adapter for specified content type + * + * @param string $contentType + * @return string + */ + public function getAssetMinificationAdapter($contentType); +} diff --git a/app/code/Magento/Page/Model/Asset/GroupedCollection.php b/lib/Magento/View/Asset/GroupedCollection.php similarity index 61% rename from app/code/Magento/Page/Model/Asset/GroupedCollection.php rename to lib/Magento/View/Asset/GroupedCollection.php index 5237985e1c9..586c7935a58 100644 --- a/app/code/Magento/Page/Model/Asset/GroupedCollection.php +++ b/lib/Magento/View/Asset/GroupedCollection.php @@ -18,18 +18,16 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * List of page assets that combines into groups ones having the same properties */ -namespace Magento\Page\Model\Asset; - -class GroupedCollection extends \Magento\Core\Model\Page\Asset\Collection +class GroupedCollection extends Collection { /**#@+ * Special properties, enforced to be grouped by @@ -39,57 +37,55 @@ class GroupedCollection extends \Magento\Core\Model\Page\Asset\Collection /**#@-*/ /** - * @var \Magento\ObjectManager + * @var \Magento\View\Asset\PropertyGroupFactory */ - private $_objectManager; + protected $propertyFactory; /** - * @var \Magento\Page\Model\Asset\PropertyGroup[] + * @var PropertyGroup[] */ - private $_groups = array(); + protected $groups = array(); /** - * @param \Magento\ObjectManager $objectManager + * @param PropertyGroupFactory $propertyFactory */ - public function __construct(\Magento\ObjectManager $objectManager) + public function __construct(PropertyGroupFactory $propertyFactory) { - $this->_objectManager = $objectManager; + $this->propertyFactory = $propertyFactory; } /** * Add an instance, identified by a unique identifier, to the list and to the corresponding group * * @param string $identifier - * @param \Magento\Core\Model\Page\Asset\AssetInterface $asset + * @param AssetInterface $asset * @param array $properties */ - public function add($identifier, \Magento\Core\Model\Page\Asset\AssetInterface $asset, array $properties = array()) + public function add($identifier, AssetInterface $asset, array $properties = array()) { parent::add($identifier, $asset); $properties[self::PROPERTY_CONTENT_TYPE] = $asset->getContentType(); - $properties[self::PROPERTY_CAN_MERGE] = $asset instanceof \Magento\Core\Model\Page\Asset\MergeableInterface; - $this->_getGroupFor($properties)->add($identifier, $asset); + $properties[self::PROPERTY_CAN_MERGE] = $asset instanceof MergeableInterface; + $this->getGroupFor($properties)->add($identifier, $asset); } /** * Retrieve existing or new group matching the properties * * @param array $properties - * @return \Magento\Page\Model\Asset\PropertyGroup + * @return PropertyGroup */ - private function _getGroupFor(array $properties) + private function getGroupFor(array $properties) { - /** @var $existingGroup \Magento\Page\Model\Asset\PropertyGroup */ - foreach ($this->_groups as $existingGroup) { + /** @var $existingGroup PropertyGroup */ + foreach ($this->groups as $existingGroup) { if ($existingGroup->getProperties() == $properties) { return $existingGroup; } } - /** @var $newGroup \Magento\Page\Model\Asset\PropertyGroup */ - $newGroup = $this->_objectManager->create( - 'Magento\Page\Model\Asset\PropertyGroup', array('properties' => $properties) - ); - $this->_groups[] = $newGroup; + /** @var $newGroup PropertyGroup */ + $newGroup = $this->propertyFactory->create(array('properties' => $properties)); + $this->groups[] = $newGroup; return $newGroup; } @@ -101,8 +97,8 @@ class GroupedCollection extends \Magento\Core\Model\Page\Asset\Collection public function remove($identifier) { parent::remove($identifier); - /** @var $group \Magento\Page\Model\Asset\PropertyGroup */ - foreach ($this->_groups as $group) { + /** @var $group PropertyGroup */ + foreach ($this->groups as $group) { if ($group->has($identifier)) { $group->remove($identifier); return; @@ -113,10 +109,10 @@ class GroupedCollection extends \Magento\Core\Model\Page\Asset\Collection /** * Retrieve groups, containing assets that have the same properties * - * @return \Magento\Page\Model\Asset\PropertyGroup[] + * @return PropertyGroup[] */ public function getGroups() { - return $this->_groups; + return $this->groups; } } diff --git a/app/code/Magento/Core/Model/Page/Asset/LocalInterface.php b/lib/Magento/View/Asset/LocalInterface.php similarity index 90% rename from app/code/Magento/Core/Model/Page/Asset/LocalInterface.php rename to lib/Magento/View/Asset/LocalInterface.php index aa48525f259..7938e3348ed 100644 --- a/app/code/Magento/Core/Model/Page/Asset/LocalInterface.php +++ b/lib/Magento/View/Asset/LocalInterface.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * Interface of an asset with locally accessible source file */ -namespace Magento\Core\Model\Page\Asset; - -interface LocalInterface extends \Magento\Core\Model\Page\Asset\AssetInterface +interface LocalInterface extends AssetInterface { /** * Retrieve source file diff --git a/app/code/Magento/Core/Model/Page/Asset/MergeService.php b/lib/Magento/View/Asset/MergeService.php similarity index 58% rename from app/code/Magento/Core/Model/Page/Asset/MergeService.php rename to lib/Magento/View/Asset/MergeService.php index 8a533ab9e67..db1fa6a1b33 100644 --- a/app/code/Magento/Core/Model/Page/Asset/MergeService.php +++ b/lib/Magento/View/Asset/MergeService.php @@ -22,64 +22,57 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * Service model responsible for making a decision of whether to use the merged asset in place of original ones */ -namespace Magento\Core\Model\Page\Asset; - class MergeService { - /**#@+ - * XPaths where merging configuration resides - */ - const XML_PATH_MERGE_CSS_FILES = 'dev/css/merge_css_files'; - const XML_PATH_MERGE_JS_FILES = 'dev/js/merge_files'; - /**#@-*/ - /** * @var \Magento\ObjectManager */ - private $_objectManager; + protected $objectManager; /** - * @var \Magento\Core\Model\Store\Config + * @var ConfigInterface */ - private $_storeConfig; + protected $config; /** * @var \Magento\Filesystem */ - private $_filesystem; + protected $filesystem; /** * @var \Magento\App\Dir */ - private $_dirs; + protected $dirs; /** * @var \Magento\App\State */ - private $_state; + protected $state; /** * @param \Magento\ObjectManager $objectManager - * @param \Magento\Core\Model\Store\Config $storeConfig + * @param ConfigInterface $config * @param \Magento\Filesystem $filesystem, * @param \Magento\App\Dir $dirs * @param \Magento\App\State $state */ public function __construct( \Magento\ObjectManager $objectManager, - \Magento\Core\Model\Store\Config $storeConfig, + ConfigInterface $config, \Magento\Filesystem $filesystem, \Magento\App\Dir $dirs, \Magento\App\State $state ) { - $this->_objectManager = $objectManager; - $this->_storeConfig = $storeConfig; - $this->_filesystem = $filesystem; - $this->_dirs = $dirs; - $this->_state = $state; + $this->objectManager = $objectManager; + $this->config = $config; + $this->filesystem = $filesystem; + $this->dirs = $dirs; + $this->state = $state; } /** @@ -87,7 +80,7 @@ class MergeService * * @param array $assets * @param string $contentType - * @return array|Iterator + * @return array|\Iterator * @throws \InvalidArgumentException */ public function getMergedAssets(array $assets, $contentType) @@ -98,18 +91,18 @@ class MergeService throw new \InvalidArgumentException("Merge for content type '$contentType' is not supported."); } - $isCssMergeEnabled = $this->_storeConfig->getConfigFlag(self::XML_PATH_MERGE_CSS_FILES); - $isJsMergeEnabled = $this->_storeConfig->getConfigFlag(self::XML_PATH_MERGE_JS_FILES); + $isCssMergeEnabled = $this->config->isMergeCssFiles(); + $isJsMergeEnabled = $this->config->isMergeJsFiles(); if (($isCss && $isCssMergeEnabled) || ($isJs && $isJsMergeEnabled)) { - if ($this->_state->getMode() == \Magento\App\State::MODE_PRODUCTION) { - $mergeStrategyClass = 'Magento\Core\Model\Page\Asset\MergeStrategy\FileExists'; + if ($this->state->getMode() == \Magento\App\State::MODE_PRODUCTION) { + $mergeStrategyClass = 'Magento\View\Asset\MergeStrategy\FileExists'; } else { - $mergeStrategyClass = 'Magento\Core\Model\Page\Asset\MergeStrategy\Checksum'; + $mergeStrategyClass = 'Magento\View\Asset\MergeStrategy\Checksum'; } - $mergeStrategy = $this->_objectManager->get($mergeStrategyClass); + $mergeStrategy = $this->objectManager->get($mergeStrategyClass); - $assets = $this->_objectManager->create( - 'Magento\Core\Model\Page\Asset\Merged', array('assets' => $assets, 'mergeStrategy' => $mergeStrategy) + $assets = $this->objectManager->create( + 'Magento\View\Asset\Merged', array('assets' => $assets, 'mergeStrategy' => $mergeStrategy) ); } @@ -121,11 +114,7 @@ class MergeService */ public function cleanMergedJsCss() { - $mergedDir = $this->_dirs->getDir(\Magento\App\Dir::PUB_VIEW_CACHE) . '/' - . \Magento\Core\Model\Page\Asset\Merged::PUBLIC_MERGE_DIR; - $this->_filesystem->delete($mergedDir); - - $this->_objectManager->get('Magento\Core\Helper\File\Storage\Database') - ->deleteFolder($mergedDir); + $mergedDir = $this->dirs->getDir(\Magento\App\Dir::PUB_VIEW_CACHE) . '/' . Merged::PUBLIC_MERGE_DIR; + $this->filesystem->delete($mergedDir); } } diff --git a/app/code/Magento/Core/Model/Page/Asset/MergeStrategy/Checksum.php b/lib/Magento/View/Asset/MergeStrategy/Checksum.php similarity index 64% rename from app/code/Magento/Core/Model/Page/Asset/MergeStrategy/Checksum.php rename to lib/Magento/View/Asset/MergeStrategy/Checksum.php index 5a2b530de7a..8e2c6fe764b 100644 --- a/app/code/Magento/Core/Model/Page/Asset/MergeStrategy/Checksum.php +++ b/lib/Magento/View/Asset/MergeStrategy/Checksum.php @@ -22,35 +22,34 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset\MergeStrategy; + /** * Merge strategy representing the following: merged file is being recreated if and only if file does not exist * or meta-file does not exist or checksums do not match */ -namespace Magento\Core\Model\Page\Asset\MergeStrategy; - -class Checksum - implements \Magento\Core\Model\Page\Asset\MergeStrategyInterface +class Checksum implements \Magento\View\Asset\MergeStrategyInterface { /** - * @var \Magento\Core\Model\Page\Asset\MergeStrategyInterface + * @var \Magento\View\Asset\MergeStrategyInterface */ - private $_strategy; + protected $strategy; /** * @var \Magento\Filesystem */ - private $_filesystem; + protected $filesystem; /** - * @param \Magento\Core\Model\Page\Asset\MergeStrategyInterface $strategy + * @param \Magento\View\Asset\MergeStrategyInterface $strategy * @param \Magento\Filesystem $filesystem */ public function __construct( - \Magento\Core\Model\Page\Asset\MergeStrategyInterface $strategy, + \Magento\View\Asset\MergeStrategyInterface $strategy, \Magento\Filesystem $filesystem ) { - $this->_strategy = $strategy; - $this->_filesystem = $filesystem; + $this->strategy = $strategy; + $this->filesystem = $filesystem; } /** @@ -63,13 +62,13 @@ class Checksum // Check whether we have already merged these files $filesMTimeData = ''; foreach ($publicFiles as $file) { - $filesMTimeData .= $this->_filesystem->getMTime($file); + $filesMTimeData .= $this->filesystem->getMTime($file); } - if (!($this->_filesystem->has($destinationFile) && $this->_filesystem->has($mergedMTimeFile) - && (strcmp($filesMTimeData, $this->_filesystem->read($mergedMTimeFile)) == 0)) + if (!($this->filesystem->has($destinationFile) && $this->filesystem->has($mergedMTimeFile) + && (strcmp($filesMTimeData, $this->filesystem->read($mergedMTimeFile)) == 0)) ) { - $this->_strategy->mergeFiles($publicFiles, $destinationFile, $contentType); - $this->_filesystem->write($mergedMTimeFile, $filesMTimeData); + $this->strategy->mergeFiles($publicFiles, $destinationFile, $contentType); + $this->filesystem->write($mergedMTimeFile, $filesMTimeData); } } } diff --git a/app/code/Magento/Core/Model/Page/Asset/MergeStrategy/Direct.php b/lib/Magento/View/Asset/MergeStrategy/Direct.php similarity index 78% rename from app/code/Magento/Core/Model/Page/Asset/MergeStrategy/Direct.php rename to lib/Magento/View/Asset/MergeStrategy/Direct.php index e1e7ae00906..cafa4ecadda 100644 --- a/app/code/Magento/Core/Model/Page/Asset/MergeStrategy/Direct.php +++ b/lib/Magento/View/Asset/MergeStrategy/Direct.php @@ -22,27 +22,27 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset\MergeStrategy; + /** * Simple merge strategy - merge anyway */ -namespace Magento\Core\Model\Page\Asset\MergeStrategy; - -class Direct implements \Magento\Core\Model\Page\Asset\MergeStrategyInterface +class Direct implements \Magento\View\Asset\MergeStrategyInterface { /** * @var \Magento\Filesystem */ - private $_filesystem; + protected $filesystem; /** * @var \Magento\App\Dir */ - private $_dirs; + protected $dirs; /** * @var \Magento\View\Url\CssResolver */ - private $_cssUrlResolver; + protected $cssUrlResolver; /** * @param \Magento\Filesystem $filesystem @@ -54,9 +54,9 @@ class Direct implements \Magento\Core\Model\Page\Asset\MergeStrategyInterface \Magento\App\Dir $dirs, \Magento\View\Url\CssResolver $cssUrlResolver ) { - $this->_filesystem = $filesystem; - $this->_dirs = $dirs; - $this->_cssUrlResolver = $cssUrlResolver; + $this->filesystem = $filesystem; + $this->dirs = $dirs; + $this->cssUrlResolver = $cssUrlResolver; } /** @@ -64,10 +64,10 @@ class Direct implements \Magento\Core\Model\Page\Asset\MergeStrategyInterface */ public function mergeFiles(array $publicFiles, $destinationFile, $contentType) { - $mergedContent = $this->_composeMergedContent($publicFiles, $destinationFile, $contentType); + $mergedContent = $this->composeMergedContent($publicFiles, $destinationFile, $contentType); - $this->_filesystem->setIsAllowCreateDirectories(true); - $this->_filesystem->write($destinationFile, $mergedContent); + $this->filesystem->setIsAllowCreateDirectories(true); + $this->filesystem->write($destinationFile, $mergedContent); } /** @@ -79,18 +79,18 @@ class Direct implements \Magento\Core\Model\Page\Asset\MergeStrategyInterface * @return string * @throws \Magento\Exception */ - protected function _composeMergedContent(array $publicFiles, $targetFile, $contentType) + protected function composeMergedContent(array $publicFiles, $targetFile, $contentType) { $result = array(); $isCss = $contentType == \Magento\View\Publisher::CONTENT_TYPE_CSS; foreach ($publicFiles as $file) { - if (!$this->_filesystem->has($file)) { + if (!$this->filesystem->has($file)) { throw new \Magento\Exception("Unable to locate file '{$file}' for merging."); } - $content = $this->_filesystem->read($file); + $content = $this->filesystem->read($file); if ($isCss) { - $content = $this->_cssUrlResolver->replaceCssRelativeUrls($content, $file, $targetFile); + $content = $this->cssUrlResolver->replaceCssRelativeUrls($content, $file, $targetFile); } $result[] = $content; } diff --git a/app/code/Magento/Core/Model/Page/Asset/MergeStrategy/FileExists.php b/lib/Magento/View/Asset/MergeStrategy/FileExists.php similarity index 68% rename from app/code/Magento/Core/Model/Page/Asset/MergeStrategy/FileExists.php rename to lib/Magento/View/Asset/MergeStrategy/FileExists.php index f81470830dc..588543f102a 100644 --- a/app/code/Magento/Core/Model/Page/Asset/MergeStrategy/FileExists.php +++ b/lib/Magento/View/Asset/MergeStrategy/FileExists.php @@ -22,34 +22,33 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset\MergeStrategy; + /** * Merge strategy representing the following: merged file is being recreated if and only if merged file does not exist */ -namespace Magento\Core\Model\Page\Asset\MergeStrategy; - -class FileExists - implements \Magento\Core\Model\Page\Asset\MergeStrategyInterface +class FileExists implements \Magento\View\Asset\MergeStrategyInterface { /** - * @var \Magento\Core\Model\Page\Asset\MergeStrategyInterface + * @var \Magento\View\Asset\MergeStrategyInterface */ - private $_strategy; + protected $strategy; /** * @var \Magento\Filesystem */ - private $_filesystem; + protected $filesystem; /** - * @param \Magento\Core\Model\Page\Asset\MergeStrategyInterface $strategy + * @param \Magento\View\Asset\MergeStrategyInterface $strategy * @param \Magento\Filesystem $filesystem */ public function __construct( - \Magento\Core\Model\Page\Asset\MergeStrategyInterface $strategy, + \Magento\View\Asset\MergeStrategyInterface $strategy, \Magento\Filesystem $filesystem ) { - $this->_strategy = $strategy; - $this->_filesystem = $filesystem; + $this->strategy = $strategy; + $this->filesystem = $filesystem; } /** @@ -57,8 +56,8 @@ class FileExists */ public function mergeFiles(array $publicFiles, $destinationFile, $contentType) { - if (!$this->_filesystem->has($destinationFile)) { - $this->_strategy->mergeFiles($publicFiles, $destinationFile, $contentType); + if (!$this->filesystem->has($destinationFile)) { + $this->strategy->mergeFiles($publicFiles, $destinationFile, $contentType); } } } diff --git a/app/code/Magento/Core/Model/Page/Asset/MergeStrategyInterface.php b/lib/Magento/View/Asset/MergeStrategyInterface.php similarity index 97% rename from app/code/Magento/Core/Model/Page/Asset/MergeStrategyInterface.php rename to lib/Magento/View/Asset/MergeStrategyInterface.php index e6a6f5344c5..c575eeaaaa1 100644 --- a/app/code/Magento/Core/Model/Page/Asset/MergeStrategyInterface.php +++ b/lib/Magento/View/Asset/MergeStrategyInterface.php @@ -22,11 +22,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * Interface for different file merging strategies */ -namespace Magento\Core\Model\Page\Asset; - interface MergeStrategyInterface { /** diff --git a/app/code/Magento/Core/Model/Page/Asset/MergeableInterface.php b/lib/Magento/View/Asset/MergeableInterface.php similarity index 84% rename from app/code/Magento/Core/Model/Page/Asset/MergeableInterface.php rename to lib/Magento/View/Asset/MergeableInterface.php index 4636d3db0f8..ed24409360b 100644 --- a/app/code/Magento/Core/Model/Page/Asset/MergeableInterface.php +++ b/lib/Magento/View/Asset/MergeableInterface.php @@ -18,17 +18,15 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * Interface of an asset that can be merged with other assets */ -namespace Magento\Core\Model\Page\Asset; - -interface MergeableInterface extends \Magento\Core\Model\Page\Asset\LocalInterface +interface MergeableInterface extends LocalInterface { } diff --git a/app/code/Magento/Core/Model/Page/Asset/Merged.php b/lib/Magento/View/Asset/Merged.php similarity index 57% rename from app/code/Magento/Core/Model/Page/Asset/Merged.php rename to lib/Magento/View/Asset/Merged.php index 923dba4dac4..fc048b84ac6 100644 --- a/app/code/Magento/Core/Model/Page/Asset/Merged.php +++ b/lib/Magento/View/Asset/Merged.php @@ -22,11 +22,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * \Iterator that aggregates one or more assets and provides a single public file with equivalent behavior */ -namespace Magento\Core\Model\Page\Asset; - class Merged implements \Iterator { /** @@ -37,40 +37,45 @@ class Merged implements \Iterator /** * @var \Magento\ObjectManager */ - private $_objectManager; + protected $objectManager; /** * @var \Magento\Logger */ - private $_logger; + protected $logger; /** - * @var \Magento\Core\Model\Page\Asset\MergeStrategyInterface + * @var MergeStrategyInterface */ - private $_mergeStrategy; + protected $mergeStrategy; /** - * @var \Magento\Core\Model\Page\Asset\MergeableInterface[] + * @var MergeableInterface[] */ - private $_assets; + protected $assets; /** * @var string */ - private $_contentType; + protected $contentType; + + /** + * @var \Magento\App\Dir + */ + protected $dirs; /** * Whether initialization has been performed or not * * @var bool */ - private $_isInitialized = false; + protected $isInitialized = false; /** * @param \Magento\ObjectManager $objectManager * @param \Magento\Logger $logger * @param \Magento\App\Dir $dirs - * @param \Magento\Core\Model\Page\Asset\MergeStrategyInterface $mergeStrategy + * @param MergeStrategyInterface $mergeStrategy * @param array $assets * @throws \InvalidArgumentException */ @@ -78,46 +83,46 @@ class Merged implements \Iterator \Magento\ObjectManager $objectManager, \Magento\Logger $logger, \Magento\App\Dir $dirs, - \Magento\Core\Model\Page\Asset\MergeStrategyInterface $mergeStrategy, + MergeStrategyInterface $mergeStrategy, array $assets ) { - $this->_objectManager = $objectManager; - $this->_logger = $logger; - $this->_dirs = $dirs; - $this->_mergeStrategy = $mergeStrategy; + $this->objectManager = $objectManager; + $this->logger = $logger; + $this->dirs = $dirs; + $this->mergeStrategy = $mergeStrategy; if (!$assets) { throw new \InvalidArgumentException('At least one asset has to be passed for merging.'); } - /** @var $asset \Magento\Core\Model\Page\Asset\MergeableInterface */ + /** @var $asset MergeableInterface */ foreach ($assets as $asset) { - if (!($asset instanceof \Magento\Core\Model\Page\Asset\MergeableInterface)) { + if (!($asset instanceof MergeableInterface)) { throw new \InvalidArgumentException( - 'Asset has to implement \Magento\Core\Model\Page\Asset\MergeableInterface.' + 'Asset has to implement \Magento\View\Asset\MergeableInterface.' ); } - if (!$this->_contentType) { - $this->_contentType = $asset->getContentType(); - } else if ($asset->getContentType() != $this->_contentType) { + if (!$this->contentType) { + $this->contentType = $asset->getContentType(); + } else if ($asset->getContentType() != $this->contentType) { throw new \InvalidArgumentException( - "Content type '{$asset->getContentType()}' cannot be merged with '{$this->_contentType}'." + "Content type '{$asset->getContentType()}' cannot be merged with '{$this->contentType}'." ); } } - $this->_assets = $assets; + $this->assets = $assets; } /** * Attempt to merge assets, falling back to original non-merged ones, if merging fails */ - protected function _initialize() + protected function initialize() { - if (!$this->_isInitialized) { - $this->_isInitialized = true; + if (!$this->isInitialized) { + $this->isInitialized = true; try { - $this->_assets = array($this->_getMergedAsset($this->_assets)); + $this->assets = array($this->getMergedAsset($this->assets)); } catch (\Exception $e) { - $this->_logger->logException($e); + $this->logger->logException($e); } } } @@ -125,18 +130,18 @@ class Merged implements \Iterator /** * Retrieve asset instance representing a merged file * - * @param \Magento\Core\Model\Page\Asset\MergeableInterface[] $assets - * @return \Magento\Core\Model\Page\Asset\AssetInterface + * @param MergeableInterface[] $assets + * @return AssetInterface */ - protected function _getMergedAsset(array $assets) + protected function getMergedAsset(array $assets) { - $sourceFiles = $this->_getPublicFilesToMerge($assets); - $destinationFile = $this->_getMergedFilePath($sourceFiles); + $sourceFiles = $this->getPublicFilesToMerge($assets); + $destinationFile = $this->getMergedFilePath($sourceFiles); - $this->_mergeStrategy->mergeFiles($sourceFiles, $destinationFile, $this->_contentType); - return $this->_objectManager->create('Magento\Core\Model\Page\Asset\PublicFile', array( + $this->mergeStrategy->mergeFiles($sourceFiles, $destinationFile, $this->contentType); + return $this->objectManager->create('Magento\View\Asset\PublicFile', array( 'file' => $destinationFile, - 'contentType' => $this->_contentType, + 'contentType' => $this->contentType, )); } @@ -144,10 +149,10 @@ class Merged implements \Iterator * Go through all the files to merge, ensure that they are public (publish if needed), and compose * array of public paths to merge * - * @param \Magento\Core\Model\Page\Asset\MergeableInterface[] $assets + * @param MergeableInterface[] $assets * @return array */ - protected function _getPublicFilesToMerge(array $assets) + protected function getPublicFilesToMerge(array $assets) { $result = array(); foreach ($assets as $asset) { @@ -163,10 +168,10 @@ class Merged implements \Iterator * @param array $publicFiles * @return string */ - protected function _getMergedFilePath(array $publicFiles) + protected function getMergedFilePath(array $publicFiles) { - $jsDir = \Magento\Filesystem::fixSeparator($this->_dirs->getDir(\Magento\App\Dir::PUB_LIB)); - $publicDir = \Magento\Filesystem::fixSeparator($this->_dirs->getDir(\Magento\App\Dir::STATIC_VIEW)); + $jsDir = \Magento\Filesystem::fixSeparator($this->dirs->getDir(\Magento\App\Dir::PUB_LIB)); + $publicDir = \Magento\Filesystem::fixSeparator($this->dirs->getDir(\Magento\App\Dir::STATIC_VIEW)); $prefixRemovals = array($jsDir, $publicDir); $relFileNames = array(); @@ -175,20 +180,20 @@ class Merged implements \Iterator $relFileNames[] = str_replace($prefixRemovals, '', $file); } - $mergedDir = $this->_dirs->getDir(\Magento\App\Dir::PUB_VIEW_CACHE) . '/' + $mergedDir = $this->dirs->getDir(\Magento\App\Dir::PUB_VIEW_CACHE) . '/' . self::PUBLIC_MERGE_DIR; - return $mergedDir . '/' . md5(implode('|', $relFileNames)) . '.' . $this->_contentType; + return $mergedDir . '/' . md5(implode('|', $relFileNames)) . '.' . $this->contentType; } /** * {@inheritdoc} * - * @return \Magento\Core\Model\Page\Asset\AssetInterface + * @return AssetInterface */ public function current() { - $this->_initialize(); - return current($this->_assets); + $this->initialize(); + return current($this->assets); } /** @@ -196,8 +201,8 @@ class Merged implements \Iterator */ public function key() { - $this->_initialize(); - return key($this->_assets); + $this->initialize(); + return key($this->assets); } /** @@ -205,8 +210,8 @@ class Merged implements \Iterator */ public function next() { - $this->_initialize(); - next($this->_assets); + $this->initialize(); + next($this->assets); } /** @@ -214,8 +219,8 @@ class Merged implements \Iterator */ public function rewind() { - $this->_initialize(); - reset($this->_assets); + $this->initialize(); + reset($this->assets); } /** @@ -223,7 +228,7 @@ class Merged implements \Iterator */ public function valid() { - $this->_initialize(); - return (bool)current($this->_assets); + $this->initialize(); + return (bool)current($this->assets); } } diff --git a/app/code/Magento/Core/Model/Page/Asset/Minified.php b/lib/Magento/View/Asset/Minified.php similarity index 58% rename from app/code/Magento/Core/Model/Page/Asset/Minified.php rename to lib/Magento/View/Asset/Minified.php index 74ec58aa2d7..0acef553c6c 100644 --- a/app/code/Magento/Core/Model/Page/Asset/Minified.php +++ b/lib/Magento/View/Asset/Minified.php @@ -22,60 +22,60 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * Minified page asset */ -namespace Magento\Core\Model\Page\Asset; - -class Minified implements \Magento\Core\Model\Page\Asset\MergeableInterface +class Minified implements MergeableInterface { /** - * @var \Magento\Core\Model\Page\Asset\LocalInterface + * @var LocalInterface */ - protected $_originalAsset; + protected $originalAsset; /** * @var \Magento\Code\Minifier */ - protected $_minifier; + protected $minifier; /** * @var string */ - protected $_file; + protected $file; /** * @var string */ - protected $_url; + protected $url; /** * @var \Magento\View\Url */ - protected $_viewUrl; + protected $viewUrl; /** * @var \Magento\Logger */ - protected $_logger; + protected $logger; /** - * @param \Magento\Core\Model\Page\Asset\LocalInterface $asset + * @param LocalInterface $asset * @param \Magento\Code\Minifier $minifier * @param \Magento\View\Url $viewUrl * @param \Magento\Logger $logger */ public function __construct( - \Magento\Core\Model\Page\Asset\LocalInterface $asset, + LocalInterface $asset, \Magento\Code\Minifier $minifier, \Magento\View\Url $viewUrl, \Magento\Logger $logger ) { - $this->_originalAsset = $asset; - $this->_minifier = $minifier; - $this->_viewUrl = $viewUrl; - $this->_logger = $logger; + $this->originalAsset = $asset; + $this->minifier = $minifier; + $this->viewUrl = $viewUrl; + $this->logger = $logger; } /** @@ -83,10 +83,10 @@ class Minified implements \Magento\Core\Model\Page\Asset\MergeableInterface */ public function getUrl() { - if (empty($this->_url)) { - $this->_process(); + if (empty($this->url)) { + $this->process(); } - return $this->_url; + return $this->url; } /** @@ -94,7 +94,7 @@ class Minified implements \Magento\Core\Model\Page\Asset\MergeableInterface */ public function getContentType() { - return $this->_originalAsset->getContentType(); + return $this->originalAsset->getContentType(); } /** @@ -102,29 +102,29 @@ class Minified implements \Magento\Core\Model\Page\Asset\MergeableInterface */ public function getSourceFile() { - if (empty($this->_file)) { - $this->_process(); + if (empty($this->file)) { + $this->process(); } - return $this->_file; + return $this->file; } /** * Minify content of child asset */ - protected function _process() + protected function process() { - $originalFile = $this->_originalAsset->getSourceFile(); + $originalFile = $this->originalAsset->getSourceFile(); try { - $this->_file = $this->_minifier->getMinifiedFile($originalFile); + $this->file = $this->minifier->getMinifiedFile($originalFile); } catch (\Exception $e) { - $this->_logger->logException(new \Magento\Exception('Could not minify file: ' . $originalFile, 0, $e)); - $this->_file = $originalFile; + $this->logger->logException(new \Magento\Exception('Could not minify file: ' . $originalFile, 0, $e)); + $this->file = $originalFile; } - if ($this->_file == $originalFile) { - $this->_url = $this->_originalAsset->getUrl(); + if ($this->file == $originalFile) { + $this->url = $this->originalAsset->getUrl(); } else { - $this->_url = $this->_viewUrl->getPublicFileUrl($this->_file); + $this->url = $this->viewUrl->getPublicFileUrl($this->file); } } } diff --git a/app/code/Magento/Core/Model/Page/Asset/MinifyService.php b/lib/Magento/View/Asset/MinifyService.php similarity index 60% rename from app/code/Magento/Core/Model/Page/Asset/MinifyService.php rename to lib/Magento/View/Asset/MinifyService.php index 40843490f03..7f55750bec3 100644 --- a/app/code/Magento/Core/Model/Page/Asset/MinifyService.php +++ b/lib/Magento/View/Asset/MinifyService.php @@ -22,11 +22,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * Service model responsible for configuration of minified asset */ -namespace Magento\Core\Model\Page\Asset; - class MinifyService { /**#@+ @@ -37,71 +37,71 @@ class MinifyService /**#@-*/ /** - * @var \Magento\Core\Model\Store\Config + * @var ConfigInterface */ - protected $_storeConfig; + protected $config; /** * @var \Magento\ObjectManager */ - protected $_objectManager; + protected $objectManager; /** * @var array */ - protected $_enabled = array(); + protected $enabled = array(); /** * @var \Magento\Code\Minifier[] */ - protected $_minifiers = array(); + protected $minifiers = array(); /** * @var \Magento\App\Dir */ - protected $_dirs; + protected $dirs; /** * @var \Magento\App\State */ - protected $_appState; + protected $appState; /** - * @param \Magento\Core\Model\Store\Config $config + * @param ConfigInterface $config * @param \Magento\ObjectManager $objectManager * @param \Magento\App\Dir $dirs * @param \Magento\App\State $appState */ public function __construct( - \Magento\Core\Model\Store\Config $config, + ConfigInterface $config, \Magento\ObjectManager $objectManager, \Magento\App\Dir $dirs, \Magento\App\State $appState ) { - $this->_storeConfig = $config; - $this->_objectManager = $objectManager; - $this->_dirs = $dirs; - $this->_appState = $appState; + $this->config = $config; + $this->objectManager = $objectManager; + $this->dirs = $dirs; + $this->appState = $appState; } /** * Get filtered assets * Assets applicable for minification are wrapped with the minified asset * - * @param array|Iterator $assets + * @param array|\Iterator $assets * @return array */ public function getAssets($assets) { $resultAssets = array(); - /** @var $asset \Magento\Core\Model\Page\Asset\AssetInterface */ + /** @var $asset AssetInterface */ foreach ($assets as $asset) { $contentType = $asset->getContentType(); - if ($this->_isEnabled($contentType)) { - $asset = $this->_objectManager - ->create('Magento\Core\Model\Page\Asset\Minified', array( + if ($this->isEnabled($contentType)) { + $asset = $this->objectManager + ->create('Magento\View\Asset\Minified', array( 'asset' => $asset, - 'minifier' => $this->_getMinifier($contentType) + 'minifier' => $this->getMinifier($contentType) )); } $resultAssets[] = $asset; @@ -115,30 +115,30 @@ class MinifyService * @param string $contentType * @return \Magento\Code\Minifier */ - protected function _getMinifier($contentType) + protected function getMinifier($contentType) { - if (!isset($this->_minifiers[$contentType])) { - $adapter = $this->_getAdapter($contentType); + if (!isset($this->minifiers[$contentType])) { + $adapter = $this->getAdapter($contentType); $strategyParams = array( 'adapter' => $adapter, ); - switch ($this->_appState->getMode()) { + switch ($this->appState->getMode()) { case \Magento\App\State::MODE_PRODUCTION: - $strategy = $this->_objectManager->create('Magento\Code\Minifier\Strategy\Lite', $strategyParams); + $strategy = $this->objectManager->create('Magento\Code\Minifier\Strategy\Lite', $strategyParams); break; default: - $strategy = $this->_objectManager + $strategy = $this->objectManager ->create('Magento\Code\Minifier\Strategy\Generate', $strategyParams); } - $this->_minifiers[$contentType] = $this->_objectManager->create('Magento\Code\Minifier', + $this->minifiers[$contentType] = $this->objectManager->create('Magento\Code\Minifier', array( 'strategy' => $strategy, - 'baseDir' => $this->_dirs->getDir(\Magento\App\Dir::PUB_VIEW_CACHE) . '/minify', + 'baseDir' => $this->dirs->getDir(\Magento\App\Dir::PUB_VIEW_CACHE) . '/minify', ) ); } - return $this->_minifiers[$contentType]; + return $this->minifiers[$contentType]; } /** @@ -147,14 +147,12 @@ class MinifyService * @param $contentType * @return bool */ - protected function _isEnabled($contentType) + protected function isEnabled($contentType) { - if (!isset($this->_enabled[$contentType])) { - $this->_enabled[$contentType] = $this->_storeConfig->getConfigFlag( - sprintf(self::XML_PATH_MINIFICATION_ENABLED, $contentType) - ); + if (!isset($this->enabled[$contentType])) { + $this->enabled[$contentType] = $this->config->isAssetMinification($contentType); } - return $this->_enabled[$contentType]; + return $this->enabled[$contentType]; } /** @@ -162,20 +160,18 @@ class MinifyService * * @param $contentType * @return mixed - * @throws \Magento\Core\Exception + * @throws \Magento\Exception */ - protected function _getAdapter($contentType) + protected function getAdapter($contentType) { - $adapterClass = $this->_storeConfig->getConfig( - sprintf(self::XML_PATH_MINIFICATION_ADAPTER, $contentType) - ); + $adapterClass = $this->config->getAssetMinificationAdapter($contentType); if (!$adapterClass) { - throw new \Magento\Core\Exception( + throw new \Magento\Exception( "Minification adapter is not specified for '$contentType' content type" ); } - $adapter = $this->_objectManager->create($adapterClass); + $adapter = $this->objectManager->create($adapterClass); return $adapter; } } diff --git a/app/code/Magento/Page/Model/Asset/PropertyGroup.php b/lib/Magento/View/Asset/PropertyGroup.php similarity index 80% rename from app/code/Magento/Page/Model/Asset/PropertyGroup.php rename to lib/Magento/View/Asset/PropertyGroup.php index 1d61cc0f7ac..4bddb4451eb 100644 --- a/app/code/Magento/Page/Model/Asset/PropertyGroup.php +++ b/lib/Magento/View/Asset/PropertyGroup.php @@ -18,30 +18,28 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * Association of arbitrary properties with a list of page assets */ -namespace Magento\Page\Model\Asset; - -class PropertyGroup extends \Magento\Core\Model\Page\Asset\Collection +class PropertyGroup extends Collection { /** * @var array */ - private $_properties = array(); + protected $properties = array(); /** * @param array $properties */ public function __construct(array $properties) { - $this->_properties = $properties; + $this->properties = $properties; } /** @@ -51,7 +49,7 @@ class PropertyGroup extends \Magento\Core\Model\Page\Asset\Collection */ public function getProperties() { - return $this->_properties; + return $this->properties; } /** @@ -62,6 +60,6 @@ class PropertyGroup extends \Magento\Core\Model\Page\Asset\Collection */ public function getProperty($name) { - return isset($this->_properties[$name]) ? $this->_properties[$name] : null; + return isset($this->properties[$name]) ? $this->properties[$name] : null; } } diff --git a/app/code/Magento/Page/Block/Html/Welcome.php b/lib/Magento/View/Asset/PropertyGroupFactory.php similarity index 61% rename from app/code/Magento/Page/Block/Html/Welcome.php rename to lib/Magento/View/Asset/PropertyGroupFactory.php index d743579ae4e..c130506fcdd 100644 --- a/app/code/Magento/Page/Block/Html/Welcome.php +++ b/lib/Magento/View/Asset/PropertyGroupFactory.php @@ -18,39 +18,40 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Html; +namespace Magento\View\Asset; /** - * Html page block + * Property group factory */ -class Welcome extends \Magento\View\Block\Template +class PropertyGroupFactory { /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param array $data + * Object Manager instance + * + * @var \Magento\ObjectManager */ - public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - array $data = array() - ) { - parent::__construct($context, $coreData, $data); + protected $objectManager; + + /** + * @param \Magento\ObjectManager $objectManager + */ + public function __construct(\Magento\ObjectManager $objectManager) + { + $this->objectManager = $objectManager; } /** - * Get block message + * Create class instance with specified parameters * - * @return string + * @param array $data + * @return Collection */ - protected function _toHtml() + public function create(array $data = array()) { - return $this->_layout->getBlock('header')->getWelcome(); + return $this->objectManager->create('Magento\View\Asset\PropertyGroup', $data); } } diff --git a/app/code/Magento/Core/Model/Page/Asset/PublicFile.php b/lib/Magento/View/Asset/PublicFile.php similarity index 76% rename from app/code/Magento/Core/Model/Page/Asset/PublicFile.php rename to lib/Magento/View/Asset/PublicFile.php index 5ecf6500c67..d1ccef09ee5 100644 --- a/app/code/Magento/Core/Model/Page/Asset/PublicFile.php +++ b/lib/Magento/View/Asset/PublicFile.php @@ -18,33 +18,31 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * Page asset representing a local file that already has public access */ -namespace Magento\Core\Model\Page\Asset; - -class PublicFile implements \Magento\Core\Model\Page\Asset\LocalInterface +class PublicFile implements LocalInterface { /** * @var \Magento\View\Url */ - protected $_viewUrl; + protected $viewUrl; /** * @var string */ - private $_file; + protected $file; /** * @var string */ - private $_contentType; + protected $contentType; /** * @param \Magento\View\Url $viewUrl @@ -53,9 +51,9 @@ class PublicFile implements \Magento\Core\Model\Page\Asset\LocalInterface */ public function __construct(\Magento\View\Url $viewUrl, $file, $contentType) { - $this->_viewUrl = $viewUrl; - $this->_file = $file; - $this->_contentType = $contentType; + $this->viewUrl = $viewUrl; + $this->file = $file; + $this->contentType = $contentType; } /** @@ -63,7 +61,7 @@ class PublicFile implements \Magento\Core\Model\Page\Asset\LocalInterface */ public function getUrl() { - return $this->_viewUrl->getPublicFileUrl($this->_file); + return $this->viewUrl->getPublicFileUrl($this->file); } /** @@ -71,7 +69,7 @@ class PublicFile implements \Magento\Core\Model\Page\Asset\LocalInterface */ public function getContentType() { - return $this->_contentType; + return $this->contentType; } /** @@ -79,6 +77,6 @@ class PublicFile implements \Magento\Core\Model\Page\Asset\LocalInterface */ public function getSourceFile() { - return $this->_file; + return $this->file; } } diff --git a/app/code/Magento/Core/Model/Page/Asset/Remote.php b/lib/Magento/View/Asset/Remote.php similarity index 79% rename from app/code/Magento/Core/Model/Page/Asset/Remote.php rename to lib/Magento/View/Asset/Remote.php index 3f151a6ff0d..b38f493c9b1 100644 --- a/app/code/Magento/Core/Model/Page/Asset/Remote.php +++ b/lib/Magento/View/Asset/Remote.php @@ -18,28 +18,26 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * Page asset residing outside of the local file system */ -namespace Magento\Core\Model\Page\Asset; - -class Remote implements \Magento\Core\Model\Page\Asset\AssetInterface +class Remote implements AssetInterface { /** * @var string */ - private $_url; + protected $url; /** * @var string */ - private $_contentType; + protected $contentType; /** * @param string $url @@ -47,8 +45,8 @@ class Remote implements \Magento\Core\Model\Page\Asset\AssetInterface */ public function __construct($url, $contentType = 'unknown') { - $this->_url = $url; - $this->_contentType = $contentType; + $this->url = $url; + $this->contentType = $contentType; } /** @@ -56,7 +54,7 @@ class Remote implements \Magento\Core\Model\Page\Asset\AssetInterface */ public function getUrl() { - return $this->_url; + return $this->url; } /** @@ -64,6 +62,6 @@ class Remote implements \Magento\Core\Model\Page\Asset\AssetInterface */ public function getContentType() { - return $this->_contentType; + return $this->contentType; } } diff --git a/app/code/Magento/Core/Model/Page/Asset/ViewFile.php b/lib/Magento/View/Asset/ViewFile.php similarity index 77% rename from app/code/Magento/Core/Model/Page/Asset/ViewFile.php rename to lib/Magento/View/Asset/ViewFile.php index 1b57e71a3ff..faaeeac5a4c 100644 --- a/app/code/Magento/Core/Model/Page/Asset/ViewFile.php +++ b/lib/Magento/View/Asset/ViewFile.php @@ -18,33 +18,31 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Core * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Asset; + /** * Page asset representing a view file */ -namespace Magento\Core\Model\Page\Asset; - -class ViewFile implements \Magento\Core\Model\Page\Asset\MergeableInterface +class ViewFile implements MergeableInterface { /** * @var \Magento\View\Url */ - protected $_viewUrl; + protected $viewUrl; /** * @var string */ - private $_file; + protected $file; /** * @var string */ - private $_contentType; + protected $contentType; /** * @param \Magento\View\Url $viewUrl @@ -60,9 +58,9 @@ class ViewFile implements \Magento\Core\Model\Page\Asset\MergeableInterface if (empty($file)) { throw new \InvalidArgumentException("Parameter 'file' must not be empty"); } - $this->_viewUrl = $viewUrl; - $this->_file = $file; - $this->_contentType = $contentType; + $this->viewUrl = $viewUrl; + $this->file = $file; + $this->contentType = $contentType; } /** @@ -70,7 +68,7 @@ class ViewFile implements \Magento\Core\Model\Page\Asset\MergeableInterface */ public function getUrl() { - return $this->_viewUrl->getViewFileUrl($this->_file); + return $this->viewUrl->getViewFileUrl($this->file); } /** @@ -78,7 +76,7 @@ class ViewFile implements \Magento\Core\Model\Page\Asset\MergeableInterface */ public function getContentType() { - return $this->_contentType; + return $this->contentType; } /** @@ -86,6 +84,6 @@ class ViewFile implements \Magento\Core\Model\Page\Asset\MergeableInterface */ public function getSourceFile() { - return $this->_viewUrl->getViewFilePublicPath($this->_file); + return $this->viewUrl->getViewFilePublicPath($this->file); } } diff --git a/lib/Magento/View/Block/AbstractBlock.php b/lib/Magento/View/Element/AbstractBlock.php similarity index 83% rename from lib/Magento/View/Block/AbstractBlock.php rename to lib/Magento/View/Element/AbstractBlock.php index 0de570a0db5..c46a29d800b 100644 --- a/lib/Magento/View/Block/AbstractBlock.php +++ b/lib/Magento/View/Element/AbstractBlock.php @@ -22,9 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block; - -use Magento\View\Element\BlockInterface; +namespace Magento\View\Element; /** * Base Content Block class @@ -39,6 +37,11 @@ use Magento\View\Element\BlockInterface; */ abstract class AbstractBlock extends \Magento\Object implements BlockInterface { + /** + * Cache group Tag + */ + const CACHE_GROUP = \Magento\App\Cache\Type\Block::TYPE_IDENTIFIER; + /** * @var \Magento\View\DesignInterface */ @@ -50,14 +53,15 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface protected $_session; /** - * @var \Magento\TranslateInterface + * @var \Magento\Session\SidResolverInterface */ - protected $_translator; + protected $_sidResolver; /** - * Cache group Tag + * @var \Magento\TranslateInterface */ - const CACHE_GROUP = \Magento\App\Cache\Type\Block::TYPE_IDENTIFIER; + protected $_translator; + /** * Block name in layout * @@ -77,27 +81,6 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface */ protected $_request; - /** - * Messages block instance - * - * @var \Magento\View\Block\Messages - */ - protected $_messagesBlock; - - /** - * Block html frame open tag - * - * @var string - */ - protected $_frameOpenTag; - - /** - * Block html frame close tag - * - * @var string - */ - protected $_frameCloseTag; - /** * Url Builder * @@ -168,10 +151,10 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface protected $_locale; /** - * @param \Magento\View\Block\Context $context + * @param \Magento\View\Element\Context $context * @param array $data */ - public function __construct(\Magento\View\Block\Context $context, array $data = array()) + public function __construct(\Magento\View\Element\Context $context, array $data = array()) { $this->_request = $context->getRequest(); $this->_layout = $context->getLayout(); @@ -181,6 +164,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface $this->_cache = $context->getCache(); $this->_design = $context->getDesignPackage(); $this->_session = $context->getSession(); + $this->_sidResolver = $context->getSidResolver(); $this->_storeConfig = $context->getStoreConfig(); $this->_frontController = $context->getFrontController(); $this->_helperFactory = $context->getHelperFactory(); @@ -219,7 +203,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface /** * Retrieve parent block * - * @return \Magento\View\Block\AbstractBlock|bool + * @return \Magento\View\Element\AbstractBlock|bool */ public function getParentBlock() { @@ -238,14 +222,12 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * Set layout object * * @param \Magento\View\LayoutInterface $layout - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function setLayout(\Magento\View\LayoutInterface $layout) { $this->_layout = $layout; - $this->_eventManager->dispatch('core_block_abstract_prepare_layout_before', array('block' => $this)); $this->_prepareLayout(); - $this->_eventManager->dispatch('core_block_abstract_prepare_layout_after', array('block' => $this)); return $this; } @@ -254,7 +236,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * * You can redefine this method in child classes for changing layout * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _prepareLayout() { @@ -275,7 +257,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * Sets/changes name of a block in layout * * @param string $name - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function setNameInLayout($name) { @@ -311,7 +293,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * * @param string $name * @param mixed $value - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function setAttribute($name, $value = null) { @@ -322,8 +304,8 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * Set child block * * @param string $alias - * @param \Magento\View\Block\AbstractBlock|string $block - * @return \Magento\View\Block\AbstractBlock + * @param \Magento\View\Element\AbstractBlock|string $block + * @return \Magento\View\Element\AbstractBlock */ public function setChild($alias, $block) { @@ -350,7 +332,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * @param string $alias * @param string $block * @param array $data - * @return \Magento\View\Block\AbstractBlock new block + * @return \Magento\View\Element\AbstractBlock new block */ public function addChild($alias, $block, $data = array()) { @@ -365,7 +347,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * Unset child block * * @param string $alias - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function unsetChild($alias) { @@ -394,7 +376,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * @param string $callback * @param mixed $result * @param array $params - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function unsetCallChild($alias, $callback, $result, $params) { @@ -418,7 +400,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface /** * Unset all children blocks * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function unsetChildren() { @@ -438,7 +420,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * Retrieve child block by name * * @param string $alias - * @return \Magento\View\Block\AbstractBlock|bool + * @return \Magento\View\Element\AbstractBlock|bool */ public function getChildBlock($alias) { @@ -532,11 +514,11 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * * By default inserts as first element into children list * - * @param \Magento\View\Block\AbstractBlock|string $element + * @param \Magento\View\Element\AbstractBlock|string $element * @param string|int|null $siblingName * @param bool $after * @param string $alias - * @return \Magento\View\Block\AbstractBlock|bool + * @return \Magento\View\Element\AbstractBlock|bool */ public function insert($element, $siblingName = 0, $after = true, $alias = '') { @@ -544,7 +526,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface if (!$layout) { return false; } - if ($element instanceof \Magento\View\Block\AbstractBlock) { + if ($element instanceof \Magento\View\Element\AbstractBlock) { $elementName = $element->getNameInLayout(); } else { $elementName = $element; @@ -557,9 +539,9 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface /** * Append element to the end of children list * - * @param \Magento\View\Block\AbstractBlock|string $element + * @param \Magento\View\Element\AbstractBlock|string $element * @param string $alias - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ public function append($element, $alias = '') { @@ -600,31 +582,13 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface /** * Before rendering html, but after trying to load cache * - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _beforeToHtml() { return $this; } - /** - * Specify block output frame tags - * - * @param $openTag - * @param $closeTag - * @return \Magento\View\Block\AbstractBlock - */ - public function setFrameTags($openTag, $closeTag = null) - { - $this->_frameOpenTag = $openTag; - if ($closeTag) { - $this->_frameCloseTag = $closeTag; - } else { - $this->_frameCloseTag = '/' . $openTag; - } - return $this; - } - /** * Produce and return block's html output * @@ -634,10 +598,11 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface */ public function toHtml() { - $this->_eventManager->dispatch('core_block_abstract_to_html_before', array('block' => $this)); + $this->_eventManager->dispatch('view_block_abstract_to_html_before', array('block' => $this)); if ($this->_storeConfig->getConfig('advanced/modules_disable_output/' . $this->getModuleName())) { return ''; } + $html = $this->_loadCache(); if ($html === false) { if ($this->hasData('translate_inline')) { @@ -654,13 +619,6 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface } $html = $this->_afterToHtml($html); - /** - * Check framing options - */ - if ($this->_frameOpenTag) { - $html = '<' . $this->_frameOpenTag . '>' . $html . '<' . $this->_frameCloseTag . '>'; - } - return $html; } @@ -724,30 +682,6 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface return $this->_urlBuilder->getUrl($route, $params); } - /** - * Generate base64-encoded url by route and parameters - * - * @param string $route - * @param array $params - * @return string - */ - public function getUrlBase64($route = '', $params = array()) - { - return $this->helper('Magento\Core\Helper\Data')->urlEncode($this->getUrl($route, $params)); - } - - /** - * Generate url-encoded url by route and parameters - * - * @param string $route - * @param array $params - * @return string - */ - public function getUrlEncoded($route = '', $params = array()) - { - return $this->helper('Magento\Core\Helper\Data')->urlEncode($this->getUrl($route, $params)); - } - /** * Retrieve url of themes file * @@ -779,31 +713,6 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface return $this->getUrl($route, $params); } - /** - * Retrieve messages block - * - * @return \Magento\View\Block\Messages - */ - public function getMessagesBlock() - { - if (is_null($this->_messagesBlock)) { - return $this->getLayout()->getMessagesBlock(); - } - return $this->_messagesBlock; - } - - /** - * Set messages block - * - * @param \Magento\View\Block\Messages $block - * @return \Magento\View\Block\AbstractBlock - */ - public function setMessagesBlock(\Magento\View\Block\Messages $block) - { - $this->_messagesBlock = $block; - return $this; - } - /** * Return helper object * @@ -943,36 +852,6 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface return $this->_nameInLayout; } - /** - * Prepare url for save to cache - * - * @return \Magento\View\Block\AbstractBlock - */ - protected function _beforeCacheUrl() - { - if ($this->_cacheState->isEnabled(self::CACHE_GROUP)) { - $this->_app->setUseSessionVar(true); - } - return $this; - } - - /** - * Replace URLs from cache - * - * @param string $html - * @return string - */ - protected function _afterCacheUrl($html) - { - if ($this->_cacheState->isEnabled(self::CACHE_GROUP)) { - $this->_app->setUseSessionVar(false); - \Magento\Profiler::start('CACHE_URL'); - $html = $this->_urlBuilder->sessionUrlVar($html); - \Magento\Profiler::stop('CACHE_URL'); - } - return $html; - } - /** * Get cache key informative items * @@ -1014,7 +893,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * * @return array */ - public function getCacheTags() + protected function getCacheTags() { if (!$this->hasData('cache_tags')) { $tags = array(); @@ -1030,7 +909,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * * @return int */ - public function getCacheLifetime() + protected function getCacheLifetime() { if (!$this->hasData('cache_lifetime')) { return null; @@ -1053,7 +932,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface if ($cacheData) { $cacheData = str_replace( $this->_getSidPlaceholder($cacheKey), - $this->_session->getSessionIdQueryParam() . '=' . $this->_session->getEncryptedSessionId(), + $this->_sidResolver->getSessionIdQueryParam($this->_session) . '=' . $this->_session->getSessionId(), $cacheData ); } @@ -1064,7 +943,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface * Save block content to cache storage * * @param string $data - * @return \Magento\View\Block\AbstractBlock + * @return \Magento\View\Element\AbstractBlock */ protected function _saveCache($data) { @@ -1073,7 +952,7 @@ abstract class AbstractBlock extends \Magento\Object implements BlockInterface } $cacheKey = $this->getCacheKey(); $data = str_replace( - $this->_session->getSessionIdQueryParam() . '=' . $this->_session->getEncryptedSessionId(), + $this->_sidResolver->getSessionIdQueryParam($this->_session) . '=' . $this->_session->getSessionId(), $this->_getSidPlaceholder($cacheKey), $data ); diff --git a/lib/Magento/View/Block/Context.php b/lib/Magento/View/Element/Context.php similarity index 94% rename from lib/Magento/View/Block/Context.php rename to lib/Magento/View/Element/Context.php index f2a88da0db7..2329eacdf69 100644 --- a/lib/Magento/View/Block/Context.php +++ b/lib/Magento/View/Element/Context.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block; +namespace Magento\View\Element; /** * Abstract block context object @@ -75,6 +75,11 @@ class Context implements \Magento\ObjectManager\ContextInterface */ protected $_session; + /** + * @var \Magento\Session\SidResolverInterface + */ + protected $_sidResolver; + /** * @var \Magento\Core\Model\Store\Config */ @@ -141,6 +146,7 @@ class Context implements \Magento\ObjectManager\ContextInterface * @param \Magento\App\CacheInterface $cache * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Session\AbstractSession $session + * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\App\FrontController $frontController * @param \Magento\App\Helper\HelperFactory $helperFactory @@ -166,6 +172,7 @@ class Context implements \Magento\ObjectManager\ContextInterface \Magento\App\CacheInterface $cache, \Magento\View\DesignInterface $design, \Magento\Core\Model\Session\AbstractSession $session, + \Magento\Session\SidResolverInterface $sidResolver, \Magento\Core\Model\Store\Config $storeConfig, \Magento\App\FrontController $frontController, \Magento\App\Helper\HelperFactory $helperFactory, @@ -187,6 +194,7 @@ class Context implements \Magento\ObjectManager\ContextInterface $this->_cache = $cache; $this->_design = $design; $this->_session = $session; + $this->_sidResolver = $sidResolver; $this->_storeConfig = $storeConfig; $this->_frontController = $frontController; $this->_helperFactory = $helperFactory; @@ -264,6 +272,14 @@ class Context implements \Magento\ObjectManager\ContextInterface return $this->_session; } + /** + * @return \Magento\Session\SidResolverInterface + */ + public function getSidResolver() + { + return $this->_sidResolver; + } + /** * @return \Magento\Core\Model\Store\Config */ diff --git a/lib/Magento/View/Block/Html/Calendar.php b/lib/Magento/View/Element/Html/Calendar.php similarity index 65% rename from lib/Magento/View/Block/Html/Calendar.php rename to lib/Magento/View/Element/Html/Calendar.php index 12aaaa9f833..1ff7c3df3e0 100644 --- a/lib/Magento/View/Block/Html/Calendar.php +++ b/lib/Magento/View/Element/Html/Calendar.php @@ -22,14 +22,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block\Html; +namespace Magento\View\Element\Html; /** * Calendar block for page header * * Prepares localization data for calendar */ -class Calendar extends \Magento\View\Block\Template +class Calendar extends \Magento\View\Element\Template { /** * Date model @@ -39,19 +39,25 @@ class Calendar extends \Magento\View\Block\Template protected $_date; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @var \Magento\Json\EncoderInterface + */ + protected $encoder; + + /** + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Core\Model\Date $date + * @param \Magento\Json\EncoderInterface $encoder * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\Core\Model\Date $date, + \Magento\Json\EncoderInterface $encoder, array $data = array() ) { $this->_date = $date; - parent::__construct($context, $coreData, $data); + $this->encoder = $encoder; + parent::__construct($context, $data); } /** @@ -65,41 +71,42 @@ class Calendar extends \Magento\View\Block\Template // get days names $days = \Zend_Locale_Data::getList($localeCode, 'days'); - $helper = $this->_coreData; $this->assign('days', array( - 'wide' => $helper->jsonEncode(array_values($days['format']['wide'])), - 'abbreviated' => $helper->jsonEncode(array_values($days['format']['abbreviated'])) + 'wide' => $this->encoder->encode(array_values($days['format']['wide'])), + 'abbreviated' => $this->encoder->encode(array_values($days['format']['abbreviated'])) )); // get months names $months = \Zend_Locale_Data::getList($localeCode, 'months'); $this->assign('months', array( - 'wide' => $helper->jsonEncode(array_values($months['format']['wide'])), - 'abbreviated' => $helper->jsonEncode(array_values($months['format']['abbreviated'])) + 'wide' => $this->encoder->encode(array_values($months['format']['wide'])), + 'abbreviated' => $this->encoder->encode(array_values($months['format']['abbreviated'])) )); // get "today" and "week" words - $this->assign('today', $helper->jsonEncode(\Zend_Locale_Data::getContent($localeCode, 'relative', 0))); - $this->assign('week', $helper->jsonEncode(\Zend_Locale_Data::getContent($localeCode, 'field', 'week'))); + $this->assign('today', $this->encoder->encode(\Zend_Locale_Data::getContent($localeCode, 'relative', 0))); + $this->assign('week', $this->encoder->encode(\Zend_Locale_Data::getContent($localeCode, 'field', 'week'))); // get "am" & "pm" words - $this->assign('am', $helper->jsonEncode(\Zend_Locale_Data::getContent($localeCode, 'am'))); - $this->assign('pm', $helper->jsonEncode(\Zend_Locale_Data::getContent($localeCode, 'pm'))); + $this->assign('am', $this->encoder->encode(\Zend_Locale_Data::getContent($localeCode, 'am'))); + $this->assign('pm', $this->encoder->encode(\Zend_Locale_Data::getContent($localeCode, 'pm'))); // get first day of week and weekend days $this->assign('firstDay', (int)$this->_storeConfig->getConfig('general/locale/firstday')); - $this->assign('weekendDays', $helper->jsonEncode( + $this->assign('weekendDays', $this->encoder->encode( (string)$this->_storeConfig->getConfig('general/locale/weekend') )); // define default format and tooltip format $this->assign( 'defaultFormat', - $helper->jsonEncode($this->_locale->getDateFormat(\Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM)) + $this->encoder->encode( + $this->_locale->getDateFormat(\Magento\Core\Model\LocaleInterface::FORMAT_TYPE_MEDIUM) + ) ); $this->assign( 'toolTipFormat', - $helper->jsonEncode($this->_locale->getDateFormat(\Magento\Core\Model\LocaleInterface::FORMAT_TYPE_LONG)) + $this->encoder->encode($this->_locale->getDateFormat(\Magento\Core\Model\LocaleInterface::FORMAT_TYPE_LONG)) ); // get days and months for en_US locale - calendar will parse exactly in this locale @@ -109,7 +116,7 @@ class Calendar extends \Magento\View\Block\Template $enUS->m = new \stdClass(); $enUS->m->wide = array_values($months['format']['wide']); $enUS->m->abbr = array_values($months['format']['abbreviated']); - $this->assign('enUS', $helper->jsonEncode($enUS)); + $this->assign('enUS', $this->encoder->encode($enUS)); return parent::_toHtml(); } diff --git a/lib/Magento/View/Block/Html/Date.php b/lib/Magento/View/Element/Html/Date.php similarity index 96% rename from lib/Magento/View/Block/Html/Date.php rename to lib/Magento/View/Element/Html/Date.php index 85030c9738d..e38cae9043d 100644 --- a/lib/Magento/View/Block/Html/Date.php +++ b/lib/Magento/View/Element/Html/Date.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block\Html; +namespace Magento\View\Element\Html; /** * Date element block */ -class Date extends \Magento\View\Block\Template +class Date extends \Magento\View\Element\Template { /** * Render block HTML diff --git a/lib/Magento/View/Block/Html/Link.php b/lib/Magento/View/Element/Html/Link.php similarity index 86% rename from lib/Magento/View/Block/Html/Link.php rename to lib/Magento/View/Element/Html/Link.php index 9b1be038cf4..957b4d1cad5 100644 --- a/lib/Magento/View/Block/Html/Link.php +++ b/lib/Magento/View/Element/Html/Link.php @@ -22,12 +22,16 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block\Html; +namespace Magento\View\Element\Html; /** * HTML anchor element block + * + * @method string getLabel() + * @method string getPath() + * @method string getTitle() */ -class Link extends \Magento\View\Block\Template +class Link extends \Magento\View\Element\Template { /** * Prepare link attributes as serialized and formatted string @@ -90,6 +94,14 @@ class Link extends \Magento\View\Block\Template return parent::_toHtml(); } - return '<a ' . $this->getLinkAttributes() . ' >' . $this->escapeHtml($this->getAnchorText()) . '</a>'; + return '<li><a ' . $this->getLinkAttributes() . ' >' . $this->escapeHtml($this->getLabel()) . '</a></li>'; + } + + /** + * @return string + */ + public function getHref() + { + return $this->getUrl($this->getPath()); } } diff --git a/app/code/Magento/Page/Block/Link/Current.php b/lib/Magento/View/Element/Html/Link/Current.php similarity index 71% rename from app/code/Magento/Page/Block/Link/Current.php rename to lib/Magento/View/Element/Html/Link/Current.php index fc6ac11cc14..7b7f3ae12cd 100644 --- a/app/code/Magento/Page/Block/Link/Current.php +++ b/lib/Magento/View/Element/Html/Link/Current.php @@ -22,7 +22,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Link; +namespace Magento\View\Element\Html\Link; /** * Block representing link with two possible states. @@ -32,15 +32,10 @@ namespace Magento\Page\Block\Link; * @method string getPath() * @method string getTitle() * @method null|bool getCurrent() - * @method \Magento\Page\Block\Link\Current setCurrent(bool $value) + * @method \Magento\View\Element\Html\Link\Current setCurrent(bool $value) */ -class Current extends \Magento\View\Block\Template +class Current extends \Magento\View\Element\Template { - /** - * @var string - */ - protected $_template = 'Magento_Page::link/current.phtml'; - /** * Default path * @@ -49,18 +44,16 @@ class Current extends \Magento\View\Block\Template protected $_defaultPath; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\App\DefaultPathInterface $defaultPath * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + \Magento\View\Element\Template\Context $context, \Magento\App\DefaultPathInterface $defaultPath, array $data = array() ) { - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); $this->_defaultPath = $defaultPath; } @@ -105,4 +98,28 @@ class Current extends \Magento\View\Block\Template return $this->getCurrent() || $this->getUrl($this->getPath()) == $this->getUrl($this->getMca()); } + + /** + * Render block HTML + * + * @return string + */ + protected function _toHtml() + { + if (false != $this->getTemplate()) { + return parent::_toHtml(); + } + + if ($this->isCurrent()) { + $html = '<li class="nav item current">'; + $html .= '<strong>' . $this->escapeHtml(__($this->getLabel())) . '</strong>'; + $html .= '</li>'; + } else { + $html = '<li class="nav item"><a href="'. $this->escapeHtml($this->getHref()) . '"'; + $html .= ($this->getTitle()?' title="' . $this->escapeHtml(__($this->getTitle())) . '"':''); + $html .= '>' . $this->escapeHtml(__($this->getLabel())) . '</a></li>'; + } + + return $html; + } } diff --git a/lib/Magento/View/Element/Html/Links.php b/lib/Magento/View/Element/Html/Links.php new file mode 100644 index 00000000000..af0d06873eb --- /dev/null +++ b/lib/Magento/View/Element/Html/Links.php @@ -0,0 +1,73 @@ +<?php +/** + * Magento + * + * NOTICE OF LICENSE + * + * This source file is subject to the Open Software License (OSL 3.0) + * that is bundled with this package in the file LICENSE.txt. + * It is also available through the world-wide-web at this URL: + * http://opensource.org/licenses/osl-3.0.php + * If you did not receive a copy of the license and are unable to + * obtain it through the world-wide-web, please send an email + * to license@magentocommerce.com so we can send you a copy immediately. + * + * DISCLAIMER + * + * Do not edit or add to this file if you wish to upgrade Magento to newer + * versions in the future. If you wish to customize Magento for your + * needs please refer to http://www.magentocommerce.com for more information. + * + * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) + * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) + */ + +namespace Magento\View\Element\Html; + +/** + * Links list block + */ +class Links extends \Magento\View\Element\Template +{ + /** + * @return \Magento\View\Element\Html\Link[] + */ + public function getLinks() + { + return $this->_layout->getChildBlocks($this->getNameInLayout()); + } + + /** + * Render Block + * + * @param \Magento\View\Element\AbstractBlock $link + * @return string + */ + public function renderLink(\Magento\View\Element\AbstractBlock $link) + { + return $this->_layout->renderElement($link->getNameInLayout()); + } + + /** + * Render block HTML + * + * @return string + */ + protected function _toHtml() + { + if (false != $this->getTemplate()) { + return parent::_toHtml(); + } + + $html = ''; + if ($this->getLinks()) { + $html = '<ul' . ($this->hasCssClass()?' class="' . $this->escapeHtml($this->getCssClass()) . '"':'') . '>'; + foreach ($this->getLinks() as $link) { + $html .= $this->renderLink($link); + } + $html .= '</ul>'; + } + + return $html; + } +} diff --git a/lib/Magento/View/Block/Html/Select.php b/lib/Magento/View/Element/Html/Select.php similarity index 98% rename from lib/Magento/View/Block/Html/Select.php rename to lib/Magento/View/Element/Html/Select.php index 719f687a56a..145e7fb54ad 100644 --- a/lib/Magento/View/Block/Html/Select.php +++ b/lib/Magento/View/Element/Html/Select.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block\Html; +namespace Magento\View\Element\Html; /** * HTML select element block */ -class Select extends \Magento\View\Block\AbstractBlock +class Select extends \Magento\View\Element\AbstractBlock { /** * @var array diff --git a/app/code/Magento/Page/Block/Js/Components.php b/lib/Magento/View/Element/Js/Components.php similarity index 81% rename from app/code/Magento/Page/Block/Js/Components.php rename to lib/Magento/View/Element/Js/Components.php index f5955061eb4..fb26db65392 100644 --- a/app/code/Magento/Page/Block/Js/Components.php +++ b/lib/Magento/View/Element/Js/Components.php @@ -18,21 +18,22 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Js; +namespace Magento\View\Element\Js; -class Components extends \Magento\View\Block\Template +use Magento\App\State; +use Magento\View\Element\Template; + +class Components extends Template { /** * @return bool */ public function isDeveloperMode() { - return $this->_appState->getMode() == \Magento\App\State::MODE_DEVELOPER; + return $this->_appState->getMode() == State::MODE_DEVELOPER; } } diff --git a/app/code/Magento/Page/Block/Js/Cookie.php b/lib/Magento/View/Element/Js/Cookie.php similarity index 62% rename from app/code/Magento/Page/Block/Js/Cookie.php rename to lib/Magento/View/Element/Js/Cookie.php index bb7bcd87496..07bfcf60852 100644 --- a/app/code/Magento/Page/Block/Js/Cookie.php +++ b/lib/Magento/View/Element/Js/Cookie.php @@ -18,46 +18,37 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\Page\Block\Js; +namespace Magento\View\Element\Js; -class Cookie extends \Magento\View\Block\Template +use Magento\Session\Config\ConfigInterface; +use Magento\View\Element\Template; +use Magento\View\Element\Template\Context; + +class Cookie extends Template { /** - * @var \Magento\Core\Model\Cookie + * @var ConfigInterface */ - protected $_cookie; + protected $sessionConfig; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData - * @param \Magento\Core\Model\Cookie $cookie + * @param Context $context + * @param ConfigInterface $cookieConfig * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, - \Magento\Core\Model\Cookie $cookie, + Context $context, + ConfigInterface $cookieConfig, array $data = array() ) { - $this->_cookie = $cookie; - parent::__construct($context, $coreData, $data); + $this->sessionConfig = $cookieConfig; + parent::__construct($context, $data); } - /** - * Get cookie model instance - * - * @return \Magento\Core\Model\Cookie - */ - public function getCookie() - { - return $this->_cookie; - } /** * Get configured cookie domain * @@ -65,7 +56,7 @@ class Cookie extends \Magento\View\Block\Template */ public function getDomain() { - $domain = $this->getCookie()->getDomain(); + $domain = $this->sessionConfig->getCookieDomain(); if (!empty($domain[0]) && ($domain[0] !== '.')) { $domain = '.'.$domain; } @@ -79,6 +70,6 @@ class Cookie extends \Magento\View\Block\Template */ public function getPath() { - return $this->getCookie()->getPath(); + return $this->sessionConfig->getCookiePath(); } } diff --git a/lib/Magento/View/Block/Messages.php b/lib/Magento/View/Element/Messages.php similarity index 92% rename from lib/Magento/View/Block/Messages.php rename to lib/Magento/View/Element/Messages.php index 8315db985c1..24661dfcf39 100644 --- a/lib/Magento/View/Block/Messages.php +++ b/lib/Magento/View/Element/Messages.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block; +namespace Magento\View\Element; /** * Class Messages */ -class Messages extends \Magento\View\Block\Template +class Messages extends Template { /** * Messages collection @@ -98,28 +98,26 @@ class Messages extends \Magento\View\Block\Template protected $collectionFactory; /** - * @param Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Message\Factory $messageFactory * @param \Magento\Message\CollectionFactory $collectionFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + Template\Context $context, \Magento\Message\Factory $messageFactory, \Magento\Message\CollectionFactory $collectionFactory, array $data = array() ) { $this->messageFactory = $messageFactory; $this->collectionFactory = $collectionFactory; - parent::__construct($context, $coreData, $data); + parent::__construct($context, $data); } /** * Preparing global layout * - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ protected function _prepareLayout() { @@ -133,7 +131,7 @@ class Messages extends \Magento\View\Block\Template * Set message escape flag * * @param bool $flag - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ public function setEscapeMessageFlag($flag) { @@ -145,7 +143,7 @@ class Messages extends \Magento\View\Block\Template * Set messages collection * * @param \Magento\Message\Collection $messages - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ public function setMessages(\Magento\Message\Collection $messages) { @@ -157,7 +155,7 @@ class Messages extends \Magento\View\Block\Template * Add messages to display * * @param \Magento\Message\Collection $messages - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ public function addMessages(\Magento\Message\Collection $messages) { @@ -184,7 +182,7 @@ class Messages extends \Magento\View\Block\Template * Adding new message to message collection * * @param \Magento\Message\AbstractMessage $message - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ public function addMessage(\Magento\Message\AbstractMessage $message) { @@ -196,7 +194,7 @@ class Messages extends \Magento\View\Block\Template * Adding new error message * * @param string $message - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ public function addError($message) { @@ -208,7 +206,7 @@ class Messages extends \Magento\View\Block\Template * Adding new warning message * * @param string $message - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ public function addWarning($message) { @@ -220,7 +218,7 @@ class Messages extends \Magento\View\Block\Template * Adding new notice message * * @param string $message - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ public function addNotice($message) { @@ -232,7 +230,7 @@ class Messages extends \Magento\View\Block\Template * Adding new success message * * @param string $message - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ public function addSuccess($message) { @@ -286,7 +284,7 @@ class Messages extends \Magento\View\Block\Template 'layout' => $this->getLayout(), 'transport' => $transport, ); - $this->_eventManager->dispatch('core_message_block_render_grouped_html_after', $params); + $this->_eventManager->dispatch('view_message_block_render_grouped_html_after', $params); $html = $transport->getData('output'); } diff --git a/app/code/Magento/Page/Block/Redirect.php b/lib/Magento/View/Element/Redirect.php similarity index 54% rename from app/code/Magento/Page/Block/Redirect.php rename to lib/Magento/View/Element/Redirect.php index 9f3bc8a31a3..696921a68da 100644 --- a/app/code/Magento/Page/Block/Redirect.php +++ b/lib/Magento/View/Element/Redirect.php @@ -18,74 +18,65 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Magento - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ +namespace Magento\View\Element; /** * Customer Redirect Page - * - * @category Magento - * @package Magento_Page - * @author Magento Core Team <core@magentocommerce.com> */ -namespace Magento\Page\Block; - -class Redirect extends \Magento\View\Block\Template +class Redirect extends Template { /** * HTML form hidden fields */ - protected $_formFields = array(); + protected $formFields = array(); /** * @var \Magento\Data\FormFactory */ - protected $_formFactory; + protected $formFactory; /** - * @param \Magento\View\Block\Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param \Magento\Data\FormFactory $formFactory * @param array $data */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + Template\Context $context, \Magento\Data\FormFactory $formFactory, array $data = array() ) { - $this->_formFactory = $formFactory; - parent::__construct($context, $coreData, $data); + $this->formFactory = $formFactory; + parent::__construct($context, $data); } /** - * URL for redirect location + * URL for redirect location * - * @return string URL + * @return string URL */ - public function getTargetURL () + public function getTargetURL() { return ''; } /** - * Additional custom message + * Additional custom message * - * @return string Output message + * @return string Output message */ - public function getMessage () + public function getMessage() { return ''; } /** - * Client-side redirect engine output + * Client-side redirect engine output * - * @return string + * @return string */ public function getRedirectOutput () { @@ -97,11 +88,11 @@ class Redirect extends \Magento\View\Block\Template } /** - * Redirect via JS location + * Redirect via JS location * - * @return string + * @return string */ - public function getRedirect () + public function getRedirect() { return '<script type="text/javascript"> (function($){ @@ -111,18 +102,19 @@ class Redirect extends \Magento\View\Block\Template } /** - * Redirect via HTML form submission + * Redirect via HTML form submission * - * @return string + * @return string */ - public function getHtmlFormRedirect () + public function getHtmlFormRedirect() { - $form = $this->_formFactory->create(); + /** @var \Magento\Data\Form $form */ + $form = $this->formFactory->create(); $form->setAction($this->getTargetURL()) ->setId($this->getFormId()) ->setName($this->getFormId()) ->setAttr('data-auto-submit', 'true') - ->setMethod($this->getMethod()) + ->setMethod($this->getFormMethod()) ->setUseContainer(true); foreach ($this->_getFormFields() as $field => $value) { $form->addField($field, 'hidden', array('name' => $field, 'value' => $value)); @@ -131,19 +123,19 @@ class Redirect extends \Magento\View\Block\Template } /** - * HTML form or JS redirect + * HTML form or JS redirect * - * @return boolean + * @return boolean */ - public function isHtmlFormRedirect () + public function isHtmlFormRedirect() { return is_array($this->_getFormFields()) && count($this->_getFormFields()) > 0; } /** - * HTML form id/name attributes + * HTML form id/name attributes * - * @return string Id/name + * @return string Id/name */ public function getFormId() { @@ -151,19 +143,19 @@ class Redirect extends \Magento\View\Block\Template } /** - * HTML form method attribute + * HTML form method attribute * - * @return string Method + * @return string Method */ - public function getFormMethod () + public function getFormMethod() { return 'POST'; } /** - * Array of hidden form fields (name => value) + * Array of hidden form fields (name => value) * - * @return array + * @return array */ public function getFormFields() { @@ -171,16 +163,53 @@ class Redirect extends \Magento\View\Block\Template } /** - * Optimized getFormFields() method + * Optimized getFormFields() method * - * @return array + * @return array */ protected function _getFormFields() { - if (!is_array($this->_formFields) || count($this->_formFields) == 0) { - $this->_formFields = $this->getFormFields(); + if (!is_array($this->formFields) || count($this->formFields) == 0) { + $this->formFields = $this->getFormFields(); } - return $this->_formFields; + return $this->formFields; } + /** + * Get default HTML + * + * @return string + */ + protected function _getDefaultHtml() + { + $html = ''; + + $html .= '<div class="page-title">'; + $html .= '<h1>' . __('Redirecting...') . '</h1>'; + $html .= '</div>'; + if ($this->getMessage()) { + $html .= '<p>' . $this->getMessage() . '</p>'; + } + $html .= $this->getRedirectOutput(); + if (!$this->isHtmlFormRedirect()) { + $html .= '<p>' . __('Click <a href="%1">here</a> if nothing has happened', $this->getTargetURL()) . '</p>'; + } + + return $html; + } + + /** + * Render block HTML + * + * @return string + */ + protected function _toHtml() + { + if ($this->getTemplate()) { + $html = parent::_toHtml(); + } else { + $html = $this->_getDefaultHtml(); + } + return $html; + } } diff --git a/lib/Magento/View/Block/Template.php b/lib/Magento/View/Element/Template.php similarity index 94% rename from lib/Magento/View/Block/Template.php rename to lib/Magento/View/Element/Template.php index 794b77253cc..1ec8e8a908f 100644 --- a/lib/Magento/View/Block/Template.php +++ b/lib/Magento/View/Element/Template.php @@ -22,10 +22,11 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block; +namespace Magento\View\Element; /** * Base html block + * @SuppressWarnings(PHPMD.NumberOfChildren) */ class Template extends AbstractBlock { @@ -85,13 +86,6 @@ class Template extends AbstractBlock */ protected $templateEnginePool; - /** - * Core data - * - * @var \Magento\Core\Helper\Data - */ - protected $_coreData; - /** * @var \Magento\Core\Model\StoreManagerInterface */ @@ -103,18 +97,15 @@ class Template extends AbstractBlock protected $_appState; /** - * @param Template\Context $context - * @param \Magento\Core\Helper\Data $coreData + * @param \Magento\View\Element\Template\Context $context * @param array $data - * + * * @todo Remove injection of the core helper from this class and its descendants, because it's no longer used */ public function __construct( - \Magento\View\Block\Template\Context $context, - \Magento\Core\Helper\Data $coreData, + Template\Context $context, array $data = array() ) { - $this->_coreData = $coreData; $this->_dirs = $context->getDirs(); $this->_filesystem = $context->getFilesystem(); $this->_viewFileSystem = $context->getViewFileSystem(); @@ -156,7 +147,7 @@ class Template extends AbstractBlock * Set path to template used for generating block's output. * * @param string $template - * @return \Magento\View\Block\Template + * @return \Magento\View\Element\Template */ public function setTemplate($template) { @@ -195,7 +186,7 @@ class Template extends AbstractBlock * * @param string|array $key * @param mixed $value - * @return \Magento\View\Block\Template + * @return \Magento\View\Element\Template */ public function assign($key, $value=null) { diff --git a/lib/Magento/View/Block/Template/Context.php b/lib/Magento/View/Element/Template/Context.php similarity index 95% rename from lib/Magento/View/Block/Template/Context.php rename to lib/Magento/View/Element/Template/Context.php index ff98e22640a..53e3fcde69a 100644 --- a/lib/Magento/View/Block/Template/Context.php +++ b/lib/Magento/View/Element/Template/Context.php @@ -6,7 +6,7 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block\Template; +namespace Magento\View\Element\Template; /** * Magento block context object @@ -15,7 +15,7 @@ namespace Magento\View\Block\Template; * * @SuppressWarnings(PHPMD.CouplingBetweenObjects) */ -class Context extends \Magento\View\Block\Context +class Context extends \Magento\View\Element\Context { /** * Dirs instance @@ -67,6 +67,7 @@ class Context extends \Magento\View\Block\Context * @param \Magento\App\CacheInterface $cache * @param \Magento\View\DesignInterface $design * @param \Magento\Core\Model\Session $session + * @param \Magento\Session\SidResolverInterface $sidResolver * @param \Magento\Core\Model\Store\Config $storeConfig * @param \Magento\App\FrontController $frontController * @param \Magento\App\Helper\HelperFactory $helperFactory @@ -97,6 +98,7 @@ class Context extends \Magento\View\Block\Context \Magento\App\CacheInterface $cache, \Magento\View\DesignInterface $design, \Magento\Core\Model\Session $session, + \Magento\Session\SidResolverInterface $sidResolver, \Magento\Core\Model\Store\Config $storeConfig, \Magento\App\FrontController $frontController, \Magento\App\Helper\HelperFactory $helperFactory, @@ -125,6 +127,7 @@ class Context extends \Magento\View\Block\Context $cache, $design, $session, + $sidResolver, $storeConfig, $frontController, $helperFactory, diff --git a/lib/Magento/View/Block/Text.php b/lib/Magento/View/Element/Text.php similarity index 95% rename from lib/Magento/View/Block/Text.php rename to lib/Magento/View/Element/Text.php index d6bb0361c92..624f5d3ee61 100644 --- a/lib/Magento/View/Block/Text.php +++ b/lib/Magento/View/Element/Text.php @@ -22,12 +22,12 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block; +namespace Magento\View\Element; /** * Class Text */ -class Text extends \Magento\View\Block\AbstractBlock +class Text extends \Magento\View\Element\AbstractBlock { /** * Set text data diff --git a/lib/Magento/View/Block/Text/ListText.php b/lib/Magento/View/Element/Text/ListText.php similarity index 91% rename from lib/Magento/View/Block/Text/ListText.php rename to lib/Magento/View/Element/Text/ListText.php index 540c4cc1f2c..72f3d73f40c 100644 --- a/lib/Magento/View/Block/Text/ListText.php +++ b/lib/Magento/View/Element/Text/ListText.php @@ -22,14 +22,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block\Text; +namespace Magento\View\Element\Text; -use Magento\View\Block\Text; +use Magento\View\Element\Text; /** * Class ListText */ -class ListText extends \Magento\View\Block\Text +class ListText extends \Magento\View\Element\Text { /** * Render html output diff --git a/lib/Magento/View/Block/Text/TextList/Item.php b/lib/Magento/View/Element/Text/TextList/Item.php similarity index 93% rename from lib/Magento/View/Block/Text/TextList/Item.php rename to lib/Magento/View/Element/Text/TextList/Item.php index 8f1277e2204..000e73e8538 100644 --- a/lib/Magento/View/Block/Text/TextList/Item.php +++ b/lib/Magento/View/Element/Text/TextList/Item.php @@ -22,14 +22,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block\Text\TextList; +namespace Magento\View\Element\Text\TextList; -use Magento\View\Block\Text; +use Magento\View\Element\Text; /** * Class Item */ -class Item extends \Magento\View\Block\Text +class Item extends \Magento\View\Element\Text { /** * @param array|string $liParams diff --git a/lib/Magento/View/Block/Text/TextList/Link.php b/lib/Magento/View/Element/Text/TextList/Link.php similarity index 95% rename from lib/Magento/View/Block/Text/TextList/Link.php rename to lib/Magento/View/Element/Text/TextList/Link.php index 4ba7c1fb8d9..8af566e2b0c 100644 --- a/lib/Magento/View/Block/Text/TextList/Link.php +++ b/lib/Magento/View/Element/Text/TextList/Link.php @@ -22,14 +22,14 @@ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0) */ -namespace Magento\View\Block\Text\TextList; +namespace Magento\View\Element\Text\TextList; -use Magento\View\Block\Text; +use Magento\View\Element\Text; /** * Class Link */ -class Link extends \Magento\View\Block\Text +class Link extends \Magento\View\Element\Text { /** * @param array|string $liParams diff --git a/lib/Magento/View/Layout/Element.php b/lib/Magento/View/Layout/Element.php index 57c398ca482..4a4a7d54663 100644 --- a/lib/Magento/View/Layout/Element.php +++ b/lib/Magento/View/Layout/Element.php @@ -46,6 +46,15 @@ class Element extends \Magento\Simplexml\Element const TYPE_MOVE = 'move'; /**#@-*/ + /**#@+ + * Names of container options in layout + */ + const CONTAINER_OPT_HTML_TAG = 'htmlTag'; + const CONTAINER_OPT_HTML_CLASS = 'htmlClass'; + const CONTAINER_OPT_HTML_ID = 'htmlId'; + const CONTAINER_OPT_LABEL = 'label'; + /**#@-*/ + /** * @return Element * diff --git a/lib/Magento/View/LayoutInterface.php b/lib/Magento/View/LayoutInterface.php index 2aad608141f..d722ef01fb5 100644 --- a/lib/Magento/View/LayoutInterface.php +++ b/lib/Magento/View/LayoutInterface.php @@ -211,7 +211,7 @@ interface LayoutInterface /** * Add a block to registry, create new object if needed * - * @param string|\Magento\View\Block\AbstractBlock $block + * @param string|\Magento\View\Element\AbstractBlock $block * @param string $name * @param string $parent * @param string $alias @@ -258,7 +258,7 @@ interface LayoutInterface /** * Retrieve messages block * - * @return \Magento\View\Block\Messages + * @return \Magento\View\Element\Messages */ public function getMessagesBlock(); diff --git a/lib/Zend/Session/Config/ConfigInterface.php b/lib/Zend/Session/Config/ConfigInterface.php new file mode 100644 index 00000000000..48908e6c8d9 --- /dev/null +++ b/lib/Zend/Session/Config/ConfigInterface.php @@ -0,0 +1,52 @@ +<?php +/** + * Zend Framework (http://framework.zend.com/) + * + * @link http://github.com/zendframework/zf2 for the canonical source repository + * @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) + * @license http://framework.zend.com/license/new-bsd New BSD License + */ + +namespace Zend\Session\Config; + +/** + * Standard session configuration + */ +interface ConfigInterface +{ + public function setOptions($options); + public function getOptions(); + + public function setOption($option, $value); + public function getOption($option); + public function hasOption($option); + + public function toArray(); + + public function setName($name); + public function getName(); + + public function setSavePath($savePath); + public function getSavePath(); + + public function setCookieLifetime($cookieLifetime); + public function getCookieLifetime(); + + public function setCookiePath($cookiePath); + public function getCookiePath(); + + public function setCookieDomain($cookieDomain); + public function getCookieDomain(); + + public function setCookieSecure($cookieSecure); + public function getCookieSecure(); + + public function setCookieHttpOnly($cookieHttpOnly); + public function getCookieHttpOnly(); + + public function setUseCookies($useCookies); + public function getUseCookies(); + + public function setRememberMeSeconds($rememberMeSeconds); + public function getRememberMeSeconds(); +} diff --git a/pub/lib/mage/adminhtml/wysiwyg/widget.js b/pub/lib/mage/adminhtml/wysiwyg/widget.js index fc492d75dd8..b3e12fa6675 100644 --- a/pub/lib/mage/adminhtml/wysiwyg/widget.js +++ b/pub/lib/mage/adminhtml/wysiwyg/widget.js @@ -222,6 +222,10 @@ WysiwygWidget.Widget.prototype = { } }, + validateField: function() { + jQuery(this.widgetEl).valid(); + }, + insertWidget: function() { jQuery('#' + this.formEl).validate({ ignore: ".skip-submit", diff --git a/pub/lib/mage/bootstrap.js b/pub/lib/mage/bootstrap.js index ab605f79d6b..d7a38bb8aab 100644 --- a/pub/lib/mage/bootstrap.js +++ b/pub/lib/mage/bootstrap.js @@ -17,8 +17,6 @@ * versions in the future. If you wish to customize Magento for your * needs please refer to http://www.magentocommerce.com for more information. * - * @category Mage - * @package Magento_Page * @copyright Copyright (c) 2013 X.commerce, Inc. (http://www.magentocommerce.com) * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) */ -- GitLab