Skip to content

Commit 32017e7

Browse files
livca-smileguvra
andauthored
Fix compatibility 2 4 6 (#154)
Fix compatibility Magento 2.4.6 --------- Co-authored-by: guvra <[email protected]>
1 parent b7e741f commit 32017e7

File tree

121 files changed

+2310
-4864
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+2310
-4864
lines changed

.codeclimate.yml

Lines changed: 0 additions & 25 deletions
This file was deleted.

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/.github export-ignore
2+
/.gitattributes export-ignore
3+
/.gitignore export-ignore
4+
/CHANGELOG.md export-ignore
5+
/phpcs.xml.dist export-ignore
6+
/phpmd.xml.dist export-ignore
7+
/phpstan.neon.dist export-ignore
8+
/README.md export-ignore
Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
name: 'Static Analysis'
2+
3+
on:
4+
pull_request: ~
5+
push:
6+
branches:
7+
- 'master'
8+
9+
jobs:
10+
static-analysis:
11+
runs-on: 'ubuntu-latest'
12+
13+
strategy:
14+
matrix:
15+
php-version:
16+
- '8.1'
17+
18+
steps:
19+
- name: 'Checkout'
20+
uses: 'actions/checkout@v3'
21+
22+
- name: 'Install PHP'
23+
uses: 'shivammathur/setup-php@v2'
24+
with:
25+
php-version: '${{ matrix.php-version }}'
26+
coverage: 'none'
27+
tools: 'composer:v2'
28+
env:
29+
COMPOSER_AUTH_JSON: |
30+
{
31+
"http-basic": {
32+
"repo.magento.com": {
33+
"username": "${{ secrets.MAGENTO_USERNAME }}",
34+
"password": "${{ secrets.MAGENTO_PASSWORD }}"
35+
}
36+
}
37+
}
38+
39+
- name: 'Get composer cache directory'
40+
id: 'composer-cache'
41+
run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'
42+
43+
- name: 'Cache dependencies'
44+
uses: 'actions/cache@v3'
45+
with:
46+
path: '${{ steps.composer-cache.outputs.dir }}'
47+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
48+
restore-keys: '${{ runner.os }}-composer-'
49+
50+
- name: 'Install dependencies'
51+
run: 'composer install --prefer-dist'
52+
53+
- name: 'Run composer audit'
54+
run: 'composer audit --format=plain'
55+
56+
- name: 'Run Parallel Lint'
57+
run: 'vendor/bin/parallel-lint --exclude vendor .'
58+
59+
- name: 'Run PHP CodeSniffer'
60+
run: 'vendor/bin/phpcs --extensions=php,phtml'
61+
62+
- name: 'Run PHPMD'
63+
run: 'vendor/bin/phpmd . xml phpmd.xml.dist'
64+
65+
# - name: 'Run PHPStan'
66+
# run: 'vendor/bin/phpstan analyse'

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/.fleet
2+
/.idea
3+
/vendor
4+
/composer.lock
5+
/phpcs.xml
6+
/phpstan.neon

.travis.yml

Lines changed: 0 additions & 19 deletions
This file was deleted.
Lines changed: 18 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,47 @@
11
<?php
2-
/**
3-
* DISCLAIMER
4-
* Do not edit or add to this file if you wish to upgrade this module to newer
5-
* versions in the future.
6-
*
7-
* @category Smile
8-
* @package Smile\StoreLocator
9-
* @author Aurelien FOUCRET <[email protected]>
10-
* @copyright 2016 Smile
11-
* @license Open Software License ("OSL") v. 3.0
12-
*/
2+
3+
declare(strict_types=1);
4+
135
namespace Smile\StoreLocator\Api\Data;
146

7+
use Smile\Map\Api\Data\GeolocalizedAddressInterface;
8+
159
/**
16-
* Retailer Store Locator interface
17-
*
18-
* @category Smile
19-
* @package Smile\StoreLocator
20-
* @author Aurelien FOUCRET <[email protected]>
10+
* Retailer Store Locator interface.
2111
*/
22-
interface RetailerAddressInterface extends \Smile\Map\Api\Data\GeolocalizedAddressInterface
12+
interface RetailerAddressInterface extends GeolocalizedAddressInterface
2313
{
24-
/**#@+
25-
* Constants for keys of data array. Identical to the name of the getter in snake case
26-
*/
27-
const ADDRESS_ID = 'address_id';
28-
const RETAILER_ID = 'retailer_id';
29-
/**#@-*/
14+
public const ADDRESS_ID = 'address_id';
15+
public const RETAILER_ID = 'retailer_id';
3016

3117
/**
18+
* Get id
19+
*
3220
* @return int
3321
*/
34-
public function getId();
22+
public function getAddressId(): int;
3523

3624
/**
25+
* Get retailer id.
26+
*
3727
* @return int
3828
*/
39-
public function getRetailerId();
29+
public function getRetailerId(): int;
4030

4131
/**
4232
* Set id.
4333
*
4434
* @SuppressWarnings(PHPMD.ShortVariable)
45-
*
46-
* @param int $id Address id.
47-
*
35+
* @param mixed $id Address id.
4836
* @return $this
4937
*/
50-
public function setId($id);
38+
public function setAddressId(mixed $id): self;
5139

5240
/**
5341
* Set retailer id.
5442
*
5543
* @param int $retailerId Retailer id.
56-
*
5744
* @return $this
5845
*/
59-
public function setRetailerId($retailerId);
46+
public function setRetailerId(int $retailerId): self;
6047
}
Lines changed: 16 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,61 +1,44 @@
11
<?php
2-
/**
3-
* DISCLAIMER
4-
* Do not edit or add to this file if you wish to upgrade this module to newer
5-
* versions in the future.
6-
*
7-
* @category Smile
8-
* @package Smile\StoreLocator
9-
* @author Romain Ruaud <[email protected]>
10-
* @copyright 2017 Smile
11-
* @license Open Software License ("OSL") v. 3.0
12-
*/
2+
3+
declare(strict_types=1);
4+
135
namespace Smile\StoreLocator\Api\Data;
146

157
/**
16-
* Generic Interface for retailer time slots items
17-
*
18-
* @category Smile
19-
* @package Smile\StoreLocator
20-
* @author Romain Ruaud <[email protected]>
8+
* Generic Interface for retailer time slots items.
219
*/
2210
interface RetailerTimeSlotInterface
2311
{
24-
/**
25-
* The date field
26-
*/
27-
const DATE_FIELD = 'date';
28-
29-
/**
30-
* The day of week field
31-
*/
32-
const DAY_OF_WEEK_FIELD = 'day_of_week';
12+
public const DATE_FIELD = 'date';
13+
public const DAY_OF_WEEK_FIELD = 'day_of_week';
3314

3415
/**
16+
* Get start time.
17+
*
3518
* @return string
3619
*/
37-
public function getStartTime();
20+
public function getStartTime(): string;
3821

3922
/**
23+
* Get end time.
24+
*
4025
* @return string
4126
*/
42-
public function getEndTime();
27+
public function getEndTime(): string;
4328

4429
/**
4530
* Set the start time
4631
*
4732
* @param string $time The time
48-
*
49-
* @return mixed
33+
* @return $this
5034
*/
51-
public function setStartTime($time);
35+
public function setStartTime(string $time): self;
5236

5337
/**
5438
* Set the end time
5539
*
5640
* @param string $time The time
57-
*
58-
* @return mixed
41+
* @return $this
5942
*/
60-
public function setEndTime($time);
43+
public function setEndTime(string $time): self;
6144
}

Block/AbstractView.php

Lines changed: 10 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,31 @@
11
<?php
2-
/**
3-
* DISCLAIMER
4-
* Do not edit or add to this file if you wish to upgrade this module to newer
5-
* versions in the future.
6-
*
7-
* @category Smile
8-
* @package Smile\StoreLocator
9-
* @author Romain Ruaud <[email protected]>
10-
* @author Guillaume Vrac <[email protected]>
11-
* @copyright 2016 Smile
12-
* @license Open Software License ("OSL") v. 3.0
13-
*/
2+
3+
declare(strict_types=1);
4+
145
namespace Smile\StoreLocator\Block;
156

7+
use Magento\Framework\Registry;
168
use Magento\Framework\View\Element\Template;
9+
use Magento\Framework\View\Element\Template\Context;
10+
use Smile\Retailer\Api\Data\RetailerInterface;
1711

1812
/**
19-
* Retailer View Block
20-
*
21-
* @category Smile
22-
* @package Smile\StoreLocator
23-
* @author Romain Ruaud <[email protected]>
24-
* @author Guillaume Vrac <[email protected]>
13+
* Retailer View Block.
2514
*/
2615
class AbstractView extends Template
2716
{
28-
/**
29-
* Constructor.
30-
*
31-
* @param \Magento\Framework\View\Element\Template\Context $context Application context
32-
* @param \Magento\Framework\Registry $coreRegistry Application Registry
33-
* @param array $data Block Data
34-
*/
3517
public function __construct(
36-
\Magento\Framework\View\Element\Template\Context $context,
37-
\Magento\Framework\Registry $coreRegistry,
18+
Context $context,
19+
protected Registry $coreRegistry,
3820
array $data = []
3921
) {
4022
parent::__construct($context, $data);
41-
$this->coreRegistry = $coreRegistry;
4223
}
4324

4425
/**
4526
* Get the current shop.
46-
*
47-
* @return \Smile\Retailer\Api\Data\RetailerInterface
4827
*/
49-
public function getRetailer()
28+
public function getRetailer(): ?RetailerInterface
5029
{
5130
return $this->coreRegistry->registry('current_retailer');
5231
}

0 commit comments

Comments
 (0)