Browse Source

moved chmod lib to utility package

euromark 13 years ago
parent
commit
c64ce30a75

+ 2 - 0
Console/Command/CodeShell.php

@@ -147,6 +147,8 @@ class CodeShell extends AppShell {
 			//FIXME: correct result for plugin classes
 			if ($missingClass == 'Component') {
 				$type = 'Controller';
+			} elseif ($missingClass == 'Helper') {
+				$type = 'View';
 			} elseif ($missingClass == 'ModelBehavior') {
 				$type = 'Model';
 			} elseif (!empty($this->params['plugin']) && ($location = App::location($missingClass))) {

+ 19 - 13
Lib/GeocodeLib.php

@@ -8,6 +8,8 @@ App::uses('HttpSocketLib', 'Tools.Lib');
  * @see DEPRECATED api2: http://code.google.com/intl/de-DE/apis/maps/articles/phpsqlgeocode.html
  * @see http://code.google.com/intl/de/apis/maps/documentation/geocoding/#Types
  *
+ * Used by Tools.GeocoderBehavior
+ *
  * TODOS (since 1.2):
  * - Work with exceptions in 2.x
  * - Rewrite in a cleaner 2.x way
@@ -126,7 +128,6 @@ class GeocodeLib {
 		//neighborhood premise subpremise natural_feature airport park point_of_interest colloquial_area political ?
 	);
 
-
 	public function __construct($options = array()) {
 		$this->defaultParams = $this->params;
 		$this->defaultOptions = $this->options;
@@ -180,7 +181,10 @@ class GeocodeLib {
 		return implode(', ', $this->error);
 	}
 
-
+	/**
+	 * @param bool $full
+	 * @return void
+	 */
 	public function reset($full = true) {
 		$this->error = array();
 		$this->result = null;
@@ -190,9 +194,10 @@ class GeocodeLib {
 		}
 	}
 
-
 	/**
-	 * build and return url
+	 * Build url
+	 *
+	 * @return string $url (full)
 	 * 2010-06-29 ms
 	 */
 	public function url() {
@@ -247,8 +252,7 @@ class GeocodeLib {
 	}
 
 	/**
-	 * results usually from most accurate to least accurate result (street_address
-, ..., country)
+	 * results usually from most accurate to least accurate result (street_address, ..., country)
 	 * @param float $lat
 	 * @param float $lng
 	 * @param array $options
@@ -348,7 +352,6 @@ class GeocodeLib {
 		return true;
 	}
 
-
 	/**
 	 * trying to avoid "TOO_MANY_QUERIES" error
 	 * @param bool $raise If the pause length should be raised
@@ -361,7 +364,6 @@ class GeocodeLib {
 		}
 	}
 
-
 	/**
 	 * @param string $address
 	 * @param array $settings
@@ -487,6 +489,9 @@ class GeocodeLib {
 		return true;
 	}
 
+	/**
+	 * @return bool $success
+	 */
 	protected function _isNotAccurateEnough($accuracy = null) {
 		if ($accuracy === null) {
 			if (isset($this->result[0])) {
@@ -512,7 +517,6 @@ class GeocodeLib {
 		return $accuracy < $this->options['min_accuracy'];
 	}
 
-
 	protected function _transformJson($record) {
 		$res = array();
 		//TODO
@@ -618,7 +622,6 @@ class GeocodeLib {
 
 		//TODO: add more
 
-
 		$res['lat'] = $record['geometry']['location']['lat'];
 		$res['lng'] = $record['geometry']['location']['lng'];
 		$res['location_type'] = $record['geometry']['location_type'];
@@ -704,8 +707,13 @@ class GeocodeLib {
 	}
 
 	/**
+	 * Convert between units
+	 *
+	 * @param float $value
+	 * @param char $fromUnit (using class constants)
+	 * @param char $toUnit (using class constants)
+	 * @return float $convertedValue
 	 * @throws CakeException
-	 * @return float $converterValue
 	 */
 	public function convert($value, $fromUnit, $toUnit) {
 		if (!isset($this->units[($fromUnit = strtoupper($fromUnit))]) || !isset($this->units[($toUnit = strtoupper($toUnit))])) {
@@ -722,7 +730,6 @@ class GeocodeLib {
 		return $value;
 	}
 
-
 	/**
 	 * Fuzziness filter for coordinates (lat or lng).
 	 * Useful if you store other users' locations and want to grant some
@@ -769,7 +776,6 @@ class GeocodeLib {
 		return $coord + $scrambleVal;
 	}
 
-
 	const TYPE_ROOFTOP = 'ROOFTOP';
 	const TYPE_RANGE_INTERPOLATED = 'RANGE_INTERPOLATED';
 	const TYPE_GEOMETRIC_CENTER = 'GEOMETRIC_CENTER';

Lib/ChmodLib.php → Lib/Utility/ChmodLib.php


+ 1 - 1
Test/Case/Lib/ChmodLibTest.php

@@ -1,6 +1,6 @@
 <?php
 
-App::uses('ChmodLib', 'Tools.Lib');
+App::uses('ChmodLib', 'Tools.Utility');
 
 /**
  * testing

+ 3 - 3
View/Helper/CommonHelper.php

@@ -369,10 +369,10 @@ class CommonHelper extends AppHelper {
 	 * 2009-07-23 ms
 	 */
 	public function asp($s, $c, $autoTranslate = false) {
-		if ((int)$c != 1) {
+		if ((int)$c !== 1) {
 			$p = Inflector::pluralize($s);
 		} else {
-		 		$p = null; # no pluralization necessary
+		 	$p = null; # no pluralization necessary
 		}
 		return $this->sp($s, $p, $c, $autoTranslate);
 	}
@@ -388,7 +388,7 @@ class CommonHelper extends AppHelper {
 	 * 2009-07-23 ms
 	 */
 	public function sp($s, $p, $c, $autoTranslate = false) {
-		if ((int)$c != 1) {
+		if ((int)$c !== 1) {
 			$ret = $p;
 		} else {
 		 		$ret = $s;