mirror of
https://github.com/woocommerce/woocommerce-paypal-payments.git
synced 2025-08-31 06:52:50 +08:00
Add Container typehint to all service definitions
This commit is contained in:
parent
3d39f3b2a9
commit
cabcb7d9e4
8 changed files with 101 additions and 94 deletions
|
@ -9,11 +9,12 @@ declare(strict_types=1);
|
|||
|
||||
namespace WooCommerce\PayPalCommerce\Session;
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
use WooCommerce\PayPalCommerce\Session\Cancellation\CancelController;
|
||||
use WooCommerce\PayPalCommerce\Session\Cancellation\CancelView;
|
||||
|
||||
return array(
|
||||
'session.handler' => function ( $container ) : SessionHandler {
|
||||
'session.handler' => function ( ContainerInterface $container ) : SessionHandler {
|
||||
|
||||
if ( is_null( WC()->session ) ) {
|
||||
return new SessionHandler();
|
||||
|
@ -26,10 +27,10 @@ return array(
|
|||
WC()->session->set( SessionHandler::ID, $session_handler );
|
||||
return $session_handler;
|
||||
},
|
||||
'session.cancellation.view' => function ( $container ) : CancelView {
|
||||
'session.cancellation.view' => function ( ContainerInterface $container ) : CancelView {
|
||||
return new CancelView();
|
||||
},
|
||||
'session.cancellation.controller' => function ( $container ) : CancelController {
|
||||
'session.cancellation.controller' => function ( ContainerInterface $container ) : CancelController {
|
||||
return new CancelController(
|
||||
$container->get( 'session.handler' ),
|
||||
$container->get( 'session.cancellation.view' )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue