diff --git a/CHANGELOG.md b/CHANGELOG.md index c440cb6de5ba6c2aadf602efccab92fc4bacbcc9..1c8730a6634896d23533b4c0968f54580567ae65 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 ce984ccf278201222a5f1710a8de8610504147b3..c856cf0f7b23dc6065569b769feafdc847614d79 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 95635f6103cddd7880b2473eeaec10b88c1f789c..977079f27a73d6b0108ea94a4e03d10166313f4f 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 3ad43a591176a1e16e7ca071c1927644239b557b..71bdb06d6b8a1324dbdecb66d4154f468126e290 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 a2116a9fb027f41231c1bc15959a14c48d6a58c5..fdf6faaadddb08c1575fd9755bf017fbde044475 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 6ca88914496f46f94c7fa267ca743d85d5a4479b..64d24124c6321808de1f6693c10ddb3525f8c544 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 8181e408161f81e7d132b9e25f1d5c67a30be801..8548afe579f6b926a0b886e1e7c475b1bdcc1e19 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 76cb3bd7b0c49de82ce0dca058c1d6e7571d5679..6e753a4ffcfd27bdb81de6cb7918b35b4ea20cfa 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 affd5c6e26674ba7b6f8bbbabb5a89693cb35cac..d2f8102695e0a0f8894877f0dbad589d25dcc275 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 fe123bac7003946c9ebd7719f8fcd54c36be4e9a..5d170ced6d02431c1dc5e56140270ba484e4a8bf 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 adf3c25e6763a6f215dc4de178651227ac0bfd98..4396ec907acea9bc1080de14b3a102516966fb8f 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 cc6745ab1294639eb911bdd862961d42b9dba63f..d0368dadf971966b0956ca3fdfcf316b070f7e8c 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 5d36e90c52d30431aac5a5cdfbf84d4ccd06ccc3..d3847e57d1b25124824de4b85cdcacd8a5011f3a 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 385ae7a4063d5c7ced1d7c04fa31ddac50d0dfb9..3d2ed64f2d12e61fbbe0165e76f06c9927f229ca 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 bfa806ad3afb298729e8ef504c8e22d1809ec284..4bc9bb0d6d348d74c765c589766cc6dfb986bfc3 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 da37c7a96d35bf7bebe7d03c29a17dd390b21085..f43d6f80a11843687635fb760bcc3ca8973ed861 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 be91545f67ac0408dccbf65d7f4dc6164d1fd860..5c813ae2fcb00ed4d18aa3142ff59fe897240001 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 b066a100577479a1ff7d4249ec45687dd85b0dcd..3b1ffc4dfc5f60beb403486b14be83d4ada42f8d 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 62f85dd7de96d06aaed2a260b63725a7c90393bf..a412712b5772ad7355aa1097c7b7de5ac4b85fc2 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 640a40be19d16781110bf273dc34ea8a558cf3ee..2769b31300a89aef8559f2b77c4fde5b52d899e1 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 b9e48dc84ac3eca982dca82305a2e2293f3ff373..333ffdfdd05f3f3edde8eb108a734ee84c27b47d 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 f9c3d2557674be1c0b377fb686593ce2d1eb04e7..648f5d328e276c8399d4aadda506cb2abd34088d 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 dc13f7485e3054bbd101d7736301a62228999476..9676de45bb8ccc2ee9e8485b47f7b00bb907f246 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 0939172917c34ca3ff9b268c057c0fee9ad7fea6..58e3f4248e1708f703bd7137962872b6d856350b 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 95e2cc91ba3a9af5782487f71c204edeb7ecf8fb..26f397b91dc860f73091ac11194aaebabb1b0138 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 3c327bcd36e84480df5dd9ddb8d71dd2c0471d7b..a7c619f98ca57fbb620a05d5fc864fac29c8b990 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 b5e66559d38b3abe4ffc3595ee5ecff835f850dd..77dbcf0d00ebd498b9a1cebfb8d95c0ec98268bf 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 668acee53e7a45507ad7d2cfd41afb302ce48cc6..f9a951dd5bb4ab8fe28ee23e7a3e081d86f1609f 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 bf71c6b32293db2ea4a84143ad71d88af497d74e..97b801df3667ae4bafada52e972d3f3c6b5531f2 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 157f30132896a3339bc15d997811211ddd2dc61d..778a9f409225e0e718be22c31e39e7a279ca0b8d 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 2258e1dbfd3818efd3d9f77f57f6da811c92f94f..efba0d75d9cdd97b51664583e0f6b7b370780983 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 ffd10813b78330b50d5e400fd75a75c14b34609b..6ea4c18e07e5aa1e3f6ed115f4a6b5284e7acb37 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 213ec8a08a1b51057641f566f6cedb63c6db8db4..fe7f665571913d51305a9d0b12743d6a33cfc4c9 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 0000000000000000000000000000000000000000..b26a6ddc5807114dde49eb00e1dc78ddb051ae7a --- /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 5c916bf7a5113150e6ef148496c05f88cf8b9d8c..19fcfecc6b14d3214ddc2acfe4a41508b4061ac3 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 0000000000000000000000000000000000000000..8cecd7ee730ac76b382020984e0257fd75114745 --- /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 0000000000000000000000000000000000000000..f27cc69b75b0747378ae726a76f873cfc98d149e --- /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 621d1e8b3e0c95b4a9a8932a41dda9a93b85e6a5..5b5907260dd0d164426a00500a23a3a46779855b 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 0000000000000000000000000000000000000000..cce2256d61a246278133a6b11a6f45b517b836aa --- /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 0000000000000000000000000000000000000000..02b6f60d2c140564c1fef5a2601a05f381e8a55e --- /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 0000000000000000000000000000000000000000..60c4f0bceb64033d635d6826b06d7c1352a7a1a6 --- /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 0000000000000000000000000000000000000000..4dbaf698ee87b10f808c83d6cb53394402f42447 --- /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 cc66376f9c66de9802d3d04dc9587298771b765f..91159766258e50ba2f2bfd3ea1162ad67867f7f3 --- 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 308a1c84d847949d0c8a38bcf6ae8fe3453913d4..58259d8b1fe217e8450d86ecf70ec9aa779f26a2 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 7774862ce12076a76a0447f43bffd889afec0066..1eec150730b63289b158f27411237d3ad4305591 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 d2f15309be7434a55d899bfffef64ee325d2593b..454167989a73538841bf1fe5cb0c0eec58f19a25 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 0d5e6c6b706246ec5f6a537edae98d626f8d14e9..ec71ca71908952821abe93fdcae3ef16673fab5f 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 5fbf20e5c8f9075ebadf4c4f17fca18ac4360d98..bbe32dd6fc456a064b21b61c2e9d8e3a929786b7 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 55880dc9e89c51119d3f6b03b0651dd7dc48e326..be933a5adb5a53935e6585c6329c63d2e0771613 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 123848b6717a7805e547d273484dc46a679114be..ef09ab5fc08443dc9689958b7ec9fb3418b373f2 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 797aaec69a2ac3399993381e57db0c32aa477474..ee642713d2155410f3ecc51b1ad12ac07e5c5f23 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 05cd859d92c443d826b8ebf8968f5470afb6285b..e2225b40488c660aa3d4cc5d4b87962e8e71d4b5 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 48893c077f2bde43d7d6d4651336f81aae7ac8ed..a5366e2fe25b3804f2d6c621c507cc13368e382f 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 c340713e2b2313bc9cc567447e9f955903418345..e6e83587bf9c243a68aac273391b49365317983b 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 a525d9e837227f75ea36dbcdff3c4816623d8da4..2205271431890fa10c92c228d4e2c2f6709ffe8f 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 86fe59f32fe07a55521760ba01cdf53947d78883..1c0f19b593c2a1d7dda6fd13e037d94fd9a16b9b 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 237218ec3db663f6c742d45ad02238ffe39e988f..82289d9f94d090da81bcfb7b2d063e13a292c963 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 24166c3530e5623eaef227626da8565839ac7404..d93d9c02b117befc1c71bc60ace1bf42ed467d11 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 ac246a749d41ef6acf872f17e15e948093d4b917..a1298bdac49cfed4e107495cc1050c5ace768e41 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 3f6879a491ebd1b5c9305e89b836dfcfbd9fc172..6fdbcad87a007d713992303de16ed88cb8a6032a 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 8de1d49d475874eaa9701a6a01db347316434021..9070dc570f8e375fb700e008890894ae5f83a78d 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 19418d994a0297623d7c2546fe123c15e13957c9..8a393e0590302408d3ec1c31a9c5d416b90b7698 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 d7e946f5d270bd69a3bb0ae2b9b39d53c9c3bcd5..2897995077c6c09e175bccbf6a4f314c748c9eaf 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 db71c6f792b8706dce29f5cd872b22023098e295..96505249f40d94821d334953d19b836e3075fefc 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 953723bfeb268b76801480873ab5e5c11f467748..59b864a1ecc2724299e21cfc571b0bd12760546b 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 9b039a8957798472a32209d84092233f5ac40af2..f1434842a11963fc20903fc1ee109308b93a8eb2 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 9644f6152111ad7739be8e1e759a4c6fa9690515..159801a751060345051f33566703887d2820b6da 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 3f2a19901c1d963d68957f539d34a2f940b2f089..a5b5f19a4735be2cbddf46fb657ea2e3ea98a32a 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 2cf01c41a9e24d67f23a635c0148309bd48d3150..43470b7b2a42291f18d8311463d29c11bebd654a 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 81f16df26931286962c2ed2781dc8e6675aaacc7..a5733b6c49b4c4c9758992427519efdf01093952 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 20cc7cd2df27e10d70811f2ff4fb24c2d72ce211..b0e931d649d7d200a7d278fc37300df9ede7e369 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 adc4ed43bd7fab93ce315c092315a70e9b2ee415..42e8ff8570813496a6c45c95c22af46658b8b6dc 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 28fd6d6b0748320475f41dd21aa231950fd3c14f..933a2a1986e6256f5ad0f6da3bdf7a5eb3e4a765 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 6ab009aeb20307dae5f283bbf9597b7c3e65d430..4b01635ab02a7a1f7f25097b1d7b3e1a181dd7bd 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 ca8c823a68fe993cbb607d950cabaf0bbc929b47..d888cac68e3bfcd58b013a50da13fcf7f4e4a227 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 83728b75fab63657bd72b7397f50344d82bb39b1..a59c7cc7f8a3e9c9a5a0a24ee170b0943ebb8f3f 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 751ea6b97c9b0ea6a3b0cd62189bef2d73922e1f..104d359393b7585324e4056e2b92155a2ed1bd18 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 32a3ef650fe1f8e349fa6e5f6ce4823b60365e90..f41d6865deaadceb506e1299470b36bbb0b1707a 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 39c77447a8d0d964d72865837d6cab44f33ac7e0..1c85a66774e6a7fba9a2120ddd27272231e17383 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 e43f5746b0fcf85ecce0ac5b7f16b0b55596182e..519293e54428cc690ad7def3d8aca8df4b4f37d7 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 65fce16e9cb3f7b20f526057f72347636186b20c..b5ecebb8e411b09d5f630b74993c68513c1edd4f 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 43006b0954ae2da9d5ea6d7f7af587108fd81e98..8ecc56346b09339ed1124cbd5781f4be9003d022 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 284e0d7c0b7642a4835db818e3983355f1467a6f..fadb2f024df7dbe957b91e9e2b5f236facb83395 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 c1c4668a1ff6f3f4cab5043a7b6e5a3e5757592a..09b71ed2bcaf9ae13263587801affc6e1de7e876 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 f7f0f0dbb6bca6b6c7822a15bc78ba8a30962fda..e13c3daf2d7b074711e230ca4b042994916b1b63 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 ca04a1cafaa067488cac86b154b27eb652cf3463..cc5d8166fb1ebd3e308277064754e5021afe9d91 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 cff54dcb7ad3a367fa0d9544924fca7f1ead38cf..6467570d39b21f36f0440b061bcde94c6db8f433 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 7de430c0a747f48043b7391ca809f7510492bb75..092744bedd42758b48872f47d326d488a96f24b8 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 85b65c92a21837dc42e552a6b63169232256fdfd..63b55d67dd37ab7f529eb28f7d7154ee912be3ce 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 bcb67e4605121c90298b4e28fce9384876949caa..4abea54585f5e19d329cf0eadbfce8755afb4752 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 3cdb73c67b403c78e4e12e2c0cda96817680bb01..558184496dbe16e8fb45ae305640f72996d5f8c5 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 d3f6dd06e7a7901f76520299c65a6d1c9e68d9a7..f1a5f5a57799dcca8fee014ae1265e9dde8e739c 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 a2494e34954daa21337d6bdfd9ee369efeed88fc..17a5670c428281566b9d8d24118fba456e81dd67 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 8d9d9de344b375fa68dc788664e9614850aec4e1..0a0f635a0ba208da641249d2d3a47e50a7fc698f 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 713f3e121614960bb8355e3148055ad527982421..383fb366ad5e2a451d37c7521712164dd83c2cb1 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 1ccbc22101f6f039f11621b3000dfe96e868f277..87423d607b7dbb58eb136f037895947d505a2518 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 4351f21f1adb91fd342d6a8d1373fa4c25ffb209..a56ea489a55ba332b4bdf8dbd274d15a5ec95c13 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 848a262308cb425376d938489a3d7309b990d3f7..139159622f1144a78b20c2fd316fc2d8c174c8e3 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 8c88e4caf3b729b8219f7e11bfe571f0cbada19b..d6c8d668045240d704eac47ce3e3e8fb80bbd967 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 20771cbace8a07dabeb14ff9056ec8edce070e8f..051f06d6f57a917491c4d1e8a8a0ba3ca9fcea31 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 1c7ea433520bc41b38694279df3040c41fd6066d..c4a194c43cf96909c1246dd4ac7b4777e23f9947 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 c2a02a878227d031710cb01546bd51b9f61e44dd..27710cfc645e0115901294935a0ddbc8b0f41fdc 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 88c70aad1f0c21d6d60adc78855bc8fc1ad9de19..2b9c927caf667d898964dc900f5ca81daf5835d0 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 5695da8fee3e56b2ce2281113a2a7a3c0ef25dc5..94ccea59c988d386eb3eb38621e37ac13c6fff5d 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 f706254a356de4633583410ffc0b1ec85f947590..66f34d6e07ce9bbc6679d6d8301d2ff445013cea 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 e573b5a3ce26c328b2ff92f25dc32c511fe2482c..04f17c8c808e5d323babe656871fbfc5b610bf0f 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 c28b6ef2cdc8d77230a58b3535530701465aea99..e58e38e98e8b6522ace0c7734c727cc0f3a54368 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 076d838ef9af750c508ae27c11ce8b33d08ecc28..36ee1a2579fec86b4976862db2fb2a5947c35a09 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 51c97b9f6e3cae79aaeb8ac737b517c419491d5e..5668dce84c5843e98c72c6d74ea0b1381d8a235a 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 47cba7c717e5b0f6659495a135016fee459f30ae..d7203803eb7acf235554e9cf38c0c9c2d393214c 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 d54df862667cd639005dab70f3a953fb042082e9..fb023198b7c88a20be0879fab594849754245599 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 c378d6b8096ad34460dd16dfc195e181d7f94a71..3f443e53d9729e60f0d11fd0e1ac01a7c4e940d1 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 78f025a1dde32b47a49e12d1399255752bd60be6..73fccd88e4f6442c38fcc6aa12a2e937946500e3 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 b8e152f162774d79a0e87969d7d19a067ca4248f..6cc537374f6f5e934aee277b63ddd51c3a18628b 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 ad53e13aa4c20212c4b018512bd1947f4ac2a95f..ba08ac5b49f16b4ebe251e0db16df39a3e9a9085 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 0dcb6e1dea5fc9bc4638714604303b5798b89259..8b5bc5373775a2d0884e691e24cbd5893296cd8d 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 ec624916431bb4d06e5e2a6fe17dbe2387d1c1e2..ae82e04232570b156375597e860036046cfc6ced 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 b5e2226d744293882fb44ce104028eeeee959725..5f0e0863a5038f7a710f1a15713cec5d9af61f84 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 fbc1d4e42607ff9f28447fca1cf8d804c175bf4c..f4e902d153c1f4efa55ad32ddc723e860aecf585 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 81f6c2eeb0b10aa77130bbfbe4d54cae68644c29..7d5fcda93e3394fb06ebbd5ec4f1c86f0b85473a 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 7c9e596e484452ed975d6c25e31cf920e7f3a4aa..638faa9da90e17b0a4b167560e3a965813408fd3 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 aef7d360109c2a553d46b2060d9fdb8a8e6ec489..1b227ac2789fcb4c46187ab739f02a234d806ec3 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 5a63d7d2737d534b82b7244ae0e9706f0e3ea435..af9150cbc8986d2669a69a870cdfc49ff846f7c8 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 e851ea8a1ebe0fde73026bacb15c7255dc1a9f1b..0aa8593cca20adb50b4d7b0d4c8aaee21435274b 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 a569ffcd121596ca05dcce0c6da32e7bc5dad44b..0175d0b77c3026fa0712df3d42afcda2e773ecbf 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 a56227e8af3df152fb82bbb86b452f52986dac11..ef930159ab7ecbc061e75afde6014c673eb50d52 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 b214ee1b22e570b7a839386874fd2dadd3982292..6ad3f1a00398ea97b9a55b03970bde7712a7f7e3 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 0c1c259cc62cf9f0848ee384fc5e4fefbf73e018..31707580ba47da76e9b845dde7cbb61f46ee33e6 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 8093941b8ac89b8b259ac9ce4e2c122ed670bdca..7cae9191af950c6b57a0c6cbdc35c7f8e3ef3db2 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 9bb06c3802b9a1f075af72efc7f59691897de1e5..b55806ea37c0fbd28c1060a72a58d99325d1c2c0 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 ca3282a197b5c58920ed7beaec736b15dc24c375..73683d148589da25b9c673305f2aa08d5173987f 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 a6083df04e9e9d300e5c285497ec8ed27bb143bd..a362ef4694d3f65049467ff9238660984b4b021a 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 d4194cfaa17e14a55ce79acdb53c4c473ab79429..96c20d0c58faec8e34d6c626905eb9608c55ffe8 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 b02a07c66bb893790aac534778c465bce1572a30..b7ec7fb1ba1783cfe197af341dbc3605de13f6ce 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 91e7ae02746cbc6335e52f5200c63ed110071819..299777a8fc13a98ede24ab8e2c7dab6804bfb5a2 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 2f8e7658414349422da1a4258a4fcd42e9714bae..ea117a5cbdb25c1a9f8d9f6a9ae16675d4395384 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 577ff48d604d8cca8a28eff1235e65b2166089c5..d7692dc3b774f6a1cd61682403ff9c0fbd91dc17 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 d5bd2bfdce22a621ad35d3bf0e85afdb4b9cc8a0..9a4c21242a36ab3e66a21cc8e577f1cf3c6d3f3c 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 3d581477295f2262726ee12671626049cab76171..73272361df03c47a4d98ad66b23bb4bcc5db8d7e 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 5133ce302349f89813dc766d53f9f81a8b72b086..85d2efdb69637521855a25653d27f152c273a173 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 bb9c72242752e889cce4926ca40e3d6f1f61cd6c..1761749ea94ac2c7c6775c662b28599db625dbcc 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 fd4b662c7ca37cbdf2fd4a8b59703d14111cd087..6c4f564d71158365f38e7e75c1e2b5c5638eba5d 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 503a75586ab2f49de142909e405fd245b6eb4a83..2a2faf272a498981c53e801c2d3d445b24eae534 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 b7cf851e8b8ba9714d3e097c92493d0bc8ce1ecd..6407e722154168e3f93cfcdf90c395330ceee93b 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 f95d01747dddec197c15b6c61ee4960e3a605afa..1cd874a223a99161e9d85847f7d9c026b83189b3 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 1ab8e943a7b9478e156f1fddefd6981dcf344a7b..1decc537fe11e72e4e1a05c60a6a95481e32d508 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 59eb3b11820824020177292b3a6b45ad60934af3..7c85978d31ce884c9e50046afc077d3ff776e6ad 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 07f609cfde27a581265d7c36fbb88c1b7a2be245..14a2ac636af1bb3b972cab86aa93c504968685a5 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 5e15017a597766b299bf5b503f3ce744aa8e2d4a..27dfc41a32a8e1696610d62b9ef3c72683584f5e 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 1cd7e914e5c2afcdc9d803f24299aec7d4c5ea95..aa1992a783798ed2235c5e60c2c19f6089e05f41 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 6831f8ca5f652a5e0b63c9e9bf9cf2baec6989b5..e09840c341a372e22a0954a368c77571b95dca63 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 bb7665791fa23e91a9e38dafb17956779ae4bc1a..8961aa6d1c5bb731010cb4b058dea2362f01fc7a 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 21d611a3e53528291e2d8410ed66e9a73223d4c8..ec2eda68e6464bf91426d3a29fe5d58d106641e2 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 1bacf99654c774ea2d1dd283c016e9330255a65a..0e3c4b2254cfe6bb73526327efabaf3ef2c512f3 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 b03adadf349329af56b9e66b9f1706afc24c0e74..cbf54f49749073bd39164992a7d1b40ba46fab67 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 9be4697e4592fbe17b1b6515f1b804c9adcd6e29..47abb2f3f08624938dd40f159d0be62f1081b651 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 47d84bbd3e20dd503c0f12c8b9416f7155b75b10..ca2aecc74c32a2db2d9fcf9397788525d3995fc4 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 e22d4ebabe5a2daaf6624636377b48d39d5cb8ea..de127f01d0d3b38c2de3a9899a1bf4c5536a7524 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 bd8db974b257f224dfb653193bae19c13902363e..6c8f5274f1c304b3c87131c162194739c3052f1b 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 b0d503a44332cd72db7754efd54ef2e5d371447e..1a4d7c029d5c47f1a556710796c0b40c232e02a2 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 c14cc87343328ccfb50297bbb690fcc7baf99a39..989f7dca2d2e875128a7e88fdb2c424f2e9664e2 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 5241294fa121a408a4aa6a61018b6a357ae88ae3..1adb20f450373e093e90347b3212c76619c6228c 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 62db14aaee53fd2584057faf53145179326d9647..7733a9c8acb3c99756072b8814d7a2a86997e4c6 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 3e1666e39a95774fe8b6a5c4e4fc16545ec16e62..bf9fa5c8741648145cb0f87114737a10b302266c 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 74b0d87dc935f4d67e9b4b1583efe6450651ff75..6ed0f6d35debfc5bb776912e1bb37f4342b03c87 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 7b5596960bf6f7e2320dfd590204cc86be5b2a27..44f9e3ef9d5320a8eb1eada59d672d3ae98c01cf 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 824eded230ea714eace71a2f495b0a9d9ec4bd42..9d3a579e17ea356f8f3af8ebe7fa0d780d2614dc 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 9182e4a8050ff0115614d42f9eb94c434d209ee3..579fefbebe00953a97bec8bef2045c1f08d6eeba 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 38d67235675855dc8dbfb6499abe87e0800a4744..856a0cb1459f8cd2ea24f2807ff018b0444d20b7 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 19db3f966ca289b23f61b0b512d64d3b248c2fc1..ae0c605db73391edd15fe3eecb77e430bb4781a2 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 a2ee233933dac627f4e6c6c6ab4f33e374bb2750..ffec774c2c316bf3f5c312f6ace002e57f994c51 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 6ff20d407aefbd9786ad4b819ffdf8f33e5b73d9..91a7137b277d97f7fbd952509390f6c9b7e7e598 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 e073a3782af50f7cef44bc0d02326ca58137012b..9328febd43365c7273dcbf935c7c776dadbf2156 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 3c8f365f731d7b3767f554388a588cf3b6886db4..64a0f1c755889bab7d1e01cbbe845d246c6b0de8 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 28883bd87f7afc3a8ec3c5ddda20a69251362061..5c0e0a17a8465c72f7b8300151c56b27ebc69243 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 a1cf464d6d051e399b6583ed34bcdff41f58aeb3..f77878d44083f3a491dcc607fa44784d5a88711f 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 c5b898f710ddbc2c307ec0c332cc5f9bd1f24c1d..e732d9182d4febe30b3c7dbf801418aded130215 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 f7aac690456ba119cac43ece28b22b8b429a65ea..35898e4a6d0089bc485890801f96fa7c7ba0865b 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 b4f277ec399623eb5643ecf66858a429d06aee37..3eb3faff2d70f9c2f3d74abd2e491abdae291939 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 baa0d5a08c1071c2509e520b0bf6d83db7ca9e58..60792a268b0e55d1941b1f4380b3ae497281b327 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 d4c7b7c8b72b746d6dd46017f177008c3e88c570..8ccfc9a5ebaca60ccb997907a9c935e2d3a4779f 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 b53a3bf69a674aca016a946b4d0211ea95534c11..6020308644509136900887b34d10414bf2d06a2a 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 cc3d422af242c99bff38db5b61d0dea3e279e389..dfabc8eb050c47ad94ce38b5861d79e01c02880d 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 5b12d7246000980bcec929d19b69e4712b8250a5..3d558d56e81f988bbd2e571dc015ccf80870b136 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 59a0ab8609e818955e66986fe3d88af1d9e8dbad..4de91ca8c57dd9cdf588d9043696ea2cfa833b8a 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 0828ebbab7885209886562e8d5a15ab21d1fdd11..12825ead9167b68e3171f9c41e62b4151e7b2cb0 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 2cf4226a935b1ede04fe296c41ab839aefb12705..d8eee292f702ac26e4c60f3eed8a8d053bbc153c 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 2dc36feddfbdc11c0c375a097db1bca8cbb8a9d7..e1e6a0ccdcf1e0d4bcdf805c9e4b786d989d9df5 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 d005b8634784ae9a24f3650e97175463a049bced..c2e72f780ef77955ef3f56dab8d488b98a3beebc 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 bb81640b271ccb6bb6aab5483003e126c0daf479..65f6ac7be93640b6c35568baf764823625b557cf 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 ed712a68f64c141f454b828856b3d08e35b6d452..a62df00c0065bdf7d067e53d6351ae36e3ba5b30 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 10318696be4f4daf0c8e3e322b0aeec17c4f3b97..a461d3d0367db51592f6802e6c08e9cdf7cea902 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 dde58155e8055bae661e4b9a6b0b3a5c50a22411..1a93e57ce4280dad184b37967b0ef50859f3b50a 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 94993e6faf3f11ef319c759cfe72de4913c8a30a..96625c7af420560168829b168575f3b598d8e0e5 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 3f4a8026e08e666dac392b6df2fceddca40fae35..42eed0e02726e36511a984a8c02c91a44a4ad8b4 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 a3518827035d6e4d34977c35d44b9ebf9b72c9fe..685fd157858995f8fd2700c3b4aa040c41466331 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 3de2bf5166f599fef70b038237ab4727fa64ace8..466c38c56b8d342989224fbf100e2f9887405d51 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 16707d06ac980c584718692f80e9cd4d18d86164..d457b006777f215b532b9fabc6c34bb488b199e6 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 480a1f8e60f4528c222e3e470eae7f6ae1348cb0..606f7ca4a4016e2cfba6ef0f7529296d4f6ae744 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 f3d3f7663dedb12cd77be02b5266ffb2ca591e91..2e78e31e6d1d7c6a57f4d9460d076352eaffc8de 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 ce1b092e0ab312dd6151f54c68cff172f573c13a..521f1fa1b86ca3e01c0246be6c83dbd13be5f8d6 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 9e62dda5b001bfaec91521f12e2e8f8f89dae79b..f8afd94bccef127312827802459ade945139150c 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 e705bb1ceb3c7e5c761cf03d3e912c13e0ee48f4..569314d9513cca79815083570c3763eb76febf48 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 7460e9d1fbb134b75a18658fe6d16843de68a1d7..4e74526cffe63eaf1d7e4c0e9797dd2528505bae 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 f2960deaa20887bd8aadeccb96b118da9eb42c02..49a94bb131c4394da819064769094bce2a630e10 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 9fa51ea9b55c7e349cf35938ac3c1b8474a3222f..a35f350be4bd94fe594ba754b546396716af157b 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 f5220902e9b689c47b4e3ba54497d7d45115e31a..88a7ddf792a140fe18d271904a5acd25602f1278 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 613b4b31b2de5db027c620214d4f9ffdb5419023..b3e920e85c100d90117684fb3cb80dd6f1bc942c 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 a5cdc6b1e0eded8c76024967e7f2504742a65a81..3a121f5a9ce5980bf2ba7f5cdee43d48ec99bdd5 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 2b8f3ffacfa92797185b9ea460f830942caefb34..7088ded311e659f2c41053f3afc3df429674c8a9 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 a834234f5426dba241dfe5a626e923c7c516ec5a..a2df4e71d904738adc08f13d12289c5971004f99 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 8d6a526a33e774cdafea8ad606c328f79a3a1521..d9ef580593276edfd65b151393a84d7a93a8702a 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 118da106ba3626501e9cadf5a723a250b2178201..9954522f20bc3ddc677b43b178a5378d68bc792a 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 90bb3fd6c7e1d2241c7f5b5511d0f5e31154a84a..22d6816d061e50d8939a6d7a4bfc918c15810fec 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 d5a2e2e2da69d4b5854db9a7b9b2258b1105f088..e24433fa4d417ca93a502be5092f76402be3f80e 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 f8bc14458e7b9dca30322b4a6fb86f8493131aa0..03a62df24cd71f5c8279ca4a3569e187d0578ac9 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 54c0fa632e82b797c2214e95894fd957bf8dc072..0c7104d2a938b095840f4c73ed511e072898de3a 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 977eb645793313255c2d81dd8db8bb4c8ee2075d..6b2d70030df35863b816e771d506f064204d85c6 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 1b983bc8448917a022fdd6b051a54fe4c8d71d4b..bef3f2227e000531b4ec9538b8bceed83837ec33 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 0091dc7b01d001e268a1bea7e3d8252b3555749d..0ca800bac669fde84844849b6e0ef3bea0847473 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 915f01943f02a1fa95a20b2e8fc20563b6b3b4eb..d24762f941fe5f97d4c3fa8b0f7b819614ed390f 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 e18930377acf8cdaa193e5e5731641ff85bb4388..969ed0161cdc440d62e9a9d34fad8cdbb9276f85 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 9b1a54e2c4aa782f49f4afecffb0a45fda3919b1..c53988ec8801cafe04a9823a9b0ae9cc9240a5e8 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 aa83f6051fe1cde8e9acd3a5092f626f24aaea6e..c25f519a3d1e9f6a1bf8ab3b45822e4a740379e0 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 22a576cc5aba082dab2635fc3b5d0f6714623eaf..989c9d5aa38046073107ce6bab940b4cca0d3c1c 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 477426fa37044a79f07e0d3def0cdd115a4d2fd9..82a1a14e801588396f804c8317f05d3319b605c3 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 79cdc85bc810f93f0facd62feca82db77184cf77..f8e437c4969601ca9e70e2ffcda9cc37aeafed3d 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 d5e8538e586399e77e53c498046a9adb4d2845b5..4e22a3db0b6d898653f847bdf1fe4b8b0064f3b4 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 e1eb0d9aac5485b6762eb5b479c4d63a0f214347..67e85f553d8f82cad2a73b6a34ea7494ad4742cd 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 f2a9fb0b0d35b50017aaa2d2dc912e0c24d618a8..a18bb9245c348d800a6124737592a5755d9f70b5 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 e7434c4d7827c11147b714dd560c3029b24f871f..2c6d33afdba4260287b17404cb9efed390c700c1 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 a89e445717e124639b3eb3a2992050234678edf4..730e9d931529ec23223179d957b7c7888ac040b5 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 69f5eda44bf4fe51036478408b6dda49dcfe1ad9..a79b57044bf59ee801fbd42921917b725718c831 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 095bb93785136c791a5ea6be4905def4294c65b8..f0cf86e16c79ceb51f3a10a3069638e23af1e91d 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 6be814a2a5dbb2240bfc67ef85a6c65cc659fcea..4cce0ae64da81fddb96c643aa96efb2cce2b553f 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 498610ecbee77d7df7250cd1d731d562cbfa56c8..3ad996bd0bb62a3b31487b2b3e8392d67373431e 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 e104a80f49d60600b4b971885c7720839f1025b1..dfc2a45f006861b82832bb8c87187da3cb516e3b 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 502efcdf9d069b900d65310adf90a2c1de11d6a0..3c8a24302c2353838bf2320eb8d21452b9f7a505 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 4fb668446a6b284e4d11c8a76b7782fc82bc9f3e..d4f59eca80007dc2991830911a5798eaa02d9252 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 41aa1b04033b3fcd63016b04df34b416c700fd0c..bc85b4255a0920da3fef29d6e7eb6a6bac4bf63f 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 db7c4a8f09908cec5039c72f5aa7419e9eb5507d..0edaab64e07a173c8f8ca7f3ac4a09c68ebc61db 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 e39b31cc2ac24260d6fa35e37e80f898388063e0..2a99639725e3d67429e3304cee75a56362d41eb7 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 9fe9ff3dfdb85e64df864a06deb2d54b5ee37884..f3f8942bf68da22a673114ff2917eb63c6b582af 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 8a540fbfbb5652f4130e9cdba359de81f1dd21b8..da62b101a3863c102d0603af84f571348f8c8747 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 7489db03a246f157f799af3cf327b7ebce740d84..0b54d84c7bdac29a9b655a3edb1b0eb10e9f40d2 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 ab704a3459a3bf5ee8d5e13aa9bc67af8b02364a..9768e0bfb9338015a1407aeb3366a46d9bf439f5 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 34e581214ba6720c353f154241331c3d0935fa3c..fc59f8cd3708d75376e97c537c2a1745e51d2965 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 4bd748c9f2ad4faed2060d77201bf911b6ddead6..563ade07089c9102d35ea224d681d06b18496765 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 5e349ea57fba13cd554ab3e251b1352fd2bfcbcc..0dc276c8855848962726fd5aa574b0677da61e9b 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 5467c63158cfcd2d1133336a047f84ff70428c54..13d6c1e5d20de8697d34accab5774da79aca2a80 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 d14df1a7d4bb1fb4f8e3ec3169d00e075b111ee2..91a17a6c0201ba422c6e14e8c369b85d21c53de1 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 cbbbefec796738c0521c1c82d2264229afd967fd..4681f1e428cd56dadfe0194ee77e275d5d0dd9a7 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 fc4d9afec88dc4f0ae7e8084b2b71bef981fddb3..38b349e78278978b1d312f6e470dd4fb7ee691d7 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 8e53a409ae0859ba1ce0e65ab239052ed03c14dc..4dfa461a47c868d7d51060594ef8bc5964f9be5b 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 35d31e0bcef2e2dca016a3a069657b9115976498..4f4c43e406f325d551be6850bd4840d19245a183 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 758c6c51e9e4ff0a9aa652a94abbab08636bee34..23c4733a23fd2840429fa97f3e28e2429bca31f7 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 91c0c05399b3539aaffe52cfd350bd9a0061d483..f22be4c5d391097f5d507df7b524bca98e8c84ee 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 7488844c9e00fa6cb3437581d147d26e6e39e784..820cc5880468a5d437c7a8a3c08d56d9bd5d4c03 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 a9d07f23c1f744f115282925fe8df171f19ee8cc..afc5a8f88b192c9d5d3d5665751b77622e145e5d 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 6576cae55bac8aabe31eeefc11ecebd0d7656f9d..1f3464019c5a3644484ce6ed82b0f484913e6409 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 6e7c0fdae58a60a0193fb214439a4f6e247365a5..328f91af0aba5707e36b1d4718673f056101617d 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 b9f791510f48d3442c59fc2a8a4f8bf3ddccfcd1..11e19af6c0997cdc746e5b18f4ce8a757bae26de 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 50693fb405530e6c16891e4fbe5e929c90b94780..a6ac246acf98a71563b7a66f38c183f6ed55275e 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 6867d3546ed6b856b4486d1fa155affacb511c49..3fa0a3ce257717d9fefc178f9643ed5e7774b58e 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 2f6b0a0cae5867f338b685630544a251beb89211..e578727a43edcdc56e14a1e410149313477c4d29 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 c7ee886d324796c0ed5735fb6435517a34b5435b..8252069f8c1dd3f23761d8340599eb31e2601853 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 c4384e1a69194eb0927852e094b2ed2b6abe89fb..e414e7f1d76735a8c4d92a8a74942cc67e3635d2 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 592f722cd2a0d4abea94c8b30974ed74887863dc..dca71d03499b740b3c66f8ace6eef3e6d6a55b82 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 daff46f31c8600a6d17272efcba3e2245ea44638..0c38f9d68310c22c68c55ba4cadfa50112df8c18 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 c5033970afa4cdd942ca43bf2133d592e1b1d311..6607f3406c3b95f672b16b094299788cfa1ffa58 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 af3a3c62c0bf8c1a48194652861b9bc2c1ecdb4e..2c287bef6aa3ab52f4ad3efa7f8ffecc84a7d319 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 6479a6f52c7ca73d84c49fb8f60e1bc0ee82ce6c..115e414e3486311ceb2d668d51f4aa28e8597dcc 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 4b71aba1147853cf575ff46664aed9f720638275..75052a3faa572455449d28797573741686e37d90 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 a84b6d9afc72edb6bf7524daaeb41e9bcbc63e17..65ca47f0ef2dc9ff8ce7105b1cb92b758df5d2ad 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 cac91bfe806714d9d06302cdc7cb6a5470d25732..81ce0199561e73c4c9cd52b326dddf9b25be8c1f 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 0ccce4bf22d545c18f8e66fe34ceffb6cf458d5c..396e55979288656fddd27ee5a78abcf16e03b5fd 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 d416c2459e2df73a6b5b1277001fb7a9eef2cfb9..5b9f98caf4de89a8ee6b7ae986c314ae98d8181c 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 e9bf476282974ae85c9fa5eec5d45e8e6363d15f..fcee41e987b863dfdb1429efa60696562facf407 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 50238607c49e160421a0c010b12f9beba0531379..68ee6885eb3eb244f9fab0314b6d78cb18c5f457 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 336128512cc1bc73522ff5fc70f7d320a39ff557..6bd9b326c7e211148f38397094100d6389aa7bb8 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 2e2813525e4657cd0cbe62a4c3bed0812b8cd15f..b67c004a61546519fc504740b8ab99ea5add648e 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 dd1d38c31c8b56890274570df73b78759151c12e..eb1b609634bf6687095d2ff99c68733902c0bc4c 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 ebbd9c129374027b86d06188fbd2c192104cdefd..501b68c2f1883a71e8046b15afbaa7f82b54be42 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 701e437e155ee1183fa9b17e5364e81cbc8dd7b3..e73f82973e73acc5fe58a18fd9130e3585a0a9f8 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 bbafd2addca6255a0b19cb9c42d0f7a2aa6326fc..43d5f44622a9e4844400ce1f5f7f1fd6654968a4 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 3a413ce38f5a097e9f4d5b0f1d1f87740e10228b..709196385b2ecfa12715a35b114a29e57731072a 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 8b0b89fd28d45caeaa9fea0d9a0b6c30fafbd72b..3de0b4575b99dabbf50200e718fe5d7942533aaa 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 ff31c375d0a88f3482438630fe642c6b8bd56b89..7fe2e80c929d8a012a9831d728192256b54ea9a8 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 65b796af3e249727d671db4691171e3a6113d7b8..76a2a24f779b12d06329a22066c07d2a7c08d5e2 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 83ad9af6702367b01ba8a37ba6932317b175018c..4627868c9d76b19db5f6211544e86ea401ca002d 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 e32cf4c07efd44718b9fb100177fa8b69bf5a8b0..5d9259558130b9af10df88eda14b51a43dca3524 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 49a19813c0cdc9460238645191228912bb7c71bc..9c7dd4a1a955aa05af5032310b52b2a2bcb0a2d6 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 3bbf862334b6aeb7308601d55d776488d5af5741..f126ea6af484b1fb9c1375b26c8b425b219b2648 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 b8e4d570b9cc1fe10a9a32bf13b6bf2320e66ede..5b1b68c5b6f7b4b9e9c35513e6065e8afec831a4 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 0c1572225bfc1e0a440aa278c4dc45afc15fa7a3..b4640a724df0f17d539f5b57575cd4525a0bd533 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 698db0fe2e9cb59ceb12d8d7c8b9eec225d491c3..6d0655803208d6371288de9c31abb928f9d2c0e8 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 2ec5723ab001b5e7258eb1cd63f3e29eb1dc0911..ac5639bc80226d67af1b4990a62e6470a1ca58bd 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 c900032becbb89f50498896aeae204ede418d717..5dea59516c8eebfe63737af94ddae3f742751c6c 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 4de4a29ef3ad5b943876bbd878289dc1a8a687f6..138e1d1df9cc5231d5f220e1665739334ef6eb9a 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 3627f6cb0562c34fef151311fa57b067d7766cf1..5fbcd68df723f0d6a35f030962b9d9716d597e26 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 b8422eb2678b21a1cca5a844b3179004a87280b7..2fdbe3a1b614233e1e7ee7a8d7beadc55f4d0297 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 81b21dad49682c6a10269f417f05e64f0dfb612e..2218b378c13339498131ac71dc23666d5aedd5f4 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 ddd91b58f036d7790a69d917a3b9f8a4766095b9..69b3dd4b79b14a2dfd8f8d707ef7f87d5e64400b 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 af4d7174c9ac0e432c4b9f1991da30ddb0f6cfaa..45a15443d4a1267de5b23a5af611af28d818e9b1 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 81c4a9fd98629161dff08c34d0199804df8a85e1..95fed24ff6cb379cece7efe113d809fb35958c64 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 046644f74ac21aaf8018eeafa5fa0bcab3ee2778..672b074bf35945175474371d4bb008c9e057ec9a 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 b6f3cd3e0a1d31a01ad3b07e9881b449b227b69e..131599f2788570113d1b7bcf250b35f855e45aec 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 2f1227f86d1eb0d5d5e130479a02ae2513fe1b21..1e2e5bde24991c545901bae58da0472ad774229a 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 70675696da787d5d0b827155b33ad0d60fb098cf..9d6293223e66952eb96f68607e966b2716b14270 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 ff27e811b577fe987db2174f6b608d1260f29ee8..ac0e79e87f1fdbdd269d5615168350d19f70cd17 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 1d707190d47252ec640c84e8e0eb646d989e22ef..aff7144664aac38bb42448a4f12c45e0b606513e 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 0ff9a0683d74f30bfd749a0de519ee6a32e00453..57f78235169ae5837acd105ef3b710e52c6ac579 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 8e371e22e537ec22161bdc96d8d7d9b3c76f33de..ab653a6d3d64d5ba8edfa85f3e7be3e275a8555f 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 149ab71dd9e01654deb9011a0f416c87a7e71ccd..fefd96e11c3fc97e15fb9b8fbe1773fbb41b0ea2 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 f150c0b8853bde85f0d54b8370ac14832f23d186..54a7572a8734b1c496cdb7d5f6455c516f159ca7 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 dd44a43cf628ec19bfb8501613c686802d624522..20b2e7dbd540066b235ee4fe07c1e4fc36a220c9 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 15957d4c4f4ca11c665e4716860241c6329ab1a7..376c1a0689c41a79845599e0fcb6dddaa6d14833 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 b67c27a54dfc24e3197b87efc5a9dbfc3149ded0..a09854c0e38f90d89d5e182537f9a77a3a3c10cd 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 99867d52719518bc347d35e6d11ac3c0d73c9bd7..a889748eb6e73d4d02e59636fa6e43996d0f1a16 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 1947eb04a8a076b19e0ae179ecf2f1f210d93978..3cd9ce1b61cb213d36fa16d40a36258c52a9b58a 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 f6d3abd98be66b03a65713c64a93b3119f1b17aa..f822e123f76cdd1169716eae7bf55117468c0a56 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 0d5287f8809fe9cd588228e8dc4e282e97361621..d49581a5fc7b956c0093b9642c45c2294e2533c2 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 297bd6e8cea6f112c7f20beade22bac995a9a7e9..d1a18d3af655aab9fc7714f4139700bd514a1749 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 ae3630b2f9ad3a40aa15f106aba5b5521745b40e..4cb3ceb20fb7f52262639c9692c5782ff5e35306 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 6ef01c2606654a954c08c8e0be3f1a0e728c5279..40e30a4ba610f7738725048cdce118e5d9b96cac 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 25fda479b9544c40a6ed3ba8be35524bef14f428..cd2e89af7d24e072397b1da6af5c878aa87561e7 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 2ac004f3b566508e9034cd7b0d2b089aa5c702a3..11bb4fbb014006bda728f1f4092ae65da27404e0 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 b4db96dc2037a005521c426d7db0619551c1fbbc..263f48358bf042d2b939d334e7432b4aa88a5a4b 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 638fe33172985e0fbd0b05b479df66a255d1e2f1..3e19fbce823f64fe3e3d363859c13701bb1d95d0 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 889bc5c6f491456f7f348da45a5c242682836637..65760904c124e993a89e841db153575f5c811138 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 43be06b240b40faf0d86033f097bc08308e09c50..4ad46deb5a048a69afbcb816ab358862288373a0 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 023381887b88a255ce584f851217c79977942a30..de75fbea38adff6fe56823eb7d173b3cd51fa7e0 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 86cf51586bc22b43ff81f18682486c2efc4ab8c5..4183876a8263446a3cfe305ee383454bfd921af9 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 2cc60096ae47e32e24b98a86129127480585ef4d..9fb2bcf91d40724b0aa673340feb14fb64e1e9e8 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 de6dee60c64ec83e546cdd54ee536b04fa798db0..43e30960ea6dc9b6a31c6713f81f9bf88a6e3f96 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 7f423a01a2b88ebecf7f9467b33396338c7a052b..aefba1d77a2dbe2cd7594bce1c417a8d750481cc 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 6206132d7abe53591231e343879b0d0301da444d..b550dd7961c6974c2b3a674325fe1ae7e40dd9a4 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 5ac15b549c2f20b088ac957667322285674464af..3ca9ab962ca499381244fb5b756121203f5ca1db 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 ce40ff299b3050466c1a528b0b06627e8c0f353f..987b7f55b6384974db0e3ba5dbdc1f46560a83e5 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 73227bc59ac823b4eff7acbdebdc89f0ecbd0ef1..e79182a84922f07e4262d6ab4ba737c06e857c11 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 9d7b484d94902b049e51066402afa854ed2d5eb4..03dcc5b2b7c11b10905c60f6a0b0fffde28e29b7 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 8d2019790962c8a93b4f97e027d112a8180b8268..3800d9b3ac433f2d21bc1609887876204046002f 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 d1c5bfdaedaff75880baedd1bb594b9eac8742b4..122f47d3a5e693a50f1d35c65823484c10dac258 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 e62be5fd5b3562ce48c8815ae108593c4e71a261..cf448e64476f2be21066ba706b44c2aa84e3c327 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 24494575ce1b71a21203f91c65478572201346b5..9af617f0d4774b1cbe7fb990d2d3c653f6bdcb71 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 9ded2b173953ab0762987af7aa60826d0deee1d3..f603f0a4831c7d802b40c02ab6ac7f68bf092955 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 e73c7363a464a08eb9354f60166c279c8afaab72..9f695a8b1105f0d6b16e9a1031158540f4612cea 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 6efff826f020e727db3d7ac61e5bb89e71ef3c2f..fd08c5e722119fcaad80bf712c41d66849cd63f6 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 7d4961b562b9743567e932da492d6e2eb660da7c..6514076090e5570cf5dc5d15d4788facfbf38815 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 5942d7449dbb74f1ced569495d483bc486bda5a2..4bb1ab68f8bd9f429fec57c1e7b3e75d70a91467 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 1f250d2453ebeb58c9efe1bad8653276235267ab..eee7b32d4c7b87700948d830dfdf33e0fd558654 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 cec450787e08247d57f788e8ff2e83fae1468c8c..5c879fd0c960c5af8a779e62d8c447d31f82ee0e 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 3fc59ceed7a28f6b6acc048ceeae79968057d355..71ec2335e53decd63c4c99dc5328e9580b9ead4e 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 57788350edba658d9dd313358e4aa9b4db912990..907b3619080b634ac50aafd9e497a9f3906a37e5 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 59a46c1af004ced809162cb5f062ada833610a64..5c133f983c1dea06bb02f144be94b5fec74ae1b4 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 d7e235f05b8fec2df65b5267d291780d1cd17b62..c14547025670fc31aaf430b0ae188a8958b3926c 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 7a8dd8e1124e42f400e81e5b9a4f745304134b1b..08123b7d10b2c37ce9fd3d248b3a89c89b79a11a 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 e7adb5187b5ea17fdfac603a3e56700747dfba59..da2d217c0d99f11aae401bf0145a5f0c1efaa1f5 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 398d9d663f8cd52d4d73899f848c7f63eb747190..1cfd79ed04b49f3b20d3ea2ac8828222114a3d23 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 17f6471e7b4fae77f8f90709512e553e837e3f57..eed50e59ee6d51d6d9efac2e8c75317f5a2bd36e 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 ff62f4ffb26708c11e3f871065c380d8b62eb382..0b09314227a167c43e7474600816461d474807e7 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 9dfc1b043d93f7c50210d3ae9bda1e30b1e16386..fc6fc9ee8b31c3b5ca996facf8ded470bedced83 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 a98821e53c6c87514a14df33d70d27b578044873..72e12e913f3e1bd309c90817e820966801cb1b5d 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 8a8eb65a16cb854e8d7046dfa70968ab36a491f5..76c88bf29e24c49cfa1ec5c8c9d5d492d18cc491 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 145e04d6ed72e45b07d3a818539e683d7639dc74..c8a0414e3d07845a9ac13bb547c74c8dc156ff39 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 f03cbf87ef5b7de765c413f0dad3f2b8d518cb4a..4b1307eb7ad2a7a78a2edfd1d73d40200d8f2a18 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 c326a78bf8341f96574d2ebca3419231f59cc45d..dcc2db0676df734d61794f431870d24e265579ea 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 1057fd89fba15a4331d8603889f415b91db4d0ab..2fff18589144d3c962a08f51ac47bc949b577919 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 80da91b789841277a7d3c093e1e0c133db14e29c..67e4bc4ff2095dc71c3cdd41370de62b4e03d3e6 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 b902561416dd416caac6fd22620762df3436f421..98aedc056299c05bedb442729b8fc8febb62002d 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 aa54e2e677c6d91a1e58e240d3a1bc716bf7997a..c9113b110077a8e82eb32a61d4cb413367c817ab 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 e944cf25824e61b4b0839cf11bcdbd6cf925e474..e51b2b2d9b98b33c66764598d14fc51ef2c314b6 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 6b92f27f4fe0b433f27be9490e7cfc5242101564..c6e8d7be694b47634b3389179657cf2490bcc12b 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 2115c0642a8da2687842cd7a6ee30e69030b9709..d0f01b2221a8e9ec576a5e291c0a1b8128758e2a 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 966fb71c73592b64f86dc7e73e93ba2a1970075e..2f282e0cf3051f2f2e93af85b5a36d430c637388 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 b0d90f5de38584476f20837d50ffee316aed5918..4be2228a3a4b0f0945f0abe996d66464ea82b517 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 f1d047b6ef934cc42b221be30d44febde8264fee..7454929c560c3fc4593308f53801cd7d8ae85e2b 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 30031df9e58f7a3ed22f07c656c25f06e5d113e1..56d7b53a596e96d11cb6fde69a5dcf5f29846d7f 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 53fbae7e7b84ca5b01275b2c7c6a18748f61104d..ed681d473bf85efc583422d46277785cfb961e16 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 75d67d04c13db9753e4e5914fd66a9877d8ebb2f..8623599aa2bc6d8b4bc81a2f7881437eff16ffe4 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 87af424704bde75a7c2d4ae0148b8d6a8398b416..d9c274a66fc3b2188ee41a6a62b4c3f14a565107 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 988b07c29ae76b708b8e014c1cec91c955d186c6..2e1f0ae8af710a36862b99d873cc3afca6cc1dee 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 db70925f7592822b70dc2e65ebf541afad498fd4..a3424d920b195802fb700cbc01eabc2e3050cdf8 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 0da7d62a20e57ebaeb0808a11dad79355a7701ef..b2d4053bbb696132963289cd9f533a023a99bf14 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 d1e2bd7c0ee983fd86a500ed93ab60c9ffa9dfc3..d03b82e3a524a4c81c57748a8cabfa5fdf1298cb 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 3510ed3f34ed365423029eaeecd9478205c2fb69..44cbdb7ebd2127d917b5b720a4ef1a5b4f31aa44 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 5c6ebc268d9ee0709dff331665c2da5a478218f3..7e04b240daca7c25f89a3c123ad24e3b5dfc6db9 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 f9f661d884d83bc45f578dab4a4d52d829184751..d60b9a1ef6a4668214890316dcec062b866812af 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 81182cf4c0e66a1dca61c57e97cd8f6ded089a8f..3570d341e7a24121ad77ee3905a497437e4b41d3 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 8454bb6d813c9c21afc174420617199a2ae76311..6845a1111a9e8919eb09d2b55898965db1a9298f 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 075de9e727de4f223b1b0de0597514dc4bf955db..754eb86fe70e8ad91154975b818275c2fb29cdae 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 f3bb56bbe3af39135e679d7dd25da7540f0c9561..ad617d1b28426f062890c47a29a9146f7188ae21 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 7c0b164ca8a45d90bd18f39380b8ea6dcd824af0..34ec3875c000615effc4a203178260a8877b606c 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 311c649eb79f72d9050f2d8d66853694551ef2f1..0ff411674b8e002246a35320af94a4d183aa48ea 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 d21950e74fdfc86b135ddb50dd745de797f1606a..68c2943c139c9837742d0ff16f2ab7e6530dcb01 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 d7211898798f36666cd4820f86494b3d4c76480e..288315b01185a366a761dd34b6f93a469ddc55a6 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 b293f7a8d09e4b886b9d116643303b49bf11a420..edcefd192fe186cc82a99bea003c4e402b9b2a3c 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 442a503534347726a0a90434d461322f60142efb..7a594610782ac7d5df17477b65ed0a159d1bcdd1 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 e628bff786850c8f2e3d2b39d53b2d2cb3ae7516..17ffc549873061df44ceff02bf118a12e381d127 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 607d7dfb1eb53da363c76f0f188c91ea7844b9ed..b58d5854f3c585d8c14e7c0427143fd054318b1a 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 c5d49f12aa2f7fd082f5517c85942d79a6f7aa82..8eacc56285ab9b56d97924b1bff1130a07b88e89 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 fcd958b73ea4c958cf4d9f2f272587c7129a067a..e28f317418f0d27b36164a75a019bd23ed387ac0 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 4060adf6b2e0d94f248463b1208307e1b6f410a7..54add2231b7723ca4380840b2f7d55b19db15986 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 92a7e85da4413cd7b33acbdc925b8ab29733fed4..78a918cefebeba1ce6829cfce4207265ca4a2954 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 bf11f7db07ecd5585b2cc729d9719b088b8fc33c..da8229fa0cc491215588df624a2381f89225c7f5 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 1bb998b973b5be746fa8f936590a047be793d2ba..5dd3441363c7ffa27f9862a1cb4ed6054fa0cc81 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 6be0c50ea0a4c2c93e8d0769ae2a7da3b23b3a53..ee93ecac2df7de61fe32dd2c6dbd36e90333b2db 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 2dda9fd8b153bc3373c1df774b4762dc05877d46..5f566c2feab85e7d6779311e647e9d1523f17ed4 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 c9fd4c0ce92ed7c94f6412dbe3aa26d14b22638e..def77100868dd279169ec0d7011c3033287870ae 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 9f2de88b2b6cc7d90d87169df0b8bc1c06737436..69db0dc596839add50fa71d73e6d992e33ddd917 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 c7eb59e7c4576ae8baa3bca976ad4c56ca50c3a4..987a42c6271676a8060ae4ef44a32255e44b18e1 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 6a18cfecf9653ef1e80e794b7bf6519aaf6f3508..b9fb6b7caba917430a934ab24d9cc95184016d8c 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 e830d7d8156fe2e6b7b198fa41c8178163850e58..514e179730e4d3da1f0bcceaf9c98b89e60910bf 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 e7c36860c30e7baa026f802813a424d5c0e84a7a..1bcb3e1d60c5d015d1f6445836edb73f257dd7a7 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 ca5d94b845235129ce90699d4158196b6cdb08dc..ce1c9a03bd1f781e3adb6400404cefa5be209e1c 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 7acc228644469f43900cf9560482b978c769236f..b20101e87c1477a5c01d8d75e8be7ec332d322c5 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 374dc895e4e6794a7011a7a0fd048ab1f33eabeb..fdeb34ba5cf3c2fc8cd4a041ea6fe1dcaa418494 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 c46940f9017bff56905b4ff5bce680c12b9ba0fd..8c62262926b89aa01fe7a4df865658c04a85ed85 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 240ba98ec05a9b0258e5b7ece54ab979c8d436ab..c802ed645d5e88aacae74d67b4dd98415e9cbddc 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 ecd73a13d10726119084afddcf8eb961e746b84e..5d674d150957c3517cdf1d298f2e26aa201a8cce 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 3c729003c0516acf16d67f4175d8d4200b4141c0..0296a7268dac3875458c282cf02fbf1ebd16b917 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 c6eae8c6bd3403f4c989eec3d7c34ce5ee7fdfcc..a0d1fb65352cf03636afb11c1184aed75f959edd 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 245f1fa0b67609b0d9f9eb07d5b9cb97ac83ce6b..45f0fc146171062d3f07af50608b6165615ccd1e 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 b8bc7e5e727de6daa8b0882ac579d5c9cb22fc30..c6867dcdf289f08ef2b16d23a38a9c0417f1c306 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 416c6de0ffb6ac4afe3f58d3ff45cfcb6a09bf0d..3684166f7cf2265d9788d8a0fde5490e21479a1d 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 eb2d74dd9f045565946d742f74eae3cfd8f7fb6b..355d16fe16726f2dcc83415046f00cc1804fd294 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 ae1c190e0607e9b02848ebe7984f31260fdab847..8dc1f7aed72dfaa64dc3be4ed83a202b19102880 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 082db96ccc128668ed1ecb6a04a949a638f94a8a..014b453f18c53f2ed644978a5c227fbf6f510ad1 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 1f38720086d38497fb87387900d29d8cc4d00f86..91838f7eb9eeef2df3867ec6f6b4782119f4b83b 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 4615084fab167c4766e4aabbedfc66e010633a08..d3fe6ff7250fb432644f720d13a72c47bdd1460b 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 935cc6b89df4b8962aab32fa835e50a9b9dc4a31..87e7647826a686a545382cd84a7fadc212fdd60c 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 01a26f747670c316172be0eb162a05e834161770..54a052c0d749abef1d2009cc82ed89c89ea4044d 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 42d925dd3da540a87255468f910227142143b37e..2fe8503d4576ec085813de7971183256cbf362d0 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 a5e27ecd562e3f7df1aca6c9941c60c55697c810..97a598a3a08801a1c764f520ba702f9fce1da044 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 efead2fd444ae689ebbfc743e2d63899378415f5..65d62c9c680e047730d85fba34b507f0616d041a 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 e85468dec2eb40a473724ca1dcd13ca5055b161f..cc24334a6ee55bce1eca2d621636b15911b90a19 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 f74a3a11743ea06535c70e0cfbddd026df9b907d..cda03409c4f1ce799a503d091d587ccc6cded82d 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 91dcfecbebac62b040a88585ee7275134730adc5..f01ad4cd352702b517deb2186d3b778b250635ad 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 e7d001da6105172f5e8c8943804a6311bf9911c3..e42fb34ca8f6b64a6940c4117bd3231d4bb43831 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 1af9e5dd1f1f3dc91e43e8c57cc5cf7c83ebd8be..84265014e26daadd58d7c6cc8e357a417ce608bd 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 b67a58eaed30cf1e5fc0ef9c97a1a55b8c690830..c6ae9a38b3b16735c9cfc633d44bc9efa2cca441 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 fb08b4987f3283d28589e5da3bc44de03189dcc4..a4feec089ea600dfbc2ebf657c1354bf9180d253 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 e13f318ffbeacd92ca24883096d6e4da5b4080d4..b899db32ef36bb2aa8f783ecf6f2e3bad5695fe0 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 dacf3e65ab92a398effdbdae00d424d47483f6cd..a96393e24dc827de74ebd16bd2871016b016f8cc 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 00fa8577451272eac678f95c9ea73202895377c7..a8743ef4b254105810144eec6603a8e01f0844a3 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 d536294740351ea0d8ee99e118c918c9bc8423f4..fbeeb1891d90ac997551fc0fba8ea6aaa5311654 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 85128b7b94f3ec9d9f6bee5871890c764b039a28..79ceb873ba908e8f7daa5a4803b3cc21a360b646 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 c5252ab70272800f200d8e5be60a634d215ce2ee..aeb5de37273fbf6557786829788439b0e042cb37 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 ae8fae2ac76aeb29953962095de5aa3fddf5ffa5..b68a13d14df08e0d2ce874aa3e272275fa21422d 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 1088c62a07678df3464d290dedb157bbc9b81d08..856c7840ea2e0129ac49b87143b0d43bfd6f6006 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 41f0483f9baa89226f220ba00ad3700b938b04d8..8d47dc6f1fb4123108622039699aa6bfed8e777f 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 b06331783dbe17c8de2ffe2f8dcd02cfffcba9f6..d946aa452c8f5a7880725f7c3c4473e630d0d216 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 0d5fa34087a62a100b6c19a41bdae3de01163110..8a6635aabbab16ac1197043a8eef684cd06d9633 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 c11b33cb587168bfa92995ad8ba60cc96ab27337..88bb13e27114379145d9a228461292c2d344e8de 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 d683d1d95bd745ae9d687eee8ce23aa52f5fc028..b5bf1229ccbc0556125aeae18caf1e69266adce3 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 dd4584c6a55ec1127514c881eebf9171975ae0c8..fd7e6462f1f9790c9a01c9c015fe03233e311044 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 563446df85f05c03a488a90180d83fe43601da57..62303e26362efe1e0d87c65791df4da51d386cb0 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 31c7bbe42d58aac74fa9d17614a4497011367db1..41c021bf3ad239e3c7cdd1c0cd565fcfa91fd26f 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 49f2bca50bcfb21c689585f2bbeb8e452d8bff1a..74c75c4ad209fe2f83f957ad01101edb0c115e8b 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 99c4d820ee543de95dfaf5f25f7bf201e3ed8703..312cc732030070dfd0d67c196a02306bd5d20d22 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 0e7ec3871ce2c4b7810309707c19d6aaff414f57..dbf823ff0dc84916e31547b6efbbd36a824392bc 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 9cde9c297cc78092ac3e230d0af4867924691d5b..2b14b1673ae620cab20652823696972f5966c5bc 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 f3b98b928f9f8eb6a3877517e4267e1c1b7860bb..cbe9639379ccef651ba6d912c81d8d7ddba5108b 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 8f1ba323ae8a6fb3394090a3df57f81182255225..f1d4c4256aadbdd3438e5f85decf13577a42bc16 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 b3132f9d63b69bb26c4bc26570cbb93d98599b3b..d61aa6ce0bccea9a5f3d1a7e84ca4e5b79dad66e 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 3339bb9976c236f2e75666abf0d602fdba6ea2c1..b2fe249384bc195ce581cbb33376f3265467a322 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 b2adfca4b5f88d8dc8970ddd8561a13ecf398415..aba64d262166e80716883b43a41cf98d185b5a0d 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 18a94685167e445e1d7ea5b266a5a0f5b6035fee..c8967f89ebbea6a43d29c475b3ec5a93b50c57f1 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 497c0fe17019c08469201892d9c4ce73209bb6bc..dfc2f3d79ce2af75e1c3d534677326e5ab2fc5a2 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 f99a4be5a10aacd23ab4f89428c0d88a09e01b0b..046e4a44e8e07474c0aaf2257f065376627af639 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 4297b91e4c00fab9671d0e136ad2cbd647b917d1..6bec71b42b961bddca0c8ba01cdc346702bcd1d3 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 f3a47d1ae1a22b5d7be5a33788cad25024a770e6..7aafdae4b7c2e22e7e48a3f02a8bac539ddb235c 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 fa20b90a7c2b0d2e0728ca6dbf40408c252511ec..88ded907c2fa605fde019b220cb5864daf9910e4 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 96f6417ba0107218712d0743436624d916476935..d0e2471e5ea836cb7942cc336c7c8f7354fdb66c 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 c694e9b85640f1a7885e84764fe85a457f8b84ca..461211b6bbfcfc7cfa12b344b167875c8d304146 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 0c6228769824f424ff3c5338c74e0e7bc38abe79..43d1e828c91e45cb1947b8f0504d78b8c330306d 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 ea923101aa1ab73541288bb8802f63ef19bf7cf3..af890b76dfc4c2e37eaf6d5d1b026cd450f90ae0 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 6876cd1901fe28e66f6f72e20a8cf9632d5d7ca6..2a2d811456a1aaaecbc8cc7f8e23b4e068368276 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 66b6fddb63b43a813584d40453edac14e24725de..f4bcb3ad7cedc7f5c1537c37b32162c58cf07a82 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 7afdf1b9a939c6ae863613e15e2b1d9ad0f5f8a5..681e15f3d755364e668f17e8dacf37dc3c94ea46 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 f5899bb18f1f605163d03bcf1abd356beb1644e6..c67a3db5cf01bdbab828d8c8525669ca5ed8e9a6 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 86873d474c1b42729ce2ed4cead79fbb40902c29..9f0426dcf0f0c83d4a57313dcdeb0bbda28df0c4 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 70b67a67f919615a5c917a110369f7d93c6f194c..3d340e183035abd938d831807c49e1c1d2dcab93 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 f97d91d72c8499773e6b892a9775c246059c50f1..5fc9e8e49c20b543e34ee679a27aa52d095bb4de 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 86486fe09ac03d44ca2538ee13b9f9b520ea4841..86ff827a7422d783ca17c93a5d1724e4e1bdc0d5 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 738c9f5593e52dae275b54f30e7e2835e3e4af56..ea9b65301395ade10e5f2c4f959e2d55ea7a4c95 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 ef2c7b61054b938a1320af63a26a0abae752740b..e7863c1c13567723110f50f70fb582042ee7003b 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 5c9374a609d7410d85880cbb1c46d23595ec1a0f..6f4471a3afab8c45e29143d7d8a05f6530442f49 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 e0ef5232e6c894da37fe3df8aebf25e91ec130be..dfcd7d3954bc808a4fa5a06a6d0798d85d2bcc2b 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 b97355123829db1fbf4eedc0bcdca2dc30211e68..f4a2af6244ca87af5bd3340a66e6700abad742b2 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 3705d66a85eefff5beb75b5286351f8a6a548d90..70c7a25089969499af81825de20c3c175cb953d1 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 b1631c6fa3d6abea37413945bc2d1d369a91a8f1..ef8f1e54e1cb5435b74cd01dc25f9f6f6258f9ac 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 c95985b0e218257f8339d9665d2dbcaf7c18565d..5b87daa0ced6cc5a4356d73246a2aafc999a1af7 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 6e8e84642412c2b9745fa183113710f663bb1ef9..6822c31dab22aa59e819297f5c0192b6e3eab3e8 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 c93b913c5c018787eef9fff2438e55a64b69c54a..e9e815ef31ef13f4159334e1fae02df77e53cc6f 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 2e638715576b4142293afdb3df3d65d6721f0d0c..1639b94107013bee443cf232567857d47c7ca40e 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 a90844b660e3eadc0f58cc97112023a41e3f7869..f69b6a5f3c07a9f0c68e5163a88258668decc3b4 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 d82ae7ad8d24dc25cdb6ab1a5923cd3d6d7b3715..0c457537075497af8d80430b295c01fab3101476 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 4823d32a1c69a7be61fb39b2152b6efb1e0ede72..0c7af2a7ba6cba809e314a8f0c5c7ed8f62399e0 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 e139baf16bd10d1c078d4560a4459dfdf83c895d..f3d3306ba449e86544705213145bcb862abe824e 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 2249f8191790ba76d6b9835b4a546501a5475b77..bb96568d463106036b30dfaea5d2d8ed82cf9a14 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 f786cdadd9731bd1f31bdaec299223d4e7ffe72b..d7c9b2552c505dce38840364c417bb96b889d385 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 0000000000000000000000000000000000000000..aebbd4ca9cd1ab879f75d189f0d3bdc4a642dbd6 --- /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 0000000000000000000000000000000000000000..aef7bd92e3b64abf5b361d47638e722114bbcef2 --- /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 ed1271fbabab76ea9eda2d4ffe013a9e0b79bd7e..0000000000000000000000000000000000000000 --- 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 992e8176e17f85be971b8b3eae2dcfc549259aba..ca2b58084009d56abf6591aacd99330485acb425 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 9882c87a439c6e787c2fd60e55845f982855d397..f54fc16ca5a8ea02db547d82fabc5cb5739b9da8 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 a7ce7e97cb0684fbe1b43c21e6075db97bff3c56..3b076dcaa2ab7a002a5823d0fd69b242d5d481b3 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 15a50465b3803f3b4d1af8ce6b6543649d79eb5e..096d8fcf8815757ebfa8886e3b442b3d4e667271 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 bf6e7dc21f93ee0c950e5cd7a2b80f002f707976..cbe28f3b31d6268f59cad4fe34f0e8775c9f1edd 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 8da9f986e50123a9fb14e0ed107d76e49bf3ce9d..7cdc54dc67416b3ab2135355fff335d5d701769a 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 9afb7c7a3b371fa8411f528ad46edc7192495daa..5f06c0c3db669211a14b1d446ea49dcae2ecfef0 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 46a662136ffd0c19a98246dc042880ea7140b49f..8f12c1ffe85a0f07576896e269f7eb25703a742c 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 e7e23ab3da2fc477b5c187b778be0b8b64a54901..c196d1d923da2b9f0eafbc69230548dcace3e099 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 f42c681b907fe0b42a2402ddd3a6dc6eda7d252c..bc0b374ca762c731e0f907fcadbd37d492b95493 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 5e672bc3e264ef4e06d5f659d2abce6d3a0921fa..c8e8b1edaf659668aaff9784dc2f928d9302553f 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 420ad076a6d000231428493e5282052ae1b2463f..581786ac34ee9291d5dcd023c0ced07bc417b512 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 5532e71c107f5ab84d6fdc7259e5aeca62c06359..60266f6a66fc15f3d95bc5e9028fa34b6543f542 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 e4768e3007c52b5da30acfed791ce383cf3e5179..444cd685af2960cefa2d718485fb8ba2d1e2aa7b 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 849986844c8af55c90c1ebcce8449222b8e57d1e..b434f0388ea7118366670d907bad8c4e76b8cfc6 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 480d4dec4f38435c8e34b48bdafad75b3bc581a2..2e2d6b85431b7dec264683c4880e5129a94a4ba4 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 09ab31792205f83320831bf8a103a5d73f984527..a0330359ab586462e0c23a35f1fc18b1f85490c3 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 459f294c5f4b278a5c412878bc404f1ba4b49af5..5ad6862ad6767545946da575b9897b3fb4d37796 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 574e7b1f540fd82ce76a29a4516cacad43fae53d..a69e21a480848fc931cc1d2cc71c1399651598b3 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 0000000000000000000000000000000000000000..f8d493cea255aa82f56537a825a65e85551b5239 --- /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 46c0e29f3f24a184fb19884c4c58dcca86ccd62d..1c19fdc7a7eb6f2d8e27ab1325dd1bdbd1ec10ce 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 b9d6ba8b5151cd6c8026fe2cf83227d6322a7882..f0404480f59f03e808b33ad9cd809652aba2c8d1 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 0000000000000000000000000000000000000000..f99b7c1ae2a1a6632425a22439c8977812c289cb --- /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 47f5e35ee94b3222cee224b180aef73647c4ef0d..89a1ee56f21477265912afd3b6ec5d08cb7851ec 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 7689e317703f7b8d16b9aa638025f9cf83caf3e2..37e0e98212983ba3282fd617d17e056ebe32f4f1 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 eaff6813981d92b907bc7cc9276e0916183e5bb3..cec17400b0d8bd0adc87011d315b66dd3e3fe0a6 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 e2c0285a87c1452ae9db29ea942d3ac3e7c766ec..fc403b332bc6fb18d215194537fbdfe6aeeff522 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 b788b4282f94c605c1fed57beaf43e5128efc00d..b087bdd31c3dc8d781f81dffa196e38a61bd36b2 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 1212e36c63524d4c80301b574021b5994db3da07..d0b3f1b46b97d1142420a95b8bd0141b2964ce56 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 c18bd207236ba91ea61213c1f49f9d2a843c00c0..184ce74f84593f5c73eeca7200f21a6c587d818e 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 975f93222712821b46841445b8a585b4cf7554e6..b209e7bd50f108c35b23c2286fbd8bbe744a8741 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 4e798263e457fc158f99eaff96ca5cc8ad8d62df..3c590b3b4b21eb50972d655df372e678ef07d14b 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 1283d811a86711c716dddb8d6a6fcf25131171fc..e7c79712c206b28de68159459a04cabaac5f58e4 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 fee188b4556d4d3ec820341bd356d097133101c3..05c7ebe25bea60d10393959ac4821310b562e24f 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 d9ba2471cafaf93abe13287d1b0835d429dfb2ac..601e9bbd21ec9baebc871e413055c80291bfc2f0 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 3b6a76e6cb6299a904add44acdac7d7ed7c8d456..39253e792565d67f5073f09b0650b206d7683c6f 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 73bd8c1bccfec93a441a3910c1646a03d389e2c5..0618c9a9482d41fc358739ffe08e343b38541b84 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 246c360242841f6f1886e85db072649fb6ca6e4c..8925d2c26124eeb65dcb87d1c8c2b7fe52e54c3a 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 7537d5099c383f04e3ed883bd6078b18ad1e78bb..a1b9d179c1b7f36e95044936b611d20262acc2f3 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 f6bec98233101607689a8ea118204dcb4b8abed0..a40cb9ceadf1e4f201c76a2bbd596b10ade6a0b7 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 0b69229b0865cd712251d7a0bdd1bee01d3905d5..4e2f8c5ff7d3d018e51133855c69690c4fbe73ec 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 1b0b197992bfbbd3aa2b89efd15252678f41c0a7..3aeab5c673324d55e24676936479e922d7065213 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 0b86e73af836f80c874e8947111b755b6816c1a5..f36ee8ecbf6c46f21791cd476540fe0c78eb9e17 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 2690deb58c521d964ef3843e16062d18e6e4be84..3876569063cd85672506d09a2608cc039d4c6485 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 cd2fde10f784aae319dc2cda101ea07e69f060a8..ae4b35d8962b75cea5a18493a8f09bb2c2441d75 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 7e46d6c916d018d1a3978fc97a85ab6ef2289c29..46ba260f388b09ff489df24ee887b12f69be2366 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 5215d420c52489767866b817ac279aed83ab60e7..eda0a34ac3ea7f5f9ef90f61ae7da09eec3ee1ae 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 3aa0b3e3475736981cab1d6f9f1fbc95527cfde1..85881cfa95b709182ec17ebf115dd09b40403c3b 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 1687e8bb5f6fe7aa3c877bfbedfdded83382db38..b914b35f9b2a4fa745fc338b7ece56c39b9f42ba 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 bab61998c26fd89c8aadadcbb8366f58e80cc79b..eea4c44bae3faebbcb5fedc7676835072d63462a 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 4dc447ac5fb3c1faab1f41b97e195226f74b5c7f..3f1a5fa350d4c7e6fcaa250e5649d2616f48da76 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 3806aca5ca135cb341dfed3ef53554061f55d7c9..ff7873c924d59811cdc87e4893504718bd8c96a7 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 e45d47ac74e57bbb58ef455c13abcecc7664f68c..3375ac23f6c9af77f3d235086130eea768be46ab 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 fc4a6b688c410b205cdcb97a3f3d6c3115c7df80..17922920e203f8bfabfd702f22e406ca7e01d39d 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 212137a0241bbef95668d592c611c5cdfe41dac9..caedaf8bee0222a246925cdeb0afad63038c8cdd 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 7dcc00c280759dc02ae138656251e0d0e73313c9..3f0f470ce4e4516e77f1a9dbb95839ba22b01236 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 dd028ffc6af5033de60b3ca9b56d18f5360e2809..92b93b6672116ad49df5f52ecba040aa320ab808 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 068f0c09d762fd21ac369893c82ad6f1332a39c3..17497cb0d89ad16f0b1a61b664e240d49244429f 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 a386b98f3dc4de4acb9066d40a50b5d847fdfc71..31e709eedad0a2f996f857c6a680e079204b85fe 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 d32bcbad18739048c46bbd7456c3598322a94c7f..966bcd80b14a53c10d87eb752367a9b036129242 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 8a41f3340bc76d6466efe509c8f1d9be32f69872..55d2a9ed7af64d27441576dace36e658561452e1 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 92b5ee0d467e1951a15c02234a9945d81dd5ae6b..4d5619f63b0eb7843b2c2a80ef95724a5bd827c4 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 590ac64c6e1704c36440c77435b0a62111d8f257..0b58d9a45ed7849b5a2937895b1c7866dcffdcde 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 239057fd6907c5de918c933d8bac388a03196c89..5a5657552708edcaef61daa5a2f2fe035b14516d 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 5f2aa802b5646c350c668dc26a9bef9c5e0e46af..49bfacef3920193b5402a916694dc0119c7f453c 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 ba3cd074bcfe7dad37a167436c387371f56b0f49..90670db2e31f06028f091ae65d7ae183cdce1a9d 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 d8e6ce160735397d75655ec086e23f8aa5824f28..404889eccac0b099364ba2dffbf907f653fc6fe7 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 dccfcde274a8820e966065e86e0eb509060a3460..8593c87dd8a596466f5e98d980247fcb8c508f91 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 782249d96d70661b67efce76ea2d7e796f4b0f5d..43157102b4a1202ecd1ac9c800b0ef974f514dc1 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 ed0cb7edec65c08c5af4f2d099703c756dbada14..b793e9e8027f2bc970a6c7028040e0ee4f00ae1f 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 6e4c3cbf408864ca891fb4a95c2185d2e6c15a0d..a61367ecd2a5cb7faded187e799db70c8be200ac 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 1a50eb89229117082001bd2ccd8da599c54f844e..b4cf3aa1c4eb0d039c82a4568344aff269b0a5a7 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 9b3ead0c890fdcd0d2a5de66c61316491a27e3f4..4eb80968e07f7f409d3cc8b945bb4b64faa81692 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 1cd8b1002fa2aef11da47c3dc094ff4632f399e2..4604f67059da9a71160a7af8730b8582f33c92e6 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 c01330688de40d6e820387fa3b538d8a2f5ded32..d1df9b861225cb31bccd2cd5fc3c66b9b670e079 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 f817ab726b9b987b7df32d7128c416999fd044f5..59def1cfbe5c2f9277bdcb06aebcd31421bec388 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 4d9526b9186e0907c026db99fe3333623ab230b3..2c7928d3d51c460849dc671bc0edffb55100a85c 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 ebe4612fb863bfe7f39851eff1fecfc4494297fb..2c7a6df869d63edb3fd387bb8fbfacd1c43c5487 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 1664c69413c93f3050684c7d9470b73f21e73817..3801a2dfda1ac090d23b1ca57bab8c0d72a3cd3a 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 cebbe3b1d6a27e2f8eb7c068a0e1598340638837..2be14928a0bf4a768b1c391c61936768c48c0d67 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 83243a3e4a095d724a5a74c7ed197f4259671dcb..71ac451544c385270a8a521b4f8efb3540736880 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 1a2c94bf0c842bb017b031ce5ec57e2446d0f9e9..cbd4e442848b6bafb623cd1c971d68189cc3023b 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 8ca30eca52e0b81e7bf23e8135d2b62c6e28958b..f3a5dcad08ae301a0a345f5cf8f8ce5e9f823dfb 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 16758a524cdc0fb9e006fd5c0fb43cb9c553c118..53e9ef3291fa45a829341a3e8c09521d3766f28e 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 7ed23a426ed84cdc9afbf629ab853eddea03c513..e99725ec32c342f7d8176ca44293fa9224e61b01 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 d5d55bda9d86cd35c9d54935f977e5cf87661712..0e3c0147d663c6a0691fccfa24b270a85c85ff43 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 96e4c19297aa9ba638b75200746d028aa804ce5b..ec8803720d45c6e6315565849218f88d87389e05 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 e1b998582316d48456a46c76890b30a665b22370..d4eded14c3cd327240b981f589a49c77f58fc7aa 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 1b6f5306de19a4a6e7f720feb35076d1ea0754ac..19a4ad5257bbce9873b27a7505690d77525f225a 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 28705a39c6850164710f17654a917ce50044db40..4679d2faf3ece85e2cc24149c05c67645cceb703 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 c3eaf57c2a376bb5a71392e2f067aac627afbc43..dd8598f04802669534789da5a0bef6aad98f905b 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 c361746935ac86798b078dedf9070bc24c9b48ea..824e0d06ffa1b7e95c90798611e5671f2b80bca4 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 046003dc517c6a2b755b770085b8e3028ae04213..f1fdbc438eaf90db4d22357c61c0a50ef8e55716 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 dfbbdd4d6612aebfe3274a918eb1947eb9c6957e..8e3bb42af99b29384093577e0a164113bada8949 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 35c7fc739f4ca487e31cabf168766c11cd8a5be2..d10c2400f54c8b0a29906a8001fc3be7a28c3910 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 1bc2adc94b02b0a7010f53e57b7c54e540b4437b..d4b96f9ba23d4bf89be5e2974661f3d98b7dfb4d 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 40327482b2c2a501fcea35b6707cc276832d1c06..afe42840e936d39f9927c84ea67259f256371500 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 cab46eb40b90e0a5e7f07affe42ada9d3b3621a5..fae0de2ceb3c34f55d9643cf397aa56c46760491 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 ca526741059c7e92b330f0ae112c26a373a66f7b..6a4ef38b38634965654dd80522f7f043ded5d483 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 34e54f22ebff17fa4d3810526c96293d96b8f6ef..3e2adb8c592bc8ec49cc94f0737a156d0b23501b 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 1d1922a9d7da38eca1096dbaa89dc12107d23802..e05ec0970b451118b8007040ce048ac25b6eecf0 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 9a17dc8e9c05ebc9e00acd85610b77e93df1bf37..247c193ae334ee7c34ab6fad17f487aad71032b8 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 95cedefbb5f3ebdc87035f35f3635b4dab258048..5d37c0d6d9a842532a0974b2404e12d778f29f29 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 1ff5b226fbe7b6d1bf6d53ea393fb0490be99333..5e8654c96fd4c862830e8ab43ee6fd66d330169c 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 765ab97da9fef1b10bea19443562b9fd575b342f..775929c06044d69d7813b6250d595fd23730e3ad 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 5791179d15f68f9590ba3530c47c687775a81da6..1078bb3598a9a4b40d1d9d499d3463fd7e0ca708 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 e3f51e19f8a48d730b1f5208b95b6be43ad1531b..157ec6c41e408ec57349ec80bce4cffd35e4fe94 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 5c98b0d8f09b0c02b438d1d7eed7ae813e0892a9..77a62390613ae4280acab3f688e9d1d2f2f3b501 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 806e9afcb0d9d031332c5c336c9a3ca9a1a3287f..c8694d00acfb15a530cd1c151e654c2f61e66338 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 fe0cbd86a9c8258d34c2ba460355b0a966f10b24..09593dcd3ea9273144d0cd579a7307792264ebc3 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 d179993bc06049a933d42adae82f3f5a9afb206a..041d724c04dee19c845afde61cc71328bf5abfde 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 978cba1aa85533487b8878404c092c6767f25de7..c6abafe61e51ea4d8b1157dc0cf9f619f9c91dac 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 98e200a2536b58a86b7c5171caed5f24d6b64b09..c83e3360cfda8b15a73a3b122810e8289d8cfa51 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 4f671b605a7e27f4bfffb667819beea5000c6a58..e1ce0d70f44ec766f373b5145c0ef48f30c93a88 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 40d57cb23884d05d3fb7aeb2c878fe952581eeda..5d4615053e0c83c73c979e8f57c88dc495b2322d 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 c21ea4d630c9e58a7bc184470dd18ce26e16249a..4f2ceb061ebd115123cf30c614acf37db0cc5c06 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 10f6eddbea8e499e33d1fa4ab1f9cf04ceacce45..7a6d7e65543418f7f4bd7ab1f8ea0d1a370653a0 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 efb288cb10e29fa597b622b0782d7a94e6e884c9..3a76761d5fd14adf1dfa28bf48878c13842bbc24 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 184d8c7dc275e7df8d9d68bd0e26978302ad3038..6e514bba87bfc4fef757b5396bffcbd1a88719dd 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 395ce68cea8ec1d840a7724df96232e484944910..9c94e973e880980aa42625d2368376dc21b0a3e9 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 4fb3d6e567f8e260cf1fade28838a4d507953977..2892d3c06120304479842ceaaf09f5261b42c959 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 7eac055567ce86055fe743d4aefdf9d711726316..936cd901e806b01c6feb325f38dfb534c1f23c34 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 843d6e216b5ef91d891142e5082074373ce108a9..983e5cddf377fd615a7f1d4143328f0e91f2ae80 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 84f30a7433d3b640dc0be7661e177729f9e8bb4f..b973c0bdb062bad89fd2fdfe82271d91180c79ca 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 dca7bc85c262351a75c3bdc5699b9f23df1a2535..b89d5d23cc6739794645112fc4e51bc11581aadf 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 fd6b8272da1b3c7202f63b578d383972884d3f1f..2dab6406c172c3831776bbc3ba02035340041fe5 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 74990f09fa318e7d4fee6bb20d7b5e42cbff105a..e3b735ef72f0baf96e6f6e5bf98752ff2e1cc898 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 5d55b1fbecafd871a1a4e48566b170072d735122..d337d8ba3f483eb1fe0dca41b700022b42e13c02 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 f78cc0037f64216ce86b1e7281061cb9e9eac91f..29d7b01370e0a6b8cf41da2b2c2057cb5fa5e2b3 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 e4479a1fb2635a621efb4b0056a1a3f4bb5f1007..04fe8b56b96e147f3f29c3f3758e1f9b5aa2adc3 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 39ee33d70890d642738448015dcdd4c08687e24c..bd027c81317c3cde3336ee0a7945ee52935ad831 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 ce4b6dd1736e309ffe11786bdfb991bf31375972..ff1fbc9128cb3c2e5cbf034ec9f8aa345f1f833e 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 81a9a8f50c03521e180ed6a70d818934e2c36105..9772f6dddf3bfc8ed13cc258b2293a03abaa9263 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 066f947eb7c88dc2fc10f9517307800970e37d33..a96a790eeda34ece81e280bc84036dd5c6d5dda6 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 890f781ec375aa1603fcfeb2f0d72f2d90ecc14e..1c5d025c5c6df75b20cb7d9198ec2dfe4e0fab88 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 e254ad3c958a78d02bf07f5c18ed23b569331fbc..0f6c00ab1e60016cac0f5113856914b2af28b6b2 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 bbacefd508cc6059af323575621c0aec703334d1..950e184842cc42ff6fe57e3d6e9980572a50a26c 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 50c393864bb6fe8594346907a524d3fce86763e6..36a856f28d454762ae8cb982a319d58ee967c5ab 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 b0b99d4ec011c5c26c0151728c75e07e9ead6e21..78fa6dc2e57b5b2cbd57487d3332f3eedaf08a64 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 12217b84604214ab413728b549ed3569396a20d0..7b9ffd3f4c1862ee262da1b2d5eba4c16d9be0c5 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 0437bbcb168e4f915509f50f682cfc386e2101cb..3f26db29f47c8db1d466d511a82eef10a8770f6e 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 b650ab0510162f9e0dc815b12f1582b2b4f3fea3..57df3084287a17950cc57bfa48cd503990b9cb5e 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 f01a1cb70941f4dd1956d9f32bf88a7f45e243f9..b129a2974ed05bc4c064271f35083807416fec71 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 fbef1005b74054b108c432b6fb63f53ecf9ea76d..8b3b68a24fd0ef54ebb4e2a11f8bcf2a862b1db1 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 7fc2ae64177d82c05254a92205b0c0ae78500dca..81538ca63d611d92a6aef84bf3fc975b8728313b 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 df7bba3f69fda63bbf7785ddb7a695eeffe80a93..f7836508d0274f4b1133113f21fe35a08210c2f6 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 7f21b4c232221b63f18519ff260cfae5fd4dc1c8..bb53143f047e7aeee54b9b139d7143dfb5423fc9 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 2f57c1213e9e64a3f71f590060e4cfe4fdd5d5c6..517bb4ac81f7209e29b465be33f8359460a74ad1 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 aa5f61dc45f31be263f5ef957ce39a967cceac34..901600565f982d20c0f66c16a2c3a22ee76b7546 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 7bb18f64e44196f4f2c11449edbf65ce3eead14c..08fe08ccda7f292fc98523146044dff1f277efd9 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 7263a9511a695cc17445f50d43a36fd4518979a3..e960c53fc8417b0224de59c6d0c4f03872b06fa4 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 46791af98683dc1690ce407d5714be07f728e9e8..061d0ee728cdd5591491472bdf1a34c872814806 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 8370ed428ee7f746b7c9222d75573a97e18949f7..b84790b780b1684d9fb24d62c64d96262b97602d 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 3d84f8141c8b0487061cf30b73e698bdcb9aeb96..273fb261403e602bc37e12ef057b80361a5012c1 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 dbf40a97e7f5d970b12ea5fc4b2880deb666d4fe..5667ca3433e03fc88b0483eb246dfe9cd35980a4 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 335271e220794ea373cc597745c0ad16859b4b9c..e7483e0fbb562ddd10ee832dcff7ffae13596162 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 fc523591ae7989f9c4cc6758117616d68e58578a..74c5092af18c04c16dcb5ea0c54c9866571c01d8 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 f7cb50c8447ccb88856255f05f8dc77afec165f4..65ce0249c535cbbc2f5d3eaa08f92c636fb4a25d 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 8aab043bd8ba3e92c3a2714bf172d737c5ab0a6d..be6384b002bd7c11557aa33d15f9c949b03092f7 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 5fcd87e6ff2a2e5f957f1f4f978a83a248b9625a..593a274836a2850ed6b02562a08fb2f69fc69df2 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 a9a5b613483b84d6d5257e23282d60ce4d797d7e..8caf0f584d61c01107d8142b43b5a0253f6ecb84 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 da6f54a92f917a316f043a3f85f243d62dd4dec7..bcf2aa20b72e9fba8953ba9ae452ae8a17db6e0e 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 5015f1291c6ff76c9060cca6f488b05b2694049e..9c3e1f7ab77c7bacb63f690913b56ccbc7146afa 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 c3ab70c971cafc58d9fb86c1ad6d4050737542b6..af4f465d2cd5787cf1737f97564a75884511c6c7 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 5282d3053f9da34884015ca240f989911baba01f..93e742e98c1ae3b72b085cd22eed5a9ddf8455f5 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 1053a8f980ae5b47fd1059e8df402f3a9b0e014d..c36904737481bef0fcc80603f4b599b78f25a467 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 aee0059cacfa375f5ad227e97d8a2c915b4b40fb..24f6cb433971451d6556f8346ff99d7085013c84 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 82deb06e4d2ca58405f7703f006ead322e641770..806a121e9dc25c87a0b66fccbbb9bca03d12c635 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 950b2cd4d6ff229aa49b5d664d1962e86c4a3782..7fabdb53af0698fb2ee657b24c45ae3c01beb5fd 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 f395693807b69d46e5ecae12b0bfbe8d32d4272b..234101fed8b2b8978a9c2924c5af845d52588330 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 ccb18e293538aa6338bbd4bd5235bc2522ffa8c2..7513f96c98c4b99cc7dc788ed9f4cb0d316e1865 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 382c6a8c5a7dc85dfa5e707e0a358915ebc38ec8..68392caf5e40c45a34ab6c523831c5084c77850d 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 189a8549257dc6a1d9f4758f2b6a4a3133b33bef..af06fcb2b17b64b271c3f536f5bfa38c40260b7b 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 2b08ec583634ceb5672ac57d698c010d305b8f4c..cfdcf34c7ad933c9d8338dfc511ba8aeaf17289a 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 d77c6da59ffb1fd953c7b8409a88d6d865858ec0..58af5b152c83a3fe27c0d298f1ddc8a79a7fbe9f 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 65cf2850d365ddd186b9e2a89d65dbe215c38db7..534aafd10133ad790d565f2530d9281b3ed1a1af 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 2bdca45b04ddb1e4a8b00340f35c626871865dfc..e6f4e1c5842a9656fa36ffb8372a7dc6cd2a4880 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 08424e77f2b3445b6650044674ea03961dce30ab..ae5fd09b8efd7c01635395a600abd822d1e060dd 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 65b8e12b32537f53e2ad6e51753c450bb0c7e89a..204999e29fbe835f74457e50c7f121f7624457e8 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 4118d75e80498d117999d6cfd84ffd79131f3e82..e2453e8b042ea1ebb3aa11d05cf1a834a33499eb 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 8e55cc917a54216cdbac17726aec24b2357e11e1..b4c479dfc22fad221f00c8ff4bb0821bbcc5ea7e 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 93012f878986a1eb2fe7d54a67975393bfa247c5..93e224389e6d80e1c4f2be879777237fb2461024 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 7a6ad0e8307498302c9de29a8252dad590bc85f7..56c1021e3aeae2458d627635226acd403669edf9 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 34d45f11ab198633b58142ed5cc26cae836a53ba..ddce627f4754b3e73853d91693995fd9c86bc155 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 6da2a334f8c05dc471598ba4f55aa13466e233bd..bb89ac765932092e165e25861f77a348d54b43b1 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 72d178489b5c2c4c95ad5189829d416a2b53bf78..2632bf1c23ef2203e16235f148425f698b1c5c29 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 7b1beee953c9b6bf9e3e8892e62f4ba0a1742e6e..cf42c640e6b03bc462a65628119bfcc990608805 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 20d624793ff1f4dcf8fbfe23192beba0c012e06f..89a54b6f32aad6216e6722da38c69ae43e4546c5 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 3ecf3a3c195c4876f5975378ffc28322705106fc..67fa41e43b24312f40a55edd27710d9f1d037b14 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 c0089e2ee15a199166d60f5e71ad7d2a64d89e09..eeeaa1b309a1631a370703863378603f61de9f3e 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 693ad5078d01ee93a7711949b86a4eafc1aa2f7b..7d909a8fb5f006d188bff5197bfbf5fc6abe8f63 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 c1ba7ddc5fc2225056b26c212ac3f7892cd64fbd..79d977382ff91dcea1c788cd25dadf74bffddae9 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 ec00f51d5bde705a3d36a0ca7c24ed281608890b..47e76a6f493accaeaff0335cca2bea5cfaf56195 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 1c1f9b3498569035c3604d72f309e79bd4f03def..346a2962aec21ccec887897b6d4ca26b5fbd6b9e 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 d522b25b1625b30a804c1bd74523992b9ddd5e32..899cb38cbb7e8f31511bc5c950556103e6141335 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 0bce35e6c9c80d5c01b6d2da901b1f95eab0afda..697d63b622e43a7ce9cc5fa5d5f7d126e1748b8b 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 ace0afd8b60890b10fd78552f90800bbf69ceddf..16da65cafc3a20a9df41d4665db4464331ed428f 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 918564669a5334af3c25eabec74d8c9429467054..40a55f0bd9826df473733ac399782dd119c8b85c 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 6af7a6169a28cf27bce6d644dbc409914da6fad3..5b4f748039fa0f89c11a39daaf770fa2b439d38e 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 faad94c018b96e241e211d9da21ae5bb185b0878..b3293939617da11d3b7c2c3e6ecdc9f75941357d 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 6028202a2ef74474f1826246feca4bfc9e19897e..545bef398568caa2d06271487a799958a728ce1b 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 8a6e8b848326cc0dd3a817d890ff6ff52426c209..66b0e7679fed8ecd913f13d82b8ac1d23117db8b 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 81f1a246f27dea7e33a4c9ba62377cb7c2364336..925abebb8c3eab01973b7b3721232a243f68af53 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 a81e322541382c1fbe87825312583ae6a07573d0..3116e3e7bb7a0415938a89d82cafbfbdba034a06 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 c090144562c52ca3ae4612a60a0215829da6b817..c2ec5c37de26b5cd9b1b8940181fc9561f02f9a9 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 8451f0e3832bc6388d0e3663f6163f98c3410ca9..cf26a21e0f510569da3abb827d9618b62b2d6b83 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 a0f6f5f234e279217a601ca859132652fa9a2dc3..85c68be9955eec87f3a181fb9f75f554f32001d5 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 8b0dec22cfde02b04061c60b936d3072da4db293..4118ec4ebebe37197e2ed7ca8b3325152ff5b394 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 6471e9bceed726c9c9ea7ed288912f2b1edf59de..7222545fa3b6a7edd753bf8b2a1ca5f2841fe26f 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 afec7ea5a351756080c66e4111bedba6cb5864f5..9e4267df4e99b84f2223e7d52f08986e496e46e9 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 f978f4bfa467031961ddf0f7cb93d622bc38275c..ab0a460d68a9adafff7c153e53518be7e294e8f2 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 2d8e7cd2dfcc2a9fd1f3c46c8fcda2af2dc971db..fe52a7e102f71776010979f26a07dd0c221a4b5c 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 99366d01fe677e34e42b92c572ac92deaf71078a..3996b89077c1763f74bfd9cad4f27d7f2a19ec63 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 f098c361504c1e0ba55b9bdebdd513cb0d64d252..8956cc49f8857580550fca65e413998af507060b 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 8b9debe25c27f0197497476bd69e448dd37f99d4..3a55f59dea15c7383cb068550fd0e1aed3bc5a90 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 e15b9fb1e56c56dec693a47246193e6b84940d01..0becad82f6daa030a77450f14c2435567664664d 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 e3e84bdf2293e9ca4d2a8a06ced8d62b514cc054..4de7eba2176702fe991b47222eb0a3dc9fef8e51 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 12b40d93998191887841044c24e45e777ee81517..110104cf98f85f3f66dbd3feedd8744fd150386a 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 ee00cf2152c8407c2e7f13cc37c6d7b746982a20..f771269af4e7939f00ec4016fb98fb37c67373bf 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 73c0251aa90bde64a118e291fa8792bd3fe003b7..b301aa9fba8126288670bd51120fc18a55f6e8ab 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 bd0c612860097f2b268fd56f4b67264e0e53811a..c95b34130a11a022263b4598ee9a5c33d31ff5c3 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 5eb2f8746a94feb9261a782095a7c9f25c55431f..94bdc3cab95e379c1632308183b04039e10caf4c 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 a377f019bb224a9c7df2f24557cfe14a149cf79c..608d1a813006d996418081a3c405530cc1301f86 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 5152d148228a1c9bfe01cb64cc7279c21d412adf..0ce5d312bb9d0d11fbfc2cf53e2c1be20825d60b 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 a48e1dd20f990bf4d6c865b1ff53fd6f323b1770..95a4c0dc4d389c045afac2eb6cece4134f334f13 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 6d051b774a0dd7cdb834d5b2867067a259d42266..d6a76b0afedd802a6842e1e71e1f86238c4108a7 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 ed044631d8baad6e7ed51c91deb5ee16aa75fbbc..093f93ea5fa8d9c7482e0559768d27f7ccde9ac0 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 288a95943f7eb532baf834148ecd9ab5ee4c9d9b..4bf689eca0e6f4c1882ae9b395feaaa89ea21f44 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 eca1e4506f94a3b5f1932a5e2192fbe330624b4c..1e558f8491930e62b5408c74fbb364859b09e0a6 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 de08adb9416398cbbfc83d28d01e73fe4c8293ee..e80ec6c6974326b815823aed6274eb29c2828593 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 326de92a4a832ab53d222a539d52f4e5963a0b0f..4328e068e21d058f04e39446788d3be17dfa3d87 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 665037b57f599696ca45d661e3dea27d66bbfc8d..90b5e3912c4d0b535c0365b73a35f9480a68f8a1 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 fba6e31329b91ecd8119c085d5ca53bdd45aaa56..c39c0e7b5c2240e283d4d3a0235d7dd77ca3f816 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 bfdf6e0bc093be407cdecce9fcc896e1225f9425..91ed1a0b52247253e9d2677d4cc6bed17478af91 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 b5d539b612c79d75dfa143c8d84bd331323ced84..2c968e68dc03b9e9436e155ee1816b952772a2cc 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 da98e41996c9a901232483623d3304589cd0fb75..87f308d762ad4cde1c61bec1f041c47b94870c63 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 2538c54aecd96bcd488d814edc1b906ccf5b006d..1f7f2d43bb46338017b88403dcd48cbf7557e4b4 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 1b40bb5aaa26157c35795fe1858de39b6a7e6d9f..47ad1c45f4ff7822622b367f2828df31181b3df1 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 4ccad27be7102764ddbe3438352d76873292683c..1d2d5c08f9bc128f8ee778f30d004c571926b519 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 eb11b30b60ecb4c18271a4ab7ee37979a5c9fadf..ac12aa72ea6e897c2ace0e28f10c0991d47e8c1e 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 9fff9f4b7d5de2a4d37332f52519618bc9b6d676..f89be92cd837f7b9f2c87f9d19238643b5070230 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 7c6fc8ec61c5dddb233b001ce9a3ce13c80bd009..103276bde5eacac444e2149d4cec6835e8c899b5 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 27e3e586376bf985653a9475864b9e21cdbcc591..65e721a7d3e8e90237c0b02497163d1e776219d0 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 09aae1b06e3ff13239fd2635b6e0fca42f34045d..b6ce06b867729a054264e39deeaff4926c011bf1 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 2d2105de5780aa4a5420b776b4278dc5754dabde..a017abb34096e867ca475e17d424eb713df7dbf5 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 d73a1ab89307245fae7cc54f759b305acfaf382b..a8568e0c9cc043ec119f521270480675a38f8199 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 c955a0c29049384fc833642ca7cc105c94e32f03..41aea4538a2ad3aa8889096de713a685ed53aec5 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 720b3f7ef114c1c178c714f669f9f10296d0bcc6..8fd99776850219032294b5d4d5226138eb90a9b2 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 fffeb7ee9ba428baaed411c74abdb113a2a53214..03df1042d759a129c77b05e533ac94904d325769 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 0000000000000000000000000000000000000000..a4b1a47c2ccbe2e3627e9b63be0dac7b1a82fb5e --- /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 59f577305daa7b4d8f6479cbc9d3eeb007011b54..a074c1c8922222da609b4a4b84508df45ba66825 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 36a404873d3be687856bc8df18293e19040539ef..1eccbee1b67f6e3342a7adf8bcf76295e99fbbf2 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 2b5e77ee31edbeff958a98e3d573d94fa562455b..4baf8ae6b08b2eb542de98ff9867e8aaf7fce415 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 9deeac5ae619198a28ff8f1a5ad7ea01b8d6ab80..c106a6ac21638265c97bf360e89b35ac4a5ef3bd 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 0000000000000000000000000000000000000000..e64c122d4235e2c36613c06cd566e662e5716483 --- /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 0000000000000000000000000000000000000000..011613dc07c6881aea36adb45a9d9625be10b967 --- /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 0000000000000000000000000000000000000000..a9364800f3e5a99143cb7a50a3eb4b3b4c35e9b7 --- /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 0000000000000000000000000000000000000000..3c1d6e4a57570c840bd8569806557f057cbe9627 --- /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 0000000000000000000000000000000000000000..76db7a82352e7c668810b1e8ae1d991306840c05 --- /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 0000000000000000000000000000000000000000..d675789d15c671c987fb183e1bedb919af8a0e87 --- /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 0000000000000000000000000000000000000000..c96b7e74f4b0543a1cdf27c48ffefd99a8d140eb --- /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 0000000000000000000000000000000000000000..74bd75e6ee633d054156c0f4276a15bd98fb2985 --- /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 5534a570ba037d9f7ca901f0bbf5cb4b575acdc8..f5e1693d972a169c6b9d532732014d6ee77c301c 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 88b0684b8e07fa11b93eb349872a4d329ab93dd3..7becc725d7d0f350d68cf5f02498874b7f33748e 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 19d0c78adfc0bde8adc22473a4b6240d0ac29caa..823a7fe5ff0ad9a3104d710851d9edc5c7908803 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 0000000000000000000000000000000000000000..2b24fcd43d08616d88ea1d7ee2a9433bf72caeb8 --- /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 f7674e037d034fea87f0cffc85329b7ad0f5bd2b..df21a836308166c667f8534655807242ab174e55 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 ed33b48afe185afba5a91670ae3ffe40801c9ba1..4fd412169b732a671f5edae68d0447b5f9ddb3c4 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 bd4eb4424a5e9d74461072703a45c9573c68add8..1822d2e11ef35929e8000c94be2b9197fa837810 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 0000000000000000000000000000000000000000..b19c32335d48502e202b63630a59200255738258 --- /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 262479304b43f46aad5b789ded752f6a7834dbe1..e534d7214fbfd848c2681a1cb3a30575396ecf55 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 15fcf0d959ba26c4d824087961ba9a00ff722959..69d84f25309a424787dd42230c144d7775fbfc53 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 d5cbe354c0119b8b2dcdc19e052a5a2ad863943d..f5bf1f69515590b6b01dbef6b917102977666785 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 9f6671a1b72d7bc0f3f95553d6a20a7deb97c372..9fd2fe80c7b8317260624e653a881907fe75146f 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 21a4937a9d461f3e83b111aa3a2b597ed9db80d9..57dfef333eafd6688ded980f0d47f1f6d6a44f1c 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 9495ab1e796aeb7e15db64475c572659afe76f37..9463ae100b811ed5dfbe3d77c044508c880f3480 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 0000000000000000000000000000000000000000..c7f5591334dbf526d998e75f30feef9aa3ca8214 --- /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 3f57375bb723d8366dcf7a451615cea6f21fd947..49d3f16b533c6b8f12bbaf65020a0000115cc1ff 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 ecc31daa214541f24629f984acca01fc931f07c2..75a8b4e6bd56e8fbbbcec66aa2bcaf5a14eac94b 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 0000000000000000000000000000000000000000..a2d8b29b6a6130836c8d959bda31f473cf0810e1 --- /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 5950721c7d8d5984fb8fe40eb0a038295f8e7992..1381c44c4af9659706b7a2bd0e06f0df6a30d4a2 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 a064c18a09c5f070116a3ea17937748f50e2bc7e..f4b9ad3d881cf32babe8a0d9e0caa26d041f0172 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 5159af92dee65cca925fddaa44b942810b6a3bdd..ddada3104dbd89cdcb652c4100159e5b21e20c96 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 0000000000000000000000000000000000000000..c106a33b756519733006c9318e8b071abc502088 --- /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 0000000000000000000000000000000000000000..f303d5503fb1c7bf844168dc1db2ed186bb6b230 --- /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 d8e6268840b44ab068d25704f3e8ece163e730a8..d99d82572ed4b14074e877e5348ea10c6f3150ff 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 0000000000000000000000000000000000000000..59fc19b33e69057bb903020af5b58ef4389e41bc --- /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 a25c3c222d9b224808f7d7038fb225f2158e5f7a..6e4e805e34f28e23f68372f7d9df3d47e032211c 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 0000000000000000000000000000000000000000..ad4945eacb62725316d4af07643083221ab94f0f --- /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 0000000000000000000000000000000000000000..e06c57704e8b938eb59a0b3bba3725d1820b81a7 --- /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 d31f920053486b2b60d63bdbbfd85414953265c7..65c4a9627390296e1af4b3860d16b329b70d0afa 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 32c982c2dae7f11c66c89240ae503b90302493c5..bc2a4f7d68ec5bfadf7d9ff375ecaa81e0f74d41 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 b66612e929e63e218b4f24303c62781ebbae095c..718ae1d6e803ddcbabaa3e6efa45e9316806134a 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 f4ea556b8ecccd6521b73a049362672e63ec6bf6..dadd55f1a451a690ad91c1073c933a8002ab22ad 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 4432918d76f3de166d2734f1653201830da5a1ec..ff87155c8f1517d0bfb0bbafc68bfed87c9812aa 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 d94d838949aed09819b43025b6e38f5ed921ffa5..06c1765f3a1d9cbd6cbd0193608a2c0cce247775 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 4a09bf99a4b4b8ae8dec2a9c91be628836ff3546..e8b0d357535cd9d9c02d5482fdd824992025f489 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 dceb0cd97edd1647092ffe10c1a3b660963842ed..53966211ae24f7a5a6adbdff2e7b1fb1eeea2376 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 2978812ff2b46ab8fde121dfb600843bc5c5d23c..265654db0e6ce97752fe24cfe66bac4ae9ac1d57 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 8e16d8a6343fd781f6ab7096de8e1281f94648c8..8920aa07e32ef53440417eee00579d0f859f4f32 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 e2db507913dfb3b619355f5d094b92a422455ff9..6aa27621535ee3111d3926d7beed6a0f54abbc5c 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 9e4deb50052b9e354437a7d3147e68283f6d43ce..701c8a915429a53540865c252d3a91f791bc85d7 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 15256a4debb3a500034d680843c939e05087d6ad..cba4e53d6361257db5b7c2816ccefdb1e9fe1e58 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 acdd2df811a5ee9fe9a1529e744b8595aefdec3d..0f85f9b8944a1110a2be428506ce4c021fdfc2e3 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 349353454346b60c0f19b29c509229bd2e933c75..c90e96674456f539fd106a317be3551be383943a 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 58d240b98873848efbd60403bd2702b6d09fe6bc..ecc6068997bc73f9e0f4ede10481b6624f092cd4 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 6ec289fd7c6c80bcdeaae5d06c2d652f2f593c17..de3148d60decbf6ad45a267b124d4ef5379c5adc 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 db184b5912e554a286e2ab2cdf7fc341ef75510a..f6f9f93c9713af2cd9c2a11aed02ff503edb1dd7 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 ee139ca5be6e940d81d0edea7e23c9198e47bf3d..9c29f3623bb6f566b4481e325c0b7e13857ef0c7 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 713c2d132cf6e1f6bf16ebfb11c83331f8f5c145..ee4a5631bb131c824ee8744425efd076a0b7b765 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 f0a77f8b77d7203cd7023fdf2363d9ad82ffbf83..a5ec8f0576c4bde5498b719c624d26e2276aae2d 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 a9d911787ce838950263a6b9275386dfbd6b46c5..f2ddc03b6ee757ef578e91a07ef62d85a528bf15 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 745ae4d6a8619900ca394de9a635ca362cdc1e95..90b906a6621913677de349bda47b347533728e4f 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 146ffc73aa14814bfb8dc0b11092a86620512089..3a055f7c1cd3536dff669760d7a842a28211e0e8 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 b6b32228ad0e8207b04c3c7b2d9135811d9f7e99..389881968ba7fc19507eed15182b90c2b64f8185 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 42760efec49fe39d3f6d7536ff94844a4e333b11..35a9ca2a0c79884dc8e173f0aa29a6a5dbb7a8dd 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 cfecd07e597a29ae0468058f16a4c7f4a26240be..908260980b263c5bb40d3af667d532dba5f0a3b9 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 9e0a5c342cd5738443fbedfed00d1fe859fed25e..7a108b5f9a77426f14b5479fd9e55e328c7fcadc 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 31e4589d51466d215af08e2427cf85318d678f7c..1e5adbcbb77bf22e2592c7d3322922637b341fe8 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 4499857d0b0b783f67520539143d560ce5c740fd..31469b3c14fb6c887afe27fd0881164ad97ec80b 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 4cc5ebbecc37918b328747c4c5f9293f835183f1..fc51c6bed0a0da44dd59da6d8bb7763bd2dd43e7 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 bd27e408093de574f37eec6710ae70aaa695fd58..fc1a2dd88659ee0402e9b6b7709076d3e462e0ca 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 9e3e41fdad1219626dc5014f49688c2123621fd3..e32e58a1ec0f827558b0ae4471daf3b6be01c32e 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 516baf9cc90e6ae91d09a5b5e2871fdda3413197..66ca330b77868b0f6c71575993c1dc434317a891 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 ceac2a7218715ca2bac9b85692cddb7c49543af0..63dffb21b2f9ff2de8cbab18146ef0cc5ad42985 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 2b67f4ce7e5b3aff7e1ae8b6ecae18c4ebd82975..a811ac8b5ac4f61365af253b6b2443b07e1ef811 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 e7c0615d8e35ba93b041f7a8026953ffeff87ecf..76e46107159114d5c6ee757577e30be5f252b6d8 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 48ec7d0baa00217188fc705bf16491b08ccf16e7..911f9c400e057d27d78913a749c78743e05791e3 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 ebd4622d346b7ef85dc93640bb880e8d9b96ec94..b740b9f8b63d0b9162fd2a6ba06443ff08608d1f 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 414cf73dbe579f8a7e5b76308cc05d4a4d7ea592..bde8c0d1b4bac8d8930ce73b89ce97cf1b3dc165 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 5c7885efc9d68fcd266fdd3e01a5ec379dc9e45b..2e3033c9649947f5e3d0a12c96b6b6f4a85f59ee 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 e89f40805881d9d79071b35e94f1ec413909a2cb..54bd77aa35f299c9cd9adc493946d82db81ddf5b 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 3b9b844e53b62c035781394818bf1de06d49d2c3..0000000000000000000000000000000000000000 --- 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 3ceaa0738d30b156dd7ac3d9877d4a6fe8a6df6a..0000000000000000000000000000000000000000 --- 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 ed801ae2e2961d264e0a8caa86a57d47ca4ecbd1..0000000000000000000000000000000000000000 --- 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 7c75b50d25bbf6eb5a3ab196cee090f3fe1e7f70..0000000000000000000000000000000000000000 --- 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 9f2418eb54ebc3dd3d3db15ff9a7483525f421b5..0000000000000000000000000000000000000000 --- 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 89e03c5a3daf411da35225c4b957ff104c0c9075..06da984fad2bbe6b81e9b53c826a7700583d623f 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 7bc45d76bd1c89cda574d213a1e887237d05bb5a..af498dc613172eb4dcb1658077e751ceaaaff5a2 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 773199f930a68bcf01cfa3a255561eb18464b0e0..129c5e9fa625613d0b2f7d232cd7ac1f25f94b45 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 aa2419e292934a71adf3b361f2b208bcf5efe7f1..b8796c1f1db9af30518a5be7b0734cea73f19b19 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 5577a9c0e2128a2f670bec1cf55d558c8f9bff35..14568cb69cdc25087cdf53c227f4f898f84c18d3 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 15536b24333c69a2c3ba650e489e446515243499..7106e22e882c81a13656046387838e3c400ea5d4 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 48245e15900c681f20bfc63b71404b1ab87c35fc..86cbe83c24fc53cecb535c3de4a852f56337faf8 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 1ae3e7242ec23c224690591d7a2c00c0db4797bd..f20abbce92e6c383880bd7fc81c23e28f8146d15 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 7baed204b2b5dde9ad985e3b60fe085f09c30add..4ccd4762583738e5c5cfeaf6120eb08538d98ae3 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 cf9e7f122527dc003e1f14997f57ca631c5bf6a8..498804dd3f0f9b7e388b919ca06b8d91d135f554 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 7e4ce2c726560fa72437a667850722bebc5bc9a3..779c219025b1a65dadf5af35876c1d8b05e0a60f 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 ccf2dc17c03f06675a3eb5b5e51e580ac957c92c..e6a94db83009fbf821e676d96e8f2c26d0513554 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 c74ffc2bd137211ed093cf24acf7c6a5a66dcd23..1239e5dbaf97140835bda7c22bb9a79166e093d9 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 15a7d07acded36a373ffe34427fe6dcfa5b1d452..aa918498f4ccd7ebb71cbf253f0d5c994ff3ff39 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 e73f9fc19f704d1cf96bb3387ee8987ada268e11..9958e2fdbae8126e2b9dc0ac82b9cfeea831a5b9 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 ca41e7aa837a10e38a0a2b44b75c250cd348915c..9a9c28e9f7e239b2fa67a8ddf7dd5ae6df025f03 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 41080a46a66d7e9325bebe28ec0880d4b0c27e38..06698a1170b762f46a6f06f05408dfc87e98cb64 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 5583bc112b5fc9c9f89bd03a45a830238bf534e3..f9f5ff5aa2940a896f7304006c6c00904a18d80b 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 6f55be3452b9709f93d738ca1842edb1da9e8a11..6d2cf3c07bf6efeb7c9c6a80efd0586b0830eee9 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 202a726da88c164e2a58b4a82e98317691b39e78..0812475998d87c7e4555aa9986545c55d39c0535 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 2e8eb96bad9b236a8ab317aedc6eff52878c83fc..99d2ca240f3a7f0be405f714252e118aaf38e3b8 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 c07fcde8f2ba642672d654dd6b1423b4d7fc4585..909243ffd23a7d7a07945e961d6f708c64d0f2bc 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 dd80bd9909a78d3c8bd3722a27d5ee31dc2caf2a..c2f1780a0f90b14042f1e8c8ec27f65ef52891d2 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 43185675a35f8b806b9a36f4b9ce3f335e485ee3..8a5091a426d79a345d3c852172e024b2846faa05 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 24b4c428152858041e067b045f82fbf6617b7521..a55739f86c2ecd3b166dd0e28db6fabaaf96a40f 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 7756aae00407b67a4b72c80bf6d088b6800d636e..4a4f077c901bcfcd8d89f2ac19e1e969a921f42e 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 0631e8b5d992f44cae0fb024a1c702e266f664cf..8d82dada50278c279507e0a21b2eada798130e55 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 e74fa3a260e251b2c8331b3d8f3e99587cddbf78..4e998b6cbca3fef75392e9a820333d5f8f59c895 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 bf3d0d42e1254a1b7ca2b9ba6498d68e97180df9..95001ff51f6fd448dc0069c211507b1ea91f9f5a 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 9bbf8b65aa39d156e406a4b540a00ab4f7209298..51d8d2d943cdf76beb806ac6d9217b409d95cc39 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 ddab4ebe5d13ef1a4f48856d6414e021d2212c63..dcb5fbc97637675831acf05b5812a4f75d68d010 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 111ee6f1796aca1efe06d20a4feb0ee9a93d30e9..ad591c874672daab944d1f3d0715c7d898805b27 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 4da5cd85e50a28b406f8e6ad907a031bd6e3f327..25417eff4424f9ed31ec7416c6a25642a473a568 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 7f3dda071f2ed264fb11ff42036bc73f6e510e3f..60f67beed9f24dbcf58a4c864200e4131e711877 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 249c6320ff17d6a7bdcab9aff47d43614857c9d5..0ca27a097704908f975d070bf499dc3b1f83bf64 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 9a748b9526c677e0512218bbad819a8a29bd4085..52094da7e119398d7309d772226f14e23907d605 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 3c688069565d7aa804fe22bf6589016a9d15d796..29c57019dd04b92ce8c5c21b95db7e8076231379 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 4ccc784c9fc9e65dc3fb37c11255795b30858838..8abbc6edf14eaa079558dd2870f41d16aadae822 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 9cd0ceb598b7f1153ce4e2e73c7366db0ae78a0f..245b89f67369411d038406b525c833dba5f2316c 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 18bc72cc3bec5c93bb2d7c6c909ca58ff072ca4a..354d5a320798b2fc24e4d6e7fac9107dfe136472 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 016f203c6128585732dadebfadf0844bea970e2e..044f76275d7b7b8add1a91bce8798ad8ee4fb45f 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 71a0624c3dfd6e3084db7089aaf67af91baff7f1..461198c273afef60afeddc55f72d797d2a69c983 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 448a2a52b693de2b73fa20c11357ffaa9642a7bd..4fc023989173f0f6cefd05f481cd7c754a49f48b 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 448a2a52b693de2b73fa20c11357ffaa9642a7bd..4fc023989173f0f6cefd05f481cd7c754a49f48b 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 918f120f611e4909e6d3a7e8482c97d487f42e40..955184f57ef8fe6381be2fb255353c3a3ecbc1d5 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 0d125e31ce5a2d900e176d9307ee9c205e450e0b..ceee4d8a5d395670dbe44ad7ffc81b3601bc1aa2 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 00e74527880f552339acbcae163f3f8de0a0b952..3c72adffd0f3b4e2994a1a157fb23e85dbdc6080 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 2b2c68f40f399bb79f6a399da77f1f90086446af..c186694d561adc3a51856d003627f5b1b5a7eadf 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 61c1cc7d4a49a0b92295272e78afffa9846563e5..2446a6cd993b43cf962c937d153a606f2fa1a5ba 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 028e707825585e34ed3bee3aa5131df272a3159a..4c1233b3c78c1cd37c1122a6b485345a886b98f8 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 93dd0c2fcdddacdc18b92feca0a0a38854cb481b..7cb0c24c52bde8b288259ad71fb23852c83c9e94 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 5684753ad5ecfb182b9af04b4a94c3f3407e0ff8..a9787276cebf23c68ba0d33d3b4c79d27c212b4d 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 8514e417ca4457defeeda390468eaf60b8785a58..b511f76f213e90dc1e392966bdb81176fc848276 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 c7f415cc05386f04f4df6032d0015c61f5bf1a8e..494f05937a88c3f8e222b6ab64c91a55d3d2bd10 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 2c8bbaf4012e7b210168f22f1a78da573290fb26..3447aa2f82ffc91f95399f479da826622238e45b 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 b720426d35f58ab2090a1bd8311098da84cee5cd..5deac36da70828faf1bb27031689db521206a7dc 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 705e0687f743097538781c959078f9979b630583..14c822830e888368e2c1f85a90dadccdb396b549 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 3d1e86ac38129b72f99723f719f17597fc6b9cce..7756fa9b3719df4a3be18a8df0ecdaacccaf7c3e 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 81b117d39eb6346d959fdd40a6a8b0274dfa99fc..3d95409940294225103f9eda28c7c19ea4617839 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 7fc96321abc1469f53a57a566f0ed24d44df9eed..85a1c2a5a54cd28120962e51beac0e7789ec6275 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 aada0221fe9490cb660867769bb503bc5b208abd..1c2cb24199a3ddb865ffee9532e5460136d2e9fc 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 f8fb2d79dc00c74055ee42c924a5a94f998c48d9..a8ef09d4678bab4d19daa74a4f800e7089320476 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 ed52b112651eb9e19ab56e392472d60703d85103..ac81efa155003c4864da37222183341b76b2a7dc 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 965b745578cebecebc3f8ed68d0a2bfcbb2c872e..5bb9a34d558fa978d845e2ab78bc82fe15a2b2c6 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 c2f84aaec913f53bc3b3cc0d3bccedfa3f758889..a85b83d5153d0ffbd6055714a0e710a77f5db03d 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 8f3fb5280eb882a316b79f4d94cd533f0fac9b4d..33eefd1309d47915deaa1486770d9d117a0462a8 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 1c55591d983c703f72a50683a508564fd260bc46..12e1db3778b8d0594aee37357b1c02b4f3443be6 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 2665fc7d45779205ff5064ce658695a1fa9173d8..b25f018d29e40f16279aeb88187391ef4f5ce670 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 5862a8a039422a4d642fbe46dc89b44408f541d2..b785995c13d9c8c9fdb61f3ca510967544359ae2 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 a323af2d41bcca0eeba24ed7ddbfd44e29548000..ce2908b0e5b62a73b1029f1a9d12d2f57dd6affd 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 05d91f033e67f07c791fc3bc554cab97cf2f8bee..48aa58fe0914c7df70d69dafcb88dbb2987d83f1 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 537ab80d1ff258ec3b1f2c2207e51c615af27f9c..07d352d61890fa09610f2b14d3008621cf175b53 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 7ab0246581ef253a8ea5eb9b5df66d0c985fd886..337418dd95a2b69de37fff9ad831c8a37ba1b08b 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 3ac93095fa50fb047b6f49e28e58778d245c14f5..75745759013e516dab34bc8be330d89b28b8a15b 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 64d1977fb9efe8c2171144420deecf86c635932a..d2dade74d1f6ce624c46fa5739f0423ed45b6364 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 0dd5e80667bffdb79d12dee0fbc51cad885b0ee3..6d7a92b4883ef8bd0f588e7badd50aef1b3c1d3e 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 ffdc8b4bbdcec1aa800a6f459f7763f218b0b053..96294c5503ce8e8d7bc6d17a48e0db61f170c3b3 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 47543894e6c1687e346b6e5b128518a04e628e81..be1fc3cd1c7e2ceaaf7726b5cedcbcf3fa898af9 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 d23826f27d044582e3808c70acb1b580218ce7b7..0ef1e8b77f35d8faba5df13dc2cd291c2707c686 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 dd47253cc36b6a8b63b3fdc431252de80b096f3e..129297469ae6fd875130e49134877648558cf413 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 057332551edee56f8b45aa14fc12b91b424b0e7f..594df752055f59feef4dbb88128925951cb55e83 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 bf48a88423cc53ffd96551dd28c6b3365d70dc92..cbd0ed38f8211c14b617f755b781b9422d0d15a9 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 4a99ca15354c902859a0b7fbb95c51c5f33cbd1d..df106894252092b7d97ab8aa7c488d5c3a9eb2a9 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 83130a8060ddb627d72cf3661156f1e899fcb89a..584bb900d8a935eab2c5e59ab2d0caba6daeed91 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 69f27ede6ee58117a96aedba219053ab3ba0d178..999e06d2e0185d49960a4d95e10b13441655b30a 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 3bdf0fbe691f83ff81ddc59e2dde62e400fbc165..43ad1c96ad40d9ed4b27aa28da619526f5d8809c 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 b776d41b517ba556fd86035e32a3f5670f63b38a..4b3dfb805c5dfcc446c6731df3dd37b02f788cdb 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 db21dcdecb333bfecd05ff055c73e50147a5a501..f269dc72a41172a8ebf24dcf15ed57c2c7372cfd 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 0a0cd2d72f4fccf2a6cbb6bc76ae0a4bc1ce75b3..b9e2a64d1647d2f1f2806b36083359a6898b264b 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 3bc06c4618ea942a96913d267c6c8a29b2174e4a..f8b0433e306476427b95f665f3ab421d3890fc29 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 5c0c75035b2e644bee44cacde4e750f9a7706210..25db0febac142d28176e405df25be9aa4bbedb20 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 ae43818c089e079d40ec9629a4372701e4d04c98..03f194582514f37b837848c98de79558273b1b1d 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 2a0ae6edb250555de667ee2183999ff6f3a421ea..44672479f5ab21ee467b36411cda49c603ae2ae1 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 e4c98732802b9977b893d58cd9f9dccba8795d2f..7c842d5e01d439f9c6bf74d1fc2eaf2dc8df271e 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 843db456b5e39c0f26c2ad88af2dd69706bde7b8..cec94c8a202629e57386538b1ba3650c15340a78 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 2bef95fbf734383ba1e852e4c9c9826b95255412..1eb8b524054d374cdeb2eeb0749f6b52afda1072 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 aa674f80220a1abb24bf4a29f66c0e6f676de3d3..99ec5202c2712d5788032eca2e24a860adb53268 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 67e9e2f2b807efa76ed8b2d8abc8a6d55a21f6ee..1c7deb78c3d17bbfee974dc04bea58ad33274077 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 8eb65421b13252d5fa909f51343eaa497491d229..04dd3814d798cee9e92fa18dade6f085fcb8bfe1 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 946d7081469da80e501edb00c0c23f96198eb059..36843b4bd10d6924c7e49f0aac401c35ed8bf7da 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 ce3a248e65934aef206ff77390f9d89106ec90dc..656b65d9169f7305d1cd3c0ea52df16b1b1a2758 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 f28615023c4b5242c609b3df11dba16fd4dd0b02..900f0e1b2ae892ea4e7358a4d1001fca11ecced5 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 34376721cca0cc1862becfe474d031b0cefc3bd3..a5063d50ff3ba54be44007dd947c8a69546c4fa1 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 75813d38db5cc9177ca6d418d129fd459ca7f986..77861503c75b253d0d2251b05b0835244c757d43 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 093bade1e48180ed7cd351ca117c01c6b799a0c4..009d5456d5eccb7c059bebe49b9e10cb48a1b799 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 64f5023ee049068cde749beed8390474032bc37d..d7eb5878051b26d2772642670e5878cb50dc027f 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 cef26369d3a31b817a22cea6cd5b4be8751a2af9..310e2b9a2fb67d0615eaec122b39cc6ae447c4bf 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 3a3d42c9552226baae402c684fcff1762098815d..3f8ee5e70341e1307d4d9677c79ecd109b9dca83 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 025a6bbd2d8c41c8f92498406f954b6e943325b1..5d915465b5ef5ea61f0ea634d46f41107b698fdd 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 8a1e673fbda49b5ff546d06c97e69f5171251203..fac7ed741f374fec6b8bcc866ca9c88faf4d170d 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 d75915b84ef3a9ca8bbe962abef1d75056770ec8..9453c66663192d4b1516cb827e64984308dab032 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 25da8573e46a3a0101550e81f0396b8fba2788d9..774067370be585607bf46d4637dd008c20bd56a3 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 ca826facc6053322d41af28b7d8f090747e4bc89..103c9486f20b7802e540669ce483b6ede218207b 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 4a2716f10c14fa66a1b7aafd9df30639ed62710a..d57324b2843eadee0f0f5700e5cc069bac1be84b 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 04c8b050c68458888bfe23dd735a2aa4d16f30fe..3b5fd823bc962d207a95764115a82ff6c717664c 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 3a240f76a1a45f26f6cc5c466a1e391283588c81..774c1a1c2bcd636002f94d02e3509ee07c7da0d1 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 e6e2bacc310365d6032b1881b12e36f63ad52102..cf9c370a691593c99639ad2e7d187d25c7d5c071 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 b2285ce6a5a2491caddf658dc50de144b99345bf..7be09080f37c8fd2aecf6a9dddf17c7d1c443b51 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 3c598e443531a8455b26b604e04c44477ab8254d..40979c93a3c3db7ebbbf877972ffb4803ee47deb 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 af53dbb762b760087a046150d2307d435e6d0cd7..e466f9a5690d3a3dfe71c24cf06e971f275b2d70 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 09c62d9e29357cef506a5a9c3fca84b765f74dd2..887a81440130f8d2435a21aa2a4e7f6c5cce8deb 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 56c899aed98e509fa3f2e621fa88496732c0ea3b..4bbb373501a843bb39f674d16f89d2ce1f7e1479 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 ec96b30ed73bd5e0b5ab7802da684ba2f3ded4a7..6eef11c3fe36ebefe0bd0b01fd8b366fd83da483 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 35d1c4bbaef56c8d61e80b9e6d723751f3859bb7..6f604d63359951c17ce3ea85d6dd711d7542004a 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 484b5128ece22fa42fbe219a32c16994091e574d..6f46cb2b776ebad24c89252f58677200e62c75c4 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 02ac9061005a65d213ded0af0517f2b9bb648c59..e5658c16fbaf4cf4dba5c727d0e8967b4eafa5d7 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 3659b7b8621ef8696de8c27ebf702b4d9965b68b..edfce21543375610f07cfd8ac81e5ce5f344900c 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 ee4a13dbb46545fba0aad47b3a6e15021b569ed2..b8fe4bce0f9af3e6e63c863e8f19ef4976691b4f 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 b45da837cb5e68d1c7efa070522fc91a00b5dda9..2109835fee7ff9297571c8f622c4eb3529425a8d 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 f0afe1c4215356a2c5e11c44386defbe8c7deba1..40ec49d362745607b5bef691a7c834aec5b62ead 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 ab80e19e79588334dacaa6d21906c47b626d68fa..b171c8c253095b4debe5a091f604366d391809e9 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 c58dbc5fdfd31dcc3fe1e9e43d9a49baea785e89..652167200154c466677b27be34c86d636cf68cd2 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 a870799ddf68e29d02d35612f3294343662d41fc..82095805e7c09d51765b725cedfbcc1482846465 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 0f490d411e8f5053e0620c8d2e3af185dbed0840..03af0cb5de5e7818a2c619fbbbc8ea17ddc317cb 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 4315d23149ec645849d277c68e5f4e827af81413..0f350b4f5b0a974ca1cbbeebfaac6885ef5cbbb7 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 0b32b7384751b1105e2307fcde3b2a4a3ade0b49..8164162624f5e785ebde52deaa1c8e90954508dd 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 171a82cf5792d0c42d06eacd6c129c76fddb625f..fbe748f877c2ba59e8c41eb2259fe91f53c36055 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 6fa5f43c2895ba990ff537a9908caf1c62844c4e..6e37f368abe6ea2642726eb737305df18e08617e 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 63044d68f96039f90a53a7caeb32dfc9632640e6..9001f4f8a1f4c0e64820920c84c5205581dd3a66 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 62f1a861e18ece2ccbae254e00e88e6961b84907..d6b4aec3989b56c3effe3c36d663e2f197885c60 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 2f67b1db59b9016c4ca0ce12d7edc5c5ec41faa2..706adfc282c1d4223ebc4a20588ee8eb83d098d8 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 6f48f0ad4bdfd3a19cc6cb7cdd01866a9d27e9d2..aaebd85de956c2f38525f987ca27231affa650b3 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 8b902908b4c6c9b4a82de28f32f060dc3370a4e0..ae17815db747b1c8fad9d96f11bd724ae5333591 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 d47f24cee543517f2979bf6279405cc8f84db14c..52d5e3ec8792c17452350f371f8b73d4e783884c 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 2204c7df2823a4eb0a276bbddafe69eb715f5c9a..f48991437a4678ccac8ba146a2d81459b950cc55 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 4ab31bd7ceff7656788b077ad429a72150e8bc62..80ad6bc6864bdf238185c8ea8cd1b48a990463e0 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 4a781628b99ceefcf010416ad46a6f65c3739695..78ed7447d760847574990e2f1defb23987827a58 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 85e0b429c21de7311fd41ef1aba0d630de745584..57792332ea26f0b9ff907263067685f8bd8fa35b 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 8a85c7f3b21364a5e5e55931f1e76e6faa1fe8a6..da0559ae19ecf4e550cd72987f0218052b4599e4 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 f66e3168ee586a72dfdefe7ae756d6977b751efd..297bd0b41c8634a8f0d769551bd3e3ffff156037 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 d4c7fcf7fd477b92d3df2dcb495e5e7ef796af8f..c3424d9777bae80a2517753ea1ceb390aa2b7d32 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 9c5ccadd5efc745a37c9e91ccb41427586169228..da36b489464cad423db1f95cabdd7400c61282a9 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 857729fce0df9812f949569620712e24de79df89..b5f56553bcf51feff1750e852b01cfd819c05799 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 f2e016968ac06aec763931839acf5b69745653c9..b5617feb083c9f77fe2c919858a05f69dfb3d671 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 ee4283a7040315dcff9736673b99c154e8223927..821415d5d1da020facc1d2814e18c26cfaf25c34 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 25c30ed3d98b1aee3f6701a3d922109fbd3eeadf..bdc1b6e2ab48540649d644e0d31e8aa69f5d3bbb 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 b3b133a34b826644dad9a98b6920ba9ab222e2be..fb5b4a81a898eccce9ebddce14266c7197a29738 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 97c9dbb6a7a0650859baac29149706648ece26b8..57b3c88c0fb26cc4ad0f6578e1d39dda1e97b2b0 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 dda12bd9e24face1d5b369f60ec4aed26e96e842..a7ccb1db8a57b18d9268ee0645fac0a582138f3e 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 f7bddf65e4a842fb83c73c1478c8f4990a42e41a..02f8fa6d81e4e2ad59658599f06301505a2b39af 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 415a389c163bac9fd5ef2b123e3aa232353ef0c6..2e9c799a887a5fd6ea062a583d4f7446c458ca7c 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 5e56fe587e7e4ba2582bbe10b752449d1e8c0cf7..0a5ad6b5fbbec5d6c8a9468ced66dce4d0b485ca 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 57b0210dfed76344e8da48a280a032c59d745dd2..6df8ba4adde5c856ca6bdd8e124c538965de17cd 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 953121a3939a912ab7a9a8aff29f64dda4ce2b9d..32ae4837088fd9d2b202a88b79d51a8bdcb215d2 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 cc78c772a157641fc1b5030599647a4ed7ea185e..1bafa6eb2551e11e6983a2aa45836882d6e4ad89 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 e880922bdc809da0926e69afee3460e4a68a0b84..7fdc7fe6499bb4098a2182773410728668c9ea16 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 adc4130d3b2d4938cd72ea1c5972a3a27a2363d6..49f5d41ea81637e107e9c8f46337206f612bb41d 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 f78b111896f5e70494ca6000c61143bce7dcc079..4851388c9c4c362896e93844d7795ee5c392e99e 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 88ad92e75617781adeac2634bc999f3c6f7030bc..6e0591c2064487a6eafdbae63a468423b4ec4282 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 4f400bb644a467754963448d1d14929ed1c38c8c..afe51a21f55eb1de260bf81ea0b45ec7483d2da7 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 ec495a54640d5c0a09b74c7b7ee13b50abc90655..ddd8f385f0a3e86544c2eefa781d9b2053b80cb4 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 29d7bc5ac48984161612e7f9d0652e74e8fe320e..f43d7f05c57d1d91d38d6f5cd8bb85981cc03d9d 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 ec74e3fe195521db3646ac193f708499a7ce5cd3..2de1206afbe7551ca344e230a73b569925685f83 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 cd199ec430250e196207d0cdec74ba45b9d5a4ce..f8cfd8708a9525601c79b19ba7b225b525045ffc 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 b585ea2838a7d7b808fd494900dfbc6680176404..73cabe06b8fee4ba302470f27e9e1dbdd75a8eac 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 5e957e1fab7cd07b82ddc23a2adc0cea1e68cb3d..ab240c338f18b94073465bf0979b1704a673ea89 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 a9966598efa10a9ad26badc4d977f422b5415fb5..0266b460a3d5e81a6ec9b4f3f3fbd06d6a5cdd8e 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 f832578c2322969f97ae7a45aba7a428abf204a5..ff2f6f5cd15d6eaf7f2a2c67464d32fdfc43fb59 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 c127560b1c965be62ab2f56693613b2a0ed1439e..7b13d540eb1ce0dedc9426821d86b728babdd629 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 9008b47e820978d2def984655235128050da3554..a0ef8beecc6015abf0eb76d2e6ceb1876867c4c9 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 e8b8388b1463dfb720dedc25eba1b023110f8665..d1ec8fc1fc63aa531024fde3f04677cc516c0cc9 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 7b52408e48e8fd117ddbfc4389c9e3448544fbb3..b48e3ff021c0fa5f11e566e77c6c4c47b6ee94ef 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 97b53054f98f0b2ab08444d6a744b48191680fac..23afb4f4f81f41c677cbcadd5c00948a827ff32e 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 4d5c1e9b073a586236cbb6dd8b4b82d2bf693c6c..07e95dbfe1b78351da5782f94ce97d142304771a 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 e37767f3274cbe865580c8ac62c0209784437636..02641fd3c4dd54a85764eb2d4959046cc82daaa7 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 31f7af846c149cdc567ec6caf05802224f90e2fe..fd691ec74e0553c22227c78f623d1f19929cc610 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 443d4cb6f28b5acbb70ef60d3f744543224e09da..ee7ec5b6a931ca8aa7f43ed0fda57e77dfcfaa90 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 3ca69a76d8104359070f728a4a4b4f284fb91c72..ad6128801ffab307cd65aea2ad584a2063214afd 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 fca1ea07cd78223a899dd8555691ae76dbbe763d..ffaa79576fdb744199cd3de42fb6f2d90b473dda 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 c6d9de87ecd6030b944563f03980c79418be4be1..1581fe3a9b8fae3afb73344b7459717ac3a6c8b5 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 218f4cb4313131d1155b0e778b1fde1f84d5b679..c004bd4914b35368b7c611b5a3ab8e349a5c8d3e 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 b370c769e572f41222321d7901968ce31e05be82..c33c7583e3e628909ad94901497761d5e866d9c4 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 43c60ebf14c340cd4c5767ec95b3c85df4910129..d3bd3078a7edf868cd97648586f6df7336d77bc7 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 12aad575db38e0d42d21340a11ef59d58ac88941..f4fc1cb4fc6e99a59be612ce9368fa9ae3678b83 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 95b535b3702398a177013011c1b0693cc3a9eb49..00456af4385d24618bdbbf99f42f8f53af22a45d 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 ddf5be61a8714409ab5016b325ccbe57f044bbcc..f63d7ccda8f66c3ac8b8a6e644374f4e526099db 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 c8f4f3123eb90270c6657a3df2cd9014eeb3af77..9f92736c5b6fe9587b0643ed2dba6dca6588d59d 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 bebf0f768b23801c8ae5be1dcaec9d48d00dcb07..9f29b52c850e868e56b5e1ada26c24a2af3c974e 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 a3a0557d99d77d5ddcdf8b283f07b3cc3d183efb..2b13b96b8c0191862b9a33ae6179792858c1d4a8 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 20070d81a9c0dc7439460f020b7d3ab53f9e54fc..8342fd18559bcce1d976b53b25d4c549098c31d2 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 8d00e2f8cde812ccdd0a77690c287963ed4519fc..943b27b41c20d3f2c4a1246e34073524fd9c7d39 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 8f366c50f3bfb5c8432dc38bb5858e12ab357c9f..f8d6f57547ff1acd3100697b668fa46ab25aa223 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 d349e7225bc8471942f5d71e473d060d0b6a1ae1..f5a1e885b592b2bcae1179ba9284f50ce881e419 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 bfb80743e1fe72fb7deaecb1d64ab8054ab81c34..25566efa7b1d3c44cc49ff4ba0740236dbd64211 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 43ba18ee490d090c1168dba5883a4f0016daab2e..904bb13c41c55598cf33f99e89db31015c69db1a 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 40897ae3b1282487a61050bd165a726719053ef5..ed0ff1d82354c1e8c226662f266b11ee3a122c8a 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 d427dc9a4f41ffc6394c3e80e8e48c7f2bf0acfa..1948bef9a686893082fb0e33a5f09b45a4585b87 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 09237015c7a9363da8f419394d1acdec8a2db612..2f8f3a62c48d6e8db34a79b312049e0ea182b2f8 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 d2c6a46bfb04e856bc07b35812fa7a29f82ec9ee..bb3fd2b16fe4ddd4057b4b4d0035b338f73694ba 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 e3b7078a0fcbdf4c4fad1bebbaa3bdd797612ecb..ec41ea64a89c178082da86a6a78a776b42294a23 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 f38db14ff448fe781126b98fefc1e35248e385a2..532070565c757657733cf2d7156ca44f545f0988 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 029b43619a8d1d1a800868c6bddf2d7c20d5b5bd..c1f5c7f9159202e2909fcf6db7167cd403c60ad5 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 d64872e55bd9acf0bd3653050627bf732ca03387..d9b6dbf75f5543ac959d77a2c2a4ab7787d78979 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 c315751642a8921dc8bc78d7b2355e4d4a89fd5f..bd97cc0ee36af8ea4f415ac52385efca39ab8a72 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 bfce082a79a2e648e4f399d4396a83caa4039adc..2d845a588d180205d4d1898b41254fbdc6e8ad14 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 caff09b40165e465ae7646b5b444d71b1c9a110b..8693dceb7dac2db0db60d2bc4ee1fb444c445736 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 c616d9cb5c05b0b0e5bd89203c88a3f2ff88d619..114887b530ea9ae90073874c027bb34700b4ca55 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 19ca544e709f01ae5ef6aad5288f31c0034fbfeb..6b233d19cc62e7a67a4266f96b20a747c2a5d787 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 f55802e36a1c76f05cd6642795c064b595ff1e9e..ba11afaaa419d095b94047a69e50d399a11e00d9 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 7edd9af7113e7b74543ecaf80c8544cbf1e8967f..b956b9933e4b455b599535287729dc5c5699d6e5 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 523f208ca5cffd944a7e892ccdcfbf3f1ba684a1..21801a76139757a717934c5c27bf40c5745efcca 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 50cff2756839838b876ee1102c3e0d8431f4cbf2..f8436c38bf528afda4f10f2f529a47cc441e2c3c 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 d1a77779afd7d8127b1dac652708c43e88dd1eba..d8c4f81d718e36b8619597b124c207a3c50003eb 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 4934749a5e6a5b27c0fd613a017d8827a8aa0782..2ef6e2d649f5d9a6cbac55212bd5f193422af7cf 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 e88783358d7a848a94244ff965229df9be695706..882d5bc9ab1d704c33bc187a6fb70db447a18a43 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 415f10cd6a7a8b4dcb2cefeee9ceed0fb273e7e4..6619b32c5bf864e8279f470217a6537648f91b86 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 92f690775d16cf78f9451697f485a45371a0148f..ffadf7597fd12e8a34c1292714550a5b3315bd4c 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 c5635f4ed399c4bdff8ee728d4fa187ccf1cc7df..225bc6d8db4b4319de4e37ea9b2eee38051b6488 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 783a125b22e570c9d9cc07e7431b90848a7ff2d2..d668af9e019708587bb247f3721c7cc725bb5495 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 fdbbbf0dccb20d1116a728e3ade0ccccc99ef615..c089df812271b98e1f08a3df0b5c33f7e18ddac8 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 6914aca5705f062fdfe579213699d9df0a4817a5..4acaa71941b6a378014b883c3a2d6e34e8058838 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 81b3a5720d0a419ed2a846898bb374c623e33832..e6dcf8935b1f87fbac11c657b0c459b05459935a 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 bff6cf0fa6baa6549202f9cd31e644c760a7737d..6427c52a36ac2e104976917618424eda3b77ec04 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 603339c14d8ac6a439f22da0ab3a75f4762ca52f..6233f1b3ecc1ef535754ef8e40f43a1784e5fbea 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 5febabbfb3e86ab7a552a27fd1b6965ed1f05cb6..38a4abfcc8486b735b6c27161c08e30ceedcffa4 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 99606bb83bfecf08cf85cd118dca77166749a1cd..c323037606bdf6bffc2b3c56a61008f7a3300aad 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 837b3eb68b7fee109ef800e4be738485132b222f..443af18f784c567d3ebb7985a697910f76af3883 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 aa532d026f989923ee60076646023ff4c40766f6..fae90cb3304ba0605e8abbcb8918d346511bc247 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 39363c0452ccdbe1c6d28f0b6eb2c7ae98eac624..a3c3fc3f1f0b1b22d3f937ab5db894fa0231e4b8 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 b1136de470f96f7459adbf350746a2ebb1af8e7d..0dd96d3b3c6ed44d0bf27653951b200f676e7db6 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 23caafb65c4c70090afd41dd53b86a09e0893c1b..d73454dff02a6b0e349a702889d3e36898491f1f 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 388cf363ccf5968f8080f08770f464c9363a3945..cf6ca337f2c64f32e3df7a7ac2fd3294dfc2f1a6 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 b799ff96f25936cafaa35c7868a856ac5d1eed06..6281068403985608060b1b4e4c5744e2ecbe38e1 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 3785093d5cfb664befb2b6b04d6ee824a844793f..8daf78f347a863a7e3022294bae5db641487d528 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 728deaa35eb0cf2b1854afc4e36738a420916bf2..88df1db0d0bfa402130c2e36126929a7cd225c0e 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 cd826ab68ec60acb185c9588ba6ae35e6a4b183c..19e1c0d1a10ad2ed277fc6ab1e7ec8956498e0cd 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 3066ab14194171ca2f524413d8c01dddb81c633b..4303fb167b21a212577919bb6247022894dae280 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 30468f65764ba3912c4f3d9357f0fa38662ff9c1..73ab58faa03ab1b7213c5f2c764f4956d041035f 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 d62941eb0ffea83720db4f8a772cb7e474026a20..aa858f81a046072f937e4511ddda960d310c39b4 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 50c0d283af2ac819d0684612d2af66a0e224dd63..4963e9a057596fd285ca954cdb94f24179553ef4 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 47d1aea6e192f0f2444602b27da5b07e0619b082..5d51fd52f2a9685c71490d673875f78be65b1488 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 8bea985d11ccfd2a3bad83089445e37ed1b2e29f..750b6e34e42196506a11467b7caad4e434f40672 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 e965f6259fc19b541f9c28bfdb4e6805a35f6c97..735197093bd58f7a91e1b98bbe77a8cbe8b2041c 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 884563bf248eaba38cc65acc2dd00feef0679eb7..cd7bcbc4b657ac35dc8ce442e5771eda5b986c8a 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 0000000000000000000000000000000000000000..71cf369ac5dffe3772c98c5cb88bee492740793d --- /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 0000000000000000000000000000000000000000..83bc2aea29f9210badc287b2b7063784efca79d7 --- /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 a5786283bd72e4721d5a170d72a293a544e39cf6..e7d574bdcc96615b6a3d0710fa27707fee690f27 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 600a32d43ed0c678edd19f5e5bd46ee7ce19bafa..fc11da31d0249759891c482b3a2dce2154722f8a 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 f43f0d0320a0c1cc5d27608f155d8a279bead910..b7ac592f3097093b63eead520152e01186e0b02f 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 31657ad745b71e5f81d1df078a3740f28e05e075..70ba5ca464765571e5ba4198301ead8bd806a5a2 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 d459c5e1b54d9dd07f4d0e50b1a3131da5a50fd9..f99901c5fad8372f502c1b5c9640cc1977a7acbb 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 af20dc5e2244f20671fad9da92a3a1c04560e640..fd7ddf30dcc972b157876d0ec48b59dbb7d4350e 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 de69a8580a1877d5c938b2ead0d99dfe90252c48..e3151ecd8da53fdbd281f428f13a2a21a2c08009 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 b4f36c5d9ae1dd1ca50293d8b6df5a0e62e7c850..c889863e2ff46b6ef3dce1075fdf5010f31f0ba5 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 c2d8acc6ab6511973e885a74e1cf0fceb73cfceb..209dbb3e1536d63812beb233f2c19014e5350a70 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 53153d71bcb5d77e49877dc7a872b405a18ee270..1d5e8e618aeae42cfef40db912b4239cd967239f 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 42678d50259fdaa5e707ab6c904e1af0c5ecf91f..febdab2346c933c221d6741010b837d7197cc3e6 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 659949e3a44262e135cf0e9a635798dd59de65c7..872e7d1d5ac9952c82c56e480ad39d00539703af 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 62465e267248f7d72f7acf7cf6b188ca649d6a50..b832c85067b24632308512ad9aa36900ce5c2010 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 81695dcb94b1cd856de89cbc081795381cdf1330..2fccf492cff7dfd447510a669e5221bfefb08bac 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 21c549330d10900bbe61c1fe400c18b3fc64ade2..b9105193cf5810a07695e354a3e30ce2deab391e 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 cedb9e98ea27c4bd258fd724a56c4129e1b07984..1cd6403b7a430a37c32617eaea716cbe907af7f5 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 b66e787399c5031057ce7459035756bc5652babf..30ae949c00d558a3ee990dbb845375bf056001e5 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 75fb12c3b55c3a8ebb913061f7e988b871be0df6..b301e526dc5011c190cdfcff2e26b331c5af6fb3 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 6b2985b98da3bd100e5c7f5deb4c614ecc446f9e..f31ff8c46b2e254b9c969a50991f8ad6926dc1aa 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 7b4de1b1ad7964735e383aecd7b4b19f247661e0..3a5b98dc8ca9339743d68a882e20f999d5628612 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 0bf37626e08b48c4ddb5cf0ebc4dba27982fb491..2cf8aa0c4a78c7cb3bdbb468ee817a1d52ea9d05 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 4a2293c52991c06343883d0de4388693d9f29a5b..00497552f08ba769874a57959ba136aba112f286 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 c5d164aa05642f791565f8d6bff9b78638e3df9e..0889cb595fa235701748ca60f608afbfd89d9686 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 04b2469f226254bb31f7b07d5ebb358dabc120f0..bf79e9fda2e9a073bbc35f9cf3a55ddcac2e34d0 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 84f420d7b9ed8b62ceadc4b0899dee093f237a27..2e2d289c3fdea5e0ed0a9a21d273e7634070d2b2 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 c5c4ef2824db0ee2298c1b5514714ffffa98c4cd..63ce4639909e0b2223554f10ca501017860820c6 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 44ef6292d2ce1e2f22441f18fb58d0670c8f7657..a17d3e82511b47301bda67d7fc08ec0f6c8bb5fa 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 56d4e5f062c7ddc796ee7fef597814ed1fc26cee..d273d960bfa31a2f2fe3873fd78ac1e23cfdbcbf 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 4f9375aa708eb7cf7be20aa712b5d879236aee57..9d5f2cb5ca4e21e472042ea1f8a8acc7a41d7db6 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 123c79040c90b1b702f26d7e29a903749f6c25e0..1f4d4525eb2853cdbfb57f42e9359f3ad20a1367 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 9022ed9d8dda23aa6196dc74ff3ccf77fa932e98..c2be70e1e0fe0c34bd1133df8f60ac6bddcc9b84 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 f335ab4b22e29e1998e0a6465f70f3d606e22dda..86317e343c9ed08022d93fa008f471b978f4238c 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 334220fcec5a60563e732a80185ce3d8db0cc0f6..c67766a776b738081c19695b3ea82297067322d0 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 61302020f7740a54e0da2bc789a3f98eace540c2..e37da694080fc5cafb5213334cf53a6928e4e480 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 9339c419c83d3d2dc2dd3d028d9ef1222f69450f..0777158997b8c346aca656b34d9fa8a390f408e8 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 e3ab3a47502a1bb6297c7d740de858d46a1a8303..25f15396e8cf013caafcbb716b745ff831174999 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 ed993f0c31c94561120fe3103040eae1fab15cda..bc071ade3f90c6354c39d78bddabdf9fc31bfc1f 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 15387546d38c5d3e96d391907035e302dcecfb18..538befb4e7a8e57efb18d1beb1554d5579f3f6d7 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 98a29816a8d0276423faeb71d8e317dd646ce1ae..dd6eea76e357b6fc61a940e2edf03ec124574c1c 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 48ba2ab37f3a0802263458b2b8d81c0dba27936f..f088b672e78ff9960665a49cf30ad186883aad23 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 7f1d7025dc5526bbc41bb54f78f600ef0014b412..2140a093e6f8c93000c27b69743654cd2f50a88a 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 9ea4985b568eeb67e7f5621f6588910e2dc6dc0e..6a5a7298ea6dd26c2dcede7e5cdedf9ecbdd1259 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 00bcfbd0837d3ce5417dc7c8818a98dec166a881..0891cbfa90231ac38904ad0d0b1baafb76c4e43f 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 ab9d01d5f6533f1700b7e24c206a2fa0300d7780..9531f49521e9affb1f4b0c94e51bed986a22105f 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 bb65f6231a0808c8c3ed18e7e10ac606fc15b702..7f189cd43728925c06c7edda338b31160a731983 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 ce540e078422a69d9ba29262e810bc0c068b5079..084c848c2446049ed298c77bda9a60c3a02ec908 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 c27ac0177649985edc7aa58d8d2946be5b42869c..c1675a3b7e61cc5ad4287004fdbed70e84aedf69 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 a53d752e8ee6b66edd44fdc8d28a1227ccb45058..1a7c4e66360bf0c41ed9029752344f485f861d87 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 2d4c4618e1a20e6e1eb8c7cb9be6d244da036ee8..9207b7456e169e89717ad024bce431cb6a6826e8 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 7ecb78fd6688cc4c3bae7c3d6f5a62125450c436..897494ca2550d470a46f2227889cb2d9171dc33d 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 84238d8b408bdc9526993b97e86e2a7fb7f7a0d7..d7703a65aace27e74d65f97b52fa3feb60e2654a 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 b3ff75ebf873e97711e7dd390c8b07dacdc195af..64b5f959ae7b465668cac2862d9a6cc593f19d2d 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 7516bff4297faeba71947958d88df895c2d5dd90..ecbe06b92a6f4e4def5dd0a194a6c4ad9dcb2f9f 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 c9744c4f55684cf0cebaec872d43d121913ebb65..7ac864228160974d744d5c79fe294a4b21ed3989 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 75eef0fe59645b5d25d201e1a4291395d8e89f4c..6ae6d8b41db0e2d63f73060e8c741274a2d3e619 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 56dab0aeb58f3836de337c351d0eb50ebd497da6..21034a95bb1edacc7a2598ec525735099ed090cb 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 f4b71a1e02a90fdcd48ec152ea6fb93c460d17fb..2eeab00ab07e4d9e0bb1a6cd77947cacd918f55e 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 d9319b2aa69443cdc9b12165d4461df970b26304..e48839ce4daa78fe3d618f3fd910cb5a647edb15 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 65af8bae6d361627503d1e567e99632a236cd886..7c3c5af2ef5d676b5d6b05924c44d74d92c03983 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 9e3b76ec779b4d8a1a6967fba96095176c7ae50c..58f57546682b0dd29c0d39f613805035eda233a3 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 670254ed3980b81f86cbfb192ddd760345ce8326..0b22020b159711e497cad9c048245a9428a7b762 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 20aa47ee1d77b29d5a16b291c700336400785e93..acc588c0537fcc7cf67a6c114e93070c55d67db3 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 2a043a9834cd5fa70f697fd0fa013a884d20b8ab..c978a28a119861b0cdf0b94b104f763739ed16e0 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 4a7d0a4b1c065610dc892eccc36132a34e353e0b..3b8df2bea129bef1893691c9f148cf0a0d72a43f 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 fc90247dbe2ef18fa7ebc18002a3fd13790a7d7c..bb716fc45bfe52577266cb86ae132c004c284ddb 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 242df26c3793570437210b0dee3a0e89fc165365..0f983ef0d343a29dd3071d333e2405fed1f0ac40 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 e99fb03cb3a93e8cf3538602787375ae9b460458..75e48a98c1c90315fe88a6e92db2062db65af87d 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 aa77b807dc935685bcec4848cfddf29b99c7fdf4..685401022774f2ef0f636d2746ed0a28b3b300df 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 128fbaa960105f2594c76e2df25241de8a19df22..8f0fbd3ba3bb257150db89f6dbf9e4d3e83d4b9a 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 c733d4f48f7c40b8853982bc246691936e16b2f0..8b7d7054a411962c0940c081f3056636429b9bff 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 e3dc07b950942adca32c93a3bdd7e2dd438e885e..643f19da04d1ab7b028c0f638592480d3f008341 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 448a9a6bf63a47910bc7811f78fb3f0fc55f8a23..aa98feffc2b2f5a8f3cbbca728dab8e0f7402379 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 bfe2ff3655b4c4ecc50b6f2e6f24d51591d8f549..172e1a8514e83e07ac4e00c8ea28930aca9d035d 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 d098332594b5c683de17d08df905b502bc2b22b7..148a8c81b2b4ce72f777c4cde2b1b972c47e051d 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 129c35fe533f8d1d3c7a65c9b575053a6b5a44ea..fa494fe850ca680b102ddcfb894f71d76290972e 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 dd44dee5bae4c519063645736c8b44724b6c332b..1cb87a9ccbdf27ce964e75ea0a7bc153dd89b7b8 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 8914ddee4400942b354a435fac95326e5603c698..41f63e6d800d9ca469ff06f94186f7c0173f6226 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 711950c7a9643c5e5379a3b078e1707d87faa5e8..7fb5048757ba20dbecc158ffb020c3083e04820c 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 7cb3453463ca4d05e0d768a76885507a43461c74..ccf44447722b9d8ec4d99463224bf9f02a344756 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 62b1e861aea1941c26b792027d7d6a300f8c18b9..355511c9fe75dbe1a7bc490242f39f14037bc550 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 95e51f2d5f7037b373c04153111f815810afe0c1..e0e8c8b4783bae5920c763e6a2290d07a1a362bf 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 446ac6af551b6c49be6f06a80d75d035701414e7..6205eae75dd7aac43606e949525b3945dfb51b8f 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 9349188efe893e83b5d773b59b6ab616e5c53be0..00820b7b8d7f3cc80c2ae5117f535bd044e0639c 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 357fce529ade1ed60627c36888d02ae2a21b2336..aa08ab56aafd8c53b6bf5cf6428f8312567960e8 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 73d6478997e3e46b8f8a0370d0e84acb5e705d85..0892c661ed68ef3849ae60493f3f9291e6d017d8 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 e643eba74d5c060ce700f7b8c0fb4599b729dc7e..a2b7c0b3bad98e1cfe825828c6138630a3f789f1 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 3e8047fefd1135a8cb192a2a26da15e13a61bcba..e3686855ab239aaf440a8e8d898f098d4d09a6a8 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 705600f5b4f6e63183ce31aea652ece42eb4d2b8..9e4d0366be8754d36aa2abd1495eb42fb79ea825 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 2b541225b876995ff5d4fe2726f32d116923250d..2eb50d934a2848222a1ce0379083d494039e6bd6 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 6ef0ffc2d20cbbab3b282785a8f4d8d3a8b7e552..c581b33bd4111ddeea65eb6afdd05e35c7223f02 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 be1c1dda5715c4015eb781d78363e1d4d1c0f3b9..eb157f296f0a86554ca960b57fa0fed159a3797a 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 1e077be4cfe756bf88763cf29bbf90884a169168..6523675d5830fc43420a27f0ccd5bf7c21309033 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 768f21fcea83cd514652a95c5b3be717420285a6..bcd60af5a8be8ae882637e70f29dc1d8402c98bb 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 7f867f318deda3ba52bc904f4b9239e5c1bd8191..a2f561645ed53064d11eb8630f77d7424f616cde 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 a66382ed64311a131e95f28ec23000b510722656..8efeb839fa6c3a2889d8b239e8f391bb61d1002b 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 e7da13e0cb740aae1ed810849095fc35027e37a6..b0cb9f2bfaa813fa35a68126d52e3355cdc02a3d 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 88be189127e39784ddd6c9d907022944e525f5ab..2284967977cec9245025b93572ca8d3f51e700cd 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 d79872cb9baa5001ea5cf85ff98e5420893e81a0..6e212c8d2eeb08445ce9af0a68c09cb8ff023a3a 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 b6bdada067f4246ac2844a2d4e727b53d23b0aa5..5f4a69c698a7b0da87697d20a72f2e94cdb07388 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 afbb63daa664f811355cd5639a33669bd8682c97..c92d0bd57f28f017174e260078f3c2b6447e118c 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 e7b3c4cfad2708982805a79666c110a35071ed86..28e2d2a34509e692f0d34fc1ad25cf64d56cd99d 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 26108921026c19863b3734ada5da7b4dbf780df6..2fef4b339d7b236be92234faea52d3c1cfa7128e 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 02954e3541b3acf9b02347d2c16272aac3c9bcaa..8b4247db720dc95ca91768c1d5d285d8f998a2b9 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 1b24e9301226a7be03c5d90a3eaf230ae22744cb..49684dfc545cb9ff13b5950c78a8ba6bd9a621ca 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 3771a3a5598948754159ee53db21930503eff400..3bd22eb63e0ba15043d54d50dc9fe8fe611ec1ec 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 9b9040739b99466b92f4c4cd326edf93c2f25137..687bc09bc490a1a4f4bd456c4d3a482cf3bf638a 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 45a94a4b1be06dfcffea446dc6944a2bf1c48e7b..1c8123db9a962e75ff1775722b7c2dc10aaf63ec 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 d3dd5589a8bc4e5ef66ab18ffff4c3bfce2655a1..9049ef2708269ba2e984fcd07cb89d563b840c8a 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 5cfe55c58e2f3dcb8dd80c129fbee7e0315234dd..6914d63230940effd365ab6499f377b75fd28bb6 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 8dca75257146fa03557bcca96529ddb06a390f5c..0ad2a06454ad20f94f5e0f09ea401a4179a7bcff 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 d2889222c43e61b69c2851f34c96320036ed8aa8..5a73230ca2d2e2a88adfa953778f9839239af588 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 37af06d674069952d08e0a6b8205598a1abd3419..bed2f9b99f1ab698fdd54e3213a5fab5ddde124a 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 ffb56b0c1e880f0c820b87adb326d710fcd4cbb6..1d62c7e5bab954fc97fc86c5c69e1478264e2981 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 fa8d1755eb7eba51b891dd51b65a002210f19ce7..e294a45f61e9a85e75d069d21e36d01f0e7c2360 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 d158480e2f522050971c54fd76aec3f6dbbca045..fdf72c839da3bccae20fb083f3c658eee58b2712 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 b027c1d22391e1a4e77984ed43892b29945b53b8..808d014f7ca9c13dd4d286392e3558da110c8c64 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 24953e6543b4ddd390f0d8b0c0388750d2f0d1b7..9af01cd571e04acfb47a9604d5d7d01eb3d626bc 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 80dbdc669f52301eba08707eb043081c483a399b..d505e14c0658c0e52a2e39ec3d940eaf3730c39b 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 32c0ca9fb2aa0ef08dcc6de75804402a6e1aa4a7..6f19bf052933765a64f5f727dc2897c5b312de5c 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 0916b3dd6f6295d36a85fb7baf63f888354a2b02..eb6fb5aedf006ad63c279e2f61ff9071e123b250 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 6be1972ad428dedc2177c34e8b21eb76ab5b3c10..76cc7da4dcb2c77605b0a5af261246104ff2c20d 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 01565c5b467b5643212d69a4b0b9d1ca310446ec..25c944e26d87068dadafc981f7f611e43cf4978d 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 0b1ec6e8af5541f600ad6ad4bfd352516199035c..3153b3a3f8dfce07fd68c068522fbb83c19fc7fd 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 793bdd2669311210babc390e3a72a793ed4e6b57..3aaaf796b61aee89aca69928ed1bc84d1fda4a87 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 3c0f942ab264be0df5b618e5f32746032235b4d2..d471d35fdb49aae1846283d2fa6a6f11bdde0cb8 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 ae7def360bbb255e26c156a66ed058c189acdab6..a7e2d6ff78bc553fa43cdf40bfd36462f369b24a 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 189065b06f2916c02474e1715b47390b4fb4e713..be4a45a17724da79b03137e6e17570c572077d3f 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 4e47cdef77380cb4a16a6e801eebcf8e3f2a3217..8fd9b508f3fd4da7b15a9546ee9fc35c5f2ea23c 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 49d790123b70eca38b370cbd11fdf12c41e34ffa..b440c35194d78e4f6effbb73f5ae0f4a46d7e1f1 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 9c17ed16d9b4655a3399a91f3af3c5457a3015c6..5f09faa0d7dd6c4c261736e3ed9ab2001d6c7668 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 74c8935314ae9e5b488cbe7be6962aefe00ab524..6a5597639b7c78fa4aade415d7175bbbb8e94e62 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 43e54b42fa47edafd94ad35cb6fc6ece6e8a3d6f..2d94ba22959e9827c26e6385d375d5c1201e34a5 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 8a55b5178bfe56eb4be1ca9496690eff507c3dda..ba263345778e9c20a7c56dca258c1edb2539b53d 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 e24dd186ed3ce5bff2542cc680839b8857e5a9f3..6891bbb6ca192f9c83edc30340bac79dd7244a41 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 42c0009aa5ea4a5817c1901b17a42d537a271345..57171ff5563951c945bd677ffc7c74f66ac50540 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 ce8d97e9bfd0cdd3fb873ba92ae4d231bf16b840..8558dda2ff0018fb3c6697b7e9ada7cc44ff47c5 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 f72d63916238eccb11f5d0b1226674c53d54cf19..e320d337f00b631239175902757a7fd3bf971be3 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 0000000000000000000000000000000000000000..19c9308fcd233013b2c0a14a46a6a1bbc2b5e700 --- /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 680c21a624c3c22c9ad8e9a2bf6f8095e251ff73..46b1396f4d9c0e885db3ea625ae906badf1538fc 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 ffd0e16b388c90347d15c855582570dd724c01ba..aaf39aba2d8e8f87f8d87bfaed395ca2048a452b 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 41844f090c6e54cd12d97d172b107e578aea7b8c..36fcc1252bafba4cf4e5072ca8691f39aa188b5e 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 faeaa251526723908e58e362ff62779ace7cfa8b..af20023a8923d1f1b9340598f43ec906483d5f95 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 e50e66cc6c2ec2cf071f2d6befae20f9f59b48ed..6645e981503fba3c76590127794f568d7bb6fb92 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 cd17bdabf20db7218b2ac984555f26baa84425a7..64b6d8cd4af431daf790f010da319046f77829a5 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 dbb534d0bdae91fdbaa25e8060c84870e0002cf8..4f35ddc45bf09c3d3be3386ad0c6600954d14094 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 a6cebc9def5376ba3365f4e7dabb514230c15bba..3003b9c164de95552f88a5defdac3f0569776dad 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 2f45806cae3d63fea67dfb5658cc04fdb54a7a1e..06baf8efc7afc6daad70ba9124826b0ce00dcb81 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 707f1780a8f8caac3c9a19bd3c56ad49b89d6cf1..0eb1ed6fe065d91a3c745b8382dbfa66009c6cce 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 e0d6c92995b1bfa924416b3ec561a544a0e0a1b4..133b456dedc1097e8e3e91e0b8b4055bae62049a 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 1078e7550e87b4722f3e235aa394e9bfb40d4c23..dda559740ee064902a83e44bfcdff62cc0c938e5 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 98dcbb5ded4a1324d150323427c80e543c19b88f..aa713d5164a79856e46cae1506651bb2530e3911 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 2f01dabfb785d8d409dc12f1bf35be6e15fa208b..2d77a73116afb7ea1411182e063eb30b934908f2 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 da0e81c630b1c94112566860fe71d3cf28eba786..59049a497192702fe4509556703d6aa57c046e8e 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 6af17516b6837ad736b74d351385ad511f98c2f1..eb2c28279c9230a3abd67c8849b36d6b2c031552 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 7b5aae3b2b84d2ccdb618da7d820bad30ceb9460..e15b815a18a94add09171068b8ae22856d2bd8fb 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 565563d3fa96daab2f5a6bda1ae28ed5f85e9536..1af951676bd2c901832690ca52431f09000ff374 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 947fc6c18a9df818238282cad8bb6d24a38d992b..587f0b3c06747a3024bbe21c3f369ef2a6f58606 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 ccdcbfcd6b0cdba36d18c64e759b984429a7c0f0..cdf95a051c5eddd97cc26ffbbaefa2daac2c37ad 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 d7747717eee2508ddcfaffd54ee0447e86e942f5..d4cf4564380ea84560ca9c15ff202de3fd899a4f 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 7814e18e1c7c82ea7ed2289c36ba81e58ab0be41..ccd407388ab801e4e3fc43e573610eeea84e6e03 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 689cd83158f3aa34be019791bbdffb6a14789c5b..d4cf5ebc5709d4933bf2fe87d48693a75c890f28 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 f0bb0228b0abba393696ba021358cf79bca85ed6..f41b6a64961b60540bc32f7eb0485f14f85705eb 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 98335cf91d39aa9c10e8df8a5978ce708b3c391e..f22e58fa13e6fc270803e217c525840d8a4e1cb3 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 60228433b46e8c909276ee40a135c4344a8e07e1..1f8b3003f6e0dfb84142fde761e45288fa881cab 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 a9608cdec6bc0b5feeeabb8f4ae0466d5efe5373..bd4ac1b93e06a436f1a844ac77ceef618d9b8c6f 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 f1fa0ada26fa7753b64b4dff45faf31e1d5b5ff3..351dc08899e1c010ef19f3d69dddf535f47afb59 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 3e826235e57ff0179074a8a14b98bbe7a365a524..256b3256ab040df412ed33fe3ceb0e8041b6e0b2 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 3ce05b304ebfc2f15d07bfbe98fa7a9dc48d7ec4..6309276d03708902869289376cae4ba93947af65 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 80491f76177d44fdd318de840a3cce0c27e51aae..9ca3634da5d6d844f2249aaa6928d87eef3844e7 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 80df79fcd122989f8b7c39997b4133c7c2308c90..793bb875c7e642f2cf7cd7d837181163669f0102 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 bea91f0711dde2c5653e46b87c17e37a321e4de3..031b34fbbdef03e3b79eafacf6ee5e9e6957f129 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 fcf6f9c669a33b896d66700af903de3b675023b4..04702e6856d9a1cc335e8d7b7bbae9a03e747d9e 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 157e58e456ea0376b404e3a9488b4b8c3b33b07a..e6f0aba0709c88eaa21f4174d695a357146e7866 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 b4f4d87c19f333af796b022493ffcd556f657ce7..44abf13d72444428ddb223548d5f29fab0614afc 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 34c9dcfe0e7c434be443ade4ce81f932fb773a85..b4e58f212c9a7e4d9d200c60869a5cb747ff9a44 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 623c6903065ae27320307e4b23bdd62c32482b96..511d10f6075cd91bf3da10ebdc3d710766f27a7e 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 61b886e60020f8c57ec8784dff6494984008c2eb..8fee642cb5d9f7751d37790b3545fff2d2290dc7 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 fff67ba887e33093d45898adc48a83393f7ea6c6..7977db723802720cc9db198d7b8fe33c3bdb0837 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 e4ed31ddd8868e014d5993a8b4f2161a731d54f4..3b0cd726a47eaa51edee73f052ff1eec9d40996d 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 0949a65ef70661e2f1e6c2819f923e15a0b9d5eb..07d70ed3f07419d42346c82fd21ed0b8a1ebee52 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 487dd734bd69a72ab2ac0437e64e4cba84b8530f..a52ff36e8433bb9f4c087d01d6fc4d21bb1483f1 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 d86ccca1e51e260e1b3a7f61f8431fe24b5ef128..a2fb1363bb70f63985ff6ebdfacace8bb37d4ed4 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 6d772e05bed43a6c3f02c2af784c8cc285119a1c..7231a26380a1c3c78e527b9b1e5e0a2f8caaa481 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 f9c44c6e275d8ae6f149868b3f37a171a303c248..590c5a5d4c894ceac14b8f839611476385af6f0c 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 513459cf01c9ade5944017b5c4c97e981315007b..8340c121e89f0c6907a1c7621ba74c4b0a060694 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 2c41a9960bc4427a8055c38cf2d6c93ebf91f88d..85c3c5fdf1442d6f330fa65523ccb469ab42bbd6 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 7bcae6600169f37b541cc22c9bb1b678d1eec10c..9b4526d61a4ff4e89f51932b6b9a1ba9330166f1 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 67d4dd740ab487ee557b3f5a8b4b594db13c2a05..37a27d0582d7b7b779e425b64cab7224a31290ee 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 35736c3b6d1064a798bd1419f14c8ca982c8a272..7785b37e6709f0e0bf7f2d764f3565330a870d52 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 f5315765b96c924d3c0129711c7f7500856e2965..73007e392b29cf355438a4de208182c7c9ef8788 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 2169c87f0f7eac7d029d2e18a345f5c81c10e6e2..122eac7432a03336b37aa65f06437132d1f1d0e7 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 49ae7d447dfa0dc9fd18defc8848d8c0dfd98702..4accaba2a568da3032b7a72469c1dbfd67e63fda 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 3c7b8bf1d2514e7a8a58737c6df54961e97f5a76..0745aab561a45281730f3e0c61c414e26488bf8e 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 e85b6503e40e57884cfeea44adfeac46e8c6b776..4eb482b360a7114a3f794d346c60cda0ce0abd93 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 95165292da86d726370b75aed98c304cecdc625a..f1538a73e23725192baf4aa0a9ac7c9598ffb0d9 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 b7ab9dd27a7acb1d4254d2178a0fef5d9a44ccb2..62fc1ed6c98d3431b87750ce1605a8405d720d2b 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 e35e2c558f66c6c303bfe68986d280ca0625eeb0..27ceeef491d6cf7648c8223ff4382aba10cc2bfe 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 3e4b27902840d355d4ae1caaca98aea149af2398..931ce7a9fe7eca560404e6d0845390ca33135d27 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 24e0ff001b426cea975c86f5d9a578ea6b121ec5..9e72a27cffea517ee2e7cb1008af1bddfb822feb 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 99ad2b98d253203fff48af116f4d8624b144b872..ea7df742f661b6c1fdc724e915fce83b1a1c7d3c 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 0000000000000000000000000000000000000000..ca115054c975de0544dbac6daed179dfad9b5b1d --- /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 85307bd6f95da23b382c9dc482f466a24b225e83..7d6370fb09ecfb8a55aec39829dd2bf8d9af6202 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 ab77e50eb53b45fd828accf971f87298ad3c62d6..40a179e431ffdc6a99f1de975a4f552866a93b75 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 49b96a1f4b7a8de3403070acb640a3e4810ecc34..1dfe69de69ba2fa1343b2e9158d7eceac0c13a13 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 0000000000000000000000000000000000000000..8db34a694650c854875a7045d3e315a8d0a5837f --- /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 0000000000000000000000000000000000000000..41c41975ca46bba0fae1de5a5e1034771e6d2437 --- /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 11018a016d5a34df19bb4b8677794cee76eec3da..21ba797846a72d51fe332095e3b3938cfb8e0039 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 fef002d182f44981a745827eb358357aa510600f..3751f76b55cf7aba7d4ff9dad16d5f9b48da8eb4 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 3a27190242520c614a61cd18256ee3bf803c2295..8188dd1af9987a0814636734dc332c1eaccd7653 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 bfbc2bab766c7ad01267eebae3ec0da285cf4744..cf81d440d4210ab5852460220659b337d0752337 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 0000000000000000000000000000000000000000..cb578e8415363409e4f2aa5881fd7655398346a6 --- /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 a3aa892069ac279ef677e6f93f6425cb2a12047e..dfec4d062c41bf42bad92eb874031c221e8ec230 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 1e23f8f579a40d5a7fdd3e580607b27b7dcdd98b..8464c16404f54ba650c4aac6b792707b4932fda4 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 4c20b5f22cbe18a14ed456d6c8f6297e51a058b8..18ca710d22eb47ed953a5fee22f07e3f407b006e 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 0000000000000000000000000000000000000000..cb3a5fd8dee75b2b5beb9d4ac5211bf0ce702ace --- /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 0000000000000000000000000000000000000000..cd58f6141dc22d91e1fc46cdf0253ee3f4478497 --- /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 f869a8e023ec00d19777f1791a1c27fcd408b731..1e67b3e7da102d7bc718e2ea2819380e74908021 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 0f985d23be63468be994fbc6fa0acb14f94bdf3a..caafe2e9615211ca168c6f3560c00d22714b24c1 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 51b4048d2ac8836dc487e0ab7b4ad1b6190e7ed5..4e87c64decd3cbe624e027e460524dbc1b2f8b05 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 0000000000000000000000000000000000000000..1cef2941f5c13f63890ff98cdd7cd8e3eed10552 --- /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 4ebf914fc08a77781b3691582733daf42abc7df4..aed190eb1844cdac654a22b6dd2865c4c860db88 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 570c2f364ad5eef13581ceba211d70bc2f148c03..c1f25d2ac17c4f534b93e5adf79ec2b1ce4c9faf 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 23a46959412b63b05ce69dbaece36eb7104c37e7..25017998aa7a68d08d71884db4f2bdeb8728c85c 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 82ddb2984fc0c465cfe83be6628fe4feb870f910..e09556f0e5c8ee8ff70bdeef1eae639c71cb8276 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 1173aa145ee6043b20e52f86c456ea851de27965..d701f2aa35bdb628404c8f2ee1e876220aa6d69d 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 0000000000000000000000000000000000000000..ca5af5665540de72f6c9c06c949d0ea84c241a77 --- /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 0000000000000000000000000000000000000000..3fdd0e0ce9623cc2089c1e300c510f3ceb0dac61 --- /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 0000000000000000000000000000000000000000..a034a0812f23d075a47b4e15403ef02dfe3f4927 --- /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 b19839996537dbf07cf4b2d8585a639c4bf9ceb1..148849bdee87be332c6baf63146c30bece49714b 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 c6031032e7c60fcc164ec9efbdc6657f0b1983a1..3097b6eb3afa95fe9bf6a785c65866a18d774bf4 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 0000000000000000000000000000000000000000..fb815b14ba3844394a981eb0679e43f1534d0901 --- /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 8207b80348c071251b29d14b7da89644509b8620..3399d3e9e0dfbbf2eb8627e655cb4fd300adace0 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 0000000000000000000000000000000000000000..3b71bab910f85cf9e5d5017a3c1e58d629ad3a8c --- /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 72580132e8810f1cb8704d8fcb3a607a57fb3e1e..934bb556406849110d149d227eb7a683b90b7743 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 ebfc1ffb0a2ff6975e3f46dbde3cd2cff2af5044..bac3dfadbab2ebe2c497593385d8e4fbb815823d 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 0ace3ac27362d65787ae7f2a5cf1e56904509c96..fb57603916ae0dbe4c600cbe6859bcb590f0919f 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 19dbf98d2d48d8962abca8dd96b718ff4c7562c1..53585d4d4bd829618a18a66a5210f16ac242aa0c 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 d313a0bbfd1d359614cafe5037986bef13ad3bf4..aa31958ff8e25c287f3f388deb1614fc08ba26a0 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 81df66dec3253175c34231fd1d94e751d5d6698d..1acca1484ad2c8e3a5edadcb1fdccf855f8adc37 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 b8129754f59d8f0c60ced2a72405bca182dfa3e7..56d6bb022ffc2ae34db13392f5454b1119ef9c89 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 9b1ce3657fc16939dd38ca042086e879b5bcd67b..77165d8b8e6a02690e3cd6bdd6738b36005a9eab 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 2d6c06e4cf1989c8362e17ea98e6abb7ba3fd128..445f890b54d7c82ef0d26d938afdaa9502fd619a 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 0496978978631e768189d667bbbfe8057f2ccb1f..577a752b8bd0a0370afd8b462700074340640cfd 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 dea459d845594aa1f00a58cb1429ec77276988d6..b18c83866ff358e748ce068080a7af5056ae0aa7 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 f02d078933053ebeb3d083edf8b5a6cede16b224..91337f8f30d88bb90ef1715d2916a4cea4f9c48b 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 0000000000000000000000000000000000000000..aa1363b0862656fc62fbc81a1dc639b4289cbdbd --- /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 955fa49477950c6eb5419129b21942fcd586af50..1a1f6c161aa2a4099307f62b9ac5444e70a398e0 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 9fe59844735c249e19d24eb109c371c8ba5e36a4..22f174b3596c2483ca1e7ec325758f285ef50e53 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 6fc417e3d6888ab31f98d80fe5276d0882c12c5a..0b5f63b08e1ade01d902720879b2e133fa5d5f0f 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 b97b78f07b88c69d971154e015fec011e6322543..a31415ba405cd849ca4062a514c391a92de56739 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 014dba75e468780d311e9b6a90b3ce4488d79047..2ff17af732fded3847b365c4ffbe8bcac469e116 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 1fbf1565c8b1ad6983a3d781089b8c5d93e57b9a..4bb315a10bcdd4c264ba7b516dbb72c00977d091 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 910af37a16e3887551ea62a66508defef4bb8a64..5d1b8ede61c2641fe4eeeb0013ac10554905558c 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 bc5b7a1543dc5ea3df9e57faa0acb9e85ccd0176..5b578fb750959bee4626802e325b76701aae4e21 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 c24d91ff8d6c9e43db36dcc3df85c3510fadd350..6b46ab9fb5821a84124ad01615576e8b1053baad 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 b6d37d38d9b562d280181adbfbb465ffc0efb2b6..f2dfff70c2db648ee182e295ec36b76094ef37f9 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 1d8ed69830ee4f0a56baeb19be85901fdb06e5ba..03689c4dfdf29a017cd56853c6cd6b6d8f697ef9 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 67e03446f33f49ea3ded5a086571f3c54b8846d6..49e11783bf4e5cce971521da519d1590a9f696ed 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 26fdf1e9b573a44dc79983f4c06ff391daff71b3..2bbac368204e32435f9a7e0756a2e26588d77109 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 ad6391b69c18a26c030005d69333d333b7e703dc..27535e6c3f1ca008a87e2bcae9bc81933f0cb96a 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 6010890677e5b5a2c4912ea7f000f9c4e8997f05..78ec59d665b2637a1353d32f79a9398e955d19f1 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 9356107cd9b8cc739d77eefb070fb24342202d10..877923015ac67d255faf34b61797b3b178885ac2 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 1af83ccfba3d59b02df042d460dc52f7e72e1a21..9be04df32d3c2aeb0fab4081bbd344d4ad1f0fd4 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 bef7ba3202a84105927f9441f1a048808794bcf9..2424951442a0d44ae8362b8852360f93cbb3711e 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 93cef5b4c0c18b3555abf497db4d31eb728d6fe4..0ed066fb3c6e2ffea8b1b164f9072d745462079c 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 9c8c9c07be5d2e2e6917ea5ca7451f445880b7a9..5f72c4dbdade59fa02589dd1f51f3553f88b9925 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 d3fd95318f60aa2e339f1c256d9ff04ddb52d271..552c946c98fd8abea21f55217d4de8dbe27c91a9 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 26352ca9a7cbfac499837fcdbce9b87a4b7c5d3e..b4e41518926946080bb71e82fdf02b5da92fbcf1 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 e0e25c717354cd109d71aa5f190c2d1114f77544..83122797394553a427821dce42412a3001273f03 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 522462d4879edac410f9e139fdfc6f349ce21acd..06a23fef50ceb36c4060878d6d7ddaa14f605d15 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 4ebacd8f1b41fec8bb0dafa36c90590e61ae9b75..b1d1f08122af9d919891cbae51d494b6c8e04827 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 9122cc760288e7499d393ff41f4e6907b9036a72..6ff15cc90dc2c0a398e009b0716209f1f433f2e2 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 0e60abfb1be617f1b92edde82189a5982ede22b1..4b70635ef0c58337724554b7fcd37af9ab56fd08 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 579097edb9427be14946c4489b5ab9e750d4dd4f..8a33aa02f36b85a65eef4a43cb3a76cf8f0c04b2 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 e32f00a8035dc9bc381d716cbb55d57a0b54dd7b..ff3d5249cc6db49659499c8cb9012045f6508bac 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 cb1550a9af9dbc66009c72446b81e3cb370f3f9b..9b7d8ceb487679d7949f9cebe8edceed742b2145 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 302551bf31894e707b9c5e5d339deee04d5fe4e7..2ea5230065bc88e5e670c7bf48d040d27de59bbc 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 4f930c5d455d69d12c091eefc390f9c1e893ea89..7fb2ba4217c58ea78fea5162795a2820f7fa5ecf 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 6414151dd8944bac297c360d062aec0588680e96..ba564048139bfbdc1d1bb6d4cf801f71c4bffeba 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 3562deab31b55d8dd2552b03ca34dbd9faf3d14d..a74efd661760e20d93f7634c78d8a15b269cdd0e 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 d5e0e115d3cea1707864578260aa357b90239fb3..5cfc742ca61ebbd6cbe66079b8f05fca6e3834e7 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 511814fb9c9d818385e0d26bbab7d67a19da0da4..44d494bff43cf4fd25ecef7a670c1e378e93ca28 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 a27d74e79feb56e0924f927d92a431a111e3a268..11b29c3b9af14585e4cb75aae1983fdc19224ed2 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 8675bd1f62fcee20e3596a780789d2fd88cd8046..568496ab822e8f571b67b698a064007f1ab7916a 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 e31029d64759f12d3b5d3edf8f122a87a432a15b..7b23d60ddc7c6d05d5b562a7c78519912d62ed07 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 dde9b2050341fba035637f7babb49c1f117ec8e4..e0cf923465ec87c28e3fb94956e37179afffcdd3 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 ea27f3a4f2bea715000d54e6347c6730cc3345be..63dde55fced44daf13c19718bc559cb14a09a207 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 424c18bf64708a7581e88582753e6681e7b1aa06..0d94baede9c897afecfa4026a6246fc137b216d5 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 b8ec3dcfaeb50d8a192773b0e4be5959477672bf..c1e735617d55b6c182177daf509d0dbf1c888fa3 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 9cc2b1f2db5e5908bdc0ab83ac51e3cfc1ed03f3..8c41c6fad7aa97e17934ada6b8c087eed538f394 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 d09393e45db015bf6575e01c69acb657a607094c..0ec5b11b768c15e687f1f037ceeb76e6bafbce03 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 ee4f5b8caee0486533bfb5cf4d394ddcf1ead158..0cf4740f201dab63ee8164316c4a5d03e0ed4869 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 ab700d3e318b30427db64cde976193f5b3f5ae8f..48914728a3a77e0dbce4bd422e09d15fb93f6e64 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 7965073a56fb1d54b3b2a2329ff6cd60b5cc2aea..66855df7c3d2b29c36106cf254552ffcf658b5b0 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 51f6344bc3e2daeebcc37923b9a31a8d56f65fab..e45a7578a27a4e6fb45fa09cfe961fa1760424ef 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 09afe07811ffb72fce88b3f0fa17356d9eb99398..a3d6613096f21acc00710b659b6476671088d56d 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 8a46c3163a15f4e8288196dc9140d053072e3360..7c81ffd765f8541b652f1fb9b10d1467fa4496f7 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 8ba6964fc103247d87631d9b0225d5918606ffff..b3df16f4cff564f855e3884d711191a35edff0c3 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 f4a769d47529bda15b19c37917a4dde383a423f4..1af97e55c26e786a99b0929655d7c71591aed612 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 61b761c8e9f60aca1e7532b2a4f80d7f277ab30b..d24667c2328a667432a21ff125b2c135211077b0 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 70aa089bb5ccd9d977f65fc7667c06f4b20cf9d3..537167a59ad72751b95e7b3e276ffe34684c5f2c 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 78ca4af2db4bc41ac88e6e77324816bd7324df44..fe3e588b0c88abc0a969a275538e588fc47af046 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 37a8bf5c911561546cd97a2a4dabdea728be6fb1..f5b5eb31ee764e6f883452bb9e2df89ca80546b3 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 627537351d565790aceaaf8d712b5405dd986bff..850ec7b1f98fb1013f65b1dc43c5e93d13d7090b 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 8d1328c59d6583f14dd57f915a61b78299bebf0b..5ff9cd504cc48681dac985d7ff3df66ddd8d64a1 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 fb25f5490970da61e28119b2879cee9e825846c0..128bbed6945d31a05f0e0a9d0f2740c99b79895c 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 bcd1d13ce01ac92a5b5f5ad55f9504fc5964c382..3452a853c75d6ad0e2f65246b123047df2a9f066 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 7109f806f722102e77dc6fa4730dbc8e27482626..9154549aecdc496a8c8bd5c8fc9fe6ea97debeaa 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 c3f49d7d4f563a1407f53bf751223de67216fd36..09a58e7defb32b6d4be821073cb66c7a8a64d8d4 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 e5d8c02f7e29aeec3b7cd30ecb9af307a433604e..af10bb180a0e219fb56fcef7ae8eb1aa2af94da7 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 62997c8abc9decfe2a7fe8db3464681e3e2e1458..9b124daebc03dd4721318d539e00a1caee0b36d9 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 0e0e6b030721f4ca9aad6ee6bb6710ae32d22446..aa93b4b504d9762b261c79f0e8ce036a6a7030e5 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 bdfc76be3fa0a421cebec567cd43471e70a783df..b2f77a735095734f3ebd87e21622c71a10335596 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 f3bd2e292526b651af3da553e06ee2e3683b23d9..4e95f9f4b435e144b492995aae4683f0ef6d8e6b 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 0000000000000000000000000000000000000000..552349bc49f251a824f6c74dbd8b12110c40308d --- /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 0000000000000000000000000000000000000000..a3261e7cb16f6c3d1b4548c1a301bc850f938573 --- /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 13754662d08e1efd45304fdbcc46700033b03e0b..bfa487e34f252b6d1ba2208fd46d0f6f5f889361 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 ca2e56e43f7a3355d845acf6d59f3e4a2afa0acd..57d1cf4f1296be564fc681d6f2307394d4938eef 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 b1a1059d4d67f3b66d817076c4ad68c849653ca1..0076b6dc78a54cc91068de05ce0da34e8731651c 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 6755bdcac1038743be2eef6b93584a3c81db7ff3..2ec7ff5970281a6671227592d38854f201710658 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 58025f3e30961bd4576da3c9465d7b5916e4d61f..aed3ba0beb49ee25d05ee57e4ebc19e7b628148b 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 c10c76ae2d186a670c4683d3fca6d56a649d69ba..4ef0e4653330da9dbb1448edf6b731d56a14ab1f 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 772567cc1c8ae8a5a366caf8b07b7f482e52d5b1..02832693aff37eca8c5447d4a8bbc4eb88b09751 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 9537974c07dc7a82a52dbfb4f3ced786d309a46d..0c4f9edfbf46cb516516f9a33522db55cffb10f8 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 9d361167fa07b597697cae10e288e042d66568d9..0f541491fc177a7997387d9481528e1075e9c285 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 b643a33212faa1d6a6fc1eb985c41ab0595fb845..54bc4b8ac8eea7c573473de835af4c24e0bd3e7d 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 2f61f44383f1f0046deb788e06fc656a47fddd42..540151897080c70cd5fa37a7654c63043319a83b 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 c933d3fb36412caa2199a3ca0633eb20f158c7e2..1c3629c255db7e519e34cbb17eba1e910e2e9884 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 f94f82e2b4fe3f50dfc1884ea07f5b0d204701fc..9dfec8062c33ec540e9cf61a06a3ede4bc2cb9c1 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 8d26cb491028ccce7288fd9d56b59ffe91ac2568..0d55c0ba0a148bb82b3e56ccf2104e8a7d34be60 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 a85e6bb3ab7b9ebf969299ff57493020b8aa9826..0db7d7cb42dbc6b6a812fc9141dfb98b306e3b2c 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 d5b05edbee9eae2ca30ddae73c1286594351ea4b..0c0f1b8e950b5d3eec4b3578f38a7b317ebfda24 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 daabbdfccd38a6a1296ca2108f272afe8a590179..231377651af4d510241d19dfe676fd3353098564 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 2ac45f964bf983429ce3c9df59c439d05c76f74d..f1580964f9fdf075e350f01f18b0bcbeb5bddffa 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 48b2e4cb96c317ccfba0d19399c6632a3c27436d..ab03d6a33d8c8e2286006f1ea44e0baa1832c036 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 6f5b0a39c5fde14fbc1dba071afc50cc19508891..63ab5c23342dd5123f954a3517db76c8429cb980 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 0c46998b7b9b1cef4ab68f16b7d1e0d66bda6329..ca6f81e31d989a8552db622619bfcf0d2f8b40d2 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 24902a8cf6140e5e39829dea5d8656a0ad8caef3..2c144f3639a989899130130bd2d9991db328ee31 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 94d6c2bf252340a67e3b7ada390fe14aad29e12a..e3a7e48194a33d74fe293bafcd63a5f482530d60 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 2b5cd688ff3179d423b452369424e2e18a6f9198..b676bd54eebb1297386ef875c07be11f8520946f 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 8273f564ee6d150156f67d915ac90ae1bd3796b5..df9347b77c0213e010593db11f627606ad6b379c 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 71aae82a729af25ccd8dff7a46252f1dd47dbf25..880749fc466267bde62c861ffb740392e91d256c 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 4cfec93d00ae629fb81cb7cccf57755b67f682fa..aa0cf6258b093d20918399bc065bd8eb6e1a2bfe 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 610ac9efd056baaddfed58b00858f0ae9a63b32d..00f2df13fd609a36688d8867cdb8e0e122400a76 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 a9a707c54070cc4212ec1d65c06e70550320c828..eec7687d299055e81f4b1f34c808065d64e49683 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 a95764179cf1bd99eab6aae8c0f827501b2dff72..a468319616274e8762bbabe070290e37434743b7 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 dcfa18f85fc94979ca1c52089b70accf98199000..2e8c3aa3dc5d85b9a8ce2e053bbcd4da853591e0 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 f4c46aa0fa42838691c35dbc5da683b8a3ff7d15..6f03c9dda6d9e6878153d985dca94d9b9b077bca 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 9a6e2f711304a4a5a507cb6a067c9e983bae2f61..0bba1eeeedc1c664fabeb11f1ea9c691015057d7 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 04fda32ef9f39b10151a7b8798ccb154d75acecd..db0120697db5c09782b04f52b6dcd1aee2106f97 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 e9c1fe7debd992a7c8b3590533e61d11b0f8e5c6..139474cc7f84fb42043d43266e0dc99091981ef2 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 e844109ab93558020a5388698517d4b0468accf6..7697d3fcb4b384656f7849349e5746747c0222a2 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 e7cfbed7b7abaceadd477ea18225c6e7d9a4b987..d5f4b4a93a23b464593e6b30fc69b2a8953f0dbd 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 5b2e198655f5970bec6cbb23699b7228b5f81d09..8acc273c2b96537c76706641a1c44eaea8e5dda8 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 413d20ff1a14d6fa8adfe8bc0fb1226c273effc5..c06a5516b83571be3b3c0b6f97c302731eaa6e50 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 8ece7e703e98b17cc662b56d04751be1186c4a50..1743b465f81d1877b9bfeffcbde2618f1af36534 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 0000000000000000000000000000000000000000..304f00efaa8afbc989e67c65e1132702ef331c29 --- /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 0000000000000000000000000000000000000000..73d5ab3289baa5a45a7b43c6f628b54faa9c7984 --- /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 806ec740e427665c56dd747987df05b911b91575..1917b28bc5fe9ea6bb52b4809a57ea5940fa79c1 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 df4c9d89b60adf9449a352a516286abbbfd37127..db43b76114d769d89817a788595a8a3a0d19b6d6 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 de3e5df9fe372db0b5871bc13dcdf23d2459da9e..bbcdb2dcdc4bc2ae998adc9af647ec0ac0a6941a 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 28e08efbb6d271c8201c175fe5f420db8fa32fdb..44329928043aef9fc2afd7d55802032c983c87b2 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 78e759838fbdf4767dc60d8b7107d580728de7fd..e17b34172c6c3aff2406aed020c0066bbc7bdd2d 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 d4c188c7bbcbd6affbbb2c3a0ea5a2ca20cb2721..3cf9822b6f463fff3ad80465bd2f524b89595fb7 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 1cc34a278f3f18bf78ddfdf38868a0dc48f01a79..4ac9978736febc9b04995d5d71a63d7317f512a1 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 02389a7aaa577eb969954ce7c3983316418655d0..7e89b1ff1d189787fcc41bb88f2c868a157f2d46 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 788ebe73981f5e090d4b5048763575b4b3c556d9..89d0492805ec902511afb8d595236513b9ac8197 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 1889d197fbfe76405432dae797a5c9fd0ca82ecf..42a2743d06f546831d9c00c8f92761bf9e5c5cf3 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 5380bb06f0bfe125da2f0ce322191dbde0ec0270..a38f3d34e7b78a26b4615fed68ad43313dc2806f 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 e5ff876835e95b466436875921e37c29d622ae48..6a7b80d25001b3c94e6616c7c26d0de2c18053a2 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 90bb85d17286a2c505af6fb3e0c64bac406e3eaf..cad98a1161816c104898af236a6ec7bd27a359e8 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 c87ac3cfcf1d93583c8b51d481fcf3a182091e7f..b9501910ed3e7b1cc761cd3bdd89f57452e5c6d5 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 2812596b8c69c922569f8cb78c1ae6a5eb3137e2..e931b2aa0ac2973596518ae8497799348219cd1d 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 76066a8776d51c8ac39334da53ee588954f8bdb5..44cde07f8e4eec3042430668c0d561c29a2aef6f 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 c5b8865411774e47027f1435e5ffb0e2f553f2f5..0f6e2f1e1bf8e71e5fa83a7fe50800bad489e1c1 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 b22987c91d0f924bcc738607c689737e9fd11033..353ff0de1fa433c8860ead0ed34f48b0889eb6ef 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 9a457a04f60abbc775f53198ca71b9b3aed003ec..7b00f5b00dfe608fccb67cffd452db74132ac931 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 47ccbb54e712ea3324a2b829c4d7af61edad59ef..7a096d5b259e3d7a7d1c6d08dc8b2b162acdcf6e 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 9a289aa37c2fdccd570a14a07a42d874c443831d..e2e8bea900b37e1ad65fb5f016e671d413d8aa29 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 f697895b68be79d1d84056463465b6d8dddb27c5..1d06e7c657eb4a858bbfda17a9b80ac84a682c51 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 0e699133bbc63a25eb38a57f412d046b8d9ffcb1..7d05fdce51feb2861b9c3d7de32d95a6c6df9d94 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 3306c8580d1e3d676dfe9b43ae89818e8c3d58e1..bc9c9971d6133a05009154a4238dd1e0a605578c 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 d51f5bb2d61e693e75f798f18f72535e03a0dd3b..3cac51956fcdf9d302f13009844e5037bb756b1b 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 691d29e02bf468b5171f75178b1dfaa41a05e346..c5907f92fb3999034e9860a1dd51e0dd046d9620 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 5afed0bc447c71586410cca9ed74aa1a2403708f..261d0d0da35c9751373fe1d898097679d8057fd2 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 4450ec759e55057eb860c8c33f54808a2755ed0a..2902eae2c27aea637358a48f8fc0ee0a9b7a2625 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 c8ea855fba106ccf38a54f1e0ec51a9f418b4135..47d8b706667a3d3290b0e8275e5d8cf4cce05b5d 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 d7ecf105a82cb55566d81bf75af8514b36220be8..69a488eb663cc896c15f80ab1da8be9e756a2847 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 06da3c34dad4a2167494328ff856130a2e2f2079..ba80f7d253db69a22c9292d5262243b5258e0833 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 8003c92da01ed2e8ba8313e70106350dad1bb0f3..4039ea95e4f5cf45df3c08c3407864abaa7b6252 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 94213cee83fbfc806ecc713baa894628ba144046..c43962c924664c7e0c2ac24978b402434d3f8e5c 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 de9be851472691000219593d406d37f7aefd374e..87e1edfcbe2435eecafb31abd31cd9ecec787202 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 a5d60320b88821d989d639912ce4a3c35cb100c0..655252730d2038b1d6f4036c4923b61ff130e12f 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 8d65b73dbbc5ee852f96ba184ae778e7c1a6c755..d3179b050f0e0837ec40b6a974284f57ed6e6771 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 2ba6e9d740daa6e8450bc70e4515d41e8ab880fc..9cfcf90ff3b3b275994ed129d6c6741f86180a7f 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 d165b3f8eaf9cd2e8c56840e68945ff8b6bd5a46..12b4e0e142d6703023d48bc0ae84c7121d705384 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 3a0885349e01c75bfb82f96f7e5a644026fa4dd0..a65c17eba1b2b7666e836133307e0500d76fb882 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 05f821c354e2355dc38a94dab43e000c3ba28c94..a8d923116230917c2f891363e6aa32e38587d216 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 4df92be2738e67f698ba01670f997c610850b934..7b2b93d83472f5d3c93e0e9b21d309176d36b02c 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 17fcedfb37beea3aa4d4e668f89eb757d74c4e73..4216f45fc6c78af4ec9627ca9a67c47bbbdec0ab 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 0000000000000000000000000000000000000000..73960a607aa49c795e33b094b3b4e19eae6a4d14 --- /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 b0cb503af21670f8b4cc75918251ab5bee143a15..0174f55ae61c30b4766ba4caf2be983e1fee3976 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 0000000000000000000000000000000000000000..9adf046a90dde7f82977ec37c4c6f47c547f652c --- /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 0000000000000000000000000000000000000000..5096a031de5a88a7befe8d8a3b2d1b59c9295088 --- /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 5a4215b2485fb5a1b0cdabeac8a2c4ccb9ad2098..c4486e276349e646ddc36620355c571aaca1d344 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 cbe0015142ac911048a0a1bc2124a2b2abceeac8..e6a20aca0508ba9c4de35f75eff8a7e03532efda 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 0653284ae5c1b41f3db876fe4576c8185beac1a2..7804d9c7261b013d72534431cd01e4ce452aacef 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 cd86bcf71faad2c9a975624ac71ef0fdcc626c77..9f7c6f89a3b658934a40c0ed5622407b9e4b76ba 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 d1a0bb310720d1c8126662e3714f6cfd83de6660..0000000000000000000000000000000000000000 --- 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 4b8897273f1dbcb5dc8e61ad164203a8f72b161c..e0830ca220641cceb7f2e86dfe73bb330b65de60 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 adaaf9755be2de1a9b9540cc6289c8e945aa351b..a947bd2106f15069c22fbc432e74bce157b00840 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 ede0e33dfaad0c72d8bcd60fd67260f1ad505a46..eb77e63494f2b50cef7b71c9ccbd03b7a6759bf5 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 876985e0bc8afa3234fb7fc41fefa0d7b102eec8..d1c3c608755e1bb43db2ac38aacc29c2094f0afe 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 a92d2d1706868d1a6373169962fba042e571cce3..3ed43dd69e3e9567c684c4846ca9922fd62ed85a 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 4c3c5b741f4d135745ebfa28d11e7de78e168a64..db90790bef47be44a743159cb49cf2d3eae1d75f 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 041fa027d852df56546d5a61d75453924e674c51..a334ce12166c01a51a5e55e8003af9c21d6f71a2 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 7663aa8d94a41fd3c72a32cdd91099dfc6beb465..a2e559d91e416bd6f9ce8a262dd5cd3612e02290 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 083be5f59ff51e1dc4ad9d294449eb5a7262dbfb..c25433fd4872d06c3e8132707303fcaa6360a403 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 38e05d40f19fe0900d61730d6bf400f1ed509559..1654a109ba796600da3f129cc6a2a667987507a9 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 f39f69c46b1ec7411ef011eb2a2896110af5e88c..84c5e7b8c2ebeab7b702eba54cd39fb4bd84167d 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 14b97f1a47edf0d7dd5a2e577d0be1cc33a71967..393ab645743601e94dc1e0988610d10e48d26a74 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 fd0e8bf159c59218713aa8696a7007858e4055b0..6e605af257ef2b147dfaeeafa0e7d2a9e918a224 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 0000000000000000000000000000000000000000..5dbb88ff36fd2ba11dafff9797a3da87a9386ab1 --- /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 437a66a7e329349dd9bd16c3d176a4ac36aa4357..846e0afbfa9e1df0501e2d6a828343034c1e5796 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 f702e88e2b8b719efae56f02efa9750546930f72..86ab47e540f63e4798669026a6d115400da58756 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 519e494ed5a6cf67f096ed7b93a842cdd7f87064..d1c346a6a162b0da066b1911c9506696ef60cd70 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 7a30001afcade759d95dce7833b8b50dd3d1c55f..80c4037e82b8d3bfacb7ac519d2a77e64c94370a 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 e9c6be0c2fdf0834a96f66aef3b557485dc0cf92..f444b511f942dcbe18e41121a0e38c28be8d4d03 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 0f4ca514054ba7526ba7782c84ca746f4388f3fa..6547c18b0bd51743bf2441c50720c28f27e7165f 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 3fb570f22d0c26f110e4d22f6b734e6fd2ba6119..0081c4125ff1526ae141c30108c0f1ed87160c73 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 d8cbb573f38ea63fb5e44694f92973425e4893f4..ea787fbb74d154851b75941b11f981514662f0dc 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 83fadec45fb99155d7d018d5a98590be8f92e52e..d60244b0c6943d4a35d62106b730dc5431e90c93 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 cfa01aa6376dd6830b6ea194070a7d4f22ed24f8..f939b9658f37c3a7b7a8d686ccea32cc038367c7 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 1978a9750dcaed8c62ccc1d77e1f801ccddf0adb..a84917c4bdc7d78d7d639086766bdba34476bbf3 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 b3dfb0adca039cfaf9d8bb79b3d09714a16cbc85..1d002da1e51a8e12ffdc77274f727693b57294d1 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 9ddbce109756ba53a14cfdd5493ea27f361ae388..7befa95cc498aff82523bd1b0fcde16524619d9f 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 0ce75e260b5b137d4e40b7fd42709e835ac09b5c..21c159974e1ae61a555e17bb9b4be1b1a0d912cb 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 3d0297c92a7393fd3317895661601673e9235a02..59eec98220d2a660b2ce7266e7a13978651989dc 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 4219eaf5ed33e3bee5f58ece51f99f4fc73b9ec2..4fd615055e96ad4c90c16579c4bb4d9158a4900a 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 20e828eff0fb3703f444d9760629b477c6ff8e4a..7f13dc37cdc7a2e3742e29cd452c30292b246c83 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 1c0d5516f0d0cd7c06ad64936dfc1e3df7241959..c004d0f491e925a5226bb8e6b97b144b3ce575cb 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 ee701c208ab4115ffcb500002b62ff63c44fe881..67969705c334e0b7e5955784e1bf14a1037f33ca 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 33daf9e948a056d10da86c558971fc2547b11860..47fb013ecba5a66bc3f1d7a673b57dfea2751d94 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 31d3da3060789d279f77d68e59037fe388ad62da..2f9ba9e44ac93de573dc76fe34d836be5f9c44fe 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 5f53d1b2ea779ae3c015202a55f251f136b0955d..2231c1fd456a25c13688942b5f81ea08d9398e3f 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 2e4fdaeff2a51ad73d3da99ef32ca1ca6f8ac5d8..55075fc6733b9f6e446c8718abcd6af48c9b8634 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 3d444fa170da08adf657cb6779555a750539bcea..2e177eb8017bfc116730b746dbe466dc4a4900be 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 f43f1b978f16f6ef48ffffb1773c535d72eec9e3..fa0f4ba99590337ea95f1d813b67bfb8f78044ab 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 1d2bd9649d9adca2454db29e717b4ffcf246b3bd..1e0c860f679f1506415f659753b9cab28f4d3a30 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 072d3a23fba4ee318d67c53335981f4508ad4cde..529def79006f8330c44eb91dc8d9705c2f859026 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 2ed4704a4c9935ff5e970fec7517420aa45cc0b3..a6d6b4436dc2e593fe07914ef2990bfd12a43064 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 0000000000000000000000000000000000000000..a41b2687a60b0d9adc8cec25ef808348bcfe4549 --- /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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 0000000000000000000000000000000000000000..07a2f62c52b1bc5adaea24c3dff5da8683bb838b --- /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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 0000000000000000000000000000000000000000..07a2f62c52b1bc5adaea24c3dff5da8683bb838b --- /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 cbc6a151a36131aa14335f155140100bc982c79a..a4bf39f5ae835a5dd7f1a8901151b301b196ae71 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 0000000000000000000000000000000000000000..51f2b12820664a43fd706d228d1ab3a53e70d560 --- /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 0000000000000000000000000000000000000000..92a306f5fbbb7b3eaa94ff7b3cc1999151020a1f --- /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 0000000000000000000000000000000000000000..44329928043aef9fc2afd7d55802032c983c87b2 --- /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 0000000000000000000000000000000000000000..550dfe7869dc500e6f4091c60bf7525fd227304d --- /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 0000000000000000000000000000000000000000..73d468dae96675fac7663f50591f149456e33c0a --- /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 0000000000000000000000000000000000000000..73d468dae96675fac7663f50591f149456e33c0a --- /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 0000000000000000000000000000000000000000..73d468dae96675fac7663f50591f149456e33c0a --- /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 0000000000000000000000000000000000000000..73d468dae96675fac7663f50591f149456e33c0a --- /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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 21195779d8fd09bdba3fcb2525544711435f612b..9dfe71409daff9bbe1e13c26a57d39c4045ce848 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 0000000000000000000000000000000000000000..73d468dae96675fac7663f50591f149456e33c0a --- /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 0000000000000000000000000000000000000000..e17b34172c6c3aff2406aed020c0066bbc7bdd2d --- /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 0000000000000000000000000000000000000000..0ee1ef27ceb4c8160c4f924ec3c7cdde48bd7bd0 --- /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 0000000000000000000000000000000000000000..708bcd7549e082aed28351a8b9172b04c9c74f95 --- /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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 4ec1175059863be41a77e60937e5bdde6dc49a53..1680dac037a3e78cec3f307afa9f4131ac1e2cb8 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 0000000000000000000000000000000000000000..5352fe17010e6f16a45b8b6e72be06ad1be0dd40 --- /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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 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 0000000000000000000000000000000000000000..1906afb22d31d3321c81adf5cefc09725fdd09a0 --- /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 0000000000000000000000000000000000000000..51f2b12820664a43fd706d228d1ab3a53e70d560 --- /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 0000000000000000000000000000000000000000..d6df191787680d3cd9460c12881a4fe21f306669 --- /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 Binary files /dev/null and b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/images/rectangle.gif differ 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 Binary files /dev/null and b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/test_publication/images/square.gif differ 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 8fa794add68132c74ea1b118b9aa417ca0244577..a4061ee04b1fb3cba0032229cecc27b79b1823d0 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 0000000000000000000000000000000000000000..ad5b982cab36571b4106b0b0a0ff724ab94d7a19 --- /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 0000000000000000000000000000000000000000..51f2b12820664a43fd706d228d1ab3a53e70d560 --- /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 0000000000000000000000000000000000000000..4ac9978736febc9b04995d5d71a63d7317f512a1 --- /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 0000000000000000000000000000000000000000..8039168a9fa8cdb2b6dae7608c2d600e06cf53ee --- /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 0000000000000000000000000000000000000000..4cc8b3b1db898b1c8fc363442ce31bfda34860eb --- /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 0000000000000000000000000000000000000000..d86c1898d83f065027a8b429d8ec00f1b4c9891c --- /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 Binary files /dev/null and b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/Namespace_Module/absolute_valid_module.gif differ 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 bcee260cfa3d3008f2af8bf576a23ce82a24d1dc..a4bf39f5ae835a5dd7f1a8901151b301b196ae71 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 Binary files /dev/null and b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/1.gif differ 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 0000000000000000000000000000000000000000..589f3c838119546c97bd0c4207262ff987c9faa7 --- /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 Binary files /dev/null and b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/css/body.gif differ 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 0000000000000000000000000000000000000000..ca8741e84936d06c4b3acae7cd0309c4a70d2697 --- /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 0000000000000000000000000000000000000000..13ef18a72adc9ade848270e6eeb171150f8dc4bd --- /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 116ea9f70ee0cd60fa9df7f70e81ce6289e478be..7e89b1ff1d189787fcc41bb88f2c868a157f2d46 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 Binary files /dev/null and b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/h1.gif differ 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 Binary files /dev/null and b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/images/h2.gif differ 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 0000000000000000000000000000000000000000..4d59e4d69dd6337a2b10c8b2e685037f5483844f --- /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 Binary files /dev/null and b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive.gif differ 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 Binary files /dev/null and b/dev/tests/integration/testsuite/Magento/View/_files/design/frontend/vendor_default/recursive2.gif differ 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 0000000000000000000000000000000000000000..595b459369a84ffce81e568892fc55a2827fcacc --- /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 0000000000000000000000000000000000000000..51f2b12820664a43fd706d228d1ab3a53e70d560 --- /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 0000000000000000000000000000000000000000..513f228949e0d16a9aa4944b3eab5eb28ef9d6af --- /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 cab9d183e983aee58a4563ae23a045911f5062dd..31589d32a53604c840e4d271f5ad7b80d75728f3 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 0000000000000000000000000000000000000000..b60ba7e6a3d4c8965ed9fcf2a3b0f69332d50bba --- /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 0000000000000000000000000000000000000000..85a467f444a203e91e20e0ec2725b5c038ecc3e2 --- /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 0000000000000000000000000000000000000000..8fc3c0df06117c103ede9552da2676dc3ac0d7f2 --- /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 0000000000000000000000000000000000000000..cdf7287f4641edefd95a8c65c105c729e6f959ef --- /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 0000000000000000000000000000000000000000..874f8e6eccb9d7d05e09d514ef540e0330a7559d --- /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 0000000000000000000000000000000000000000..acd67d02c695c8ab40036034326903671c88689d --- /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 0000000000000000000000000000000000000000..2ab43187f04b0c08853d71683c9122623fd2bb37 --- /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 0000000000000000000000000000000000000000..8165984b516f2a12493b21801a98b33553e47bc9 --- /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 d45a17cea2f36f150f38e05373286085ec941f22..33446ace0909a597c637bbf4225542740430b1ec 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 abcecd94e39f696a2dca7189e1e681f4f4b7c4d8..efcf7e870b42e0296fe1f2e51b73ca3bac4c0101 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 152321cca9b79593016d200215c346f23c06637e..8a26a89783551f2ed35c5f1d3c52847210d42554 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 a508803fa38656fda994c086c6edaadf45e0cd29..baaf1d96a7d40b119701435aebd2f9f649a1a260 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 2f781bf297340dec01a7ea0fd4ef73696bda8636..42a5f0e734e0e60b38599d692b531a1293b9902d 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 fb0ac2302e13ab84cc2f5fd40b13fcf21e134571..89b68ab5f80772b816618e3fc0f876b8f07f57ed 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 cfcac8100b6ed276912e3e7930db558ca6fc5803..9359537afe82470b03a8bd812c10c100543cec98 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 45ab6ffa1f492d2dd9cfdc0c8cfa72205a08a2f7..27472c10f605b9d055468f1b772cb4249ce4466f 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 cf5211844e2840e89cf3020b564d2be86799335b..82c7b3ff9cf9fd8261754a9e2658c524cf9e4525 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 c4d3938033d60bb344944a6010ee0472400c4cd8..a0237d3b091a4b5fb3e04637b660ddf789ba9d7c 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 06b09396f00d9647fedb60be97f44565b3b0c09d..6b9a4f84a67fe6ccd5326be10895fb02ce57fe01 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 f9a76d0cf81bf9ffde8f55e7e0878d7ee7954a48..398a775a321d3185e12322958683acff9b73e406 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 23cb16b70ce8d695c45edf83c12914b5ffac8411..e221386708f5849b1d52ac570a9370273847ef7e 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 e3c9ef876e4565a430aca515073ac7ce736513c0..7852512b1943fdc9f22e9ad0326ec98bab6a194d 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 89dd656a3f83052129ce0d93cd9ec34ecbed9041..43da678e691ae3a78c3dd28a67f111adb1da9325 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 257eb36719965947c1bb2339655d10e8b91434a7..362d1136452d4c81ca3ab20d1e9f902dd3f06a6a 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 48295e9ff324f0a6d797bcbb5d14ed8146ead467..823ae562ae646b86b6adaec7ad21eff57b314c4f 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 c4449de5f83b8e9e0ec7659ba663943aeccd1bd6..2972db10e7bfe4ba0a60f27518a2fb5f1e859538 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 67c0171a8a46839e355de2d7eeb5c16a0c75026a..d05d45faa19a5b7d89705bcba288d60515fd9499 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 33735844d3be76b78dc02c58b36fc917cf77c251..7ea89038a3ecc729d1be227e0fc6ebc7ce6080dc 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 b6d8747db510c129548cb25ccc90142e3d6f3b2b..9ac33494f34e4ec91b5d08ef639eb8df3e012ee6 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 3304e65c0a4e4a7be32c5ae552b46b481f841567..54c56692c82c8416a15da9b65f59f79b1ffcd994 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 5b1cfc991d6f82e570f44f9a60cc2aa0b0ac4114..6ae4091c9574aaf5ebdd13ba4c4d6d83e71faec4 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 564a6124eae1a425f2e66fa8a5735f4d5d4a4876..03933d7bfa8cbc62bdb67dcdccc0d107283ddef5 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 2e9825fc784411413a5917cac31d4016eac23608..26b1e034d571692918181a65682240f555cdd045 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 3d18ba848726e81bb08700ff054788b35c18e942..39c96db586410206af353ba951da77c78293ad98 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 48ea702498f62c026142f8db1057ec915176534b..d1099749d03526c305850e3f55d1164efdb9c555 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 70d71d1ad1b306f7cff068b0a187106856f8c3df..fa34f242ce40fc0295c8e6d3973387a1cba3cf69 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 f9904b14edb75d6b394fed48ae07008328490943..2dbdbfe40bc015f6ffabdab3db0431149e45fac9 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 0f95fbd175f0aeb647af4a26e4f7ee5cf83c8938..a21ced3c6046b839a1568bfb20be5074ccdf85a6 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 9be1da2d8625c2c30fbaaddf38e65186be9dc6c9..cf159184bd879cac1cb09b449cccea98b42c02c0 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 639bd9da5ada9212fb6e862ef4af0b155f2e8236..1aa0a61d96ff31394a3cc6b53b2af60c05fb65c8 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 5d24c7f740b501d1225278a3769bdca134656888..982fbfe77f24ee9537422fc98d78aaf8989e2736 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 556cf1b6365d963e158838a6814e1ddcc86d6266..2cade8fb437c6414e03f7ed4dc806dc02cdf0e33 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 b0c480d47a7ceecab6baff6a2a944efe0f78ca63..6285a8f0176b1be4094d4a000257b37cff4ca73e 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 cea8eeb8a3ffca4b61d6e53ed930ed82bd69f2ce..761170154c717a97d272a1b005212e864f9aaba9 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 99b0e80021e73b2d284b4329e1bcf74fd03c4bdb..6a41cde8c384da3de83157a39ebb729bd4d8fbc0 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 0000000000000000000000000000000000000000..e5becdc1633e05e0e9d73408e01b0849fd970724 --- /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 896de7ab771efb5c11173ac537226392a759a3fe..bede5ea701da7c89844f20e1e93f42ffe14b8707 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 5bbe040e9b4a5a867a5c859e614a0755b4337217..97c2501e380d559d3331ba99dfe08b3c9af8402c 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 5415075f03109b8afa7328952b4ecb619bef8a11..03132e99598bc27fc47eb87abd43a9fd8570b793 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 025f350bb0ec06312684226f4c325dc53e4b5f52..986d59e9ec4a942eda19050e5b21a3fb425cbc38 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 15bebde7390db61e7a5b08b829dd2f454f090068..dcf20e703194943c60eb62a33edb32cdc213ec06 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 e6df4f5b43ca9e7addbd627d979c8fcbc5b24931..0000000000000000000000000000000000000000 --- 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 e79ef9f95b1ce7d8a85e0c4cf3c15c2e2584d17a..30dbf2ed417dc4870b62e184bcb75463f18772eb 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 186c62e085faadf9ba952e1478b2d998e9a993e8..2a48d47630ae71d9041c4642259fc388b1f641ed 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 9b2ffd345e83aa39fad37510bc5a9003249eb6da..edc6baad51a6536840e58144fb54dbb984d76c3c 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 8806fdca25568d8fec04d99d36fd6f3ea25d1174..990d86615e979e8427561c6b288177161a8ce4db 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 a1177ceb62564bedc996f53f916e24bced1a5399..990fe9ee27453f53f776553d42dd5e42f3211692 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 ed604d4582cfde0aa60e2eec95b60fecadfec5eb..843fe1c2a028368da2053d901cba71f96e8d9f09 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 3ca7789496c14af52662c08534c9a6cfa91e8da1..3c18354156cbc803a99bd2d2f1c90eaf1a9754e3 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 8aa067b73ec20ed700ad7a49a39507a9bdab8f5e..525d7a7c904a66a0e93354074fa52495350eea8a 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 3b4d6ed2965b0b872a8aba5934b544f0abf188ad..6d8af78cc4b9feb7f3ba7cd16a5f9d0cdd174087 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 1f78d584d2985d1431f647f11f7c8abe2f105cca..f7a16776351a2a67d8287bfaa2f1b200cc03a87b 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 183a5d506c9079267bd8d9c17ae163c11e7e50bd..d0a1fba4ce764ec2170e4c204b6e22c42e645788 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 dbb928312e0f404ba2fd9eeb9aaa02b7be54e801..88479d8113e5232ca4e59e961bcd860fad4b8245 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 370ee143cf2e6c8ff8e68196cd7e912b0c38efa7..c5311a6b6a94936663000d8e76d753c1bb96e6d8 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 38a1e588417070fa91a9a06b5bb561d16d248228..5b5af7168142a0e77c693d2d2cb9879714f5f51f 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 2774cee7ce0a09d350ce95c1ee3a240604552969..4f50e4b899fd5579464dae74ea9804681cbbce77 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 50d8bdd0a5235c3fc7485c7083abbb3771edbaaf..175e8ea10b2376f239734517a650381671e60f88 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 7ac0602a05249ce076e3ab7bdfdd058d6ad09ffd..a9449ee8244d304f7335aeafb648e5d31c1d8502 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 138452d2b373aefe705cefe037585b457fd42075..2e3ec39ad81388dcd44661859eba23b047662af6 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 d719604cd7aa86121c2216636238e986a74c6b1a..6ccf1fb9566f85569ce517eccf6ebae6464eec1f 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 0719019c215872321f6ca838ab424896cdbc78f7..ba599224c78fc2c5c139e3503c17601c929ec829 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 251662537eb99687f8a8810f2c29390499e99f25..21056c57cfec238b317ba104e661fda544ee2448 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 a9ddb3f98f9987964e7a1b88b463d64777572b0c..9d01180886f4cee53331716a1fe08c82468ec537 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 681b7689ef91b0b8a5d37450dace0d61d0667e78..378fd069b1cecf9c1dcdca1629a09ba50cf9692c 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 53e585155f25b6c0a8b9ecaddfe9a9217a9c9808..b301c6abed8c8a7437e41b1db14e971dd2ace9fa 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 5897ff1bbce831ef47a337a436d96618e048f16d..8f5aa3a9adbedd20cd3c5df2b731d4795e6fa25f 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 40e41cefafa886bab367c1cc6bb274e39b094684..4ab46c3e4eabba6abd8813587fbbed3fa322f92b 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 539b18ed1de49d1d1a9357c219c53ed675ceb6ce..04e521b5b445618bc76d9ff1e9cf11db660267f3 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 009fe75c0420498edeab638f05162f89ef2101d4..c810348fb4f7e5fd48246012dbcebd5b3ab46bf1 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 b34b28d1d745472bb6c70cc9419197e65bba37be..dff309a0fd0f8fdfa1cdea72b1c5566eebba8d4b 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 38dad3805868fe870b7f2e84c97ccc942d38b195..2d92c87e8dc167fbb6b7cd974088afe2c349b603 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 101fc25e36497414aed04174113ebfeba7997626..56a4f3db2baab90d58d5141685bc32bbf6f8ffb2 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 e19d146681c10d6974ee96d9d69dc9701fbbd689..c597f863789f1d885f15b94a4a6e2b5feb5a6da7 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 eddacc7c28c93a37306cc0b89fe3e8954d991636..a0ac5e866100f1eb8929566f33a6575ec72fa82f 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 aa3af8956e27aedca26232910567bdbf72aeeac7..e746f131c7de1ecfb788693cfc1f5e0df5bd404f 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 64a9d2ac9dc7bdcad6a83b63338102ca0994849d..5adf6aa6db46c2029dc7ca1e4ffbb124b762754d 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 1523dc5bf81d5a00bc362c110a341b39aad2bdb9..5fc9af9f23f98cd4cdcd09fb779f657d704b0ed4 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 f890078402c9c0f5966f13fbeb2b55ee8fd3b51d..225d124577a1d2ccbcab01aaec80c0afeda74b6f 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 658d07f0148999b083718bd917dc9dc7a1ef8846..e1f9eedc4b95d79d4fc35bf6e83df673ab99d8a5 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 13ecf2a8dfabec782b5ad9050e76cf7849d16d28..1f2f769d6789cd9af85866022bf7434942dccbc2 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 ce411351d14747647b3779e8da08eea96dc357fc..10a48bd1e90d24b44745ebd42f9d082cc435e4c7 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 872794f93bfd0b0ab7100034f7854c737050f032..12163aa69bdbbdc627e9b9f3cc079b9245113eb1 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 dfe9433e28fd8d0f03aa98f799e6bebb553f13a7..2e68a04e3fc7994667d1048d75aff046bf853779 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 f31f926ac647f360194bb8618f751068e2e62919..185ddbb68e1dd41f179addf83127e455785ad8cc 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 dcedd3551462cbf17b8d4c38f1b0c19b3eb8e96d..8c511fd6d6dbf03c8d4fe40dd8a4102ae279cbb3 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 e296da35ad54215f7473507ec2b5a71025dd7daf..1616cd8b892ed053d97dac99d7e6682c404199b4 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 0000000000000000000000000000000000000000..76632ce70966e5fc23b6acc5bf9f28dbf3a58703 --- /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 6759bc3952319bb626c48aa0606f164985a4924c..90112e94d79d1e8502bae39e61de328c84637220 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 bc1a3078196b9f78df174a0ebedf777878b9f155..c36deed83c4a3a53be4f21870b936970adb3395f 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 32ee23dde2e33173f579971c06a1b6e077180152..d3525534ca14d6b184b0d2454a5f255821051481 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 20d8e52524b44d8bba818cca26c25902d2cc8b97..7aac3ac12ef12f47165aff737371aa13f857d359 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 d441a51ab29460479099ba78452a1fb03a200405..6b4ae4287654739050c5c5025650a3ca6c1a3d58 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 c8024168d82b29df36caacae2a02f1239b85b495..d5746f6a95927ea6bcbaa32e9a97868d735b332a 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 31f0814bafb225146dc53d02abff3cc8ff58321c..fe239fc6599bca0e6d729286601146d05c681754 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 61a3a5bd932f18c6385e431b3ba54441584d2c5f..4be0dd7f73d022039b77b15f3074b403ffd94f48 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 d32dec75c4b00260775cd7a580c4ae86de9bf2a2..c65d91f80a446aac0a5c7180f42cbcef18d90421 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 dde697b6e56cca0d20b651306efb90044df9c622..18750b33e5331d077c2197a06fd076a06aae965f 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 6abaafa466fff3e819e889da6eaee06547e3290d..9012514f1959640d9a4b82f57e1f1c242519a199 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 01924ffe60dae3036c2a8cfa17cf7bbc0859cea2..695c6d048bbad1fc6cd1e599aef68cbd4e8a4d14 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 a07306dea0b32686c1c6a92b2b690546b9e93397..b6e7d655da8bf5a1d3837dceea2db782936c1cd7 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 4db0da00ef9367ac6a5c16385c96980ad79be4c7..80db9fd1176a1dfb16428d8cb56736f265182fd2 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 975e694c11b7a12766a21c945e3ef262584d482b..9d0e7b8e15a27c3981cc9eba4e8a4f3d41b02bad 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 175e5dc6f723c252fd41c7af967b58592a8e9f24..79bf2e2878b865577e62e7b7d1e61df1502aa36c 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 c8c92420c873e846f84486b4d5a737936cfbf138..e967a79dfc25e4d60cd84bef522044b7d460547a 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 fe3e60eecb6d65a0d93ac8dde0c5e5932853a9b0..7a2cffdf6d8c3c10e4bf6a5afaac1dfc3431acb2 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 fe4276e5fcce6d48982cd45480167c9e657081c1..ded9653faf87de7287912fdbdccd132d008a5af5 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 6c32beb739d04f3373eddfaf9e2bf63a20e0b4c6..99ae3d3bd18ee244d512ab08ac6cfa95433a46ae 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 8fd68ba7339763d3b4cb0df20e37f8b3cc4b5f5a..0480ecbd69b0c2d5933231b2e7f2811fb6337028 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 2b8782b35594ae5e810c266446024e51fa59090d..3e4a6c52850760aedfb2c53e89823ec5bb28d5dd 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 1f223d433f3584b4571d9e053b85f4181e1ecd9a..c2cf8854e25cf354660b36f24921ff721501fe12 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 08a49caa8de68c98a8214ae1727b28d421c37bf7..46acab42c380b484c55931f212b50d6e64abc7ed 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 73f7f65edd5aeeff1d7e6d7a2715fbb215a6b29f..7f09d2578ed0177ac68cde55cd83b1d5f0727c51 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 ec0feeab9322029c515b3982cb2024f1bb2bd01c..2a1941ee0653f0b48e696731e824030b129181be 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 fff6cf6c24689452f2a2e81ba9a573c4be2a0cc8..b8fcc00d0e174eb5f25f861433c960c3b83822ae 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 32d218f524f8adb7187d4bc1c782d8251d49c46e..05e88b9ea91d7007e3c5fe2fb191aa72d9d721ee 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 23f579bd30563c19f5b566482341f832af6e397a..9cb57ad1e21890399494e2a804a943a183c62548 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 2767be13ba5b5c11b765f108e8b0ef728e8b4a83..a5bbb35b23bbf03e3a9911e504982bfb63037a1f 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 166aee5eb89b026b7afa93da014fdae1ca3cf9b6..cb4b41fb09c3af08d4cecf83b211017e01de71c4 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 d8e060e223f0133f712540a205d8a2c267978cfb..f4ac75869683f7b51d8c061f05be8f2d4ff72032 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 9d5b2c7b9b15a7ca57cf8dbfdd93ed4ee27449bd..ac85b3261de1428f6e066b038ac8500a0b8a6caa 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 f0a3fcdd13a2118bb5cd0073b92786ee4d6c882a..4fb56f193b53e766d4fe91815243ee715f859779 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 f5ac7aaf87f4179aa1b748cef1a8ec10e1948059..a5d890d2c5a9c4f90a4374033d928d6a7765859d 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 08bddb6b1dfb2c3b2fe0bca00736bcc51bb4bbdc..502328f9a20a411b671216210f4d7243f9556af4 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 d3bf14aa12165f3ebb462c97409edd7a1835bb2b..bfba89de081ea6f72043281e3ee6946354e48d33 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 54997c2963ee209ef3dced02c0e86f08f8dd1a1f..59ab1cd6f0f64440c79fa8a1dc4893f120d81b34 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 88b4dfa40a9f0913669ebabc564d0c311264b063..0ceac5204a787eafbc928aa6277a8e1240aa8409 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 b88d4f43c4e9b31a7f4e6330fbb833e9642934e6..bd9569b0a2f3dcfc9921e7aee7599ac46548f284 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 ada362944633e3634e5ab1d542031a2a6e6a609e..19bcf71c8e254d8e6610ed7dae350695242a5fe5 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 a676b7857ecffb54a84bc02b718a6e4e382becf6..0000000000000000000000000000000000000000 --- 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 0000000000000000000000000000000000000000..56f3cdaa8cef61342dc486eee8333cbd5121e48d --- /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 17cc02476d799d5fa8f360a9b6ee920d83347cdf..8db1c1718b8f3c52c40f634cbd83f89a589be2c3 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 249b8c3e624e1144c77c05f419e4dc4ad42e8c62..6f11d81f0fba91890aafe694f8d9f631f351377e 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 b712704096f59df782fc38bc24886d4a92942018..5b596fa4eeca5d96a1540e3a3555f7d72cf8d72c 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 e4b5f3c8204ddd1239922bd3a12548953dafb753..08e9d1665fc4d066b435607cebeea455a1bb754d 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 ff28ef60780a0005d66ace52bc28978c75bbd780..058111f93479804eb58a25a9da08944ab8470282 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 3349a7d74542a7289bf8dd3cda5cda377e56889f..243f513be0267833728bf12506703dba38e7d122 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 002d8857f5c6b2b2914b1fa8e5af062cec702a7f..ada7c70ceedab0ae6ea8642a7350cf0d74e86925 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 37a1faa670965c58f0ce65ef1b4f69e79fe46d37..aa4c38463952effe3d6fb39c876b42ac1b1af2f8 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 b13fedc23fff3211e0ebe057291e7ebe665d767b..c986ed85efdd5c2e131c1fbf051208b93a58f6e1 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 ba99f19bbd1ebd7e6a6d6d3f7d8f596bca103602..e7a3582960d7ada8618663c0242bff08cd194db8 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 46826d1d853f865ccaebb4db248e598600b75399..8711f02aa725823f4828987bb92681e400539848 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 2f13b9467e2130f0f402f7a82d6a347154dd81a2..ce36183531b4d085fc4d917b7dee3c5ba7a47945 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 7338fc89d52b14b9581bce74b95d8790215ae6e3..e68822b8800bb4510bdd198b4ccc08ed7c1821f8 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 02b0fe444105f2962ed8a4627372c94de99cec8c..2b51bd240f8c1a43d21f49e74e31659e481a22c0 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 18ca19f515ccd9a661ab250311b1aeb0a78611a1..04ed7a59e9caac41571499898c1789634a01b9ae 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 42774d7bfa7e106f9978791b2bdcffa5f36dd5dd..b90f3787d95dfd96d13ac19079f506b1c89211a9 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 5988517e3a5bc3b5314e5e4d7495341694b4cb6d..017fc7de15c5eb27f216db233098bb211ff7a0f3 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 d3b8d4a688501b34b61fe8acfbb3d789e27b07f2..ab6e32154115497c230ec7605c83ef99d6590d89 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 ba8e503405ff222645b9c4261516b5d183549326..ce6a5197bc9eba9d74c8cd3daac181f48c38d5ee 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 cac8ad08258ea1dce265921861af2e461380cb47..c95c113d3e1d04f2def11304d845d13c19da2455 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 03393dc30a823f836317aedd63e6311fd1eeb214..b22c65916144093363e3caabf2687e3d4b1fcecd 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 b01006c5aef4261076980a55c15e3d4439bb2268..537eb14d7eb716efad96a781bb0c1b802ad7cb27 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 f3a733bb5370afe2be4026d599e36cd9dbc01b1c..a29aed349962edfa1b0283560257dc00a18df35e 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 1450fd0f4ff382224b7aa0e441b6314ab09c1bf3..c6df3bc001e8ee7b60c3d94d733b13e168d68280 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 29697bc156c9549dbf144ecb5597fa7eb7f06c66..89adbd0f56e8de47ea3927e88fc70b59b2f5876c 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 353dc8e651d1554611c36a76b33263fbb7ec7798..c2b691ba29863c19641ef84ae3189172b5eb99de 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 6df67c45521b911a29b9fa630f22f37c267f8d7d..216cf67dc70e4fc0dc8ed85a33758ecd9e75954f 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 400b1b7c6e71fe9a6f1e2ff74bd69b7575541a64..5ed9903fc1492123d0c3dd704e8552db4a73f0c4 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 32ff1413261349c4bdea64ae0e1ea9da894b0435..f600ca6014bf4f845da0f3eeee3ee04277c2036f 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 26b67fae98a21915a08f7811b4cf5b67fcc0507c..184737bc3babe41bfbf35ac6ebc2375d0d324c36 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 0000000000000000000000000000000000000000..24424eaef5c948267f9645422d4d19a6d37c3620 --- /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 0000000000000000000000000000000000000000..a039ee0e4ae58bb3e11ed505c66f172b6e59d3f6 --- /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 4362ee2283ea8db484fd7163484ab5708105f781..6eced5a48d0457dc1d38443bd288087a0ceac3a2 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 9c2fa133eedb2709201ffbe827ddf131bf740f14..a1727cad4f7539f8df5ce3246794da566bc75f26 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 b4f7e29ec9e5bd91e8010c233d218cab40baea6d..88ab0308225098b09af9444723299be84176611a 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 a2e73671fe37ec0e502361666d0981c696d5f67a..0298e9b214128695883907b237b97c6b6d55645b 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 99a6ca912a966eacd93d81c6df5305f4023f4502..e3f0b246a4cd1c775e5411197f28b6e2bd130783 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 b135822c45416a8be8312f026495ebec71dd9cb9..9b974423b4966111379fad3d0771b092283df8bb 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 c54ca17ba32a7af9e95b1234a45db0ad7391e463..b955d043a4aee201302c38482faf2de801bac8ce 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 8a7b0b789cf026432aff4934b0cc7521bd94c7f1..e818babe0e8f8b4a44038d5b7f038d450bd3bf8f 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 55112a0b723126915ac8db9a40d65513454db9d4..d7b7850786e3678efc6fdcaa86748fada14e1b2a 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 9ef48155816ebd7b7f9c337978208f27cb10c44c..209cf91e8cd8dfe52283c0b3f13af3365e928cf4 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 0e01dc54dcd7ea8febc54cac5a70cb04c893b3c0..751f20ba1966eb47686e95613101079cfb158791 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 36cc3f092bd70d7595df718eb80c584a667bdb62..8d97d749f4a6c7c2e3c5ec96ceb13ff05d3a41f6 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 16776965251a4e296211a6e5859a6a0ba7217461..03a9eb09a50f67a337262be57eab1e1136f6064a 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 86043d417a06ed1769b9dbb1315fdb4173292810..98065cf2eacb8a3771102e4993d5622babf02e21 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 8dbcd39381d97d36fabdc4f3d79ca9e4e1efffa0..a0b89aaabb62af06d56cb9650363bea448ffd6cf 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 ff39622f61f66b5f0b09eeab54c6b820c4330beb..5d3e8dcac832c372a0c6414cf6bdf53f06e151e8 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 a1f31327850a9a6e08855fa64c00659cb2e994a5..ca29da1452c852d28df1fb007a19eee56dd9cd7c 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 6eb01698ca1d298e55792a593e33a6f21685b473..4ffc35ef5f1b469420913e0f8418c8deef37e752 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 d880f0771c239074e0cb59245280030971587227..f9553d1c5ce29b31451cc945e472ce2083cdd6c3 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 686423505db5d245ad05bb8855c4543ab1f46ad2..69b641dc8c2890b621de0831ef316fe1bf8fb52c 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 57342ba5d7e577c018d6b94b2efa9acd7ead256a..72c92b89733cfd860ed6ae692094018de6f4a55b 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 58c9350129ae87dac0f130743487d3d3a6ddf933..cce880eb02059e0d5b8c05f3eb9b68e35a78f11a 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 feca73ae398020934729f62ebddd8012b54feb99..1f7f705a5dc56531c89e7944238849aee000ae93 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 303298ea8f89f8f9e8a77cdb3ec38b1c506be32a..bcd6e0a5285f5b5fc698edd923e620dab8bc1281 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 b1454e518a021dd8cd94eefca1c5b3a91aa5ca07..3b37cd1f29622687c89b502a2891b586a1e2c213 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 9c3b558cfafb16ab9bbc62203260435cfd272cc4..5945405b4d8011082c939f882cbd28987b562463 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 fa4f329c34ef35ed4486e49f4aa212eaece1378e..afe75154f68803cf89499e35a9f859a295e7d2bc 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 12e2f573576efd16ccd763bdde27bb3914cc3b57..04a8987f5a17b6d29b401018c387d504416730f5 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 dc5eae08819e7bc0f9c9e80e23e3c338f58acf1a..71549b54e78dc4bf1c9763a57fbbc1bed0ba16b8 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 c20e7d4f63b8da19fe149e916f90913300b02cca..8d3f476026be663cb3bb8e91d05095c0cd47b312 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 da5dee940f6af4a6bf54b9d8d27afd8d7921d278..dc2ffa396042a73887ac7e1424925450497acc57 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 b1d8a3e0bfea5800a65a682e0983899d54872fc0..abc51ab4150c4ee2eccaab643eae07f8e99f56e7 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 597d88b17a29dcf016b7b72e41eddf50d07a96b4..524800eb4a72309cd8ab6b66aa0aa09e0a3fefc4 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 91bf9816c488310df32de9233489de6bfd27d290..41dad65bb3af42656cb5325a146b8ee8e00e0da4 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 3c65c60a9acd2bbc2a14700058ecbb60fcb1a3d9..58eba8c9f17baab8272f29b03cc8175b4ff563ce 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 dc1a9e5d45cc2c2dde0ff3ed453dea2b6a3b2b61..a35366fbc85e8384002ef226a0e8597a3e1b19f4 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 3c7f25bdf37182b1ccd10abbf9b4558550b4fde4..c2840102d78cf3d982de85bb39a77c33840695fe 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 6a2811489f8c15d53cfa8b33ab2d75afdec560eb..3f536204516f51d1cf22331165c8843e0987e966 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 5150f24884fde4c3813c9f786ba46fc8618ab2e8..83bdd9999df33d1e5836848de102fd888b38ce99 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 b11e2538e04519cdb64acba68197b095cfda913d..37ef8fe81705a8accab5e54f8b5f92fa2ed5e43b 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 b033f1f1057ad0bda81fe3333c40ee217f6d211f..e3066fd54f82f6351ae0c256d4bbd5af8b7162ad 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 8a2f99a9f2a3faea8db24fdd71512d0a5183dbb1..1717286cf8b523a3db39f4f52fe0d8b787332af6 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 3553d4dcb8405e9098eedef7e81e42aa8c20ec0c..981d84710ed7deaa835d93918e4a2e3fd0ca638b 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 3ceb87771116d5ace37f439dba6c6ee0bf7509d4..90dfa12a5cd9afcf99865bd6f622fa0ce49f463a 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 8e25700a6ee9f5e78c11c3cb20ab894e885cc05a..6da78364e66f15b8b4756f517ef63cf361916172 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 2540117b0842b004ccb4d868ccfe022df8f9beac..5e67cf3cfd76495d44669a573e48ef4313da0acb 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 4f82ce8be295cfff4bfbbfdacd42e7e912477fc1..62dee206b4bca2baf0bffdfd2bc36527046f6947 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 bd3b83e6a4d0b40f05cf92304ab8762abde61b97..8fc3c0df06117c103ede9552da2676dc3ac0d7f2 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 0000000000000000000000000000000000000000..bb019df395fb28ee8bec3a5af693352779697bcd --- /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 43e6f92d7e8ed3cf4464611a71fc93f7822efca7..3ed8ac7b65b87e2dbe69fe5cfe675c2adb705c75 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 e6215d2369a9f30143029677e4a569b66505d133..991b7431b5f80bc01601b63f2eff8b6d71693a59 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 7e464d6bcda539bc41cf05cd5c8dab93521dd91b..1eae04230b764148d726fe2a1e29b6722b3cad99 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 b776a6536f74da7484048f5edd76c918e2e79d27..681e9f3b34b859506fd5f03d787b94319c2355b1 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 cdc4b1b2d6af4ad55b49b31682f5ce5054df0a5f..4507de7b301fb9edfd3bed3fefcd9f9b12062bf2 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 175569742994f64f36baa302f86c7606685aacb1..931e8d0af6342d677fd852edaf8502ed53bc107b 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 b68955413fdd42472e9d32824d9702e6133f185a..4c80860d1fea6be449e570db6b05c7f5a3e68d84 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 4072a08393f690c8a93523c0acb047d9f87ff861..0a90fae8b1ba46f918d10c99fd8d8aa2d5748b02 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 b927e29df75aa61ba1d67c526d211f8b134e8a7e..dda694597feb721f14642ebf51ec6a6e0643b963 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 665476dd0343ecab4e49118bd49d2697a848bc51..0e68de55f89a03b83118dcf489f23dd5762d4f81 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 5d516d00c1eee96c6d4ac67b9d8ba220bb310a99..9b83ebb593d0e299f4ca20abda8b985c4cf6a844 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 bb335fd42a5112c3acea02fe4695eecf2407666e..d9a98418850ba5b8af32cbd6fb5c40a521e604c6 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 565ed6c92bb52a6347fd88257e767c1bb64aa9b9..bcf4362f09d8f1f99584af0680bc81a21514b2b0 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 b7e91da96ffdbd01dbac49b4bb11f5b12482ff07..22c4579a6c9e2dd40739854d261d1220eb7b7813 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 25cbb1029f26d83e81fa74e2caf859607815dde7..c7674a99bc09602a09ca37ddfc606789b3fb7c70 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 296d130b414cbcded0ad9fd2e3a3e5523dc5f021..0e7e953b1e038b8b4dee9c14f246ea1fa16df3e7 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 72ebbfc105a6941e4e1fcf897c9a3dbed92d5690..8e643e403a2c12e049220c94bb68607db9b40c0f 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 a563542c366dd4d017be441e60c0b609081889c3..0df5d776b41cdd15dddb9a1aed00fde0486d247f 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 c22adc7edc8cb14370162e83fbbd5c0d998b02a2..45c18f67dc50fcba73fea0c086afe83b58afee74 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 751ddd2eeb98d278cda1dc474d1aaa52077d7a02..144c4c4f14d1bff38b8d1f54e05a347d39b5024f 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 a572b5e4146536e1c4c98114efd07a85c224a2cd..347979964f7854c01670e6979b17ffc797fd8204 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 14ef48df1def2745ff0fedff5c8458b5d0728cd2..6f9bb5a2509a7d54f34fc5c0aacc38b188fe6cd8 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 e52eaefa9fc412256903d3cde3ea2ee3c0fe2a19..6e4ed4c86f47b4ad2d758be5685fe60d1e623c01 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 e9367941c186c7b4e44add6a5a95db31f4222cfe..ca7a3954648bbc1b56a74063a887364ad5c1ca8b 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 0000000000000000000000000000000000000000..32e9c84585c7d728aeaf9441ac474051d523704f --- /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 0000000000000000000000000000000000000000..faa45f4beafb75154c290a96c0f3e0fff10d6f4c --- /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 0000000000000000000000000000000000000000..d9a881cb8cab2953b6575a39bf1a004ee3a894ae --- /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 d0d7f83a99c0b1e68f328b6692c422f218348315..361c73f663f513b0db20cf5f5febef305d4ded79 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 0000000000000000000000000000000000000000..63f7f7645b96b5c6b8ffa21e515b2d69fc2e56cb --- /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 ad4393c987091364e28cd8c8044bdc5a73d1fdbf..a3fe543b3795e4221ad1a6a8e40b569fd768d37f 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 5dcd2c2980f8250168d07ccd0c691360a71e1c1d..d2f4283d057b756074e871f5bded3761078e330f 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 8eb193d743a95d8e758082211dd93cf8e5cfef2d..e3b892274f7b5fade448ee888ed2154aa2f9a83b 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 a28493d3dd0247f03900d07de59a23e73e956458..7fc6d9601a2dd1c4a91b9963ce294974b7aafedd 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 0000000000000000000000000000000000000000..03e70a8ee63f2f0c570655e51a18ec134efc51e6 --- /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 2ed430ac1606acdad445a0e8be1c61d73525e11b..a55de2730aecac5d3c75552e3b57ff80504565fe 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 1d57bf876ade57d4ec07a08fc739ea2edf028b4a..a6411f67fdd674c23be081828a493299a4c56a0b 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 0000000000000000000000000000000000000000..174a4f1d9dabf2cd5468c3b59bb7a704dfccb75a --- /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 5237985e1c9d44cca6a6e2212e6e238fb838d023..586c7935a58607ac2346021ae1ba1adc6f0feb23 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 aa48525f259e5bb0ae6afe7552af1d8309ba2375..7938e3348ed2465b703704d8ab0998107285724b 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 8a533ab9e6732e7c48b269b94f9191c6a64a5b7a..db1fa6a1b33869c7da7809f85b4916c1805d74c6 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 5a2b530de7ace46f9972e39b2520e06f128a45f6..8e2c6fe764b36266dc634b91b74381c1efdf515a 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 e1e7ae0090691278ecd594f65d962b96aa3ee490..cafa4ecaddab12311b3f2b359542927a59dcddd7 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 f81470830dc10e01d55f0c3a1050d1443d439549..588543f102a82caa8b102f34d0b2612d3b16eef4 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 e6a6f5344c5420ed76e064ddd919ed1d02962a76..c575eeaaaa1c02ede0359b34ea27077c4443d3eb 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 4636d3db0f8ab6088b36fa2354d92e6be0d0cbe6..ed24409360b9c63add3780411c4b13d42eb75a99 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 923dba4dac41ef575bddf3c5accdd1e23d9121b6..fc048b84ac6df3e1f4f92440f2d17bbadf2c412d 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 74ec58aa2d76e63f51c167d4184d2a2d9c05f91d..0acef553c6ce0b5730f4b7ecb4c3021070e3d39c 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 40843490f03aa3209bdb8068996a6373bbd31901..7f55750bec35fe5fa12f6acb1aaa8766294478dc 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 1d61cc0f7ac4def9830cebf7a4bf6e73b7f45e73..4bddb4451eb7b0987eef00d283b519f67233ab00 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 d743579ae4e6e6c7573f0060066e32175100f477..c130506fcdd81e969fb5578da1653f47f212bd73 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 5ecf6500c675883d1237aff6813049ffcf31487b..d1ccef09ee5263f8ca1fd874f4028c17775cdf1c 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 3f151a6ff0de6cd223548648405f659ad19e6ca3..b38f493c9b186681f75009f1643f6227dac83642 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 1b57e71a3ff69ad7ed7a5768cb6f03f6630079ad..faaeeac5a4c77777ebd8d86720b6e9b44deca184 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 0de570a0db55fb97a7ecf5c1a4de1315674103e1..c46a29d800bfe0dcd231c407470b151c34d4a096 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 f2a88da0db780161b2999532655b4da562e79ae8..2329eacdf69a49d865cd8c6729c7cca560e260cf 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 12aaaa9f833a8889835a01555217c93b6a532e4d..1ff7c3df3e0024fc06f23a37ea4dfee51cd7b510 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 85030c9738d71471331a039555eb10bd9d726491..e38cae9043d45940cd5651bcf47ceac73f8934bd 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 9b1be038cf4ce28e10b3e8a635bb8193eda6d26d..957b4d1cad515916b47e5a3e4a789d9b8d595bb5 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 fc6ac11cc1491858975cfd6aec4a988d45dd319e..7b7f3ae12cdaf88daebcb2084dbb2343be52d5c0 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 0000000000000000000000000000000000000000..af0d06873eb11effe99ee1f880b48470cb89b597 --- /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 719f687a56a3f6826d66f71204cfd97d468ebb92..145e7fb54ad42d3875a289195d815c92bd109121 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 f5955061eb40b631188c44c3a248f56d90620327..fb26db653929795215097a897865556f356dc1eb 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 bb7bcd874966c154adcbb78ff7ac25e5e00265b6..07bfcf608528242c9d128727ecd40b23d4b69832 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 8315db985c1158850ee89f0beca9875899d3992d..24661dfcf39cc502fe7cd792b0da3e6b7c39d009 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 9f3bc8a31a3fca063ac3264c307e637f088a1554..696921a68da200d82f0290851e9048b802168893 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 794b77253ccdb7e5fbddf73d8b17b53a133c9d4b..1ec8e8a908ffc9a2b9ab71a6a9659c79d1fb68a5 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 ff98e22640a15fcb2d1e22bc3ba8fd3fc9b8d627..53e3fcde69abb0936cf5eff5c6cb5c49c10880b3 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 d6bb0361c92886443a253ee373fa0cc0716a2eaf..624f5d3ee6197952e8f18e35bbd6d2dfdbb0b9c3 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 540c4cc1f2cd38b890423e793d7ba344df50c9ad..72f3d73f40c036fa38b0e76b4921a0c0b98937c1 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 8f1277e220404eb9796ebaf52ba6ea37638df0b0..000e73e85388b08d6f77d0f0dec589e194905928 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 4ba7c1fb8d9367e68ffe1f1d81dcecc0722ff1ce..8af566e2b0c84c4d989cb3f990836936c5ab3f26 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 57c398ca482460ac3cfccee726cb52bc5db6fcb3..4a4a7d546637206334ac0df0a6d620161434315e 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 2aad608141fb8df441adf84ef108b29560b729c9..d722ef01fb5c9acb47b0a177132f48ecec1f8cdd 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 0000000000000000000000000000000000000000..48908e6c8d93cca58b00c5ea16e7e6376effdf33 --- /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 fc492d75dd81b113eb242de5c324de75230cc7f6..b3e12fa66754f871d929864ad1d3ed37950f648f 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 ab605f79d6b358253a9a5fc8ee8fe11da2c7ec31..d7a38bb8aab43d0a0ba6f5e75ed75bd350d86c27 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) */