Skip to content

Commit c52c6e9

Browse files
add strict types
1 parent 7e6827d commit c52c6e9

File tree

3 files changed

+14
-8
lines changed

3 files changed

+14
-8
lines changed

app/code/Magento/Downloadable/Model/Link/UpdateHandler.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace Magento\Downloadable\Model\Link;
710

811
use Magento\Catalog\Api\Data\ProductInterface;
@@ -33,16 +36,15 @@ public function __construct(LinkRepository $linkRepository)
3336
/**
3437
* Update links for downloadable product if exist
3538
*
36-
* @param object $entity
39+
* @param ProductInterface $entity
3740
* @param array $arguments
38-
* @return ProductInterface|object
41+
* @return ProductInterface
3942
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4043
*/
41-
public function execute($entity, $arguments = [])
44+
public function execute($entity, $arguments = []): ProductInterface
4245
{
4346
$links = $entity->getExtensionAttributes()->getDownloadableProductLinks();
4447

45-
/** @var $entity ProductInterface */
4648
if ($links && $entity->getTypeId() === Type::TYPE_DOWNLOADABLE) {
4749
$this->updateLinks($entity, $links);
4850
}

app/code/Magento/Downloadable/Model/Sample/UpdateHandler.php

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
* Copyright © Magento, Inc. All rights reserved.
44
* See COPYING.txt for license details.
55
*/
6+
7+
declare(strict_types=1);
8+
69
namespace Magento\Downloadable\Model\Sample;
710

811
use Magento\Catalog\Api\Data\ProductInterface;
@@ -33,16 +36,15 @@ public function __construct(SampleRepository $sampleRepository)
3336
/**
3437
* Update samples for downloadable product if exist
3538
*
36-
* @param object $entity
39+
* @param ProductInterface $entity
3740
* @param array $arguments
38-
* @return ProductInterface|object
41+
* @return ProductInterface
3942
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
4043
*/
41-
public function execute($entity, $arguments = [])
44+
public function execute($entity, $arguments = []): ProductInterface
4245
{
4346
$samples = $entity->getExtensionAttributes()->getDownloadableProductSamples();
4447

45-
/** @var $entity ProductInterface */
4648
if ($samples && $entity->getTypeId() === Type::TYPE_DOWNLOADABLE) {
4749
$this->updateSamples($entity, $samples);
4850
}

dev/tests/api-functional/testsuite/Magento/Downloadable/Api/ProductRepositoryTest.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
* See COPYING.txt for license details.
55
*/
66

7+
declare(strict_types=1);
8+
79
namespace Magento\Downloadable\Api;
810

911
use Magento\Catalog\Api\Data\ProductInterface;

0 commit comments

Comments
 (0)