/** * Throws an deprecated exception if given version is older than * the current project version. * * If no message is given, an auto-generated message will be used * which contains type/method & location where this method has been * invoked - respectively the location of the deprecated code. * * @param string $namespace_ * @param \Components\Version $version_ * @param string $message_ * * @throws \Components\Deprecated */ public static function since($namespace_, Version $version_, $message_ = null) { // ignore for production. if (Environment::isLive()) { return; } if (0 > Runtime::version()->compareTo($version_)) { if (null === $message_) { throw static::createDefaultException($namespace_); } throw new static($namespace_, $message_, null, true); } }
/** * @return \Components\Test_Cli */ public static function get() { $instance = new static(); $year = date('Y'); $version = (string) Runtime::version(); $instance->addOption('p', true, null, 'test root path', 'path'); $instance->addOption('b', true, null, 'build path', 'build'); $instance->addOption('c', true, null, 'configuration path', 'config'); $instance->addEmptyOption(); $instance->addOption('a', true, null, 'enable static code analyzers [emma,..]', 'analyzers'); $instance->addEmptyOption(); $instance->addOption('h', false, null, 'print command line instructions', 'help'); $instance->addOption('v', false, null, 'print program version & license', 'version'); $instance->setInfo(sprintf('%1$s%3$s%2$s%3$s', "Test Executor {$version}, net.evalcode.components", "Copyright (C) {$year} evalcode.net", Io::LINE_SEPARATOR_DEFAULT)); return $instance; }