|
|
@@ -20,8 +20,6 @@ class BakeHelper extends Helper {
|
|
|
protected $_defaultConfig = [];
|
|
|
|
|
|
/**
|
|
|
- * arrayProperty
|
|
|
- *
|
|
|
* Used for generating formatted properties such as component and helper arrays
|
|
|
*
|
|
|
* @param string $name the name of the property
|
|
|
@@ -29,7 +27,7 @@ class BakeHelper extends Helper {
|
|
|
* @param array $options extra options to be passed ot the element
|
|
|
* @return string
|
|
|
*/
|
|
|
- public function arrayProperty($name, $value = [], $options = []) {
|
|
|
+ public function arrayProperty($name, array $value = [], array $options = []) {
|
|
|
if (!$value) {
|
|
|
return '';
|
|
|
}
|
|
|
@@ -45,15 +43,13 @@ class BakeHelper extends Helper {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * stringifyList
|
|
|
- *
|
|
|
* Returns an array converted into a formatted multiline string
|
|
|
*
|
|
|
* @param array $list array of items to be stringified
|
|
|
* @param array $options options to use
|
|
|
* @return string
|
|
|
*/
|
|
|
- public function stringifyList($list, $options = []) {
|
|
|
+ public function stringifyList(array $list, array $options = []) {
|
|
|
$options += [
|
|
|
'indent' => 2
|
|
|
];
|
|
|
@@ -81,18 +77,18 @@ class BakeHelper extends Helper {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * aliasExtractor
|
|
|
+ * Extract the aliases for associations
|
|
|
*
|
|
|
- * @param \Cake\Datasource\EntityInterface $modelObj object to find associations on
|
|
|
+ * @param \Cake\ORM\Table $table object to find associations on
|
|
|
* @param string $assoc association to extract
|
|
|
* @return array
|
|
|
*/
|
|
|
- public function aliasExtractor($modelObj, $assoc) {
|
|
|
+ public function aliasExtractor($table, $assoc) {
|
|
|
$extractor = function ($val) {
|
|
|
return $val->target()->alias();
|
|
|
};
|
|
|
|
|
|
- return array_map($extractor, $modelObj->associations()->type($assoc));
|
|
|
+ return array_map($extractor, $table->associations()->type($assoc));
|
|
|
}
|
|
|
|
|
|
}
|