HEX
Server: Apache/2.4.62 (Debian)
System: Linux plxsite 6.8.0-47-generic #47-Ubuntu SMP PREEMPT_DYNAMIC Fri Sep 27 21:40:26 UTC 2024 x86_64
User: root (0)
PHP: 8.1.30
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/plugins/admin-menu-editor/customizables/Schemas/Record.php
<?php

namespace YahnisElsts\AdminMenuEditor\Customizable\Schemas;

class Record extends Collection {
	public function __construct(Schema $keySchema, Schema $itemSchema, $label = null) {
		//Keys must be strings. An enum with only string values is also acceptable.
		$keysAreStrings = ($keySchema instanceof StringSchema)
			|| (($keySchema instanceof Enum) && $keySchema->areAllValuesStrings());
		if ( !$keysAreStrings ) {
			throw new \InvalidArgumentException('Key schema for Record must be a string schema or an enum with string values.');
		}

		parent::__construct($itemSchema, $keySchema, $label);
		$this->keySchema = $keySchema;
	}
}