Skip to content

Commit

Permalink
Adding and replacing ticks/quotes with backticks in error and excepti…
Browse files Browse the repository at this point in the history
…on messages.
  • Loading branch information
mariuswilms authored and nateabele committed Mar 7, 2011
1 parent c690b8b commit 583059b
Show file tree
Hide file tree
Showing 24 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion libraries/lithium/action/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/action/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
});
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/action/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/analysis/Inspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/analysis/Logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/analysis/logger/adapter/Growl.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/console/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
});
}
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/console/command/Library.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
12 changes: 6 additions & 6 deletions libraries/lithium/core/Adaptable.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'])) {
Expand All @@ -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;
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions libraries/lithium/core/Libraries.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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}`");
}
}

Expand Down Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/data/Entity.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions libraries/lithium/data/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -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']);
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/data/entity/Document.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/data/source/Database.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)));
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/data/source/http/adapter/CouchDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
}
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/net/http/Media.php
Original file line number Diff line number Diff line change
Expand Up @@ -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; };
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/security/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];

Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/template/view/Compiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/template/view/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}

/**
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/template/view/adapter/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}`");
}
}

Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/test/Group.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/test/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/test/Unit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion libraries/lithium/util/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'];
Expand Down

0 comments on commit 583059b

Please sign in to comment.