From a9986688173c82517f085ae042e5dd141795c5ce Mon Sep 17 00:00:00 2001 From: Martin Grossmann Date: Mon, 16 Sep 2024 13:31:00 +0200 Subject: [PATCH] added convertim package --- .github/workflows/run-checks-tests.yaml | 29 ++++++++++ .gitignore | 5 ++ CONTRIBUTING.md | 10 ++++ LICENSE | 14 +++++ README.md | 43 ++++++++++++++ composer.json | 58 +++++++++++++++++++ phpstan.neon | 8 +++ phpunit.xml | 15 +++++ src/Controller/.gitkeep | 0 .../ShopsysConvertimExtension.php | 35 +++++++++++ src/Migrations/.gitkeep | 0 src/Resources/config/services.yaml | 13 +++++ src/Resources/translations/.gitkeep | 0 src/Resources/views/.gitkeep | 0 src/ShopsysConvertimBundle.php | 11 ++++ tests/.gitkeep | 0 16 files changed, 241 insertions(+) create mode 100644 .github/workflows/run-checks-tests.yaml create mode 100644 .gitignore create mode 100644 CONTRIBUTING.md create mode 100644 LICENSE create mode 100644 README.md create mode 100644 composer.json create mode 100644 phpstan.neon create mode 100644 phpunit.xml create mode 100644 src/Controller/.gitkeep create mode 100644 src/DependencyInjection/ShopsysConvertimExtension.php create mode 100644 src/Migrations/.gitkeep create mode 100644 src/Resources/config/services.yaml create mode 100644 src/Resources/translations/.gitkeep create mode 100644 src/Resources/views/.gitkeep create mode 100644 src/ShopsysConvertimBundle.php create mode 100644 tests/.gitkeep diff --git a/.github/workflows/run-checks-tests.yaml b/.github/workflows/run-checks-tests.yaml new file mode 100644 index 0000000..ce53a9a --- /dev/null +++ b/.github/workflows/run-checks-tests.yaml @@ -0,0 +1,29 @@ +on: [push] +concurrency: + group: ${{ github.ref }} + cancel-in-progress: true +name: "Checks and tests" +jobs: + checks-and-tests: + name: Run checks and tests + runs-on: ubuntu-22.04 + steps: + - name: Sleep for 15 seconds to ensure that split packages has been promoted to packagist.org + run: sleep 15s + shell: bash + - name: GIT checkout branch - ${{ github.ref }} + uses: actions/checkout@v4 + with: + ref: ${{ github.ref }} + - name: Install PHP, extensions and tools + uses: shivammathur/setup-php@v2 + with: + php-version: '8.3' + extensions: bcmath, gd, intl, pdo_pgsql, redis, pgsql, zip + tools: composer + - name: Install Composer dependencies + run: composer install --optimize-autoloader --no-interaction + - name: Run PHPUnit + run: php vendor/bin/phpunit tests + - name: Run PHPStan level 5 + run: php vendor/bin/phpstan analyze -c ./phpstan.neon ./src --level=5 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6e81c98 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +/.idea +/.php_cs.cache +/vendor +/composer.lock +/.phpunit.result.cache diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d53b197 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,10 @@ +# Contributing + +Thank you for your contributions to Shopsys Platform Package. +Together we are making Shopsys Platform better. + +This repository is READ-ONLY. +If you want to [report issues](https://github.com/shopsys/shopsys/issues/new) and/or send [pull requests](https://github.com/shopsys/shopsys/compare), +please use the main [Shopsys repository](https://github.com/shopsys/shopsys). + +Please, check our [Contribution Guide](https://github.com/shopsys/shopsys/blob/HEAD/CONTRIBUTING.md) before contributing. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..ec275c0 --- /dev/null +++ b/LICENSE @@ -0,0 +1,14 @@ +MIT License + +Copyright (c) 2017-2024 Shopsys s.r.o., http://www.shopsys.com + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..fcea274 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# Shopsys Convertim Bundle + +[![Downloads](https://img.shields.io/packagist/dt/shopsys/convertim.svg)](https://packagist.org/packages/shopsys/convertim) + +This bundle for [Shopsys Platform](https://www.shopsys.com) integrates the Convertim one-click checkout for ecommerce. +The bundle is dedicated for projects based on Shopsys Platform (i.e., created from [`shopsys/project-base`](https://github.com/shopsys/project-base)) exclusively. +This repository is maintained by [shopsys/shopsys](https://github.com/shopsys/shopsys) monorepo. + +## Documentation + +[Documentation](https://docs.shopsys.com/en/latest/) can be found in Shopsys Platform Knowledge Base. + +The documentation of Convertim can be found on the [https://docs.convertim.com](https://docs.convertim.com). + +## Installation + +The plugin is a Symfony bundle and is installed in the same way: + +### Download + +First, you download the package using [Composer](https://getcomposer.org/): + +``` +composer require shopsys/convertim +``` + +## Contributing + +Thank you for your contributions to Shopsys Convertim Bundle. +Together, we are making Shopsys Platform better. + +This repository is READ-ONLY. +If you want to [report issues](https://github.com/shopsys/shopsys/issues/new) and/or send [pull requests](https://github.com/shopsys/shopsys/compare), +please use the main [Shopsys repository](https://github.com/shopsys/shopsys). + +Please, check our [Contribution Guide](https://github.com/shopsys/shopsys/blob/HEAD/CONTRIBUTING.md) before contributing. + +## Support + +What to do when you are in trouble or need some help? +The best way is to join our [Slack](https://join.slack.com/t/shopsysframework/shared_invite/zt-11wx9au4g-e5pXei73UJydHRQ7nVApAQ). + +If you want to [report issues](https://github.com/shopsys/shopsys/issues/new), please use the main [Shopsys repository](https://github.com/shopsys/shopsys). diff --git a/composer.json b/composer.json new file mode 100644 index 0000000..9b54c56 --- /dev/null +++ b/composer.json @@ -0,0 +1,58 @@ +{ + "name": "shopsys/convertim", + "type": "library", + "description": "A Symfony bundle to integrate Convertim into Shopsys Platform.", + "keywords": ["Shopsys Platform", "SSFW", "convertim", "checkout", "integration"], + "license": "proprietary", + "authors": [ + { + "name": "Shopsys", + "homepage": "https://www.shopsys.com/" + } + ], + "autoload": { + "psr-4": { + "Shopsys\\ConvertimBundle\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\ConvertimBundle\\": "tests/" + } + }, + "require": { + "php": "^8.3", + "shopsys/form-types-bundle": "15.0.x-dev", + "shopsys/framework": "15.0.x-dev", + "shopsys/migrations": "15.0.x-dev", + "shopsys/plugin-interface": "15.0.x-dev", + "symfony/config": "^5.4", + "symfony/dependency-injection": "^5.4", + "symfony/form": "^5.4", + "symfony/http-foundation": "^5.4", + "symfony/http-kernel": "^5.4", + "symfony/routing": "^5.4", + "symfony/translation": "^5.4", + "twig/twig": "^3.5.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11.7", + "phpstan/phpstan-doctrine": "^1.4.8.", + "phpstan/phpstan-phpunit": "^1.4.0", + "phpstan/phpstan-symfony": "^1.4.6", + "phpunit/phpunit": "^9.5.20", + "shopsys/coding-standards": "15.0.x-dev" + }, + "extra": { + "symfony": { + "require": "^5.4", + "docker": false + } + }, + "config": { + "allow-plugins": { + "symfony/flex": true, + "dealerdirect/phpcodesniffer-composer-installer": true + } + } +} diff --git a/phpstan.neon b/phpstan.neon new file mode 100644 index 0000000..0773f7a --- /dev/null +++ b/phpstan.neon @@ -0,0 +1,8 @@ +parameters: + treatPhpDocTypesAsCertain: false +includes: + - vendor/phpstan/phpstan-doctrine/extension.neon + - vendor/phpstan/phpstan-phpunit/extension.neon + - vendor/phpstan/phpstan-symfony/extension.neon + - vendor/phpstan/phpstan-symfony/rules.neon + - vendor/shopsys/coding-standards/extension.neon diff --git a/phpunit.xml b/phpunit.xml new file mode 100644 index 0000000..bfa47b3 --- /dev/null +++ b/phpunit.xml @@ -0,0 +1,15 @@ + + + + + diff --git a/src/Controller/.gitkeep b/src/Controller/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/DependencyInjection/ShopsysConvertimExtension.php b/src/DependencyInjection/ShopsysConvertimExtension.php new file mode 100644 index 0000000..1d9ae5e --- /dev/null +++ b/src/DependencyInjection/ShopsysConvertimExtension.php @@ -0,0 +1,35 @@ +load('services.yaml'); + } + + /** + * {@inheritdoc} + */ + public function prepend(ContainerBuilder $container): void + { + $container->prependExtensionConfig('doctrine_migrations', [ + 'migrations_paths' => [ + 'Shopsys\ConvertimBundle\Migrations' => __DIR__ . '/../Migrations', + ], + ]); + } +} diff --git a/src/Migrations/.gitkeep b/src/Migrations/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/Resources/config/services.yaml b/src/Resources/config/services.yaml new file mode 100644 index 0000000..519932b --- /dev/null +++ b/src/Resources/config/services.yaml @@ -0,0 +1,13 @@ +services: + _defaults: + autoconfigure: true + autowire: true + public: false + + Shopsys\ConvertimBundle\: + exclude: '../../{Command,Controller,DependencyInjection,Form,Migrations,Resources,Twig}' + resource: '../../**/*{Enum,Facade,Factory,Repository,Transformer}.php' + + Shopsys\ConvertimBundle\Controller\: + resource: '../../Controller/' + tags: ['controller.service_arguments'] diff --git a/src/Resources/translations/.gitkeep b/src/Resources/translations/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/Resources/views/.gitkeep b/src/Resources/views/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/src/ShopsysConvertimBundle.php b/src/ShopsysConvertimBundle.php new file mode 100644 index 0000000..f5c9775 --- /dev/null +++ b/src/ShopsysConvertimBundle.php @@ -0,0 +1,11 @@ +