Skip to content

Commit

Permalink
Fixed static tests
Browse files Browse the repository at this point in the history
  • Loading branch information
sivaschenko committed Dec 21, 2018
1 parent 9b76f0a commit a557683
Show file tree
Hide file tree
Showing 22 changed files with 107 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
*/
namespace Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit;

use Magento\Catalog\Controller\Adminhtml\Product\Crosssell as CatalogCrossel;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class Crosssell
*
* @package Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit
* @deprecated Not used since cross-sell products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/crosssell_product_listing.xml
*/
class Crosssell extends \Magento\Catalog\Controller\Adminhtml\Product\Crosssell
class Crosssell extends CatalogCrossel implements HttpPostActionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
*/
namespace Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit;

use Magento\Catalog\Controller\Adminhtml\Product\CrosssellGrid as CatalogCrosssellGrid;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class CrosssellGrid
*
* @package Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit
* @deprecated Not used since cross-sell products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/crosssell_product_listing.xml
*/
class CrosssellGrid extends \Magento\Catalog\Controller\Adminhtml\Product\CrosssellGrid
class CrosssellGrid extends CatalogCrosssellGrid implements HttpPostActionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
*/
namespace Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit;

use Magento\Catalog\Controller\Adminhtml\Product\Related as CatalogRelated;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class Related
*
* @package Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit
* @deprecated Not used since related products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/related_product_listing.xml
*/
class Related extends \Magento\Catalog\Controller\Adminhtml\Product\Related
class Related extends CatalogRelated implements HttpPostActionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
*/
namespace Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit;

use Magento\Catalog\Controller\Adminhtml\Product\RelatedGrid as CatalogRelatedGrid;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class RelatedGrid
*
* @package Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit
* @deprecated Not used since related products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/related_product_listing.xml
*/
class RelatedGrid extends \Magento\Catalog\Controller\Adminhtml\Product\RelatedGrid
class RelatedGrid extends CatalogRelatedGrid implements HttpPostActionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
*/
namespace Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit;

use Magento\Catalog\Controller\Adminhtml\Product\Upsell as CatalogUpsell;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class Upsell
*
* @package Magento\Bundle\Controller\Adminhtml\Bundle\Product\Edit
* @deprecated Not used since upsell products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/upsell_product_listing.xml
*/
class Upsell extends \Magento\Catalog\Controller\Adminhtml\Product\Upsell
class Upsell extends CatalogUpsell implements HttpPostActionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
use Magento\Catalog\Model\Product;

/**
* Crossel product edit tab
*
* @api
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
* @since 100.0.2
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use Magento\Backend\Block\Widget\Grid\Extended;

/**
* Related product edit tab
*
* @api
* @since 100.0.2
* @deprecated Not used since related products grid moved to UI components.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
namespace Magento\Catalog\Block\Adminhtml\Product\Edit\Tab;

/**
* Upsell product edit tab
*
* @api
* @since 100.0.2
* @deprecated Not used since upsell products grid moved to UI components.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
*/
namespace Magento\Catalog\Controller\Adminhtml\Product;

use Magento\Catalog\Controller\Adminhtml\Product;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class Crosssell
*
* @package Magento\Catalog\Controller\Adminhtml\Product
* @deprecated Not used since cross-sell products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/crosssell_product_listing.xml
*/
class Crosssell extends \Magento\Catalog\Controller\Adminhtml\Product
class Crosssell extends Product implements HttpPostActionInterface
{
/**
* @var \Magento\Framework\View\Result\LayoutFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
*/
namespace Magento\Catalog\Controller\Adminhtml\Product;

use Magento\Catalog\Controller\Adminhtml\Product;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class CrosssellGrid
*
* @package Magento\Catalog\Controller\Adminhtml\Product
* @deprecated Not used since cross-sell products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/crosssell_product_listing.xml
*/
class CrosssellGrid extends \Magento\Catalog\Controller\Adminhtml\Product
class CrosssellGrid extends Product implements HttpPostActionInterface
{
/**
* @var \Magento\Framework\View\Result\LayoutFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,17 @@
*/
namespace Magento\Catalog\Controller\Adminhtml\Product;

use Magento\Catalog\Controller\Adminhtml\Product;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class Related
*
* @package Magento\Catalog\Controller\Adminhtml\Product
* @deprecated Not used since related products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/related_product_listing.xml
*/
class Related extends \Magento\Catalog\Controller\Adminhtml\Product
class Related extends Product implements HttpPostActionInterface
{
/**
* @var \Magento\Framework\View\Result\LayoutFactory
Expand All @@ -36,6 +39,8 @@ public function __construct(
}

/**
* Execute
*
* @return \Magento\Framework\View\Result\Layout
*/
public function execute()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@
*/
namespace Magento\Catalog\Controller\Adminhtml\Product;

use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class RelatedGrid
*
* @package Magento\Catalog\Controller\Adminhtml\Product
* @deprecated Not used since related products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/related_product_listing.xml
*/
class RelatedGrid extends Related
class RelatedGrid extends Related implements HttpPostActionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
*/
namespace Magento\Catalog\Controller\Adminhtml\Product;

use Magento\Catalog\Controller\Adminhtml\Product;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class Upsell
*
* @package Magento\Catalog\Controller\Adminhtml\Product
* @deprecated Not used since upsell products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/upsell_product_listing.xml
*/
class Upsell extends \Magento\Catalog\Controller\Adminhtml\Product
class Upsell extends Product implements HttpPostActionInterface
{
/**
* @var \Magento\Framework\View\Result\LayoutFactory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,17 @@
*/
namespace Magento\Catalog\Controller\Adminhtml\Product;

use Magento\Catalog\Controller\Adminhtml\Product;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class UpsellGrid
*
* @package Magento\Catalog\Controller\Adminhtml\Product
* @deprecated Not used since upsell products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/upsell_product_listing.xml
*/
class UpsellGrid extends \Magento\Catalog\Controller\Adminhtml\Product
class UpsellGrid extends Product implements HttpPostActionInterface
{
/**
* @var \Magento\Framework\View\Result\LayoutFactory
Expand Down
42 changes: 28 additions & 14 deletions app/code/Magento/Deploy/Collector/Collector.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Magento\Deploy\Source\SourcePool;
use Magento\Deploy\Package\Package;
use Magento\Deploy\Package\PackageFactory;
use Magento\Deploy\Package\PackageFile;
use Magento\Framework\Module\Manager;
use Magento\Framework\View\Asset\PreProcessor\FileNameResolver;

Expand Down Expand Up @@ -65,18 +66,19 @@ class Collector implements CollectorInterface
* @param SourcePool $sourcePool
* @param FileNameResolver $fileNameResolver
* @param PackageFactory $packageFactory
* @param Manager|null $moduleManager
*/
public function __construct(
SourcePool $sourcePool,
FileNameResolver $fileNameResolver,
PackageFactory $packageFactory,
Manager $moduleManager = null
Manager $moduleManager = null
) {
$this->sourcePool = $sourcePool;
$this->fileNameResolver = $fileNameResolver;
$this->packageFactory = $packageFactory;
$this->moduleManager = $moduleManager ?: \Magento\Framework\App\ObjectManager::getInstance()
->get(\Magento\Framework\Module\Manager::class);
->get(\Magento\Framework\Module\Manager::class);
}

/**
Expand All @@ -92,18 +94,7 @@ public function collect()
continue;
}
$file->setDeployedFileName($this->fileNameResolver->resolve($file->getFileName()));
$params = [
'area' => $file->getArea(),
'theme' => $file->getTheme(),
'locale' => $file->getLocale(),
'module' => $file->getModule(),
'isVirtual' => (!$file->getLocale() || !$file->getTheme() || !$file->getArea())
];
foreach ($this->packageDefaultValues as $name => $value) {
if (!isset($params[$name])) {
$params[$name] = $value;
}
}
$params = $this->getParams($file);
$packagePath = "{$params['area']}/{$params['theme']}/{$params['locale']}";
if (!isset($packages[$packagePath])) {
$packages[$packagePath] = $this->packageFactory->create($params);
Expand All @@ -115,4 +106,27 @@ public function collect()
}
return $packages;
}

/**
* Retrieve package params
*
* @param PackageFile $file
* @return array
*/
private function getParams(PackageFile $file)
{
$params = [
'area' => $file->getArea(),
'theme' => $file->getTheme(),
'locale' => $file->getLocale(),
'module' => $file->getModule(),
'isVirtual' => (!$file->getLocale() || !$file->getTheme() || !$file->getArea())
];
foreach ($this->packageDefaultValues as $name => $value) {
if (!isset($params[$name])) {
$params[$name] = $value;
}
}
return $params;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
*/
namespace Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit;

use Magento\Catalog\Controller\Adminhtml\Product\Crosssell as CatalogCrosssell;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class Crosssell
*
* @package Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit
* @deprecated Not used since cross-sell products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/crosssell_product_listing.xml
*/
class Crosssell extends \Magento\Catalog\Controller\Adminhtml\Product\Crosssell
class Crosssell extends CatalogCrosssell implements HttpPostActionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
*/
namespace Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit;

use Magento\Catalog\Controller\Adminhtml\Product\CrosssellGrid as CatalogCrosssellGrid;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class CrosssellGrid
*
* @package Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit
* @deprecated Not used since cross-sell products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/crosssell_product_listing.xml
*/
class CrosssellGrid extends \Magento\Catalog\Controller\Adminhtml\Product\CrosssellGrid
class CrosssellGrid extends CatalogCrosssellGrid implements HttpPostActionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
*/
namespace Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit;

use Magento\Catalog\Controller\Adminhtml\Product\Related as CatalogRelated;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class Related
*
* @package Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit
* @deprecated Not used since related products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/related_product_listing.xml
*/
class Related extends \Magento\Catalog\Controller\Adminhtml\Product\Related
class Related extends CatalogRelated implements HttpPostActionInterface
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,16 @@
*/
namespace Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit;

use Magento\Catalog\Controller\Adminhtml\Product\RelatedGrid as CatalogRelatedGrid;
use Magento\Framework\App\Action\HttpPostActionInterface;

/**
* Class RelatedGrid
*
* @package Magento\Downloadable\Controller\Adminhtml\Downloadable\Product\Edit
* @deprecated Not used since related products grid moved to UI components.
* @see Magento_Catalog::view/adminhtml/ui_component/related_product_listing.xml
*/
class RelatedGrid extends \Magento\Catalog\Controller\Adminhtml\Product\RelatedGrid
class RelatedGrid extends CatalogRelatedGrid implements HttpPostActionInterface
{
}
Loading

0 comments on commit a557683

Please sign in to comment.