Skip to content

Commit

Permalink
PrestaShop 9 Compability + Namespace fix
Browse files Browse the repository at this point in the history
  • Loading branch information
0x346e3730 committed Jun 6, 2023
1 parent 3d57add commit e361142
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
],
"autoload": {
"psr-4": {
"PrestaShop\\KeycloakConnectorDemo\\": "src/"
"PrestaShop\\Module\\KeycloakConnectorDemo\\": "src/"
}
},
"require-dev": {
Expand Down
2 changes: 1 addition & 1 deletion config/routes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ keycloak_connector_configuration:
path: /keycloak_connector/configuration
methods: [GET,POST]
defaults:
_controller: 'PrestaShop\KeycloakConnectorDemo\Controller\ConfigurationController::indexAction'
_controller: 'PrestaShop\Module\KeycloakConnectorDemo\Controller\ConfigurationController::indexAction'
37 changes: 19 additions & 18 deletions config/services.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
PrestaShop\KeycloakConnectorDemo\Form\ConfigurationType:
class: PrestaShop\KeycloakConnectorDemo\Form\ConfigurationType
PrestaShop\Module\KeycloakConnectorDemo\Form\ConfigurationType:
class: PrestaShop\Module\KeycloakConnectorDemo\Form\ConfigurationType
parent: 'form.type.translatable.aware'
public: true
tags:
Expand All @@ -14,44 +14,45 @@ services:
prestashop.module.keycloak_connector_demo.client:
class: GuzzleHttp\Client

PrestaShop\KeycloakConnectorDemo\RequestBuilder:
class: PrestaShop\KeycloakConnectorDemo\RequestBuilder
PrestaShop\Module\KeycloakConnectorDemo\RequestBuilder:
class: PrestaShop\Module\KeycloakConnectorDemo\RequestBuilder
arguments:
- '@prestashop.adapter.legacy.configuration'
- '@prestashop.module.keycloak_connector_demo.php_encrypt'

PrestaShop\KeycloakConnectorDemo\Form\ConfigurationDataConfiguration:
class: PrestaShop\KeycloakConnectorDemo\Form\ConfigurationDataConfiguration
PrestaShop\Module\KeycloakConnectorDemo\Form\ConfigurationDataConfiguration:
class: PrestaShop\Module\KeycloakConnectorDemo\Form\ConfigurationDataConfiguration
arguments:
- '@prestashop.adapter.legacy.configuration'
- '@prestashop.module.keycloak_connector_demo.php_encrypt'
- '@PrestaShop\KeycloakConnectorDemo\RequestBuilder'
- '@PrestaShop\Module\KeycloakConnectorDemo\RequestBuilder'
- '@prestashop.module.keycloak_connector_demo.client'

PrestaShop\KeycloakConnectorDemo\Form\ConfigurationDataProvider:
class: PrestaShop\KeycloakConnectorDemo\Form\ConfigurationDataProvider
PrestaShop\Module\KeycloakConnectorDemo\Form\ConfigurationDataProvider:
class: PrestaShop\Module\KeycloakConnectorDemo\Form\ConfigurationDataProvider
arguments:
- '@PrestaShop\KeycloakConnectorDemo\Form\ConfigurationDataConfiguration'
- '@PrestaShop\Module\KeycloakConnectorDemo\Form\ConfigurationDataConfiguration'

prestashop.module.keycloak_connector_demo.form.configuration_data_handler:
class: 'PrestaShop\PrestaShop\Core\Form\Handler'
public: true
arguments:
- '@form.factory'
- '@prestashop.core.hook.dispatcher'
- '@PrestaShop\KeycloakConnectorDemo\Form\ConfigurationDataProvider'
- 'PrestaShop\KeycloakConnectorDemo\Form\ConfigurationType'
- '@PrestaShop\Module\KeycloakConnectorDemo\Form\ConfigurationDataProvider'
- 'PrestaShop\Module\KeycloakConnectorDemo\Form\ConfigurationType'
- 'KeycloakConfiguration'

PrestaShop\KeycloakConnectorDemo\Controller\ConfigurationController:
class: PrestaShop\KeycloakConnectorDemo\Controller\ConfigurationController
PrestaShop\Module\KeycloakConnectorDemo\Controller\ConfigurationController:
public: true
autowire: true

PrestaShop\KeycloakConnectorDemo\OAuth2\KeyCloakResourceServer:
class: PrestaShop\KeycloakConnectorDemo\OAuth2\KeyCloakResourceServer
PrestaShop\Module\KeycloakConnectorDemo\OAuth2\KeyCloakResourceServer:
class: PrestaShop\Module\KeycloakConnectorDemo\OAuth2\KeyCloakResourceServer
arguments:
- '@prestashop.module.keycloak_connector_demo.client'
- '@prestashop.adapter.legacy.configuration'
- '@prestashop.module.keycloak_connector_demo.php_encrypt'
- '@PrestaShop\KeycloakConnectorDemo\RequestBuilder'
- '@PrestaShop\Module\KeycloakConnectorDemo\RequestBuilder'

PrestaShop\PrestaShop\Core\OAuth2\OAuth2Interface: '@PrestaShop\KeycloakConnectorDemo\OAuth2\KeyCloakResourceServer'
PrestaShop\PrestaShop\Core\OAuth2\OAuth2Interface: '@PrestaShop\Module\KeycloakConnectorDemo\OAuth2\KeyCloakResourceServer'
2 changes: 1 addition & 1 deletion src/Controller/ConfigurationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace PrestaShop\KeycloakConnectorDemo\Controller;
namespace PrestaShop\Module\KeycloakConnectorDemo\Controller;

use PrestaShop\PrestaShop\Core\Form\FormHandlerInterface;
use PrestaShopBundle\Controller\Admin\FrameworkBundleAdminController;
Expand Down
4 changes: 2 additions & 2 deletions src/Form/ConfigurationDataConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@

declare(strict_types=1);

namespace PrestaShop\KeycloakConnectorDemo\Form;
namespace PrestaShop\Module\KeycloakConnectorDemo\Form;

use PhpEncryption;
use PrestaShop\KeycloakConnectorDemo\RequestBuilder;
use PrestaShop\Module\KeycloakConnectorDemo\RequestBuilder;
use PrestaShop\PrestaShop\Core\Configuration\DataConfigurationInterface;
use PrestaShop\PrestaShop\Core\ConfigurationInterface;
use Psr\Http\Client\ClientExceptionInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Form/ConfigurationDataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace PrestaShop\KeycloakConnectorDemo\Form;
namespace PrestaShop\Module\KeycloakConnectorDemo\Form;

use PrestaShop\PrestaShop\Core\Configuration\DataConfigurationInterface;
use PrestaShop\PrestaShop\Core\Form\FormDataProviderInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Form/ConfigurationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace PrestaShop\KeycloakConnectorDemo\Form;
namespace PrestaShop\Module\KeycloakConnectorDemo\Form;

use PrestaShopBundle\Form\Admin\Type\TranslatorAwareType;
use Symfony\Component\Form\Extension\Core\Type\TextType;
Expand Down
6 changes: 3 additions & 3 deletions src/OAuth2/KeyCloakResourceServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace PrestaShop\KeycloakConnectorDemo\OAuth2;
namespace PrestaShop\Module\KeycloakConnectorDemo\OAuth2;

use Lcobucci\Clock\SystemClock;
use Lcobucci\JWT\Parser;
Expand All @@ -33,8 +33,8 @@
use Lcobucci\JWT\Validation\Constraint\ValidAt;
use Lcobucci\JWT\Validation\Validator;
use PhpEncryption;
use PrestaShop\KeycloakConnectorDemo\Form\ConfigurationDataConfiguration;
use PrestaShop\KeycloakConnectorDemo\RequestBuilder;
use PrestaShop\Module\KeycloakConnectorDemo\Form\ConfigurationDataConfiguration;
use PrestaShop\Module\KeycloakConnectorDemo\RequestBuilder;
use PrestaShop\PrestaShop\Core\ConfigurationInterface;
use PrestaShop\PrestaShop\Core\Security\OAuth2\ResourceServerInterface;
use Psr\Http\Client\ClientExceptionInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/OAuth2/KeyCloakUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace PrestaShop\KeycloakConnectorDemo\OAuth2;
namespace PrestaShop\Module\KeycloakConnectorDemo\OAuth2;

use Symfony\Component\Security\Core\User\UserInterface;

Expand Down
2 changes: 1 addition & 1 deletion src/RequestBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

declare(strict_types=1);

namespace PrestaShop\KeycloakConnectorDemo;
namespace PrestaShop\Module\KeycloakConnectorDemo;

use GuzzleHttp\Psr7\Request;
use Psr\Http\Message\RequestInterface;
Expand Down
2 changes: 1 addition & 1 deletion tests/phpstan.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,6 @@ echo "Run PHPStan using phpstan-${PS_VERSION}.neon file"
docker run --rm --volumes-from temp-ps \
-v $PWD:/var/www/html/modules/keycloak_connector_demo \
-e _PS_ROOT_DIR_=/var/www/html \
--workdir=/var/www/html/modules/keycloak_connector_demo ghcr.io/phpstan/phpstan:1.9.8 \
--workdir=/var/www/html/modules/keycloak_connector_demo ghcr.io/phpstan/phpstan:1-php8.1 \
analyse \
--configuration=/var/www/html/modules/keycloak_connector_demo/tests/phpstan/phpstan-${PS_VERSION}.neon

0 comments on commit e361142

Please sign in to comment.