Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
doc block and type hint cleanup
  • Loading branch information
AD7six committed Nov 14, 2014
1 parent 323bccc commit 23b9701
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 30 deletions.
10 changes: 0 additions & 10 deletions src/Shell/Task/TemplateTask.php
Expand Up @@ -70,16 +70,6 @@ public function getView() {
return $this->View;
}

/**
* Constructs the view class instance based on object properties.
*
* @param string $viewClass Optional namespaced class name of the View class to instantiate.
* @return \Cake\View\View
* @throws \Cake\View\Exception\MissingViewException If view class was not found.
*/
public function createView($viewClass = null) {
}

/**
* Runs the template
*
Expand Down
11 changes: 1 addition & 10 deletions src/View/BakeView.php
Expand Up @@ -21,15 +21,6 @@ class BakeView extends View {

use ConventionsTrait;

/**
* An array of names of built-in helpers to include.
*
* @var array
*/
public $helpers = [
'Bake'
];

/**
* Renders view for given view file and layout.
*
Expand Down Expand Up @@ -139,7 +130,7 @@ protected function _evaluate($viewFile, $dataForView) {
*
* Also allows rendering a template string directly
*
* @param string $name Controller action to find template filename for
* @param string $name Bake template name
* @return string Template filename or a Bake template string
* @throws \Cake\View\Exception\MissingTemplateException when a view file could not be found.
*/
Expand Down
16 changes: 6 additions & 10 deletions src/View/Helper/BakeHelper.php
Expand Up @@ -20,16 +20,14 @@ 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
* @param array $value the array of values
* @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 '';
}
Expand All @@ -45,15 +43,13 @@ public function arrayProperty($name, $value = [], $options = []) {
}

/**
* 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
];
Expand Down Expand Up @@ -81,18 +77,18 @@ public function stringifyList($list, $options = []) {
}

/**
* 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));
}

}

0 comments on commit 23b9701

Please sign in to comment.