Skip to content
Permalink
Browse files

Fix up return void setConfig()

  • Loading branch information...
dereuromark committed Jan 31, 2017
1 parent 7671cff commit 5df496be5df931ebacdae708765d3dd58f3cf7e8
Showing with 20 additions and 29 deletions.
  1. +2 −2 src/Datasource/ConnectionManager.php
  2. +18 −27 src/Log/Log.php
@@ -67,7 +67,7 @@ class ConnectionManager
*
* @param string|array $key The name of the connection config, or an array of multiple configs.
* @param array|null $config An array of name => config data for adapter.
* @return array|null Null when adding configuration and an array of configuration data when reading.
* @return void
* @throws \Cake\Core\Exception\Exception When trying to modify an existing config.
* @see \Cake\Core\StaticConfigTrait::config()
*/
@@ -77,7 +77,7 @@ public static function setConfig($key, $config = null)
$config['name'] = $key;
}
return static::_setConfig($key, $config);
static::_setConfig($key, $config);
}
/**
@@ -29,7 +29,7 @@
* A sample configuration would look like:
*
* ```
* Log::config('my_log', ['className' => 'FileLog']);
* Log::setConfig('my_log', ['className' => 'FileLog']);
* ```
*
* You can define the className as any fully namespaced classname or use a short hand
@@ -48,7 +48,7 @@
* This allows you to disable debug messages in production for example:
*
* ```
* Log::config('default', [
* Log::setConfig('default', [
* 'className' => 'File',
* 'path' => LOGS,
* 'levels' => ['error', 'critical', 'alert', 'emergency']
@@ -66,7 +66,7 @@
* all scopes that match the handled levels.
*
* ```
* Log::config('payments', [
* Log::setConfig('payments', [
* 'className' => 'File',
* 'scopes' => ['payment', 'order']
* ]);
@@ -241,47 +241,38 @@ public static function levels()
*
* ### Usage
*
* Reading config data back:
*
* ```
* Log::config('default');
* ```
*
* Setting a cache engine up.
*
* ```
* Log::config('default', $settings);
* Log::setConfig('default', $settings);
* ```
*
* Injecting a constructed adapter in:
*
* ```
* Log::config('default', $instance);
* Log::setConfig('default', $instance);
* ```
*
* Using a factory function to get an adapter:
*
* ```
* Log::config('default', function () { return new FileLog(); });
* Log::setConfig('default', function () { return new FileLog(); });
* ```
*
* Configure multiple adapters at once:
*
* ```
* Log::config($arrayOfConfig);
* Log::setConfig($arrayOfConfig);
* ```
*
* @param string|array $key The name of the logger config, or an array of multiple configs.
* @param array|null $config An array of name => config data for adapter.
* @return array|null Null when adding configuration and an array of configuration data when reading.
* @return void
* @throws \BadMethodCallException When trying to modify an existing config.
*/
public static function setConfig($key, $config = null)
{
$return = static::_setConfig($key, $config);
if ($return !== null) {
return $return;
}
static::_setConfig($key, $config);
static::$_dirtyConfig = true;
}
@@ -351,7 +342,7 @@ public static function engine($name)
* The special `scope` key can be passed to be used for further filtering of the
* log engines to be used. If a string or a numerically index array is passed, it
* will be treated as the `scope` key.
* See Cake\Log\Log::config() for more information on logging scopes.
* See Cake\Log\Log::setConfig() for more information on logging scopes.
* @return bool Success
* @throws \InvalidArgumentException If invalid level is passed.
*/
@@ -406,7 +397,7 @@ public static function write($level, $message, $context = [])
* The special `scope` key can be passed to be used for further filtering of the
* log engines to be used. If a string or a numerically index array is passed, it
* will be treated as the `scope` key.
* See Cake\Log\Log::config() for more information on logging scopes.
* See Cake\Log\Log::setConfig() for more information on logging scopes.
* @return bool Success
*/
public static function emergency($message, $context = [])
@@ -422,7 +413,7 @@ public static function emergency($message, $context = [])
* The special `scope` key can be passed to be used for further filtering of the
* log engines to be used. If a string or a numerically index array is passed, it
* will be treated as the `scope` key.
* See Cake\Log\Log::config() for more information on logging scopes.
* See Cake\Log\Log::setConfig() for more information on logging scopes.
* @return bool Success
*/
public static function alert($message, $context = [])
@@ -438,7 +429,7 @@ public static function alert($message, $context = [])
* The special `scope` key can be passed to be used for further filtering of the
* log engines to be used. If a string or a numerically index array is passed, it
* will be treated as the `scope` key.
* See Cake\Log\Log::config() for more information on logging scopes.
* See Cake\Log\Log::setConfig() for more information on logging scopes.
* @return bool Success
*/
public static function critical($message, $context = [])
@@ -454,7 +445,7 @@ public static function critical($message, $context = [])
* The special `scope` key can be passed to be used for further filtering of the
* log engines to be used. If a string or a numerically index array is passed, it
* will be treated as the `scope` key.
* See Cake\Log\Log::config() for more information on logging scopes.
* See Cake\Log\Log::setConfig() for more information on logging scopes.
* @return bool Success
*/
public static function error($message, $context = [])
@@ -470,7 +461,7 @@ public static function error($message, $context = [])
* The special `scope` key can be passed to be used for further filtering of the
* log engines to be used. If a string or a numerically index array is passed, it
* will be treated as the `scope` key.
* See Cake\Log\Log::config() for more information on logging scopes.
* See Cake\Log\Log::setConfig() for more information on logging scopes.
* @return bool Success
*/
public static function warning($message, $context = [])
@@ -486,7 +477,7 @@ public static function warning($message, $context = [])
* The special `scope` key can be passed to be used for further filtering of the
* log engines to be used. If a string or a numerically index array is passed, it
* will be treated as the `scope` key.
* See Cake\Log\Log::config() for more information on logging scopes.
* See Cake\Log\Log::setConfig() for more information on logging scopes.
* @return bool Success
*/
public static function notice($message, $context = [])
@@ -502,7 +493,7 @@ public static function notice($message, $context = [])
* The special `scope` key can be passed to be used for further filtering of the
* log engines to be used. If a string or a numerically index array is passed, it
* will be treated as the `scope` key.
* See Cake\Log\Log::config() for more information on logging scopes.
* See Cake\Log\Log::setConfig() for more information on logging scopes.
* @return bool Success
*/
public static function debug($message, $context = [])
@@ -518,7 +509,7 @@ public static function debug($message, $context = [])
* The special `scope` key can be passed to be used for further filtering of the
* log engines to be used. If a string or a numerically index array is passed, it
* will be treated as the `scope` key.
* See Cake\Log\Log::config() for more information on logging scopes.
* See Cake\Log\Log::setConfig() for more information on logging scopes.
* @return bool Success
*/
public static function info($message, $context = [])

0 comments on commit 5df496b

Please sign in to comment.
You can’t perform that action at this time.