File tree Expand file tree Collapse file tree 3 files changed +14
-8
lines changed
app/code/Magento/Downloadable/Model
dev/tests/api-functional/testsuite/Magento/Downloadable/Api Expand file tree Collapse file tree 3 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
7
+ declare (strict_types=1 );
8
+
6
9
namespace Magento \Downloadable \Model \Link ;
7
10
8
11
use Magento \Catalog \Api \Data \ProductInterface ;
@@ -33,16 +36,15 @@ public function __construct(LinkRepository $linkRepository)
33
36
/**
34
37
* Update links for downloadable product if exist
35
38
*
36
- * @param object $entity
39
+ * @param ProductInterface $entity
37
40
* @param array $arguments
38
- * @return ProductInterface|object
41
+ * @return ProductInterface
39
42
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
40
43
*/
41
- public function execute ($ entity , $ arguments = [])
44
+ public function execute ($ entity , $ arguments = []): ProductInterface
42
45
{
43
46
$ links = $ entity ->getExtensionAttributes ()->getDownloadableProductLinks ();
44
47
45
- /** @var $entity ProductInterface */
46
48
if ($ links && $ entity ->getTypeId () === Type::TYPE_DOWNLOADABLE ) {
47
49
$ this ->updateLinks ($ entity , $ links );
48
50
}
Original file line number Diff line number Diff line change 3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+
7
+ declare (strict_types=1 );
8
+
6
9
namespace Magento \Downloadable \Model \Sample ;
7
10
8
11
use Magento \Catalog \Api \Data \ProductInterface ;
@@ -33,16 +36,15 @@ public function __construct(SampleRepository $sampleRepository)
33
36
/**
34
37
* Update samples for downloadable product if exist
35
38
*
36
- * @param object $entity
39
+ * @param ProductInterface $entity
37
40
* @param array $arguments
38
- * @return ProductInterface|object
41
+ * @return ProductInterface
39
42
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
40
43
*/
41
- public function execute ($ entity , $ arguments = [])
44
+ public function execute ($ entity , $ arguments = []): ProductInterface
42
45
{
43
46
$ samples = $ entity ->getExtensionAttributes ()->getDownloadableProductSamples ();
44
47
45
- /** @var $entity ProductInterface */
46
48
if ($ samples && $ entity ->getTypeId () === Type::TYPE_DOWNLOADABLE ) {
47
49
$ this ->updateSamples ($ entity , $ samples );
48
50
}
Original file line number Diff line number Diff line change 4
4
* See COPYING.txt for license details.
5
5
*/
6
6
7
+ declare (strict_types=1 );
8
+
7
9
namespace Magento \Downloadable \Api ;
8
10
9
11
use Magento \Catalog \Api \Data \ProductInterface ;
You can’t perform that action at this time.
0 commit comments