HEX
Server: Apache/2.4.41 (Ubuntu)
System: Linux wordpress-ubuntu-s-2vcpu-4gb-fra1-01 5.4.0-169-generic #187-Ubuntu SMP Thu Nov 23 14:52:28 UTC 2023 x86_64
User: root (0)
PHP: 7.4.33
Disabled: pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare,
Upload Files
File: /var/www/delta/wp-content/plugins/sitepress-multilingual-cms/vendor/wpml/fp/core/FP.php
<?php

namespace WPML\FP;
use WPML\Collect\Support\Traits\Macroable;

/**
 * @deprecated Use Fn instead
 *
 * @method static callable|mixed map( callable ...$fn, mixed ...$target ) - Curried :: (a -> b) -> f a -> f b
 * @method static callable|mixed identity( mixed ...$data ) - Curried :: a -> a
 * @method static callable|mixed always( ...$a, ...$b ) - Curried :: a -> b -> a
 * @method static callable|mixed reduce( ...$fn, ...$initial, ...$target ) - Curried :: ((a, b) → a) → a → [b] → a
 * @method static callable\mixed converge( ...$convergingFn, ...$branchingFns, ...$data ) - Curried :: callable -> [callable] -> mixed -> callable
 */
class FP {

	use Macroable;

	/**
	 * @return void
	 */
	public static function init(){
		self::macro( 'map', curryN(2, function( $fn, $target ){
			if ( is_object( $target ) ) {
				return $target->map( $fn );
			}
			if ( is_array( $target ) ) {
				return array_map( $fn, $target );
			}
			throw( new \InvalidArgumentException( 'target should be an object with map method or an array' ) );
		}));

		self::macro( 'identity', curryN( 1, function( $value ) { return $value; }));

		self::macro( 'always', curryN( 2, function ( $value, $_ ) { return $value; } ) );

		self::macro( 'reduce', curryN( 3, function( $fn, $initial, $target) {
			if ( is_object( $target ) ) {
				return $target->reduce( $fn, $initial );
			}
			if ( is_array( $target ) ) {
				return array_reduce( $target, $fn, $initial );
			}
			throw( new \InvalidArgumentException( 'target should be an object with reduce method or an array' ) );
		} ));

		self::macro( 'converge', curryN( 3, function( $convergingFn, array $branchingFns, $data ) {
			$apply = function ( $fn ) use ( $data ) { return $fn( $data ); };
			return call_user_func_array( $convergingFn, self::map( $apply, $branchingFns ) );
		}));
	}
}

FP::init();