Skip to content

Commit

Permalink
Refacto WebserviceController based on PrestaShopAdminController
Browse files Browse the repository at this point in the history
  • Loading branch information
jolelievre committed Oct 21, 2024
1 parent 559b32d commit 42a1e14
Show file tree
Hide file tree
Showing 7 changed files with 157 additions and 110 deletions.
2 changes: 1 addition & 1 deletion src/Core/Webservice/ServerRequirementsChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public function __construct(
*
* @return array empty if no errors
*/
public function checkForErrors()
public function checkForErrors(): array
{
$issues = $this->lookForIssues();

Expand Down
2 changes: 1 addition & 1 deletion src/Core/Webservice/ServerRequirementsCheckerInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ interface ServerRequirementsCheckerInterface
*
* @return array Errors if any
*/
public function checkForErrors();
public function checkForErrors(): array;
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -216,13 +216,19 @@ services:
arguments:
- '@prestashop.adapter.legacy.configuration'

prestashop.adapter.webservice.configuration:
class: 'PrestaShop\PrestaShop\Adapter\Webservice\WebserviceConfiguration'
PrestaShop\PrestaShop\Adapter\Webservice\WebserviceConfiguration:
public: false
arguments:
- '@prestashop.adapter.legacy.configuration'
- '@prestashop.adapter.shop.context'
- '@prestashop.adapter.multistore_feature'

prestashop.adapter.webservice.configuration:
alias: 'PrestaShop\PrestaShop\Adapter\Webservice\WebserviceConfiguration'
deprecated:
package: PrestaShop\PrestaShop
version: 9.0

prestashop.adapter.meta.set_up_urls.configuration:
class: 'PrestaShop\PrestaShop\Adapter\Meta\SetUpUrlsDataConfiguration'
arguments:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,26 @@ services:
_defaults:
public: true

PrestaShop\PrestaShop\Adapter\Webservice\WebserviceKeyEraser:
public: false

prestashop.adapter.webservice.webservice_key_eraser:
class: 'PrestaShop\PrestaShop\Adapter\Webservice\WebserviceKeyEraser'
alias: 'PrestaShop\PrestaShop\Adapter\Webservice\WebserviceKeyEraser'
deprecated:
package: PrestaShop\PrestaShop
version: 9.0

prestashop.adapter.webservice.webservice_key_status_modifier:
class: 'PrestaShop\PrestaShop\Adapter\Webservice\WebserviceKeyStatusModifier'
PrestaShop\PrestaShop\Adapter\Webservice\WebserviceKeyStatusModifier:
public: false
arguments:
- '@translator'

prestashop.adapter.webservice.webservice_key_status_modifier:
alias: 'PrestaShop\PrestaShop\Adapter\Webservice\WebserviceKeyStatusModifier'
deprecated:
package: PrestaShop\PrestaShop
version: 9.0

prestashop.adapter.webservice.query_handler.get_webservice_key_for_editing_handler:
class: 'PrestaShop\PrestaShop\Adapter\Webservice\QueryHandler\GetWebserviceKeyForEditingHandler'
autoconfigure: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,15 @@ services:
arguments:
- '@prestashop.core.sql_manager.configuration.sql_request_configuration'

PrestaShopBundle\Form\Admin\Configure\AdvancedParameters\Webservice\WebserviceFormDataProvider:
public: false
autowire: true

prestashop.admin.webservice.form_data_provider:
class: 'PrestaShopBundle\Form\Admin\Configure\AdvancedParameters\Webservice\WebserviceFormDataProvider'
arguments:
- '@prestashop.adapter.webservice.configuration'
alias: 'PrestaShopBundle\Form\Admin\Configure\AdvancedParameters\Webservice\WebserviceFormDataProvider'
deprecated:
package: PrestaShop\PrestaShop
version: 9.0

prestashop.admin.backup.form_data_provider:
class: 'PrestaShopBundle\Form\Admin\Configure\AdvancedParameters\Backup\BackupDataProvider'
Expand Down
14 changes: 11 additions & 3 deletions src/PrestaShopBundle/Resources/config/services/core/webservice.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,19 @@
services:
_defaults:
public: true
public: false

prestashop.core.webservice.server_requirements_checker:
class: 'PrestaShop\PrestaShop\Core\Webservice\ServerRequirementsChecker'
PrestaShop\PrestaShop\Core\Webservice\ServerRequirementsChecker:
arguments:
- '@translator'
- '@prestashop.adapter.legacy.configuration'
- '@prestashop.adapter.hosting_information'
- '@prestashop.core.configuration.php_extension_checker'

PrestaShop\PrestaShop\Core\Webservice\ServerRequirementsCheckerInterface: '@PrestaShop\PrestaShop\Core\Webservice\ServerRequirementsChecker'

prestashop.core.webservice.server_requirements_checker:
public: true
alias: 'PrestaShop\PrestaShop\Core\Webservice\ServerRequirementsChecker'
deprecated:
package: PrestaShop\PrestaShop
version: 9.0

0 comments on commit 42a1e14

Please sign in to comment.