Skip to content

Commit

Permalink
Fix compatibility 2 4 6 (#154)
Browse files Browse the repository at this point in the history
Fix compatibility Magento 2.4.6

---------

Co-authored-by: guvra <[email protected]>
  • Loading branch information
livca-smile and guvra authored Sep 21, 2023
1 parent b7e741f commit 32017e7
Show file tree
Hide file tree
Showing 121 changed files with 2,310 additions and 4,864 deletions.
25 changes: 0 additions & 25 deletions .codeclimate.yml

This file was deleted.

8 changes: 8 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/CHANGELOG.md export-ignore
/phpcs.xml.dist export-ignore
/phpmd.xml.dist export-ignore
/phpstan.neon.dist export-ignore
/README.md export-ignore
66 changes: 66 additions & 0 deletions .github/workflows/static-analysis.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: 'Static Analysis'

on:
pull_request: ~
push:
branches:
- 'master'

jobs:
static-analysis:
runs-on: 'ubuntu-latest'

strategy:
matrix:
php-version:
- '8.1'

steps:
- name: 'Checkout'
uses: 'actions/checkout@v3'

- name: 'Install PHP'
uses: 'shivammathur/setup-php@v2'
with:
php-version: '${{ matrix.php-version }}'
coverage: 'none'
tools: 'composer:v2'
env:
COMPOSER_AUTH_JSON: |
{
"http-basic": {
"repo.magento.com": {
"username": "${{ secrets.MAGENTO_USERNAME }}",
"password": "${{ secrets.MAGENTO_PASSWORD }}"
}
}
}
- name: 'Get composer cache directory'
id: 'composer-cache'
run: 'echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT'

- name: 'Cache dependencies'
uses: 'actions/cache@v3'
with:
path: '${{ steps.composer-cache.outputs.dir }}'
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: '${{ runner.os }}-composer-'

- name: 'Install dependencies'
run: 'composer install --prefer-dist'

- name: 'Run composer audit'
run: 'composer audit --format=plain'

- name: 'Run Parallel Lint'
run: 'vendor/bin/parallel-lint --exclude vendor .'

- name: 'Run PHP CodeSniffer'
run: 'vendor/bin/phpcs --extensions=php,phtml'

- name: 'Run PHPMD'
run: 'vendor/bin/phpmd . xml phpmd.xml.dist'

# - name: 'Run PHPStan'
# run: 'vendor/bin/phpstan analyse'
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/.fleet
/.idea
/vendor
/composer.lock
/phpcs.xml
/phpstan.neon
19 changes: 0 additions & 19 deletions .travis.yml

This file was deleted.

49 changes: 18 additions & 31 deletions Api/Data/RetailerAddressInterface.php
Original file line number Diff line number Diff line change
@@ -1,60 +1,47 @@
<?php
/**
* DISCLAIMER
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future.
*
* @category Smile
* @package Smile\StoreLocator
* @author Aurelien FOUCRET <[email protected]>
* @copyright 2016 Smile
* @license Open Software License ("OSL") v. 3.0
*/

declare(strict_types=1);

namespace Smile\StoreLocator\Api\Data;

use Smile\Map\Api\Data\GeolocalizedAddressInterface;

/**
* Retailer Store Locator interface
*
* @category Smile
* @package Smile\StoreLocator
* @author Aurelien FOUCRET <[email protected]>
* Retailer Store Locator interface.
*/
interface RetailerAddressInterface extends \Smile\Map\Api\Data\GeolocalizedAddressInterface
interface RetailerAddressInterface extends GeolocalizedAddressInterface
{
/**#@+
* Constants for keys of data array. Identical to the name of the getter in snake case
*/
const ADDRESS_ID = 'address_id';
const RETAILER_ID = 'retailer_id';
/**#@-*/
public const ADDRESS_ID = 'address_id';
public const RETAILER_ID = 'retailer_id';

/**
* Get id
*
* @return int
*/
public function getId();
public function getAddressId(): int;

/**
* Get retailer id.
*
* @return int
*/
public function getRetailerId();
public function getRetailerId(): int;

/**
* Set id.
*
* @SuppressWarnings(PHPMD.ShortVariable)
*
* @param int $id Address id.
*
* @param mixed $id Address id.
* @return $this
*/
public function setId($id);
public function setAddressId(mixed $id): self;

/**
* Set retailer id.
*
* @param int $retailerId Retailer id.
*
* @return $this
*/
public function setRetailerId($retailerId);
public function setRetailerId(int $retailerId): self;
}
49 changes: 16 additions & 33 deletions Api/Data/RetailerTimeSlotInterface.php
Original file line number Diff line number Diff line change
@@ -1,61 +1,44 @@
<?php
/**
* DISCLAIMER
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future.
*
* @category Smile
* @package Smile\StoreLocator
* @author Romain Ruaud <[email protected]>
* @copyright 2017 Smile
* @license Open Software License ("OSL") v. 3.0
*/

declare(strict_types=1);

namespace Smile\StoreLocator\Api\Data;

/**
* Generic Interface for retailer time slots items
*
* @category Smile
* @package Smile\StoreLocator
* @author Romain Ruaud <[email protected]>
* Generic Interface for retailer time slots items.
*/
interface RetailerTimeSlotInterface
{
/**
* The date field
*/
const DATE_FIELD = 'date';

/**
* The day of week field
*/
const DAY_OF_WEEK_FIELD = 'day_of_week';
public const DATE_FIELD = 'date';
public const DAY_OF_WEEK_FIELD = 'day_of_week';

/**
* Get start time.
*
* @return string
*/
public function getStartTime();
public function getStartTime(): string;

/**
* Get end time.
*
* @return string
*/
public function getEndTime();
public function getEndTime(): string;

/**
* Set the start time
*
* @param string $time The time
*
* @return mixed
* @return $this
*/
public function setStartTime($time);
public function setStartTime(string $time): self;

/**
* Set the end time
*
* @param string $time The time
*
* @return mixed
* @return $this
*/
public function setEndTime($time);
public function setEndTime(string $time): self;
}
41 changes: 10 additions & 31 deletions Block/AbstractView.php
Original file line number Diff line number Diff line change
@@ -1,52 +1,31 @@
<?php
/**
* DISCLAIMER
* Do not edit or add to this file if you wish to upgrade this module to newer
* versions in the future.
*
* @category Smile
* @package Smile\StoreLocator
* @author Romain Ruaud <[email protected]>
* @author Guillaume Vrac <[email protected]>
* @copyright 2016 Smile
* @license Open Software License ("OSL") v. 3.0
*/

declare(strict_types=1);

namespace Smile\StoreLocator\Block;

use Magento\Framework\Registry;
use Magento\Framework\View\Element\Template;
use Magento\Framework\View\Element\Template\Context;
use Smile\Retailer\Api\Data\RetailerInterface;

/**
* Retailer View Block
*
* @category Smile
* @package Smile\StoreLocator
* @author Romain Ruaud <[email protected]>
* @author Guillaume Vrac <[email protected]>
* Retailer View Block.
*/
class AbstractView extends Template
{
/**
* Constructor.
*
* @param \Magento\Framework\View\Element\Template\Context $context Application context
* @param \Magento\Framework\Registry $coreRegistry Application Registry
* @param array $data Block Data
*/
public function __construct(
\Magento\Framework\View\Element\Template\Context $context,
\Magento\Framework\Registry $coreRegistry,
Context $context,
protected Registry $coreRegistry,
array $data = []
) {
parent::__construct($context, $data);
$this->coreRegistry = $coreRegistry;
}

/**
* Get the current shop.
*
* @return \Smile\Retailer\Api\Data\RetailerInterface
*/
public function getRetailer()
public function getRetailer(): ?RetailerInterface
{
return $this->coreRegistry->registry('current_retailer');
}
Expand Down
Loading

0 comments on commit 32017e7

Please sign in to comment.