Inpsyde\MultilingualPress\Factory\GenericFactory::with_default_class PHP Method

with_default_class() public static method

Returns a new factory object, instantiated with the given arguments.
Since: 3.0.0
public static with_default_class ( string $base, string $default_class ) : static
$base string Fully qualified name of the base class or interface.
$default_class string Fully qualified name of the default class.
return static Factory object.
    public static function with_default_class($base, $default_class)
    {
        return new static((string) $base, (string) $default_class);
    }

Usage Example

 /**
  * Constructor. Sets up the properties.
  *
  * @since 3.0.0
  *
  * @param string $default_class Optional. Fully qualified name of the default class. Defaults to
  *                              ErrorFactory::DEFAULT_CLASS.
  */
 public function __construct($default_class = ErrorFactory::DEFAULT_CLASS)
 {
     $this->factory = GenericFactory::with_default_class(ErrorFactory::BASE, (string) $default_class);
 }