Skip to content

Commit

Permalink
Merge pull request #1314 from magento-falcons/MAGETWO-69964
Browse files Browse the repository at this point in the history
Fixed issues:
- MAGETWO-69964 PHPCS cannot parse correctly syntax of PHP 7.x return types
  • Loading branch information
slavvka authored Jul 12, 2017
2 parents 20e58ef + cb44012 commit 75e5dec
Show file tree
Hide file tree
Showing 168 changed files with 1,427 additions and 3,345 deletions.
2 changes: 1 addition & 1 deletion app/code/Magento/Catalog/Block/Product/Context.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* As Magento moves from inheritance-based APIs all such classes will be deprecated together with
* the classes they were introduced for.
*
* @deprecated
* @deprecated
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
*/
class Context extends \Magento\Framework\View\Element\Template\Context
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(ScopeConfigInterface $scopeConfig)

/**
* Parse lifetime of recently compared products in widget
*
*
* @inheritdoc
*/
public function get()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Model\Widget;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Test\Unit\Block;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Test\Unit\Model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,14 +93,12 @@ public function testGet()
$attributeId = 5;
$skus = ['sku_1', 'sku_2'];
$idsBySku = [
'sku_1' =>
[
1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE
],
'sku_2' =>
[
2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL
]
'sku_1' => [
1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE
],
'sku_2' => [
2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL
]
];
$select = $this->getMockBuilder(\Magento\Framework\DB\Select::class)
->disableOriginalConstructor()->getMock();
Expand Down Expand Up @@ -228,14 +226,12 @@ public function testDelete()
$attributeId = 5;
$skus = ['sku_1', 'sku_2'];
$idsBySku = [
'sku_1' =>
[
1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE
],
'sku_2' =>
[
2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL
]
'sku_1' => [
1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE
],
'sku_2' => [
2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL
]
];
$this->productIdLocator
->expects($this->once())
Expand Down Expand Up @@ -278,14 +274,12 @@ public function testDeleteWithException()
$attributeId = 5;
$skus = ['sku_1', 'sku_2'];
$idsBySku = [
'sku_1' =>
[
1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE
],
'sku_2' =>
[
2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL
]
'sku_1' => [
1 => \Magento\Catalog\Model\Product\Type::TYPE_SIMPLE
],
'sku_2' => [
2 => \Magento\Catalog\Model\Product\Type::TYPE_VIRTUAL
]
];
$this->productIdLocator
->expects($this->once())
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Test\Unit\Model;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Test\Unit\Ui\DataProvider\Product\Listing\Collector;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/**
* Class AdvancedPricing
*
*
* @api
*
* @SuppressWarnings(PHPMD.CouplingBetweenObjects)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Ui\DataProvider\Product\Listing\Collector;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Ui\DataProvider\Product;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Ui\DataProvider\Product;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
// @codingStandardsIgnoreFile
?>
<script type="text/x-magento-init">
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<?php /** @var $block \Magento\Catalog\Block\Product\Image */ ?>

<img class="photo image"
<?= /* @escapeNotVerified */ $block->getCustomAttributes() ?>
src="<?= /* @escapeNotVerified */ $block->getImageUrl() ?>"
width="<?= /* @escapeNotVerified */ $block->getWidth() ?>"
height="<?= /* @escapeNotVerified */ $block->getHeight() ?>"
alt="<?= /* @escapeNotVerified */ $block->stripTags($block->getLabel(), null, true) ?>" />
<?= /* @escapeNotVerified */ $block->getCustomAttributes() ?>
src="<?= /* @escapeNotVerified */ $block->getImageUrl() ?>"
width="<?= /* @escapeNotVerified */ $block->getWidth() ?>"
height="<?= /* @escapeNotVerified */ $block->getHeight() ?>"
alt="<?= /* @escapeNotVerified */ $block->stripTags($block->getLabel(), null, true) ?>" />
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@
<span class="product-image-wrapper"
style="padding-bottom: <?= /* @escapeNotVerified */ ($block->getRatio() * 100) ?>%;">
<img class="product-image-photo"
<?= /* @escapeNotVerified */ $block->getCustomAttributes() ?>
src="<?= /* @escapeNotVerified */ $block->getImageUrl() ?>"
width="<?= /* @escapeNotVerified */ $block->getResizedImageWidth() ?>"
height="<?= /* @escapeNotVerified */ $block->getResizedImageHeight() ?>"
alt="<?= /* @escapeNotVerified */ $block->stripTags($block->getLabel(), null, true) ?>"/></span>
<?= /* @escapeNotVerified */ $block->getCustomAttributes() ?>
src="<?= /* @escapeNotVerified */ $block->getImageUrl() ?>"
width="<?= /* @escapeNotVerified */ $block->getResizedImageWidth() ?>"
height="<?= /* @escapeNotVerified */ $block->getResizedImageHeight() ?>"
alt="<?= /* @escapeNotVerified */ $block->stripTags($block->getLabel(), null, true) ?>"/></span>
</span>
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
?>
Expand All @@ -10,13 +10,11 @@
*/
?>

<?= /* @escapeNotVerified */ $block->renderApp(
[
'widget_columns' => [
'displayMode' => 'grid'
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
<?= /* @escapeNotVerified */ $block->renderApp([
'widget_columns' => [
'displayMode' => 'grid'
],
'image' => [
'imageCode' => 'recently_viewed_products_grid_content_widget'
]
);
]);
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,11 @@
*/
?>

<?= /* @escapeNotVerified */ $block->renderApp(
[
'widget_columns' => [
'displayMode' => 'list'
],
'image' => [
'imageCode' => 'recently_viewed_products_list_content_widget'
]
<?= /* @escapeNotVerified */ $block->renderApp([
'widget_columns' => [
'displayMode' => 'list'
],
'image' => [
'imageCode' => 'recently_viewed_products_list_content_widget'
]
);
]);
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,10 @@ public function testPrepareAttributesWithDefaultValueForSave()
'is_unique' => '0',
'frontend_label' => 'Name',
'is_static' => false,
'apply_to' =>
[
],
'apply_to' => [],
'type' => 'varchar',
'default_value' => null,
'options' =>
[
],
'options' => [],
],
'sku' => [
'id' => '70',
Expand All @@ -51,14 +47,10 @@ public function testPrepareAttributesWithDefaultValueForSave()
'is_unique' => '1',
'frontend_label' => 'SKU',
'is_static' => true,
'apply_to' =>
[
],
'apply_to' => [],
'type' => 'varchar',
'default_value' => null,
'options' =>
[
],
'options' => [],
]
]
]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
/**
* Copyright © Magento, Inc. All rights reserved.
* Copyright © Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\CatalogInventory\Model;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,6 @@ public function rebuildStoreIndex($storeId, $productIds = null)
$products = $this->dataProvider
->getSearchableProducts($storeId, $staticFields, $productIds, $lastProductId);
while (count($products) > 0) {

$productsIds = array_column($products, 'entity_id');
$relatedProducts = $this->getRelatedProducts($products);
$productsIds = array_merge($productsIds, array_values($relatedProducts));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ protected function _renderFiltersBefore()
$searchResult = $this->searchResultFactory->create()->setItems([]);
} catch (NonExistingRequestNameException $e) {
$this->_logger->error($e->getMessage());
throw new LocalizedException(__('Sorry, something went wrong. You can find out more in the error log.'));
throw new LocalizedException(
__('Sorry, something went wrong. You can find out more in the error log.')
);
}
$temporaryStorage = $this->temporaryStorageFactory->create();
$table = $temporaryStorage->storeApiDocuments($searchResult->getItems());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@ public function __construct(
*/
public function mapSelectContainerToStrategy(SelectContainer $selectContainer)
{
if (
$selectContainer->isFullTextSearchRequired()
if ($selectContainer->isFullTextSearchRequired()
&& !$selectContainer->hasCustomAttributesFilters()
&& !$selectContainer->hasVisibilityFilter()
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,7 @@ public function getCategoryProductsUrlRewrites(
->addAttributeToSelect('url_path');

foreach ($productCollection as $product) {
if (
isset($this->isSkippedProduct[$category->getEntityId()]) &&
if (isset($this->isSkippedProduct[$category->getEntityId()]) &&
in_array($product->getId(), $this->isSkippedProduct[$category->getEntityId()])
) {
continue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
*/
namespace Magento\Checkout\Test\Unit\Block\Cart;


class LayoutProcessorTest extends \PHPUnit_Framework_TestCase
{

Expand Down
Loading

0 comments on commit 75e5dec

Please sign in to comment.