Skip to content

Commit 717986a

Browse files
committed
Fix issue #23
1 parent 65538cd commit 717986a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
date: 2016-10-30
33
changes:
44
- Fix issue with override `make:addon` and `make:stream commands`, currently realized using singleton.
5-
-
5+
- Fix issue #23
66

77
1.1.1
88
date: 2016-10-12

src/Support/Functions.php

+5-4
Original file line numberDiff line numberDiff line change
@@ -30,14 +30,15 @@ function _render($template, $context)
3030
* Shorthand for config helper
3131
*
3232
* @param string $path, config path
33-
* @param Addon addon, optional addon
33+
* @param Addon $addon, optional addon
34+
* @param Addon $default, optional default value if not found
3435
* @return *,
3536
*/
3637

3738
if (!function_exists('_config')) {
38-
function _config($path, $addon = null)
39+
function _config($path, $addon = null, $default = null)
3940
{
40-
return config(($addon ? $addon->getNamespace() : 'websemantics.extension.builder') . "::$path");
41+
return config(($addon ? $addon->getNamespace() : 'websemantics.extension.builder') . "::$path")?:$default;
4142
}
4243
}
4344

@@ -94,7 +95,7 @@ function ($value) {
9495

9596
if (!function_exists('_getNamespaces')) {
9697
function _getNamespaces($module){
97-
$namespaces = _config('builder.namespaces', $module);
98+
$namespaces = _config('builder.namespaces', $module, []);
9899
return ($namespaces !== array_values($namespaces)) ? array_keys($namespaces) : $namespaces;
99100
}
100101
}

0 commit comments

Comments
 (0)