com phpruntests: Moved factory method for better readability.: src/configuration/rtRuntestsConfiguration.php

From: Date: Wed, 13 May 2009 11:08:32 +0000
Subject: com phpruntests: Moved factory method for better readability.: src/configuration/rtRuntestsConfiguration.php
Groups: php.qa 
Request: Send a blank email to php-qa+get-66471@lists.php.net to get a copy of this message
Commit: 6f659c91ffb4a45024946fc15150e013d250f421 Author: Stefan Priebsch <spriebsch@php.net> Wed, 13 May 2009 11:08:32 +0000 Parents: cd9ea6f7b7ff1096bc890e0dc0e546898f2e825c Branches: master Link: http://git.php.net/?p=phpruntests.git;a=commitdiff;h=6f659c91ffb4a45024946fc15150e013d250f421 Log: Moved factory method for better readability. Changed paths: M src/configuration/rtRuntestsConfiguration.php Diff: diff --git a/src/configuration/rtRuntestsConfiguration.php b/src/configuration/rtRuntestsConfiguration.php index 025223d...c908dfe 100644 --- a/src/configuration/rtRuntestsConfiguration.php +++ b/src/configuration/rtRuntestsConfiguration.php @@ -46,6 +46,20 @@ abstract class rtRuntestsConfiguration 'PhpCommandLineArguments' => 'rtPhpCommandLineArgSetting', ); + /** + * Factory: returns rtRuntestsConfiguration subclass for the given os. + * + * @returns rtEnvironment + */ + static public function getInstance ($commandLineArgs, $os = 'Unix') + { + if ($os == 'Windows') { + return new rtWinConfiguration($commandLineArgs); + } else { + return new rtUnixConfiguration($commandLineArgs); + } + } + protected function init() { //parse command line @@ -58,7 +72,7 @@ abstract class rtRuntestsConfiguration } /** - * @todo spriebsch: is configure() the right name for this method, it checks preconditions? + * */ public function configure() { @@ -71,28 +85,6 @@ abstract class rtRuntestsConfiguration $object = new $className($this); $this->settings[$name] = $object->get(); } - //1 var_dump($this->settings); - - //check configuration preconditions - $preConditionList = rtPreConditionList::getInstance(); - - // $preConditionList->check($this->commandLine, $this->environmentVariables); - - $preConditionList->check($this); - } - - /** - * Factory: returns rtRuntestsConfiguration subclass for the given os. - * - * @returns rtEnvironment - */ - static public function getInstance ($commandLineArgs, $os = 'Unix') - { - if ($os == 'Windows') { - return new rtWinConfiguration($commandLineArgs); - } else { - return new rtUnixConfiguration($commandLineArgs); - } } /**

« previous php.qa (#66471) next »