class_name = $class_name; $this->dependencies = $dependencies; $this->scopes = $scopes; $this->method = $method; $this->factory_method = $factory_method; } /** * @return array */ public function get_dependencies() { return $this->dependencies; } /** * @return string */ public function get_class_name() { return $this->class_name; } /** * @return string */ public function get_method() { return $this->method; } /** * @return array */ public function get_scopes() { return $this->scopes; } /** * @return callable|null */ public function get_factory_method() { return $this->factory_method; } /** * @return IWPML_Upgrade_Command */ public function create() { if ( $this->get_factory_method() ) { $factory_method = $this->get_factory_method(); return $factory_method(); } $class_name = $this->get_class_name(); return new $class_name( $this->get_dependencies() ); } }