Permalink
Browse files

Adding and replacing ticks/quotes with backticks in error and excepti…

…on messages.
  • Loading branch information...
1 parent c690b8b commit 583059bdcae523e9dd92ffdc6551db9897394d25 @davidpersson davidpersson committed with nateabele Feb 15, 2011
@@ -174,7 +174,7 @@ public function __invoke($request, $dispatchParams, array $options = array()) {
throw new DispatchException('Attempted to invoke a private method.');
}
if (!method_exists($self, $action)) {
- throw new DispatchException("Action '{$action}' not found.");
+ throw new DispatchException("Action `{$action}` not found.");
}
$render['template'] = $render['template'] ?: $action;
@@ -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);
}
});
}
@@ -59,7 +59,7 @@ protected function _init() {
* @deprecated
*/
public function disableCache() {
- $message = 'Request::disableCache() is deprecated. Please use Request::cache(false).';
+ $message = '`Request::disableCache()` is deprecated. Please use `Request::cache(false)`.';
throw new BadMethodCallException($message);
}
@@ -472,7 +472,7 @@ public static function dependencies($classes, array $options = array()) {
*/
protected static function _class($class) {
if (!class_exists($class)) {
- throw new RuntimeException(sprintf('Class "%s" could not be found.', $class));
+ throw new RuntimeException(sprintf('Class `%s` could not be found.', $class));
}
return unserialize(sprintf('O:%d:"%s":0:{}', strlen($class), $class));
}
@@ -105,7 +105,7 @@ public static function write($priority, $message, array $options = array()) {
if ($name = $options['name']) {
$methods = array($name => static::adapter($name)->write($priority, $message, $options));
} elseif (!isset(static::$_priorities[$priority])) {
- $message = "Attempted to write log message with invalid priority '{$priority}'.";
+ $message = "Attempted to write log message with invalid priority `{$priority}`.";
throw new UnexpectedValueException($message);
} else {
$methods = static::_configsByPriority($priority, $message, $options);
@@ -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);
@@ -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 = 0 in php.ini');
+ throw new RuntimeException('set `phar.readonly` to `0` in `php.ini`');
}
$from = $name;
$to = $name;
@@ -101,7 +101,7 @@ public static function adapter($name = null) {
$config = static::_config($name);
if ($config === null) {
- throw new ConfigException("Configuration '{$name}' has not been defined.");
+ throw new ConfigException("Configuration `{$name}` has not been defined.");
}
if (isset($config['object'])) {
@@ -126,7 +126,7 @@ public static function strategies($name) {
$config = static::_config($name);
if ($config === null) {
- throw new ConfigException("Configuration '{$name}' has not been defined.");
+ throw new ConfigException("Configuration `{$name}` has not been defined.");
}
if (!isset($config['strategies'])) {
return null;
@@ -213,11 +213,11 @@ public static function enabled($name) {
protected static function _class($config, $paths = array()) {
if (!$name = $config['adapter']) {
$self = get_called_class();
- throw new ConfigException("No adapter set for configuration in class {$self}.");
+ throw new ConfigException("No adapter set for configuration in class `{$self}`.");
}
if (!$class = static::_locate($paths, $name)) {
$self = get_called_class();
- throw new ConfigException("Could not find adapter '{$name}' in class {$self}.");
+ throw new ConfigException("Could not find adapter `{$name}` in class `{$self}`.");
}
return $class;
}
@@ -233,11 +233,11 @@ protected static function _class($config, $paths = array()) {
protected static function _strategy($name, $paths = array()) {
if (!$name) {
$self = get_called_class();
- throw new ConfigException("No strategy set for configuration in class {$self}.");
+ throw new ConfigException("No strategy set for configuration in class `{$self}`.");
}
if (!$class = static::_locate($paths, $name)) {
$self = get_called_class();
- throw new ConfigException("Could not find strategy '{$name}' in class {$self}.");
+ throw new ConfigException("Could not find strategy `{$name}` in class `{$self}`.");
}
return $class;
}
@@ -280,7 +280,7 @@ public static function add($name, array $config = array()) {
if (!$config['path']) {
if (!$config['path'] = static::_locatePath('libraries', compact('name'))) {
- throw new ConfigException("Library '{$name}' not found.");
+ throw new ConfigException("Library `{$name}` not found.");
}
}
$config['path'] = str_replace('\\', '/', $config['path']);
@@ -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}`");
}
}
@@ -561,7 +561,7 @@ protected static function _transformPath($transform, $class, array $options = ar
*/
public static function instance($type, $name, array $options = array()) {
if (!$class = (string) static::locate($type, $name)) {
- throw new ClassNotFoundException("Class '{$name}' of type '{$type}' not found.");
+ throw new ClassNotFoundException("Class `{$name}` of type `{$type}` not found.");
}
return class_exists($class) ? new $class($options) : null;
}
@@ -211,7 +211,7 @@ public function __isset($name) {
*/
public function __call($method, $params) {
if (!($model = $this->_model) || !method_exists($model, $method)) {
- $message = "No model bound or unhandled method call '{$method}'.";
+ $message = "No model bound or unhandled method call `{$method}`.";
throw new BadMethodCallException($message);
}
array_unshift($params, $this);
@@ -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']);
@@ -570,7 +570,7 @@ public static function bind($type, $name, array $config = array()) {
$self = static::_object();
if (!isset($self->_relationTypes[$type])) {
- throw new ConfigException("Invalid relationship type '{$type}' specified.");
+ throw new ConfigException("Invalid relationship type `{$type}` specified.");
}
$rel = static::connection()->relationship(get_called_class(), $type, $name, $config);
return static::_object()->_relations[$name] = $rel;
@@ -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");
}
/**
@@ -489,7 +489,7 @@ public function increment($field, $value = 1) {
$this->_increment[$field] += $value;
if (!is_numeric($this->_data[$field])) {
- throw new UnexpectedValueException("Field '{$field}' cannot be incremented.");
+ throw new UnexpectedValueException("Field `{$field}` cannot be incremented.");
}
$this->_data[$field] += $value;
}
@@ -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)));
@@ -153,7 +153,7 @@ public function describe($entity, array $meta = array()) {
}
}
if (!$this->_db) {
- throw new ConfigException("{$entity} is not available.");
+ throw new ConfigException("`{$entity}` is not available.");
}
}
@@ -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; };
@@ -113,7 +113,7 @@ public static function check($name, $credentials = null, array $options = array(
$config = $self::invokeMethod('_config', array($name));
if ($config === null) {
- throw new ConfigException("Configuration '{$name}' has not been defined.");
+ throw new ConfigException("Configuration `{$name}` has not been defined.");
}
$session = $config['session'];
@@ -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}`");
}
}
@@ -107,7 +107,7 @@ public function tests($params = array(), array $options = array()) {
foreach ($this->_data as $test) {
if (!class_exists($test)) {
- throw new Exception("Test case '{$test}' not found.");
+ throw new Exception("Test case `{$test}` not found.");
}
$tests[] = new $test;
}
@@ -241,7 +241,7 @@ public function filters(array $filters = array()) {
$results = array();
foreach ($filters as $filter => $options) {
if (!$class = Libraries::locate('test.filter', $filter)) {
- throw new ClassNotFoundException("{$class} is not a valid test filter.");
+ throw new ClassNotFoundException("`{$class}` is not a valid test filter.");
}
$options['name'] = strtolower(join('', array_slice(explode("\\", $class), -1)));
$results[$class] = $options + array('apply' => array(), 'analyze' => array());
@@ -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 583059b

Please sign in to comment.