Create New Item
Item Type
File
Folder
Item Name
Search file in folder and subfolders...
Are you sure want to rename?
File Manager
/
wp-content
/
plugins
/
woocommerce-paypal-payments
/
modules
/
ppcp-wc-gateway
/
src
/
Helper
:
DisplayManager.php
Advanced Search
Upload
New Item
Settings
Back
Back Up
Advanced Editor
Save
<?php /** * Helper to manage the field display behaviour. * * @package WooCommerce\PayPalCommerce\WcGateway\Helper; */ declare(strict_types=1); namespace WooCommerce\PayPalCommerce\WcGateway\Helper; use WooCommerce\PayPalCommerce\WcGateway\Settings\Settings; /** * DisplayManager class. */ class DisplayManager { /** * The settings. * * @var Settings */ private $settings; /** * The rules. * * @var array */ protected $rules = array(); /** * FieldDisplayManager constructor. * * @param Settings $settings The settings. * @return void */ public function __construct( Settings $settings ) { $this->settings = $settings; } /** * Creates and returns a rule. * * @param string|null $key The rule key. * @return DisplayRule */ public function rule( string $key = null ): DisplayRule { if ( null === $key ) { $key = '_rule_' . ( (string) count( $this->rules ) ); } $rule = new DisplayRule( $key, $this->settings ); $this->rules[ $key ] = $rule; return $rule; } }