HEX
Server: Apache/2.4.54 (Debian)
System: Linux a5825d2beacc 4.15.0-197-generic #208-Ubuntu SMP Tue Nov 1 17:23:37 UTC 2022 x86_64
User: root (0)
PHP: 8.1.14
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/themes/Divi/includes/builder/module/field/Factory.php
<?php

require_once 'Base.php';

class ET_Builder_Module_Fields_Factory {

	protected static $fields = array();

	/**
	 * @param $fields_type
	 *
	 * @return ET_Builder_Module_Field_Base
	 */
	public static function get( $fields_type ) {
		if ( ! isset( self::$fields[ $fields_type ] ) ) {
			$file = implode( DIRECTORY_SEPARATOR, array( ET_BUILDER_DIR, 'module', 'field', "$fields_type.php" ) );

			$instance = file_exists( $file ) ? require_once( $file ) : null;

			self::$fields[ $fields_type ] = $instance instanceof ET_Builder_Module_Field_Base ? $instance : null;
		}

		return self::$fields[ $fields_type ];
	}
}