Skip to content

Commit a1afc91

Browse files
committed
Merge branch 'v2' of github.com:pixelandtonic/ElementAPI into v2
2 parents c5d93be + 6896232 commit a1afc91

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/Plugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function getDefaultResourceAdapterConfig(): array
6363
return $this->_defaultResourceAdapterConfig;
6464
}
6565

66-
return $this->_defaultResourceAdapterConfig = $this->getSettings()->defaults;
66+
return $this->_defaultResourceAdapterConfig = $this->getSettings()->getDefaults();
6767
}
6868

6969
/**

src/Settings.php

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,29 @@
1212
*/
1313
class Settings extends Model
1414
{
15+
// Properties
16+
// =========================================================================
17+
1518
/**
16-
* @var array The default endpoint configuration.
19+
* @var callable|array The default endpoint configuration.
1720
*/
1821
public $defaults = [];
1922

2023
/**
2124
* @var array The endpoint configurations.
2225
*/
2326
public $endpoints = [];
27+
28+
// Public Methods
29+
// =========================================================================
30+
31+
/**
32+
* Returns the default endpoint configuration.
33+
*
34+
* @return array The default endpoint configuration.
35+
*/
36+
public function getDefaults()
37+
{
38+
return is_callable($this->defaults) ? call_user_func($this->defaults) : $this->defaults;
39+
}
2440
}

0 commit comments

Comments
 (0)