🔐 Sid Gifari File Manager Pro
v8.0.5 | 2026-06-19 11:11:36 | PHP 8.1.34
📂
/ (Root)
/
home
/
therahul
/
thedasstores.com
/
wp-content
/
plugins
/
google-listings-and-ads
/
src
/
Value
📍 /home/therahul/thedasstores.com/wp-content/plugins/google-listings-and-ads/src/Value
🔄 Refresh
✏️
Editing: ArrayWithRequiredKeys.php
Writable
<?php declare( strict_types=1 ); namespace Automattic\WooCommerce\GoogleListingsAndAds\Value; use Automattic\WooCommerce\GoogleListingsAndAds\Exception\InvalidArray; defined( 'ABSPATH' ) || exit; /** * Class ArrayWithRequiredKeys * * @package Automattic\WooCommerce\GoogleListingsAndAds\Value */ abstract class ArrayWithRequiredKeys { /** * The provided data. * * @var array */ protected $data; /** * Array of required keys. Should be in key => value format. * * @var array */ protected $required_keys = []; /** * ArrayWithRequiredKeys constructor. * * @param array $data */ public function __construct( array $data ) { $this->validate_keys( $data ); $this->data = $data; } /** * Validate that we have all of the keys that we require. * * @param array $data Array of provided data. * * @throws InvalidArray When any of the required keys are missing. */ protected function validate_keys( array $data ) { $missing = array_diff_key( $this->required_keys, $data ); if ( ! empty( $missing ) ) { throw InvalidArray::missing_keys( static::class, array_keys( $missing ) ); } } }
💾 Save Changes
❌ Cancel