HEX
Server: Apache/2
System: Linux chaudang 3.10.0-1160.119.1.el7.x86_64 #1 SMP Tue Jun 4 14:43:51 UTC 2024 x86_64
User: mgawa (1021)
PHP: 7.3.33
Disabled: NONE
Upload Files
File: /home/mgawa/public_html/wp-content/plugins/wp-google-maps/includes/class.query-fragment.php
<?php

namespace WPGMZA;

if(!defined('ABSPATH'))
	return;

class QueryFragment implements \ArrayAccess, \Countable
{
	private $nextIndex = 0;
	
	public function offsetExists($offset)
	{
		return property_exists($this, $offset);
	}
	
	public function offsetGet($offset)
	{
		return $this->{$offset};
	}
	
	public function offsetSet($offset, $value)
	{
		if(!$offset)
			$offset = $this->nextIndex++;
		
		$this->{$offset} = $value;
	}
	
	public function offsetUnset($offset)
	{
		unset($this->{$offset});
	}
	
	public function reset()
	{
		foreach($this as $key => $value)
			unset($this->{$key});
	}
	
	public function toArray()
	{
		$arr = (array)$this;
		
		array_shift($arr);
		
		return $arr;
	}
	
	public function count()
	{
		$count = 0;
		
		foreach($this as $key => $value)
			$count++;
		
		return $count - 1;
	}
	
	public function clear()
	{
		foreach($this as $key => $value)
		{
			if($key == 'nextIndex')
				continue;
				
			unset($this->{$key});
		}
	}
}

class_alias('WPGMZA\\QueryFragment', 'WPGMZA\\QueryFields');