Skip to content

Commit

Permalink
Move files into helpers directory
Browse files Browse the repository at this point in the history
  • Loading branch information
Skouat committed Dec 21, 2024
1 parent 26c82cc commit 08c99e2
Show file tree
Hide file tree
Showing 15 changed files with 31 additions and 31 deletions.
2 changes: 1 addition & 1 deletion actions/core.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class core
* @param config $config Config object
* @param language $language Language user object
* @param \skouat\ppde\notification\core $notification PPDE Notification object
* @param path_helper $path_helper Path helper object
* @param path_helper $path_helper Path helpers object
* @param \skouat\ppde\entity\transactions $ppde_entity_transaction Transaction entity object
* @param \skouat\ppde\operators\transactions $ppde_operator_transaction Transaction operator object
* @param dispatcher_interface $dispatcher Dispatcher object
Expand Down
16 changes: 8 additions & 8 deletions actions/post_data.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,27 @@

use phpbb\language\language;
use phpbb\request\request;
use skouat\ppde\operators\compare;
use skouat\ppde\helpers\compare_helper;

class post_data
{
private const ASCII_RANGE = '1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';

protected $language;
protected $ppde_operator_compare;
protected $compare_helper;
protected $request;

/**
* Constructor
*
* @param language $language Language object
* @param compare $ppde_operator_compare Compare operator object
* @param request $request Request object
* @param language $language Language object
* @param compare_helper $compare_helper Compare operator object
* @param request $request Request object
*/
public function __construct(language $language, compare $ppde_operator_compare, request $request)
public function __construct(language $language, compare_helper $compare_helper, request $request)
{
$this->language = $language;
$this->ppde_operator_compare = $ppde_operator_compare;
$this->compare_helper = $compare_helper;
$this->request = $request;
}

Expand Down Expand Up @@ -136,7 +136,7 @@ public function call_func(array $data_ary): array
*/
public function check_post_data_length($value, $statement): bool
{
return $this->ppde_operator_compare->compare_value(strlen($value), $statement['value'], $statement['operator']);
return $this->compare_helper->compare_value(strlen($value), $statement['value'], $statement['operator']);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion config/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ services:
class: skouat\ppde\actions\post_data
arguments:
- '@language'
- '@skouat.ppde.operator.compare'
- '@skouat.ppde.helpers.compare'
- '@request'

skouat.ppde.actions.vars:
Expand Down
2 changes: 1 addition & 1 deletion config/controllers.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ services:
arguments:
- '@config'
- '@service_container'
- '@controller.helper'
- '@controller.helpers'
- '@language'
- '@skouat.ppde.actions.auth'
- '@skouat.ppde.actions.currency'
Expand Down
9 changes: 6 additions & 3 deletions config/includes.yml → config/helpers.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
services:
skouat.ppde.includes.transaction_template_helper:
skouat.ppde.helpers.compare:
class: skouat\ppde\helpers\compare_helper

skouat.ppde.helpers.transaction_template_helper:
class: skouat\ppde\includes\transaction_template_helper
arguments:
- '@template'
Expand All @@ -10,8 +13,8 @@ services:
- '%core.root_path%'
- '%core.php_ext%'

skouat.ppde.includes.transaction_validator:
class: skouat\ppde\includes\transaction_validator
skouat.ppde.includes.transaction_validator_helper:
class: skouat\ppde\includes\transaction_validator_helper
arguments:
- '@language'
- '@request'
Expand Down
3 changes: 0 additions & 3 deletions config/operators.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
services:
skouat.ppde.operator.compare:
class: skouat\ppde\operators\compare

skouat.ppde.operator.currency:
class: skouat\ppde\operators\currency
arguments:
Expand Down
2 changes: 1 addition & 1 deletion config/services.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ services:
class: skouat\ppde\event\listener
arguments:
- '@config'
- '@controller.helper'
- '@controller.helpers'
- '@language'
- '@skouat.ppde.controller'
- '@skouat.ppde.controller.main.displaystats'
Expand Down
6 changes: 3 additions & 3 deletions controller/admin/transactions_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
use skouat\ppde\actions\core;
use skouat\ppde\actions\currency;
use skouat\ppde\exception\transaction_exception;
use skouat\ppde\includes\transaction_template_helper;
use skouat\ppde\includes\transaction_validator;
use skouat\ppde\helpers\transaction_template_helper;
use skouat\ppde\helpers\transaction_validator_helper;
use skouat\ppde\operators\transactions;
use Symfony\Component\DependencyInjection\ContainerInterface;

Expand Down Expand Up @@ -86,7 +86,7 @@ public function __construct(
template $template,
user $user,
transaction_template_helper $template_helper,
transaction_validator $transaction_validator,
transaction_validator_helper $transaction_validator,
string $adm_relative_path,
string $phpbb_root_path,
string $php_ext
Expand Down
2 changes: 1 addition & 1 deletion controller/ipn_log.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class ipn_log
*
* @param config $config Config object
* @param filesystem_interface $filesystem phpBB's filesystem service
* @param path_helper $path_helper Path helper object
* @param path_helper $path_helper Path helpers object
* @param main_controller $ppde_controller_main Main controller
*/
public function __construct(
Expand Down
2 changes: 1 addition & 1 deletion controller/main_controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class main_controller
*
* @param config $config Config object
* @param ContainerInterface $container Service container interface
* @param helper $helper Controller helper object
* @param helper $helper Controller helpers object
* @param language $language Language user object
* @param \skouat\ppde\actions\auth $actions_auth PPDE auth actions object
* @param \skouat\ppde\actions\currency $actions_currency PPDE currency actions object
Expand Down
2 changes: 1 addition & 1 deletion entity/donation_pages.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ public function message_enable_bbcode()
}

/**
* Set option helper
* Set option helpers
*
* @param int $option_value Value of the option
* @param bool $negate Negate (unset) option (Default: False)
Expand Down
2 changes: 1 addition & 1 deletion event/listener.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class listener implements EventSubscriberInterface
* Constructor
*
* @param config $config Config object
* @param helper $controller_helper Controller helper object
* @param helper $controller_helper Controller helpers object
* @param language $language Language user object
* @param main_controller $ppde_controller_main PPDE main controller object
* @param main_display_stats $ppde_controller_display_stats Display stats controller object
Expand Down
6 changes: 3 additions & 3 deletions operators/compare.php → helpers/compare_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
*
* PayPal Donation extension for the phpBB Forum Software package.
*
* @copyright (c) 2015-2020 Skouat
* @copyright (c) 2015-2024 Skouat
* @license GNU General Public License, version 2 (GPL-2.0)
*
*/

namespace skouat\ppde\operators;
namespace skouat\ppde\helpers;

class compare
class compare_helper
{
/** @var array */
private static $operators_table = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
*/

namespace skouat\ppde\includes;
namespace skouat\ppde\helpers;

use phpbb\template\template;
use phpbb\language\language;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
*
*/

namespace skouat\ppde\includes;
namespace skouat\ppde\helpers;

use phpbb\language\language;
use phpbb\request\request;
use phpbb\user;
use phpbb\user_loader;
use skouat\ppde\exception\transaction_exception;

class transaction_validator
class transaction_validator_helper
{
/** @var language */
protected $language;
Expand Down

0 comments on commit 08c99e2

Please sign in to comment.