Browse Source

fix scrutinizer issues

euromark 11 years ago
parent
commit
cdce2a3c44

+ 2 - 2
Controller/Component/CommonComponent.php

@@ -642,9 +642,9 @@ class CommonComponent extends Component {
 			}
 		}
 
-		if ($die) {
+		if ($exit) {
 			debug($log);
-			die();
+			exit();
 		}
 
 		$log = print_r($log, true);

+ 1 - 1
Lib/Utility/Utility.php

@@ -447,7 +447,7 @@ class Utility {
 	 * @param integer $count Start the dimension count at this number
 	 * @return integer The number of dimensions in $array
 	 */
-	public static function countDim($array = null, $all = false, $count = 0) {
+	public static function countDim($array, $all = false, $count = 0) {
 		if ($all) {
 			$depth = array($count);
 			if (is_array($array) && reset($array) !== false) {

+ 1 - 1
Model/Behavior/RevisionBehavior.php

@@ -27,7 +27,7 @@ App::uses('Hash', 'Utility');
  *
  * Install instructions :
  *
- * - Place the newest version of RevisionBehavior in your APP/Model/Behaviors folder
+ * - Place the newest version of RevisionBehavior in your APP/Model/Behavior folder
  * - Add the behavior to AppModel (or single models if you prefer)
  * - Create a shadow table for each model that you want revision for.
  * - Behavior will gracefully do nothing for models that has behavior, without table

+ 4 - 0
Test/Case/Lib/Utility/UtilityTest.php

@@ -357,6 +357,10 @@ class UtilityTest extends MyCakeTestCase {
 
 		$result = Utility::countDim($set, true);
 		$this->assertEquals(5, $result);
+
+		$data = array('one' => array(null), array('null' => null), 'three' => array(true, false, null));
+		$result = Utility::countDim($data, true);
+		$this->assertEquals(2, $result);
 	}
 
 	/**

+ 0 - 1
View/Helper/TypographyHelper.php

@@ -132,7 +132,6 @@ class TypographyHelper extends AppHelper {
 		// Build our finalized string. We cycle through the array, skipping tags, and processing the contained text
 		$str = '';
 		$process = true;
-		$paragraph = false;
 		$currentChunk = 0;
 		$totalChunks = count($chunks);
 

+ 3 - 3
View/RssView.php

@@ -171,7 +171,7 @@ class RssView extends View {
 	/**
 	 * Serialize view vars.
 	 *
-	 * @param array $serialize The viewVars that need to be serialized.
+	 * @param string|array $serialize The viewVars that need to be serialized.
 	 * @return string The serialized data
 	 * @throws RuntimeException When the prefix is not specified
 	 */
@@ -239,8 +239,8 @@ class RssView extends View {
 	/**
 	 * RssView::_prepareOutput()
 	 *
-	 * @param aray $item
-	 * @return void
+	 * @param array $item
+	 * @return array
 	 */
 	protected function _prepareOutput($item) {
 		foreach ($item as $key => $val) {