Browse Source

doc block and type hint cleanup

AD7six 11 years ago
parent
commit
23b9701fb6
3 changed files with 7 additions and 30 deletions
  1. 0 10
      src/Shell/Task/TemplateTask.php
  2. 1 10
      src/View/BakeView.php
  3. 6 10
      src/View/Helper/BakeHelper.php

+ 0 - 10
src/Shell/Task/TemplateTask.php

@@ -71,16 +71,6 @@ class TemplateTask extends Shell {
 	}
 
 /**
- * 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
  *
  * @param string $template bake template to render

+ 1 - 10
src/View/BakeView.php

@@ -22,15 +22,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.
  *
  * Render triggers helper callbacks, which are fired before and after the view are rendered,
@@ -139,7 +130,7 @@ class BakeView extends View {
  *
  * 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.
  */

+ 6 - 10
src/View/Helper/BakeHelper.php

@@ -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));
 	}
 
 }