Function __global->object_factory

Definitions

sources/global.php

  • Make an object of the given class.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$class string No No required parameter N/A N/A The class name
$failure_ok boolean No No False N/A N/A Whether to return null if there is no such class
$parameters array No No [] N/A N/A Array of parameters

Returns

  • The object (null: could not create)
  • Type: ?object
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Make an object of the given class.
 *
 * @param  string $class The class name
 * @param  boolean $failure_ok Whether to return null if there is no such class
 * @param  array $parameters Array of parameters
 * @return ?object The object (null: could not create)
 */

function object_factory(string $class, bool $failure_ok = false, array $parameters = []) : ?object
 

sources/minikernel.php

  • Make an object of the given class.
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: object

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$class string No No required parameter N/A N/A The class name
$failure_ok boolean No No False N/A N/A Whether to return null if there is no such class
$parameters array No No [] N/A N/A Array of parameters

Returns

  • The object (null: could not create)
  • Type: ?object
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Make an object of the given class.
 *
 * @param  string $class The class name
 * @param  boolean $failure_ok Whether to return null if there is no such class
 * @param  array $parameters Array of parameters
 * @return ?object The object (null: could not create)
 */

function object_factory(string $class, bool $failure_ok = false, array $parameters = []) : ?object