Skip to content

Commit

Permalink
Merge pull request #4 from magmodules/release/2.0.0
Browse files Browse the repository at this point in the history
Release/2.0.0
  • Loading branch information
Marvin-Magmodules authored Jul 14, 2022
2 parents 920a1ca + f0b7500 commit ec09e83
Show file tree
Hide file tree
Showing 78 changed files with 1,434 additions and 1,753 deletions.
15 changes: 15 additions & 0 deletions .github/workflows/codesniffer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Codesniffer with the Magento Coding standard
on: [push, pull_request]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Run codesniffer
run:
docker run
--volume $(pwd)/:/app/workdir
michielgerritsen/magento-coding-standard:latest
--severity=6
45 changes: 45 additions & 0 deletions .github/workflows/linting.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Lint PHP files
on: [push, pull_request]

jobs:
php-71:
runs-on: ubuntu-latest
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'

php-72:
runs-on: ubuntu-latest
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'

php-73:
runs-on: ubuntu-latest
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'

php-74:
runs-on: ubuntu-latest
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'

php-80:
runs-on: ubuntu-latest
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'

php-81:
runs-on: ubuntu-latest
steps:
- uses: StephaneBour/[email protected]
with:
dir: './'
32 changes: 32 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: phpstan
on: [pull_request]

jobs:
build:
strategy:
matrix:
include:
- PHP_VERSION: php81-fpm
MAGENTO_VERSION: 2.4.4

runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1

- name: Start Docker
run: docker run --detach --name magento-project-community-edition michielgerritsen/magento-project-community-edition:${{ matrix.PHP_VERSION }}-magento${{ matrix.MAGENTO_VERSION }}

- name: Create branch for Composer and remove version from composer.json
run: git checkout -b continuous-integration-test-branch && sed -i '/version/d' ./composer.json

- name: Upload our code into the docker container
run: docker cp $(pwd) magento-project-community-edition:/data/extensions/

- name: Install the extensions in Magento
run: docker exec magento-project-community-edition composer require magmodules/magento2-bewustbezorgd:dev-continuous-integration-test-branch

- name: Activate the extension
run: docker exec magento-project-community-edition bash -c "php bin/magento module:enable Thuiswinkel_BewustBezorgd && php bin/magento setup:upgrade && php bin/magento setup:di:compile"

- name: Run PHPStan
run: docker exec magento-project-community-edition /bin/bash -c "./vendor/bin/phpstan analyse --no-progress -c /data/extensions/*/phpstan.neon /data/extensions"
27 changes: 27 additions & 0 deletions .github/workflows/setup-di-compile.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Run setup:upgrade and setup:di:compile
on: [pull_request]

jobs:
build:
strategy:
matrix:
include:
- PHP_VERSION: php73-fpm
MAGENTO_VERSION: 2.3.7
- PHP_VERSION: php81-fpm
MAGENTO_VERSION: 2.4.4
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Start Docker
run: PHP_VERSION=${{ matrix.PHP_VERSION }} MAGENTO_VERSION=magento${{ matrix.MAGENTO_VERSION }} docker-compose -f .github/workflows/templates/docker-compose.yml up -d

- name: Create branch for Composer and remove version from composer.json
run: git checkout -b continuous-integration-test-branch && sed -i '/version/d' ./composer.json

- name: Upload the code into the docker container
run: docker cp $(pwd) magento-project-community-edition:/data/extensions/ && docker exec magento-project-community-edition composer require magmodules/magento2-bewustbezorgd:dev-continuous-integration-test-branch

- name: Activate the extension and run setup:upgrade and setup:di:compile
run: docker exec magento-project-community-edition bash -c "php bin/magento module:enable Thuiswinkel_BewustBezorgd && php bin/magento setup:upgrade && php bin/magento setup:di:compile"
18 changes: 18 additions & 0 deletions .github/workflows/templates/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: '3'

services:
db:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root_password
MYSQL_DATABASE: magento-test
MYSQL_USER: magento
MYSQL_PASSWORD: magento
MYSQL_SQL_TO_RUN: 'GRANT ALL ON *.* TO "root"@"%";'
web:
image: michielgerritsen/magento-project-community-edition:${PHP_VERSION}-${MAGENTO_VERSION}
container_name: magento-project-community-edition
depends_on:
- db
volumes:
- ./:/data/extensions/workdir
Empty file modified .gitignore
100644 → 100755
Empty file.
139 changes: 139 additions & 0 deletions Api/Config/RepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
<?php
/**
* Copyright © Thuiswinkel.org. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Thuiswinkel\BewustBezorgd\Api\Config;

/**
* Config Repository Interface
*/
interface RepositoryInterface
{

/**#@+
* System configuration path constants
*/
public const CONFIG_XML_PATH_ACTIVE = 'bewust_bezorgd/general/active';
public const CONFIG_XML_PATH_GATEWAY_URL = 'bewust_bezorgd/api_settings/gateway_url';
public const CONFIG_XML_PATH_SHOP_ID = 'bewust_bezorgd/api_settings/api_shopid';
public const CONFIG_XML_PATH_PASSWORD = 'bewust_bezorgd/api_settings/api_password';
public const CONFIG_XML_PATH_DEBUG_ENABLED = 'bewust_bezorgd/api_settings/debug';
public const CONFIG_XML_PATH_ALLOWED_COUNTRIES = 'bewust_bezorgd/api_settings/allowed_countries';
public const CONFIG_XML_PATH_CAN_SHOW_LOGO = 'bewust_bezorgd/display_settings/can_show_logo';
public const CONFIG_XML_PATH_SAVE_TO_ORDER = 'bewust_bezorgd/order_settings/save_to_order';
public const CONFIG_XML_PATH_DEFAULT_WEIGHT = 'bewust_bezorgd/default_values/default_weight';
public const CONFIG_XML_PATH_DEFAULT_VOLUME = 'bewust_bezorgd/default_values/default_volume';
public const CONFIG_XML_PATH_SERVICE_TYPES = 'bewust_bezorgd/data_mapping/service_type_mapping';
public const CONFIG_XML_PATH_GROUP_ATTRIBUTES = 'bewust_bezorgd/attributes';
/**#@-*/

/**
* Set a specified store ID value
*
* @param int $store
* @return $this
*/
public function setStoreId($store);

/**
* Validate parameters for correct mass calculation
*
* @return bool
*/
public function validateMass();

/**
* Check if module is enabled
*
* @return bool
* @api
*/
public function isEnabled();

/**
* Retrieves configuration of group "Attributes"
*
* @return array
*/
public function getConfigDimensionsAttributes();

/**
* Retrieves API gateway URL
*
* @return string
*/
public function getConfigGatewayUrl();

/**
* Retrieves API Shop ID
*
* @return string
*/
public function getConfigApiShopId();

/**
* Retrieves API Password
*
* @return string
*/
public function getConfigApiPassword();

/**
* Retrieves default weight from configuration
*
* @return string
*/
public function getDefaultWeight();

/**
* Retrieves default volume from configuration
*
* @return string
*/
public function getDefaultVolume();

/**
* Retrieves allowed countries from configuration
*
* @return string
*/
public function getAllowedCountries();

/**
* Retrieves service types from configuration
*
* @return array
*/
public function getServiceTypes();

/**
* Retrieves setting "Show BewustBezorgd Icon on Shippingmethods" from configuration
*
* @return bool
*/
public function canShowLogo();

/**
* Retrieves save to order configuration setting
*
* @return bool
*/
public function saveToOrder();

/**
* Retrieves dimensions unit according to selected weight unit
*
* @return string
*/
public function getDimensionsUnit();

/**
* Check if debug mode is enabled
*
* @return bool
*/
public function isDebugMode();
}
28 changes: 28 additions & 0 deletions Api/Log/RepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?php
/**
* Copyright © Thuiswinkel.org. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);

namespace Thuiswinkel\BewustBezorgd\Api\Log;

/**
* Log Repository Interface
*/
interface RepositoryInterface
{

/**
* @param string $message
* @return void
*/
public function addApiLog(string $message);

/**
* @param string $type
* @param mixed $data
* @return void
*/
public function addDataLog(string $type, $data);
}
Loading

0 comments on commit ec09e83

Please sign in to comment.