HEX
Server: Apache/2.4.65 (Debian)
System: Linux web6 5.10.0-36-amd64 #1 SMP Debian 5.10.244-1 (2025-09-29) x86_64
User: innocamp (1028)
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: /home/csm/public_html/wp-content/plugins/wordpress-popup/inc/class-hustle-condition-factory.php
<?php
/**
 * File for Hustle_Condition_Factory class.
 *
 * @package Hustle
 * @since unknwon
 */

/**
 * Factory to instantiate display conditions
 *
 * Class Hustle_Condition_Factory
 */
class Hustle_Condition_Factory {

	/**
	 * Callback to use with preg_replace_callback in self::build
	 *
	 * @param array $matches Matches.
	 * @return string
	 */
	private static function preg_replace_callback( $matches ) {
		return $matches[1] . ucfirst( $matches[2] );
	}

	/**
	 * Instantiates and returns instance of Opt_In_Condition_Abstract
	 *
	 * @param string $condition_key Condition slug.
	 * @param array  $args Arguments for the condition.
	 * @return Opt_In_Condition_Abstract
	 */
	public static function build( $condition_key, $args ) {
		$class = 'Opt_In_Condition_' . preg_replace_callback(
			'/(\\_)([A-Za-z]+)/ui',
			array( __CLASS__, 'preg_replace_callback' ),
			ucfirst( $condition_key )
		);

		return ( class_exists( $class ) )
			? new $class( $args )
			: false;
	}
}