Permalink
Browse files

Appending period to error and exception messages where missing.

  • Loading branch information...
1 parent aa00f4c commit 5c0ba726b2ae99955334a5cb6433fa075c8a042f @davidpersson davidpersson committed with nateabele Feb 15, 2011
@@ -116,7 +116,7 @@ public static function run($request, array $options = array()) {
$params = $self::applyRules($result->params);
if (!$params) {
- throw new DispatchException('Could not route request');
+ throw new DispatchException('Could not route request.');
}
$callable = $self::invokeMethod('_callable', array($result, $params, $options));
return $self::invokeMethod('_call', array($callable, $result, $params));
@@ -195,7 +195,7 @@ protected static function _callable($request, $params, $options) {
try {
return Libraries::instance('controllers', $controller, $options);
} catch (ClassNotFoundException $e) {
- throw new DispatchException("Controller `{$controller}` not found", null, $e);
+ throw new DispatchException("Controller `{$controller}` not found.", null, $e);
}
});
}
@@ -206,7 +206,7 @@ protected static function _call($callable, $request, $params) {
if (is_callable($callable = $params['callable'])) {
return $callable($params['request'], $params['params']);
}
- throw new DispatchException('Result not callable');
+ throw new DispatchException('Result not callable.');
});
}
}
@@ -106,7 +106,7 @@ public function render() {
$code = 302;
}
if (!$status = $this->status($code)) {
- throw new UnexpectedValueException('Invalid status code');
+ throw new UnexpectedValueException('Invalid status code.');
}
$this->_writeHeader($status);
@@ -90,7 +90,7 @@ public function __construct(array $config = array()) {
if ($conn = fsockopen($host, $port, $message, $code)) {
return $conn;
}
- throw new NetworkException("Growl connection failed: (`{$code}`) `{$message}`");
+ throw new NetworkException("Growl connection failed: (`{$code}`) `{$message}`.");
}
);
parent::__construct($config + $defaults);
@@ -130,7 +130,7 @@ protected static function _callable($request, $params, $options) {
if (class_exists($class = Libraries::locate('command', $name))) {
return new $class(compact('request'));
}
- throw new UnexpectedValueException("Command `{$name}` not found");
+ throw new UnexpectedValueException("Command `{$name}` not found.");
});
}
@@ -191,7 +191,7 @@ protected static function _call($callable, $request, $params) {
}
return $callable($params['action'], $params['args']);
}
- throw new UnexpectedValueException("`{$callable}` not callable");
+ throw new UnexpectedValueException("`{$callable}` not callable.");
});
}
}
@@ -214,7 +214,7 @@ public function extract($name = 'new', $result = null) {
*/
public function archive($name = null, $result = null) {
if (ini_get('phar.readonly') == '1') {
- throw new RuntimeException('set `phar.readonly` to `0` in `php.ini`');
+ throw new RuntimeException('set `phar.readonly` to `0` in `php.ini`.');
}
$from = $name;
$to = $name;
@@ -428,7 +428,7 @@ public static function load($class, $require = false) {
static::$_cachedPaths[$class] = $path;
method_exists($class, '__init') ? $class::__init() : null;
} elseif ($require) {
- throw new RuntimeException("Failed to load `{$class}` from `{$path}`");
+ throw new RuntimeException("Failed to load `{$class}` from `{$path}`.");
}
}
@@ -387,7 +387,7 @@ public static function __callStatic($method, $params) {
preg_match('/^findBy(?P<field>\w+)$|^find(?P<type>\w+)By(?P<fields>\w+)$/', $method, $args);
if (!$args) {
- $message = "Method `%s` not defined or handled in class `%s`";
+ $message = "Method `%s` not defined or handled in class `%s`.";
throw new BadMethodCallException(sprintf($message, $method, get_class($self)));
}
$field = Inflector::underscore($args['field'] ? $args['field'] : $args['fields']);
@@ -893,7 +893,7 @@ public static function &connection() {
if ($conn = $connections::get($name)) {
return $conn;
}
- throw new ConfigException("The data connection `{$name}` is not configured");
+ throw new ConfigException("The data connection `{$name}` is not configured.");
}
/**
@@ -530,7 +530,7 @@ protected function _associate($related) {
$config = array();
}
if (!$relation = $model::relations($name)) {
- throw new QueryException("Related model not found");
+ throw new QueryException("Related model not found.");
}
$config += $relation->data();
}
@@ -390,7 +390,7 @@ public function renderCommand($type, $data = null, $context = null) {
$type = $context->type();
}
if (!isset($this->_strings[$type])) {
- throw new InvalidArgumentException("Invalid query type `{$type}`");
+ throw new InvalidArgumentException("Invalid query type `{$type}`.");
}
$data = array_filter($data);
return trim(String::insert($this->_strings[$type], $data, array('clean' => true)));
@@ -70,7 +70,7 @@ public static function __callStatic($method, $params = array()) {
$tags = static::invokeMethod('decompose', $params);
if (!isset(static::$_tags[$method])) {
- throw new BadMethodCallException("Invalid locale tag `{$method}`");
+ throw new BadMethodCallException("Invalid locale tag `{$method}`.");
}
return isset($tags[$method]) ? $tags[$method] : null;
}
@@ -109,7 +109,7 @@ public static function decompose($locale) {
$regex .= '(?:[_-](?P<variant>[a-z]{5,}))?';
if (!preg_match("/^{$regex}$/i", $locale, $matches)) {
- throw new InvalidArgumentException("Locale `{$locale}` could not be parsed");
+ throw new InvalidArgumentException("Locale `{$locale}` could not be parsed.");
}
return array_filter(array_intersect_key($matches, static::$_tags));
}
@@ -49,7 +49,7 @@ protected function _init() {
parent::_init();
if (!is_dir($this->_config['path'])) {
throw new ConfigException(
- "Code directory does not exist at `{$this->_config['path']}`"
+ "Code directory does not exist at `{$this->_config['path']}`."
);
}
}
@@ -92,7 +92,7 @@ public function __construct(array $config = array()) {
protected function _init() {
parent::_init();
if (!is_dir($this->_config['path'])) {
- $message = "Gettext directory does not exist at `{$this->_config['path']}`";
+ $message = "Gettext directory does not exist at `{$this->_config['path']}`.";
throw new ConfigException($message);
}
}
@@ -266,7 +266,7 @@ protected function _parseMo($stream) {
$stat = fstat($stream);
if ($stat['size'] < self::MO_HEADER_SIZE) {
- throw new RangeException("MO stream caontent has an invalid format");
+ throw new RangeException("MO stream caontent has an invalid format.");
}
$magic = unpack('V1', fread($stream, 4));
$magic = hexdec(substr(dechex(current($magic)), -8));
@@ -276,7 +276,7 @@ protected function _parseMo($stream) {
} elseif ($magic == self::MO_BIG_ENDIAN_MAGIC) {
$isBigEndian = true;
} else {
- throw new RangeException("MO stream content has an invalid format");
+ throw new RangeException("MO stream content has an invalid format.");
}
$header = array(
@@ -71,7 +71,7 @@ public function __construct(array $config = array()) {
protected function _init() {
parent::_init();
if (!is_dir($this->_config['path'])) {
- throw new ConfigException("Php directory does not exist at `{$this->_config['path']}`");
+ throw new ConfigException("Php directory does not exist at `{$this->_config['path']}`.");
}
}
@@ -553,7 +553,7 @@ public static function render(&$response, $data = null, array $options = array()
$type = $options['type'];
if (!isset($handlers[$type])) {
- throw new MediaException("Unhandled media type `{$type}`");
+ throw new MediaException("Unhandled media type `{$type}`.");
}
$handler = $options + $handlers[$type] + $defaults;
$filter = function($v) { return $v !== null; };
@@ -77,7 +77,7 @@ public static function template($file, array $options = array()) {
if ($options['fallback']) {
return $file;
}
- throw new TemplateException("Could not write compiled template `{$template}` to cache");
+ throw new TemplateException("Could not write compiled template `{$template}` to cache.");
}
/**
@@ -294,7 +294,7 @@ public function helper($name, $config = array()) {
if ($class = Libraries::locate('helper', ucfirst($name))) {
return $this->_helpers[$name] = new $class($config + array('context' => $this));
}
- throw new RuntimeException("Helper `{$name}` not found");
+ throw new RuntimeException("Helper `{$name}` not found.");
}
/**
@@ -173,7 +173,7 @@ protected function _paths($type, array $params) {
}
return $path;
}
- throw new TemplateException("Template not found at `{$path}`");
+ throw new TemplateException("Template not found at `{$path}`.");
}
}
@@ -121,7 +121,7 @@ public function skip() {
* @param string $message Message to pass if the condition is met.
* @return mixed
*/
- public function skipIf($condition, $message = 'Skipped test `{:class}::{:function}()`') {
+ public function skipIf($condition, $message = 'Skipped test `{:class}::{:function}()`.') {
if (!$condition) {
return;
}
@@ -546,7 +546,7 @@ public static function add($name, $rule = null, array $options = array()) {
*/
public static function rule($rule, $value, $format = 'any', array $options = array()) {
if (!isset(static::$_rules[$rule])) {
- throw new InvalidArgumentException("Rule `{$rule}` is not a validation rule");
+ throw new InvalidArgumentException("Rule `{$rule}` is not a validation rule.");
}
$defaults = isset(static::$_options[$rule]) ? static::$_options[$rule] : array();
$options = (array) $options + $defaults + static::$_options['defaults'];

0 comments on commit 5c0ba72

Please sign in to comment.