config = $config; } /** * Constructs a new instance of this class, and allows chaining. * * @param array $config (Required) An associative array representing the Hadoop step configuration. * @return $this A reference to the current instance. */ public static function init($config) { if (version_compare(PHP_VERSION, '5.3.0', '<')) { throw new Exception('PHP 5.3 or newer is required to instantiate a new class with CLASS::init().'); } $self = get_called_class(); return new $self($config); } /** * Returns a JSON representation of the object when typecast as a string. * * @return string A JSON representation of the object. * @link http://www.php.net/manual/en/language.oop5.magic.php#language.oop5.magic.tostring PHP Magic Methods */ public function __toString() { return json_encode($this->config); } /** * Returns the configuration data. * * @return array The configuration data. */ public function get_config() { return $this->config; } }