@@ -257,9 +257,9 @@ discard block |
||
| 257 | 257 | { |
| 258 | 258 | if ( ! empty($this->buildStack)) |
| 259 | 259 | { |
| 260 | - $reset = implode(', ', $this->buildStack); |
|
| 260 | + $reset = implode(', ', $this->buildStack); |
|
| 261 | 261 | |
| 262 | - $message = "Target [ {$class} ] is not instantiable while building [ {$reset} ]."; |
|
| 262 | + $message = "Target [ {$class} ] is not instantiable while building [ {$reset} ]."; |
|
| 263 | 263 | } |
| 264 | 264 | else |
| 265 | 265 | { |
@@ -717,7 +717,7 @@ discard block |
||
| 717 | 717 | |
| 718 | 718 | array_pop($this->across); |
| 719 | 719 | |
| 720 | - return $this->resolveObject($id, $object); |
|
| 720 | + return $this->resolveObject($id, $object); |
|
| 721 | 721 | } |
| 722 | 722 | |
| 723 | 723 | /** |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | */ |
| 190 | 190 | protected function getClosure($id, string $value) |
| 191 | 191 | { |
| 192 | - return function ($container, $parameters = []) use ($id, $value) |
|
| 192 | + return function($container, $parameters = []) use ($id, $value) |
|
| 193 | 193 | { |
| 194 | 194 | if ($id == $value) |
| 195 | 195 | { |
@@ -448,7 +448,7 @@ discard block |
||
| 448 | 448 | */ |
| 449 | 449 | public function factory($id) |
| 450 | 450 | { |
| 451 | - return function () use ($id) { |
|
| 451 | + return function() use ($id) { |
|
| 452 | 452 | return $this->make($id); |
| 453 | 453 | }; |
| 454 | 454 | } |
@@ -855,7 +855,7 @@ discard block |
||
| 855 | 855 | */ |
| 856 | 856 | public function bound($id) |
| 857 | 857 | { |
| 858 | - return isset($this->bindings[$id]) || |
|
| 858 | + return isset($this->bindings[$id]) || |
|
| 859 | 859 | isset($this->instances[$id]) || |
| 860 | 860 | $this->isAlias($id); |
| 861 | 861 | } |
@@ -260,8 +260,7 @@ discard block |
||
| 260 | 260 | $reset = implode(', ', $this->buildStack); |
| 261 | 261 | |
| 262 | 262 | $message = "Target [ {$class} ] is not instantiable while building [ {$reset} ]."; |
| 263 | - } |
|
| 264 | - else |
|
| 263 | + } else |
|
| 265 | 264 | { |
| 266 | 265 | $message = "Target [ {$class} ] is not instantiable."; |
| 267 | 266 | } |
@@ -345,8 +344,7 @@ discard block |
||
| 345 | 344 | try |
| 346 | 345 | { |
| 347 | 346 | return $this->make($parameter->getClass()->name); |
| 348 | - } |
|
| 349 | - catch (BindingResolutionException $e) |
|
| 347 | + } catch (BindingResolutionException $e) |
|
| 350 | 348 | { |
| 351 | 349 | if ($parameter->isOptional()) |
| 352 | 350 | { |
@@ -400,8 +398,7 @@ discard block |
||
| 400 | 398 | $this->instances[$id] = $closure($this->instances[$id], $this); |
| 401 | 399 | |
| 402 | 400 | $this->reHas($id); |
| 403 | - } |
|
| 404 | - else |
|
| 401 | + } else |
|
| 405 | 402 | { |
| 406 | 403 | $this->services[$id][] = $closure; |
| 407 | 404 | |
@@ -702,8 +699,7 @@ discard block |
||
| 702 | 699 | if ($this->isBuildable($value, $id)) |
| 703 | 700 | { |
| 704 | 701 | $object = $this->build($value); |
| 705 | - } |
|
| 706 | - else |
|
| 702 | + } else |
|
| 707 | 703 | { |
| 708 | 704 | $object = $this->make($value); |
| 709 | 705 | } |
@@ -822,8 +818,7 @@ discard block |
||
| 822 | 818 | try |
| 823 | 819 | { |
| 824 | 820 | return $this->resolve($id); |
| 825 | - } |
|
| 826 | - catch (Exception $e) |
|
| 821 | + } catch (Exception $e) |
|
| 827 | 822 | { |
| 828 | 823 | if ( ! $this->has($id)) |
| 829 | 824 | { |
@@ -39,13 +39,13 @@ |
||
| 39 | 39 | */ |
| 40 | 40 | public function register() |
| 41 | 41 | { |
| 42 | - $this->app->singleton('redis', function ($app) { |
|
| 42 | + $this->app->singleton('redis', function($app) { |
|
| 43 | 43 | $config = $app['config']->get('database.redis', []); |
| 44 | 44 | |
| 45 | 45 | return new RedisManager($config); |
| 46 | 46 | }); |
| 47 | 47 | |
| 48 | - $this->app->bind('redis.connection', function ($app) { |
|
| 48 | + $this->app->bind('redis.connection', function($app) { |
|
| 49 | 49 | return $app['redis']->connection(); |
| 50 | 50 | }); |
| 51 | 51 | } |
@@ -51,8 +51,7 @@ |
||
| 51 | 51 | if (isset($servers['cluster']) && $servers['cluster']) |
| 52 | 52 | { |
| 53 | 53 | $this->clients = $this->createAggregateClient($servers); |
| 54 | - } |
|
| 55 | - else |
|
| 54 | + } else |
|
| 56 | 55 | { |
| 57 | 56 | $this->clients = $this->createSingleClient($servers); |
| 58 | 57 | } |
@@ -88,6 +88,6 @@ |
||
| 88 | 88 | public static function longVersion() |
| 89 | 89 | { |
| 90 | 90 | return self::COPY.' '.self::YEAR.' '.self::COPYRIGHT.' - '.self::PRODUCT.' ' .self::RELEASE. ' '. |
| 91 | - self::STATUS.' [ '.self::CODENAME.' ] '.self::RELEASEDATE; |
|
| 91 | + self::STATUS.' [ '.self::CODENAME.' ] '.self::RELEASEDATE; |
|
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | \ No newline at end of file |
@@ -87,7 +87,7 @@ |
||
| 87 | 87 | */ |
| 88 | 88 | public static function longVersion() |
| 89 | 89 | { |
| 90 | - return self::COPY.' '.self::YEAR.' '.self::COPYRIGHT.' - '.self::PRODUCT.' ' .self::RELEASE. ' '. |
|
| 90 | + return self::COPY.' '.self::YEAR.' '.self::COPYRIGHT.' - '.self::PRODUCT.' '.self::RELEASE.' '. |
|
| 91 | 91 | self::STATUS.' [ '.self::CODENAME.' ] '.self::RELEASEDATE; |
| 92 | 92 | } |
| 93 | 93 | } |
| 94 | 94 | \ No newline at end of file |
@@ -22,11 +22,21 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | |
| 24 | 24 | // Define the absolute paths for configured directories |
| 25 | -if ( ! defined('APP_PATH')) define('APP_PATH', realpath($paths['path.app']).DIRECTORY_SEPARATOR); |
|
| 26 | -if ( ! defined('BST_PATH')) define('BST_PATH', realpath($paths['path.bootstrap']).DIRECTORY_SEPARATOR); |
|
| 27 | -if ( ! defined('CON_PATH')) define('CON_PATH', realpath($paths['path.config']).DIRECTORY_SEPARATOR); |
|
| 28 | -if ( ! defined('RES_PATH')) define('RES_PATH', realpath($paths['path.resources']).DIRECTORY_SEPARATOR); |
|
| 29 | -if ( ! defined('SYS_PATH')) define('SYS_PATH', realpath($paths['path.sys']).DIRECTORY_SEPARATOR); |
|
| 25 | +if ( ! defined('APP_PATH')) { |
|
| 26 | + define('APP_PATH', realpath($paths['path.app']).DIRECTORY_SEPARATOR); |
|
| 27 | +} |
|
| 28 | +if ( ! defined('BST_PATH')) { |
|
| 29 | + define('BST_PATH', realpath($paths['path.bootstrap']).DIRECTORY_SEPARATOR); |
|
| 30 | +} |
|
| 31 | +if ( ! defined('CON_PATH')) { |
|
| 32 | + define('CON_PATH', realpath($paths['path.config']).DIRECTORY_SEPARATOR); |
|
| 33 | +} |
|
| 34 | +if ( ! defined('RES_PATH')) { |
|
| 35 | + define('RES_PATH', realpath($paths['path.resources']).DIRECTORY_SEPARATOR); |
|
| 36 | +} |
|
| 37 | +if ( ! defined('SYS_PATH')) { |
|
| 38 | + define('SYS_PATH', realpath($paths['path.sys']).DIRECTORY_SEPARATOR); |
|
| 39 | +} |
|
| 30 | 40 | |
| 31 | 41 | // Call the file constants |
| 32 | 42 | require CON_PATH.'constants.php'; |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function processColumnListing($results) |
| 43 | 43 | { |
| 44 | - return array_map(function ($result) { |
|
| 44 | + return array_map(function($result) { |
|
| 45 | 45 | return ((object) $result)->column_name; |
| 46 | 46 | }, $results); |
| 47 | 47 | } |
@@ -41,7 +41,7 @@ |
||
| 41 | 41 | */ |
| 42 | 42 | public function processColumnListing($results) |
| 43 | 43 | { |
| 44 | - return array_map(function ($result) { |
|
| 44 | + return array_map(function($result) { |
|
| 45 | 45 | return ((object) $result)->column_name; |
| 46 | 46 | }, $results); |
| 47 | 47 | } |
@@ -32,126 +32,126 @@ |
||
| 32 | 32 | */ |
| 33 | 33 | class AutoloadConfig |
| 34 | 34 | { |
| 35 | - /** |
|
| 36 | - * Map of class names and locations. |
|
| 37 | - * |
|
| 38 | - * @var array $classmap |
|
| 39 | - */ |
|
| 40 | - public $classmap = []; |
|
| 35 | + /** |
|
| 36 | + * Map of class names and locations. |
|
| 37 | + * |
|
| 38 | + * @var array $classmap |
|
| 39 | + */ |
|
| 40 | + public $classmap = []; |
|
| 41 | 41 | |
| 42 | - /** |
|
| 43 | - * If true, then auto-enabled will happen across all namespaces |
|
| 44 | - * loaded by Composer, as well as the namespaces configured locally. |
|
| 45 | - * |
|
| 46 | - * @var bool $enabledInComposer |
|
| 47 | - */ |
|
| 48 | - public $enabledInComposer = true; |
|
| 42 | + /** |
|
| 43 | + * If true, then auto-enabled will happen across all namespaces |
|
| 44 | + * loaded by Composer, as well as the namespaces configured locally. |
|
| 45 | + * |
|
| 46 | + * @var bool $enabledInComposer |
|
| 47 | + */ |
|
| 48 | + public $enabledInComposer = true; |
|
| 49 | 49 | |
| 50 | - /** |
|
| 51 | - * Array of files for autoloading. |
|
| 52 | - * |
|
| 53 | - * @var array $includeFiles |
|
| 54 | - */ |
|
| 55 | - public $includeFiles = []; |
|
| 50 | + /** |
|
| 51 | + * Array of files for autoloading. |
|
| 52 | + * |
|
| 53 | + * @var array $includeFiles |
|
| 54 | + */ |
|
| 55 | + public $includeFiles = []; |
|
| 56 | 56 | |
| 57 | - /** |
|
| 58 | - * Array of namespaces for autoloading. |
|
| 59 | - * |
|
| 60 | - * @var array $psr4 |
|
| 61 | - */ |
|
| 62 | - public $psr4 = []; |
|
| 57 | + /** |
|
| 58 | + * Array of namespaces for autoloading. |
|
| 59 | + * |
|
| 60 | + * @var array $psr4 |
|
| 61 | + */ |
|
| 62 | + public $psr4 = []; |
|
| 63 | 63 | |
| 64 | - /** |
|
| 65 | - * Constructor. |
|
| 66 | - */ |
|
| 67 | - public function __construct() |
|
| 68 | - { |
|
| 69 | - /** |
|
| 70 | - * --------------------------------------------------------------------- |
|
| 71 | - * Namespaces |
|
| 72 | - * --------------------------------------------------------------------- |
|
| 73 | - * |
|
| 74 | - * This maps the locations of any namespaces in your application to |
|
| 75 | - * their location on the file system. These are used by the Autoloader |
|
| 76 | - * to locate files the first time they have been instantiated. |
|
| 77 | - * |
|
| 78 | - */ |
|
| 79 | - $this->psr4 = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadPsr4.php'; |
|
| 64 | + /** |
|
| 65 | + * Constructor. |
|
| 66 | + */ |
|
| 67 | + public function __construct() |
|
| 68 | + { |
|
| 69 | + /** |
|
| 70 | + * --------------------------------------------------------------------- |
|
| 71 | + * Namespaces |
|
| 72 | + * --------------------------------------------------------------------- |
|
| 73 | + * |
|
| 74 | + * This maps the locations of any namespaces in your application to |
|
| 75 | + * their location on the file system. These are used by the Autoloader |
|
| 76 | + * to locate files the first time they have been instantiated. |
|
| 77 | + * |
|
| 78 | + */ |
|
| 79 | + $this->psr4 = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadPsr4.php'; |
|
| 80 | 80 | |
| 81 | - /** |
|
| 82 | - * --------------------------------------------------------------------- |
|
| 83 | - * Class Map |
|
| 84 | - * --------------------------------------------------------------------- |
|
| 85 | - * |
|
| 86 | - * The class map provides a map of class names and their exact location |
|
| 87 | - * on the drive. |
|
| 88 | - * |
|
| 89 | - */ |
|
| 90 | - $this->classmap = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadClassmap.php'; |
|
| 81 | + /** |
|
| 82 | + * --------------------------------------------------------------------- |
|
| 83 | + * Class Map |
|
| 84 | + * --------------------------------------------------------------------- |
|
| 85 | + * |
|
| 86 | + * The class map provides a map of class names and their exact location |
|
| 87 | + * on the drive. |
|
| 88 | + * |
|
| 89 | + */ |
|
| 90 | + $this->classmap = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadClassmap.php'; |
|
| 91 | 91 | |
| 92 | - /** |
|
| 93 | - * --------------------------------------------------------------------- |
|
| 94 | - * Include Files |
|
| 95 | - * --------------------------------------------------------------------- |
|
| 96 | - * |
|
| 97 | - * This maps the locations of any files in your application to |
|
| 98 | - * their location on the file system. |
|
| 99 | - * |
|
| 100 | - */ |
|
| 101 | - $this->includeFiles = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadFiles.php'; |
|
| 102 | - } |
|
| 92 | + /** |
|
| 93 | + * --------------------------------------------------------------------- |
|
| 94 | + * Include Files |
|
| 95 | + * --------------------------------------------------------------------- |
|
| 96 | + * |
|
| 97 | + * This maps the locations of any files in your application to |
|
| 98 | + * their location on the file system. |
|
| 99 | + * |
|
| 100 | + */ |
|
| 101 | + $this->includeFiles = require SYS_PATH.'src'.DIRECTORY_SEPARATOR.'register'.DIRECTORY_SEPARATOR.'autoloadFiles.php'; |
|
| 102 | + } |
|
| 103 | 103 | |
| 104 | - /** |
|
| 105 | - * Get the classes to filename map. |
|
| 106 | - * |
|
| 107 | - * @param array $classmap |
|
| 108 | - * |
|
| 109 | - * @return void |
|
| 110 | - */ |
|
| 111 | - public function addClassMap(array $classmap) |
|
| 112 | - { |
|
| 113 | - if (isset($this->classmap)) { |
|
| 114 | - $this->classmap = array_merge($this->classmap, $classmap); |
|
| 115 | - } else { |
|
| 116 | - $this->classmap = $classmap; |
|
| 117 | - } |
|
| 104 | + /** |
|
| 105 | + * Get the classes to filename map. |
|
| 106 | + * |
|
| 107 | + * @param array $classmap |
|
| 108 | + * |
|
| 109 | + * @return void |
|
| 110 | + */ |
|
| 111 | + public function addClassMap(array $classmap) |
|
| 112 | + { |
|
| 113 | + if (isset($this->classmap)) { |
|
| 114 | + $this->classmap = array_merge($this->classmap, $classmap); |
|
| 115 | + } else { |
|
| 116 | + $this->classmap = $classmap; |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - return $this->classmap; |
|
| 120 | - } |
|
| 119 | + return $this->classmap; |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | - /** |
|
| 123 | - * Get the filename map. |
|
| 124 | - * |
|
| 125 | - * @param array $files |
|
| 126 | - * |
|
| 127 | - * @return void |
|
| 128 | - */ |
|
| 129 | - public function addFiles(array $files) |
|
| 130 | - { |
|
| 131 | - if (isset($this->includeFiles)) { |
|
| 132 | - $this->includeFiles = array_merge($this->includeFiles, $files); |
|
| 133 | - } else { |
|
| 134 | - $this->includeFiles = $files; |
|
| 135 | - } |
|
| 122 | + /** |
|
| 123 | + * Get the filename map. |
|
| 124 | + * |
|
| 125 | + * @param array $files |
|
| 126 | + * |
|
| 127 | + * @return void |
|
| 128 | + */ |
|
| 129 | + public function addFiles(array $files) |
|
| 130 | + { |
|
| 131 | + if (isset($this->includeFiles)) { |
|
| 132 | + $this->includeFiles = array_merge($this->includeFiles, $files); |
|
| 133 | + } else { |
|
| 134 | + $this->includeFiles = $files; |
|
| 135 | + } |
|
| 136 | 136 | |
| 137 | - return $this->includeFiles; |
|
| 138 | - } |
|
| 137 | + return $this->includeFiles; |
|
| 138 | + } |
|
| 139 | 139 | |
| 140 | - /** |
|
| 141 | - * Registers a set of PSR-4 directories for a given namespace. |
|
| 142 | - * |
|
| 143 | - * @param array $psr4 |
|
| 144 | - * |
|
| 145 | - * @return void |
|
| 146 | - */ |
|
| 147 | - public function addPsr4(array $psr4) |
|
| 148 | - { |
|
| 149 | - if (isset($this->psr4)) { |
|
| 150 | - $this->psr4 = array_merge($this->psr4, $psr4); |
|
| 151 | - } else { |
|
| 152 | - $this->psr4 = $psr4; |
|
| 153 | - } |
|
| 140 | + /** |
|
| 141 | + * Registers a set of PSR-4 directories for a given namespace. |
|
| 142 | + * |
|
| 143 | + * @param array $psr4 |
|
| 144 | + * |
|
| 145 | + * @return void |
|
| 146 | + */ |
|
| 147 | + public function addPsr4(array $psr4) |
|
| 148 | + { |
|
| 149 | + if (isset($this->psr4)) { |
|
| 150 | + $this->psr4 = array_merge($this->psr4, $psr4); |
|
| 151 | + } else { |
|
| 152 | + $this->psr4 = $psr4; |
|
| 153 | + } |
|
| 154 | 154 | |
| 155 | - return $this->psr4; |
|
| 156 | - } |
|
| 155 | + return $this->psr4; |
|
| 156 | + } |
|
| 157 | 157 | } |
| 158 | 158 | \ No newline at end of file |
@@ -36,151 +36,151 @@ |
||
| 36 | 36 | */ |
| 37 | 37 | class Configure implements ArrayAccess, ConfigureContract |
| 38 | 38 | { |
| 39 | - /** |
|
| 40 | - * Currently registered routes. |
|
| 41 | - * |
|
| 42 | - * @var array $vars |
|
| 43 | - */ |
|
| 44 | - protected $vars = []; |
|
| 39 | + /** |
|
| 40 | + * Currently registered routes. |
|
| 41 | + * |
|
| 42 | + * @var array $vars |
|
| 43 | + */ |
|
| 44 | + protected $vars = []; |
|
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * Determine if the given configuration value exists. |
|
| 48 | - * |
|
| 49 | - * @param string $key |
|
| 50 | - * |
|
| 51 | - * @return bool |
|
| 52 | - */ |
|
| 53 | - public function has(string $key) |
|
| 54 | - { |
|
| 55 | - return Arr::has($this->vars, $key); |
|
| 56 | - } |
|
| 46 | + /** |
|
| 47 | + * Determine if the given configuration value exists. |
|
| 48 | + * |
|
| 49 | + * @param string $key |
|
| 50 | + * |
|
| 51 | + * @return bool |
|
| 52 | + */ |
|
| 53 | + public function has(string $key) |
|
| 54 | + { |
|
| 55 | + return Arr::has($this->vars, $key); |
|
| 56 | + } |
|
| 57 | 57 | |
| 58 | - /** |
|
| 59 | - * Returns a (dot notated) config setting. |
|
| 60 | - * |
|
| 61 | - * @param string $key The dot-notated key or array of keys |
|
| 62 | - * @param mixed $default The default value |
|
| 63 | - * |
|
| 64 | - * @return mixed |
|
| 65 | - * |
|
| 66 | - * @uses \Syscodes\Support\Arr |
|
| 67 | - */ |
|
| 68 | - public function get(string $key, $default = null) |
|
| 69 | - { |
|
| 70 | - $keys = explode('.', $key); |
|
| 58 | + /** |
|
| 59 | + * Returns a (dot notated) config setting. |
|
| 60 | + * |
|
| 61 | + * @param string $key The dot-notated key or array of keys |
|
| 62 | + * @param mixed $default The default value |
|
| 63 | + * |
|
| 64 | + * @return mixed |
|
| 65 | + * |
|
| 66 | + * @uses \Syscodes\Support\Arr |
|
| 67 | + */ |
|
| 68 | + public function get(string $key, $default = null) |
|
| 69 | + { |
|
| 70 | + $keys = explode('.', $key); |
|
| 71 | 71 | |
| 72 | - if ( ! array_key_exists($file = current($keys), $this->vars)) |
|
| 73 | - { |
|
| 74 | - foreach ([CON_PATH] as $paths) |
|
| 75 | - { |
|
| 76 | - if (is_readable($path = $paths.$file.'.php')) |
|
| 77 | - { |
|
| 78 | - $this->vars[$file] = require $path; |
|
| 79 | - } |
|
| 80 | - } |
|
| 81 | - } |
|
| 72 | + if ( ! array_key_exists($file = current($keys), $this->vars)) |
|
| 73 | + { |
|
| 74 | + foreach ([CON_PATH] as $paths) |
|
| 75 | + { |
|
| 76 | + if (is_readable($path = $paths.$file.'.php')) |
|
| 77 | + { |
|
| 78 | + $this->vars[$file] = require $path; |
|
| 79 | + } |
|
| 80 | + } |
|
| 81 | + } |
|
| 82 | 82 | |
| 83 | - return Arr::get($this->vars, $key, $default); |
|
| 84 | - } |
|
| 83 | + return Arr::get($this->vars, $key, $default); |
|
| 84 | + } |
|
| 85 | 85 | |
| 86 | - /** |
|
| 87 | - * Sets a value in the config array. |
|
| 88 | - * |
|
| 89 | - * @param string $key The dot-notated key or array of keys |
|
| 90 | - * @param mixed $value The default value |
|
| 91 | - * |
|
| 92 | - * @return mixed |
|
| 93 | - * |
|
| 94 | - * @uses \Syscodes\Support\Arr |
|
| 95 | - */ |
|
| 96 | - public function set(string $key, $value) |
|
| 97 | - { |
|
| 98 | - strpos($key, '.') === false || $this->vars[$key] = $value; |
|
| 86 | + /** |
|
| 87 | + * Sets a value in the config array. |
|
| 88 | + * |
|
| 89 | + * @param string $key The dot-notated key or array of keys |
|
| 90 | + * @param mixed $value The default value |
|
| 91 | + * |
|
| 92 | + * @return mixed |
|
| 93 | + * |
|
| 94 | + * @uses \Syscodes\Support\Arr |
|
| 95 | + */ |
|
| 96 | + public function set(string $key, $value) |
|
| 97 | + { |
|
| 98 | + strpos($key, '.') === false || $this->vars[$key] = $value; |
|
| 99 | 99 | |
| 100 | - Arr::set($this->$vars, $key, $value); |
|
| 101 | - } |
|
| 100 | + Arr::set($this->$vars, $key, $value); |
|
| 101 | + } |
|
| 102 | 102 | |
| 103 | - /** |
|
| 104 | - * Deletes a (dot notated) config item. |
|
| 105 | - * |
|
| 106 | - * @param string $key A (dot notated) config key |
|
| 107 | - * |
|
| 108 | - * @return array|bool |
|
| 109 | - * |
|
| 110 | - * @uses \Syscodes\Support\Arr |
|
| 111 | - */ |
|
| 112 | - public function erase(string $key) |
|
| 113 | - { |
|
| 114 | - if (isset($this->$vars[$key])) |
|
| 115 | - { |
|
| 116 | - unset($this->$vars[$key]); |
|
| 117 | - } |
|
| 103 | + /** |
|
| 104 | + * Deletes a (dot notated) config item. |
|
| 105 | + * |
|
| 106 | + * @param string $key A (dot notated) config key |
|
| 107 | + * |
|
| 108 | + * @return array|bool |
|
| 109 | + * |
|
| 110 | + * @uses \Syscodes\Support\Arr |
|
| 111 | + */ |
|
| 112 | + public function erase(string $key) |
|
| 113 | + { |
|
| 114 | + if (isset($this->$vars[$key])) |
|
| 115 | + { |
|
| 116 | + unset($this->$vars[$key]); |
|
| 117 | + } |
|
| 118 | 118 | |
| 119 | - Arr::erase($this->$vars, $key); |
|
| 120 | - } |
|
| 119 | + Arr::erase($this->$vars, $key); |
|
| 120 | + } |
|
| 121 | 121 | |
| 122 | - /** |
|
| 123 | - * Get all of the configuration items for the application. |
|
| 124 | - * |
|
| 125 | - * @return array |
|
| 126 | - */ |
|
| 127 | - public function all() |
|
| 128 | - { |
|
| 129 | - return $this->vars; |
|
| 130 | - } |
|
| 122 | + /** |
|
| 123 | + * Get all of the configuration items for the application. |
|
| 124 | + * |
|
| 125 | + * @return array |
|
| 126 | + */ |
|
| 127 | + public function all() |
|
| 128 | + { |
|
| 129 | + return $this->vars; |
|
| 130 | + } |
|
| 131 | 131 | |
| 132 | - /* |
|
| 132 | + /* |
|
| 133 | 133 | |----------------------------------------------------------------- |
| 134 | 134 | | ArrayAccess Methods |
| 135 | 135 | |----------------------------------------------------------------- |
| 136 | 136 | */ |
| 137 | 137 | |
| 138 | - /** |
|
| 139 | - * Determine if the given configuration option exists. |
|
| 140 | - * |
|
| 141 | - * @param string $key |
|
| 142 | - * |
|
| 143 | - * @return bool |
|
| 144 | - */ |
|
| 145 | - public function offsetExists($key) |
|
| 146 | - { |
|
| 147 | - return $this->has($key); |
|
| 148 | - } |
|
| 138 | + /** |
|
| 139 | + * Determine if the given configuration option exists. |
|
| 140 | + * |
|
| 141 | + * @param string $key |
|
| 142 | + * |
|
| 143 | + * @return bool |
|
| 144 | + */ |
|
| 145 | + public function offsetExists($key) |
|
| 146 | + { |
|
| 147 | + return $this->has($key); |
|
| 148 | + } |
|
| 149 | 149 | |
| 150 | - /** |
|
| 151 | - * Get a configuration option. |
|
| 152 | - * |
|
| 153 | - * @param string $key |
|
| 154 | - * |
|
| 155 | - * @return mixed |
|
| 156 | - */ |
|
| 157 | - public function offsetGet($key) |
|
| 158 | - { |
|
| 159 | - return $this->get($key); |
|
| 160 | - } |
|
| 150 | + /** |
|
| 151 | + * Get a configuration option. |
|
| 152 | + * |
|
| 153 | + * @param string $key |
|
| 154 | + * |
|
| 155 | + * @return mixed |
|
| 156 | + */ |
|
| 157 | + public function offsetGet($key) |
|
| 158 | + { |
|
| 159 | + return $this->get($key); |
|
| 160 | + } |
|
| 161 | 161 | |
| 162 | - /** |
|
| 163 | - * Set a configuration option. |
|
| 164 | - * |
|
| 165 | - * @param string $key |
|
| 166 | - * @param mixed $value |
|
| 167 | - * |
|
| 168 | - * @return void |
|
| 169 | - */ |
|
| 170 | - public function offsetSet($key, $value) |
|
| 171 | - { |
|
| 172 | - $this->set($key, $value); |
|
| 173 | - } |
|
| 162 | + /** |
|
| 163 | + * Set a configuration option. |
|
| 164 | + * |
|
| 165 | + * @param string $key |
|
| 166 | + * @param mixed $value |
|
| 167 | + * |
|
| 168 | + * @return void |
|
| 169 | + */ |
|
| 170 | + public function offsetSet($key, $value) |
|
| 171 | + { |
|
| 172 | + $this->set($key, $value); |
|
| 173 | + } |
|
| 174 | 174 | |
| 175 | - /** |
|
| 176 | - * Unset a configuration option. |
|
| 177 | - * |
|
| 178 | - * @param string $key |
|
| 179 | - * |
|
| 180 | - * @return void |
|
| 181 | - */ |
|
| 182 | - public function offsetUnset($key) |
|
| 183 | - { |
|
| 184 | - $this->set($key, null); |
|
| 185 | - } |
|
| 175 | + /** |
|
| 176 | + * Unset a configuration option. |
|
| 177 | + * |
|
| 178 | + * @param string $key |
|
| 179 | + * |
|
| 180 | + * @return void |
|
| 181 | + */ |
|
| 182 | + public function offsetUnset($key) |
|
| 183 | + { |
|
| 184 | + $this->set($key, null); |
|
| 185 | + } |
|
| 186 | 186 | } |
| 187 | 187 | \ No newline at end of file |