Skip to content

Commit

Permalink
downgrade dhii/module-interface to 0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
websupporter committed Sep 16, 2020
1 parent c09e314 commit ddd4f5b
Show file tree
Hide file tree
Showing 11 changed files with 102 additions and 21 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
}
],
"require": {
"dhii/module-interface": "0.2.x-dev",
"dhii/module-interface": "0.1",
"psr/container": "^1.0",
"oomphinc/composer-installers-extender": "^1.1",
"container-interop/service-provider": "^0.4.0",
Expand Down
10 changes: 9 additions & 1 deletion modules/ppcp-admin-notices/src/class-adminnotices.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public function setup(): ServiceProviderInterface {
*
* @param ContainerInterface $container The container.
*/
public function run( ContainerInterface $container ) {
public function run( ContainerInterface $container = null ) {
add_action(
'admin_notices',
function() use ( $container ) {
Expand All @@ -45,4 +45,12 @@ function() use ( $container ) {
}
);
}

/**
* Returns the key for the module.
*
* @return string|void
*/
public function getKey() {
}
}
10 changes: 9 additions & 1 deletion modules/ppcp-api-client/src/class-apimodule.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,14 @@ public function setup(): ServiceProviderInterface {
*
* @param ContainerInterface $container The container.
*/
public function run( ContainerInterface $container ) {
public function run( ContainerInterface $container = null ) {
}

/**
* Returns the key for the module.
*
* @return string|void
*/
public function getKey() {
}
}
12 changes: 10 additions & 2 deletions modules/ppcp-button/src/class-buttonmodule.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ public function setup(): ServiceProviderInterface {
/**
* Runs the module.
*
* @param ContainerInterface $container The Container.
* @param ContainerInterface|null $container The Container.
*/
public function run( ContainerInterface $container ) {
public function run( ContainerInterface $container = null ) {

add_action(
'wp',
Expand Down Expand Up @@ -151,4 +151,12 @@ static function () use ( $container ) {
}
);
}

/**
* Returns the key for the module.
*
* @return string|void
*/
public function getKey() {
}
}
12 changes: 10 additions & 2 deletions modules/ppcp-onboarding/src/class-onboardingmodule.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ public function setup(): ServiceProviderInterface {
/**
* Runs the module.
*
* @param ContainerInterface $container The container.
* @param ContainerInterface|null $container The container.
*/
public function run( ContainerInterface $container ) {
public function run( ContainerInterface $container = null ) {

$asset_loader = $container->get( 'onboarding.assets' );
/**
Expand Down Expand Up @@ -100,4 +100,12 @@ static function () use ( $container ) {
}
);
}

/**
* Returns the key for the module.
*
* @return string|void
*/
public function getKey() {
}
}
12 changes: 10 additions & 2 deletions modules/ppcp-session/src/class-sessionmodule.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public function setup(): ServiceProviderInterface {
/**
* Run the module.
*
* @param ContainerInterface $container The container.
* @param ContainerInterface|null $container The container.
*/
public function run( ContainerInterface $container ) {
public function run( ContainerInterface $container = null ) {
add_action(
'woocommerce_init',
function () use ( $container ) {
Expand All @@ -51,4 +51,12 @@ function () use ( $container ) {
}
);
}

/**
* Returns the key for the module.
*
* @return string|void
*/
public function getKey() {
}
}
12 changes: 10 additions & 2 deletions modules/ppcp-subscription/src/class-subscriptionmodule.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ public function setup(): ServiceProviderInterface {
/**
* Runs the module.
*
* @param ContainerInterface $container The container.
* @param ContainerInterface|null $container The container.
*/
public function run( ContainerInterface $container ) {
public function run( ContainerInterface $container = null ) {
add_action(
'woocommerce_scheduled_subscription_payment_' . PayPalGateway::ID,
static function ( $amount, $order ) use ( $container ) {
Expand All @@ -51,4 +51,12 @@ static function ( $amount, $order ) use ( $container ) {
2
);
}

/**
* Returns the key for the module.
*
* @return string|void
*/
public function getKey() {
}
}
17 changes: 13 additions & 4 deletions modules/ppcp-wc-gateway/src/class-wcgatewaymodule.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ public function setup(): ServiceProviderInterface {
/**
* Runs the module.
*
* @param ContainerInterface $container The container.
* @param ContainerInterface|null $container The container.
*/
public function run( ContainerInterface $container ) {
public function run( ContainerInterface $container = null ) {
$this->register_payment_gateways( $container );
$this->register_order_functionality( $container );
$this->register_columns( $container );
Expand Down Expand Up @@ -164,9 +164,9 @@ static function () use ( $container ) {
/**
* Registers the payment gateways.
*
* @param ContainerInterface $container The container.
* @param ContainerInterface|null $container The container.
*/
private function register_payment_gateways( ContainerInterface $container ) {
private function register_payment_gateways( ContainerInterface $container = null ) {

add_filter(
'woocommerce_payment_gateways',
Expand Down Expand Up @@ -356,4 +356,13 @@ static function ( ...$args ) use ( $container ) {
2
);
}


/**
* Returns the key for the module.
*
* @return string|void
*/
public function getKey() {
}
}
12 changes: 10 additions & 2 deletions modules/ppcp-webhooks/src/class-webhookmodule.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public function setup(): ServiceProviderInterface {
/**
* Run the Webhook module.
*
* @param ContainerInterface $container The Container.
* @param ContainerInterface|null $container The Container.
*/
public function run( ContainerInterface $container ) {
public function run( ContainerInterface $container = null ) {
add_action(
'rest_api_init',
static function () use ( $container ) {
Expand Down Expand Up @@ -76,4 +76,12 @@ static function () use ( $container ) {
}
);
}

/**
* Returns the key for the module.
*
* @return string|void
*/
public function getKey() {
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ public function setup(): ServiceProviderInterface {
*
* @param ContainerInterface $container The container.
*/
public function run( ContainerInterface $container ) {
public function run( ContainerInterface $container = null ) {
}


/**
* Returns the key for the module.
*
* @return string|void
*/
public function getKey() {
}
}
13 changes: 10 additions & 3 deletions src/class-pluginmodule.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,16 @@ public function setup(): ServiceProviderInterface {
/**
* Runs the module.
*
* @param ContainerInterface $container The Container.
* @param ContainerInterface|null $container The Container.
*/
public function run( ContainerInterface $container ) {
// TODO: Implement run() method.
public function run( ContainerInterface $container = null ) {
}

/**
* Returns the key for the module.
*
* @return string|void
*/
public function getKey() {
}
}

0 comments on commit ddd4f5b

Please sign in to comment.