@@ -208,7 +208,7 @@ discard block |
||
| 208 | 208 | * Set the default route class to use or return the current one |
| 209 | 209 | * |
| 210 | 210 | * @param string $routeClass to set as default |
| 211 | - * @return mixed void|string |
|
| 211 | + * @return string|null void|string |
|
| 212 | 212 | * @throws RouterException |
| 213 | 213 | */ |
| 214 | 214 | public static function defaultRouteClass($routeClass = null) { |
@@ -471,7 +471,7 @@ discard block |
||
| 471 | 471 | * @param array $named A list of named parameters. Key value pairs are accepted where values are |
| 472 | 472 | * either regex strings to match, or arrays as seen above. |
| 473 | 473 | * @param array $options Allows to control all settings: separator, greedy, reset, default |
| 474 | - * @return array |
|
| 474 | + * @return string |
|
| 475 | 475 | */ |
| 476 | 476 | public static function connectNamed($named, $options = array()) { |
| 477 | 477 | if (isset($options['separator'])) { |
@@ -508,7 +508,7 @@ discard block |
||
| 508 | 508 | /** |
| 509 | 509 | * Gets the current named parameter configuration values. |
| 510 | 510 | * |
| 511 | - * @return array |
|
| 511 | + * @return string |
|
| 512 | 512 | * @see Router::$_namedConfig |
| 513 | 513 | */ |
| 514 | 514 | public static function namedConfig() { |
@@ -526,7 +526,7 @@ discard block |
||
| 526 | 526 | * integer values and UUIDs. |
| 527 | 527 | * - 'prefix' - URL prefix to use for the generated routes. Defaults to '/'. |
| 528 | 528 | * |
| 529 | - * @param string|array $controller A controller name or array of controller names (i.e. "Posts" or "ListItems") |
|
| 529 | + * @param string $controller A controller name or array of controller names (i.e. "Posts" or "ListItems") |
|
| 530 | 530 | * @param array $options Options to use when generating REST routes |
| 531 | 531 | * @return array Array of mapped resources |
| 532 | 532 | */ |
@@ -1054,7 +1054,7 @@ discard block |
||
| 1054 | 1054 | * an array of arguments to convert into a query string. |
| 1055 | 1055 | * @param array $extra Extra querystring parameters. |
| 1056 | 1056 | * @param boolean $escape Whether or not to use escaped & |
| 1057 | - * @return array |
|
| 1057 | + * @return null|string |
|
| 1058 | 1058 | */ |
| 1059 | 1059 | public static function queryString($q, $extra = array(), $escape = false) { |
| 1060 | 1060 | if (empty($q) && empty($extra)) { |
@@ -229,7 +229,7 @@ discard block |
||
| 229 | 229 | protected static function _validateRouteClass($routeClass) { |
| 230 | 230 | if ( |
| 231 | 231 | $routeClass !== 'CakeRoute' && |
| 232 | - (!class_exists($routeClass) || !is_subclass_of($routeClass, 'CakeRoute')) |
|
| 232 | + ( ! class_exists($routeClass) || ! is_subclass_of($routeClass, 'CakeRoute')) |
|
| 233 | 233 | ) { |
| 234 | 234 | throw new RouterException(__d('cake_dev', 'Route class not found, or route class is not a subclass of CakeRoute')); |
| 235 | 235 | } |
@@ -243,8 +243,8 @@ discard block |
||
| 243 | 243 | */ |
| 244 | 244 | protected static function _setPrefixes() { |
| 245 | 245 | $routing = Configure::read('Routing'); |
| 246 | - if (!empty($routing['prefixes'])) { |
|
| 247 | - self::$_prefixes = array_merge(self::$_prefixes, (array)$routing['prefixes']); |
|
| 246 | + if ( ! empty($routing['prefixes'])) { |
|
| 247 | + self::$_prefixes = array_merge(self::$_prefixes, (array) $routing['prefixes']); |
|
| 248 | 248 | } |
| 249 | 249 | } |
| 250 | 250 | |
@@ -534,27 +534,27 @@ discard block |
||
| 534 | 534 | $hasPrefix = isset($options['prefix']); |
| 535 | 535 | $options = array_merge(array( |
| 536 | 536 | 'prefix' => '/', |
| 537 | - 'id' => self::ID . '|' . self::UUID |
|
| 537 | + 'id' => self::ID.'|'.self::UUID |
|
| 538 | 538 | ), $options); |
| 539 | 539 | |
| 540 | 540 | $prefix = $options['prefix']; |
| 541 | 541 | if (strpos($prefix, '/') !== 0) { |
| 542 | - $prefix = '/' . $prefix; |
|
| 542 | + $prefix = '/'.$prefix; |
|
| 543 | 543 | } |
| 544 | 544 | if (substr($prefix, -1) !== '/') { |
| 545 | 545 | $prefix .= '/'; |
| 546 | 546 | } |
| 547 | 547 | |
| 548 | - foreach ((array)$controller as $name) { |
|
| 548 | + foreach ((array) $controller as $name) { |
|
| 549 | 549 | list($plugin, $name) = pluginSplit($name); |
| 550 | 550 | $urlName = Inflector::underscore($name); |
| 551 | 551 | $plugin = Inflector::underscore($plugin); |
| 552 | - if ($plugin && !$hasPrefix) { |
|
| 553 | - $prefix = '/' . $plugin . '/'; |
|
| 552 | + if ($plugin && ! $hasPrefix) { |
|
| 553 | + $prefix = '/'.$plugin.'/'; |
|
| 554 | 554 | } |
| 555 | 555 | |
| 556 | 556 | foreach (self::$_resourceMap as $params) { |
| 557 | - $url = $prefix . $urlName . (($params['id']) ? '/:id' : ''); |
|
| 557 | + $url = $prefix.$urlName.(($params['id']) ? '/:id' : ''); |
|
| 558 | 558 | |
| 559 | 559 | Router::connect($url, |
| 560 | 560 | array( |
@@ -587,7 +587,7 @@ discard block |
||
| 587 | 587 | * @return array Parsed elements from URL |
| 588 | 588 | */ |
| 589 | 589 | public static function parse($url) { |
| 590 | - if (!self::$initialized) { |
|
| 590 | + if ( ! self::$initialized) { |
|
| 591 | 591 | self::_loadRoutes(); |
| 592 | 592 | } |
| 593 | 593 | |
@@ -595,7 +595,7 @@ discard block |
||
| 595 | 595 | $out = array(); |
| 596 | 596 | |
| 597 | 597 | if (strlen($url) && strpos($url, '/') !== 0) { |
| 598 | - $url = '/' . $url; |
|
| 598 | + $url = '/'.$url; |
|
| 599 | 599 | } |
| 600 | 600 | if (strpos($url, '?') !== false) { |
| 601 | 601 | list($url, $queryParameters) = explode('?', $url, 2); |
@@ -605,23 +605,23 @@ discard block |
||
| 605 | 605 | extract(self::_parseExtension($url)); |
| 606 | 606 | |
| 607 | 607 | for ($i = 0, $len = count(self::$routes); $i < $len; $i++) { |
| 608 | - $route =& self::$routes[$i]; |
|
| 608 | + $route = & self::$routes[$i]; |
|
| 609 | 609 | |
| 610 | 610 | if (($r = $route->parse($url)) !== false) { |
| 611 | - self::$_currentRoute[] =& $route; |
|
| 611 | + self::$_currentRoute[] = & $route; |
|
| 612 | 612 | $out = $r; |
| 613 | 613 | break; |
| 614 | 614 | } |
| 615 | 615 | } |
| 616 | 616 | if (isset($out['prefix'])) { |
| 617 | - $out['action'] = $out['prefix'] . '_' . $out['action']; |
|
| 617 | + $out['action'] = $out['prefix'].'_'.$out['action']; |
|
| 618 | 618 | } |
| 619 | 619 | |
| 620 | - if (!empty($ext) && !isset($out['ext'])) { |
|
| 620 | + if ( ! empty($ext) && ! isset($out['ext'])) { |
|
| 621 | 621 | $out['ext'] = $ext; |
| 622 | 622 | } |
| 623 | 623 | |
| 624 | - if (!empty($queryParameters) && !isset($out['?'])) { |
|
| 624 | + if ( ! empty($queryParameters) && ! isset($out['?'])) { |
|
| 625 | 625 | $out['?'] = $queryParameters; |
| 626 | 626 | } |
| 627 | 627 | return $out; |
@@ -640,12 +640,12 @@ discard block |
||
| 640 | 640 | if (preg_match('/\.[0-9a-zA-Z]*$/', $url, $match) === 1) { |
| 641 | 641 | $match = substr($match[0], 1); |
| 642 | 642 | if (empty(self::$_validExtensions)) { |
| 643 | - $url = substr($url, 0, strpos($url, '.' . $match)); |
|
| 643 | + $url = substr($url, 0, strpos($url, '.'.$match)); |
|
| 644 | 644 | $ext = $match; |
| 645 | 645 | } else { |
| 646 | 646 | foreach (self::$_validExtensions as $name) { |
| 647 | 647 | if (strcasecmp($name, $match) === 0) { |
| 648 | - $url = substr($url, 0, strpos($url, '.' . $name)); |
|
| 648 | + $url = substr($url, 0, strpos($url, '.'.$name)); |
|
| 649 | 649 | $ext = $match; |
| 650 | 650 | break; |
| 651 | 651 | } |
@@ -748,7 +748,7 @@ discard block |
||
| 748 | 748 | if ($current) { |
| 749 | 749 | return self::$_requests[count(self::$_requests) - 1]; |
| 750 | 750 | } |
| 751 | - if (!isset(self::$_requests[0])) { |
|
| 751 | + if ( ! isset(self::$_requests[0])) { |
|
| 752 | 752 | return array('base' => null); |
| 753 | 753 | } |
| 754 | 754 | return array('base' => self::$_requests[0]->base); |
@@ -785,10 +785,10 @@ discard block |
||
| 785 | 785 | if ($which === null) { |
| 786 | 786 | $which = count(self::$routes) - 1; |
| 787 | 787 | } |
| 788 | - if (!isset(self::$routes[$which])) { |
|
| 788 | + if ( ! isset(self::$routes[$which])) { |
|
| 789 | 789 | return false; |
| 790 | 790 | } |
| 791 | - $route =& self::$routes[$which]; |
|
| 791 | + $route = & self::$routes[$which]; |
|
| 792 | 792 | unset(self::$routes[$which]); |
| 793 | 793 | array_unshift(self::$routes, $route); |
| 794 | 794 | return true; |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | * @return string Full translated URL with base path. |
| 825 | 825 | */ |
| 826 | 826 | public static function url($url = null, $full = false) { |
| 827 | - if (!self::$initialized) { |
|
| 827 | + if ( ! self::$initialized) { |
|
| 828 | 828 | self::_loadRoutes(); |
| 829 | 829 | } |
| 830 | 830 | |
@@ -837,7 +837,7 @@ discard block |
||
| 837 | 837 | } |
| 838 | 838 | |
| 839 | 839 | $path = array('base' => null); |
| 840 | - if (!empty(self::$_requests)) { |
|
| 840 | + if ( ! empty(self::$_requests)) { |
|
| 841 | 841 | $request = self::$_requests[count(self::$_requests) - 1]; |
| 842 | 842 | $params = $request->params; |
| 843 | 843 | $path = array('base' => $request->base, 'here' => $request->here); |
@@ -852,7 +852,7 @@ discard block |
||
| 852 | 852 | if (empty($url)) { |
| 853 | 853 | $output = isset($path['here']) ? $path['here'] : '/'; |
| 854 | 854 | if ($full) { |
| 855 | - $output = self::fullBaseUrl() . $output; |
|
| 855 | + $output = self::fullBaseUrl().$output; |
|
| 856 | 856 | } |
| 857 | 857 | return $output; |
| 858 | 858 | } elseif (is_array($url)) { |
@@ -869,11 +869,11 @@ discard block |
||
| 869 | 869 | unset($url['?']); |
| 870 | 870 | } |
| 871 | 871 | if (isset($url['#'])) { |
| 872 | - $frag = '#' . $url['#']; |
|
| 872 | + $frag = '#'.$url['#']; |
|
| 873 | 873 | unset($url['#']); |
| 874 | 874 | } |
| 875 | 875 | if (isset($url['ext'])) { |
| 876 | - $extension = '.' . $url['ext']; |
|
| 876 | + $extension = '.'.$url['ext']; |
|
| 877 | 877 | unset($url['ext']); |
| 878 | 878 | } |
| 879 | 879 | if (empty($url['action'])) { |
@@ -886,12 +886,12 @@ discard block |
||
| 886 | 886 | |
| 887 | 887 | $prefixExists = (array_intersect_key($url, array_flip(self::$_prefixes))); |
| 888 | 888 | foreach (self::$_prefixes as $prefix) { |
| 889 | - if (!empty($params[$prefix]) && !$prefixExists) { |
|
| 889 | + if ( ! empty($params[$prefix]) && ! $prefixExists) { |
|
| 890 | 890 | $url[$prefix] = true; |
| 891 | - } elseif (isset($url[$prefix]) && !$url[$prefix]) { |
|
| 891 | + } elseif (isset($url[$prefix]) && ! $url[$prefix]) { |
|
| 892 | 892 | unset($url[$prefix]); |
| 893 | 893 | } |
| 894 | - if (isset($url[$prefix]) && strpos($url['action'], $prefix . '_') === 0) { |
|
| 894 | + if (isset($url[$prefix]) && strpos($url['action'], $prefix.'_') === 0) { |
|
| 895 | 895 | $url['action'] = substr($url['action'], strlen($prefix) + 1); |
| 896 | 896 | } |
| 897 | 897 | } |
@@ -923,28 +923,28 @@ discard block |
||
| 923 | 923 | } else { |
| 924 | 924 | foreach (self::$_prefixes as $prefix) { |
| 925 | 925 | if (isset($params[$prefix])) { |
| 926 | - $output .= $prefix . '/'; |
|
| 926 | + $output .= $prefix.'/'; |
|
| 927 | 927 | break; |
| 928 | 928 | } |
| 929 | 929 | } |
| 930 | - if (!empty($params['plugin']) && $params['plugin'] !== $params['controller']) { |
|
| 931 | - $output .= Inflector::underscore($params['plugin']) . '/'; |
|
| 930 | + if ( ! empty($params['plugin']) && $params['plugin'] !== $params['controller']) { |
|
| 931 | + $output .= Inflector::underscore($params['plugin']).'/'; |
|
| 932 | 932 | } |
| 933 | - $output .= Inflector::underscore($params['controller']) . '/' . $url; |
|
| 933 | + $output .= Inflector::underscore($params['controller']).'/'.$url; |
|
| 934 | 934 | } |
| 935 | 935 | } |
| 936 | 936 | $protocol = preg_match('#^[a-z][a-z0-9+\-.]*\://#i', $output); |
| 937 | 937 | if ($protocol === 0) { |
| 938 | - $output = str_replace('//', '/', $base . '/' . $output); |
|
| 938 | + $output = str_replace('//', '/', $base.'/'.$output); |
|
| 939 | 939 | |
| 940 | 940 | if ($full) { |
| 941 | - $output = self::fullBaseUrl() . $output; |
|
| 941 | + $output = self::fullBaseUrl().$output; |
|
| 942 | 942 | } |
| 943 | - if (!empty($extension)) { |
|
| 943 | + if ( ! empty($extension)) { |
|
| 944 | 944 | $output = rtrim($output, '/'); |
| 945 | 945 | } |
| 946 | 946 | } |
| 947 | - return $output . $extension . self::queryString($q, array(), $escape) . $frag; |
|
| 947 | + return $output.$extension.self::queryString($q, array(), $escape).$frag; |
|
| 948 | 948 | } |
| 949 | 949 | |
| 950 | 950 | /** |
@@ -1003,14 +1003,14 @@ discard block |
||
| 1003 | 1003 | |
| 1004 | 1004 | list($args, $named) = array(Hash::filter($args), Hash::filter($named)); |
| 1005 | 1005 | foreach (self::$_prefixes as $prefix) { |
| 1006 | - $prefixed = $prefix . '_'; |
|
| 1007 | - if (!empty($url[$prefix]) && strpos($url['action'], $prefixed) === 0) { |
|
| 1006 | + $prefixed = $prefix.'_'; |
|
| 1007 | + if ( ! empty($url[$prefix]) && strpos($url['action'], $prefixed) === 0) { |
|
| 1008 | 1008 | $url['action'] = substr($url['action'], strlen($prefixed) * -1); |
| 1009 | 1009 | break; |
| 1010 | 1010 | } |
| 1011 | 1011 | } |
| 1012 | 1012 | |
| 1013 | - if (empty($named) && empty($args) && (!isset($url['action']) || $url['action'] === 'index')) { |
|
| 1013 | + if (empty($named) && empty($args) && ( ! isset($url['action']) || $url['action'] === 'index')) { |
|
| 1014 | 1014 | $url['action'] = null; |
| 1015 | 1015 | } |
| 1016 | 1016 | |
@@ -1028,19 +1028,19 @@ discard block |
||
| 1028 | 1028 | } |
| 1029 | 1029 | $output = implode('/', $urlOut); |
| 1030 | 1030 | |
| 1031 | - if (!empty($args)) { |
|
| 1032 | - $output .= '/' . implode('/', array_map('rawurlencode', $args)); |
|
| 1031 | + if ( ! empty($args)) { |
|
| 1032 | + $output .= '/'.implode('/', array_map('rawurlencode', $args)); |
|
| 1033 | 1033 | } |
| 1034 | 1034 | |
| 1035 | - if (!empty($named)) { |
|
| 1035 | + if ( ! empty($named)) { |
|
| 1036 | 1036 | foreach ($named as $name => $value) { |
| 1037 | 1037 | if (is_array($value)) { |
| 1038 | 1038 | $flattend = Hash::flatten($value, '%5D%5B'); |
| 1039 | 1039 | foreach ($flattend as $namedKey => $namedValue) { |
| 1040 | - $output .= '/' . $name . "%5B{$namedKey}%5D" . self::$_namedConfig['separator'] . rawurlencode($namedValue); |
|
| 1040 | + $output .= '/'.$name."%5B{$namedKey}%5D".self::$_namedConfig['separator'].rawurlencode($namedValue); |
|
| 1041 | 1041 | } |
| 1042 | 1042 | } else { |
| 1043 | - $output .= '/' . $name . self::$_namedConfig['separator'] . rawurlencode($value); |
|
| 1043 | + $output .= '/'.$name.self::$_namedConfig['separator'].rawurlencode($value); |
|
| 1044 | 1044 | } |
| 1045 | 1045 | } |
| 1046 | 1046 | } |
@@ -1081,7 +1081,7 @@ discard block |
||
| 1081 | 1081 | $out .= $addition; |
| 1082 | 1082 | |
| 1083 | 1083 | if (isset($out[0]) && $out[0] !== '?') { |
| 1084 | - $out = '?' . $out; |
|
| 1084 | + $out = '?'.$out; |
|
| 1085 | 1085 | } |
| 1086 | 1086 | return $out; |
| 1087 | 1087 | } |
@@ -1117,7 +1117,7 @@ discard block |
||
| 1117 | 1117 | $params['_Token'] |
| 1118 | 1118 | ); |
| 1119 | 1119 | $params = array_merge($params, $pass, $named); |
| 1120 | - if (!empty($url)) { |
|
| 1120 | + if ( ! empty($url)) { |
|
| 1121 | 1121 | $params['?'] = $url; |
| 1122 | 1122 | } |
| 1123 | 1123 | return Router::url($params, $full); |
@@ -1141,10 +1141,10 @@ discard block |
||
| 1141 | 1141 | } |
| 1142 | 1142 | $request = Router::getRequest(); |
| 1143 | 1143 | |
| 1144 | - if (!empty($request->base) && stristr($url, $request->base)) { |
|
| 1145 | - $url = preg_replace('/^' . preg_quote($request->base, '/') . '/', '', $url, 1); |
|
| 1144 | + if ( ! empty($request->base) && stristr($url, $request->base)) { |
|
| 1145 | + $url = preg_replace('/^'.preg_quote($request->base, '/').'/', '', $url, 1); |
|
| 1146 | 1146 | } |
| 1147 | - $url = '/' . $url; |
|
| 1147 | + $url = '/'.$url; |
|
| 1148 | 1148 | |
| 1149 | 1149 | while (strpos($url, '//') !== false) { |
| 1150 | 1150 | $url = str_replace('//', '/', $url); |
@@ -1185,7 +1185,7 @@ discard block |
||
| 1185 | 1185 | */ |
| 1186 | 1186 | public static function stripPlugin($base, $plugin = null) { |
| 1187 | 1187 | if ($plugin) { |
| 1188 | - $base = preg_replace('/(?:' . $plugin . ')/', '', $base); |
|
| 1188 | + $base = preg_replace('/(?:'.$plugin.')/', '', $base); |
|
| 1189 | 1189 | $base = str_replace('//', '', $base); |
| 1190 | 1190 | $pos1 = strrpos($base, '/'); |
| 1191 | 1191 | $char = strlen($base) - 1; |
@@ -1230,7 +1230,7 @@ discard block |
||
| 1230 | 1230 | * @return array Array of extensions Router is configured to parse. |
| 1231 | 1231 | */ |
| 1232 | 1232 | public static function extensions() { |
| 1233 | - if (!self::$initialized) { |
|
| 1233 | + if ( ! self::$initialized) { |
|
| 1234 | 1234 | self::_loadRoutes(); |
| 1235 | 1235 | } |
| 1236 | 1236 | |
@@ -1247,10 +1247,10 @@ discard block |
||
| 1247 | 1247 | * @return array |
| 1248 | 1248 | */ |
| 1249 | 1249 | public static function setExtensions($extensions, $merge = true) { |
| 1250 | - if (!is_array($extensions)) { |
|
| 1250 | + if ( ! is_array($extensions)) { |
|
| 1251 | 1251 | return self::$_validExtensions; |
| 1252 | 1252 | } |
| 1253 | - if (!$merge) { |
|
| 1253 | + if ( ! $merge) { |
|
| 1254 | 1254 | return self::$_validExtensions = $extensions; |
| 1255 | 1255 | } |
| 1256 | 1256 | return self::$_validExtensions = array_merge(self::$_validExtensions, $extensions); |
@@ -1263,7 +1263,7 @@ discard block |
||
| 1263 | 1263 | */ |
| 1264 | 1264 | protected static function _loadRoutes() { |
| 1265 | 1265 | self::$initialized = true; |
| 1266 | - include APP . 'Config' . DS . 'routes.php'; |
|
| 1266 | + include APP.'Config'.DS.'routes.php'; |
|
| 1267 | 1267 | } |
| 1268 | 1268 | |
| 1269 | 1269 | } |
@@ -28,7 +28,7 @@ |
||
| 28 | 28 | /** |
| 29 | 29 | * suite method, defines tests for this suite. |
| 30 | 30 | * |
| 31 | - * @return void |
|
| 31 | + * @return CakeTestSuite |
|
| 32 | 32 | */ |
| 33 | 33 | public static function suite() { |
| 34 | 34 | $suite = new CakeTestSuite('All console classes'); |
@@ -33,11 +33,11 @@ |
||
| 33 | 33 | public static function suite() { |
| 34 | 34 | $suite = new CakeTestSuite('All console classes'); |
| 35 | 35 | |
| 36 | - $path = CORE_TEST_CASES . DS . 'Console' . DS; |
|
| 36 | + $path = CORE_TEST_CASES.DS.'Console'.DS; |
|
| 37 | 37 | |
| 38 | - $suite->addTestFile($path . 'AllConsoleLibsTest.php'); |
|
| 39 | - $suite->addTestFile($path . 'AllTasksTest.php'); |
|
| 40 | - $suite->addTestFile($path . 'AllShellsTest.php'); |
|
| 38 | + $suite->addTestFile($path.'AllConsoleLibsTest.php'); |
|
| 39 | + $suite->addTestFile($path.'AllTasksTest.php'); |
|
| 40 | + $suite->addTestFile($path.'AllShellsTest.php'); |
|
| 41 | 41 | return $suite; |
| 42 | 42 | } |
| 43 | 43 | } |
@@ -65,7 +65,7 @@ discard block |
||
| 65 | 65 | /** |
| 66 | 66 | * _stop method |
| 67 | 67 | * |
| 68 | - * @return void |
|
| 68 | + * @return integer |
|
| 69 | 69 | */ |
| 70 | 70 | protected function _stop($status = 0) { |
| 71 | 71 | $this->stopped = 'Stopped with status: ' . $status; |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | /** |
| 86 | 86 | * _getShell |
| 87 | 87 | * |
| 88 | - * @param string $plugin |
|
| 88 | + * @param string $shell |
|
| 89 | 89 | * @return mixed |
| 90 | 90 | */ |
| 91 | 91 | protected function _getShell($shell) { |
@@ -68,7 +68,7 @@ discard block |
||
| 68 | 68 | * @return void |
| 69 | 69 | */ |
| 70 | 70 | protected function _stop($status = 0) { |
| 71 | - $this->stopped = 'Stopped with status: ' . $status; |
|
| 71 | + $this->stopped = 'Stopped with status: '.$status; |
|
| 72 | 72 | return $status; |
| 73 | 73 | } |
| 74 | 74 | |
@@ -113,10 +113,10 @@ discard block |
||
| 113 | 113 | parent::setUp(); |
| 114 | 114 | App::build(array( |
| 115 | 115 | 'Plugin' => array( |
| 116 | - CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS |
|
| 116 | + CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS |
|
| 117 | 117 | ), |
| 118 | 118 | 'Console/Command' => array( |
| 119 | - CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS |
|
| 119 | + CAKE.'Test'.DS.'test_app'.DS.'Console'.DS.'Command'.DS |
|
| 120 | 120 | ) |
| 121 | 121 | ), App::RESET); |
| 122 | 122 | CakePlugin::load('TestPlugin'); |
@@ -161,7 +161,7 @@ discard block |
||
| 161 | 161 | $expected = array( |
| 162 | 162 | 'app' => 'app', |
| 163 | 163 | 'webroot' => 'webroot', |
| 164 | - 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'app'), |
|
| 164 | + 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH).DS.'app'), |
|
| 165 | 165 | 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)), |
| 166 | 166 | ); |
| 167 | 167 | $Dispatcher->params = $Dispatcher->args = array(); |
@@ -176,7 +176,7 @@ discard block |
||
| 176 | 176 | $expected = array( |
| 177 | 177 | 'app' => 'new', |
| 178 | 178 | 'webroot' => 'webroot', |
| 179 | - 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'), |
|
| 179 | + 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH).DS.'new'), |
|
| 180 | 180 | 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)) |
| 181 | 181 | ); |
| 182 | 182 | $Dispatcher->params = $Dispatcher->args = array(); |
@@ -195,7 +195,7 @@ discard block |
||
| 195 | 195 | $expected = array( |
| 196 | 196 | 'app' => 'new', |
| 197 | 197 | 'webroot' => 'webroot', |
| 198 | - 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'), |
|
| 198 | + 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH).DS.'new'), |
|
| 199 | 199 | 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)) |
| 200 | 200 | ); |
| 201 | 201 | |
@@ -214,7 +214,7 @@ discard block |
||
| 214 | 214 | $expected = array( |
| 215 | 215 | 'app' => 'new', |
| 216 | 216 | 'webroot' => 'webroot', |
| 217 | - 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'), |
|
| 217 | + 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH).DS.'new'), |
|
| 218 | 218 | 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)) |
| 219 | 219 | ); |
| 220 | 220 | $Dispatcher->params = $Dispatcher->args = array(); |
@@ -232,7 +232,7 @@ discard block |
||
| 232 | 232 | ); |
| 233 | 233 | $expected = array( |
| 234 | 234 | 'app' => 'new', |
| 235 | - 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'new'), |
|
| 235 | + 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH).DS.'new'), |
|
| 236 | 236 | 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)), |
| 237 | 237 | 'webroot' => 'webroot' |
| 238 | 238 | ); |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $expected = array( |
| 256 | 256 | 'app' => 'app', |
| 257 | 257 | 'webroot' => 'webroot', |
| 258 | - 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH) . DS . 'app'), |
|
| 258 | + 'working' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH).DS.'app'), |
|
| 259 | 259 | 'root' => str_replace('\\', DS, dirname(CAKE_CORE_INCLUDE_PATH)), |
| 260 | 260 | ); |
| 261 | 261 | $Dispatcher->params = $Dispatcher->args = array(); |
@@ -495,7 +495,7 @@ discard block |
||
| 495 | 495 | * Generates a list of the current aro and aco structures and a grid dump of the permissions that are defined |
| 496 | 496 | * Only designed to work with the db based ACL |
| 497 | 497 | * |
| 498 | - * @param boolean $treesToo |
|
| 498 | + * @param boolean $printTreesToo |
|
| 499 | 499 | * @return void |
| 500 | 500 | */ |
| 501 | 501 | protected function _debug($printTreesToo = false) { |
@@ -543,7 +543,7 @@ discard block |
||
| 543 | 543 | * |
| 544 | 544 | * @param string $string |
| 545 | 545 | * @param integer $len |
| 546 | - * @return void |
|
| 546 | + * @return string |
|
| 547 | 547 | */ |
| 548 | 548 | protected function _pad($string = '', $len = 14) { |
| 549 | 549 | return str_pad($string, $len); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | App::uses('DbAcl', 'Controller/Component/Acl'); |
| 22 | 22 | App::uses('AclNode', 'Model'); |
| 23 | 23 | App::uses('Permission', 'Model'); |
| 24 | -require_once dirname(dirname(dirname(dirname(__FILE__)))) . DS . 'Model' . DS . 'models.php'; |
|
| 24 | +require_once dirname(dirname(dirname(dirname(__FILE__)))).DS.'Model'.DS.'models.php'; |
|
| 25 | 25 | |
| 26 | 26 | /** |
| 27 | 27 | * AclNodeTwoTestBase class |
@@ -214,24 +214,24 @@ discard block |
||
| 214 | 214 | */ |
| 215 | 215 | public function testCreate() { |
| 216 | 216 | $this->Acl->Aro->create(array('alias' => 'Chotchkey')); |
| 217 | - $this->assertTrue((bool)$this->Acl->Aro->save()); |
|
| 217 | + $this->assertTrue((bool) $this->Acl->Aro->save()); |
|
| 218 | 218 | |
| 219 | 219 | $parent = $this->Acl->Aro->id; |
| 220 | 220 | |
| 221 | 221 | $this->Acl->Aro->create(array('parent_id' => $parent, 'alias' => 'Joanna')); |
| 222 | - $this->assertTrue((bool)$this->Acl->Aro->save()); |
|
| 222 | + $this->assertTrue((bool) $this->Acl->Aro->save()); |
|
| 223 | 223 | |
| 224 | 224 | $this->Acl->Aro->create(array('parent_id' => $parent, 'alias' => 'Stapler')); |
| 225 | - $this->assertTrue((bool)$this->Acl->Aro->save()); |
|
| 225 | + $this->assertTrue((bool) $this->Acl->Aro->save()); |
|
| 226 | 226 | |
| 227 | 227 | $root = $this->Acl->Aco->node('ROOT'); |
| 228 | 228 | $parent = $root[0]['AcoTwoTest']['id']; |
| 229 | 229 | |
| 230 | 230 | $this->Acl->Aco->create(array('parent_id' => $parent, 'alias' => 'Drinks')); |
| 231 | - $this->assertTrue((bool)$this->Acl->Aco->save()); |
|
| 231 | + $this->assertTrue((bool) $this->Acl->Aco->save()); |
|
| 232 | 232 | |
| 233 | 233 | $this->Acl->Aco->create(array('parent_id' => $parent, 'alias' => 'PiecesOfFlair')); |
| 234 | - $this->assertTrue((bool)$this->Acl->Aco->save()); |
|
| 234 | + $this->assertTrue((bool) $this->Acl->Aco->save()); |
|
| 235 | 235 | } |
| 236 | 236 | |
| 237 | 237 | /** |
@@ -119,6 +119,7 @@ discard block |
||
| 119 | 119 | /** |
| 120 | 120 | * construct method |
| 121 | 121 | * |
| 122 | + * @param CakeRequest $request |
|
| 122 | 123 | */ |
| 123 | 124 | public function __construct($request, $response) { |
| 124 | 125 | $request->addParams(Router::parse('/auth_test')); |
@@ -184,7 +185,7 @@ discard block |
||
| 184 | 185 | * @param string|array $url |
| 185 | 186 | * @param mixed $status |
| 186 | 187 | * @param mixed $exit |
| 187 | - * @return void |
|
| 188 | + * @return boolean |
|
| 188 | 189 | */ |
| 189 | 190 | public function redirect($url, $status = null, $exit = true) { |
| 190 | 191 | $this->testUrl = Router::url($url); |
@@ -257,7 +258,7 @@ discard block |
||
| 257 | 258 | * @param string|array $url |
| 258 | 259 | * @param mixed $status |
| 259 | 260 | * @param mixed $exit |
| 260 | - * @return void |
|
| 261 | + * @return boolean |
|
| 261 | 262 | */ |
| 262 | 263 | public function redirect($url, $status = null, $exit = true) { |
| 263 | 264 | $this->testUrl = Router::url($url); |
@@ -1090,7 +1090,7 @@ discard block |
||
| 1090 | 1090 | $pref = Configure::read('Routing.prefixes'); |
| 1091 | 1091 | Configure::write('Routing.prefixes', array('admin')); |
| 1092 | 1092 | Router::reload(); |
| 1093 | - require CAKE . 'Config' . DS . 'routes.php'; |
|
| 1093 | + require CAKE.'Config'.DS.'routes.php'; |
|
| 1094 | 1094 | |
| 1095 | 1095 | $url = '/admin/auth_test/add'; |
| 1096 | 1096 | $this->Auth->request->addParams(Router::parse($url)); |
@@ -1117,7 +1117,7 @@ discard block |
||
| 1117 | 1117 | */ |
| 1118 | 1118 | public function testAjaxLogin() { |
| 1119 | 1119 | App::build(array( |
| 1120 | - 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS) |
|
| 1120 | + 'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS) |
|
| 1121 | 1121 | )); |
| 1122 | 1122 | $_SERVER['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest'; |
| 1123 | 1123 | |
@@ -1141,7 +1141,7 @@ discard block |
||
| 1141 | 1141 | $admin = Configure::read('Routing.prefixes'); |
| 1142 | 1142 | Configure::write('Routing.prefixes', array('admin')); |
| 1143 | 1143 | Router::reload(); |
| 1144 | - require CAKE . 'Config' . DS . 'routes.php'; |
|
| 1144 | + require CAKE.'Config'.DS.'routes.php'; |
|
| 1145 | 1145 | |
| 1146 | 1146 | $url = '/admin/auth_test/login'; |
| 1147 | 1147 | $this->Auth->request->addParams(Router::parse($url)); |
@@ -86,8 +86,7 @@ |
||
| 86 | 86 | /** |
| 87 | 87 | * find method |
| 88 | 88 | * |
| 89 | - * @param mixed $type |
|
| 90 | - * @param array $options |
|
| 89 | + * @param array $conditions |
|
| 91 | 90 | * @return void |
| 92 | 91 | */ |
| 93 | 92 | public function find($conditions = null, $fields = array(), $order = null, $recursive = null) { |
@@ -1029,10 +1029,10 @@ discard block |
||
| 1029 | 1029 | $this->assertEquals('desc', $result['order']['Child.something']); |
| 1030 | 1030 | } |
| 1031 | 1031 | /** |
| 1032 | - * test that multiple sort works. |
|
| 1033 | - * |
|
| 1034 | - * @return void |
|
| 1035 | - */ |
|
| 1032 | + * test that multiple sort works. |
|
| 1033 | + * |
|
| 1034 | + * @return void |
|
| 1035 | + */ |
|
| 1036 | 1036 | public function testValidateSortMultiple() { |
| 1037 | 1037 | $model = $this->getMock('Model'); |
| 1038 | 1038 | $model->alias = 'model'; |
@@ -1233,10 +1233,10 @@ discard block |
||
| 1233 | 1233 | $this->assertFalse($result['prevPage']); |
| 1234 | 1234 | } |
| 1235 | 1235 | /** |
| 1236 | - * test paginate() and custom find with fields array, to make sure the correct count is returned. |
|
| 1237 | - * |
|
| 1238 | - * @return void |
|
| 1239 | - */ |
|
| 1236 | + * test paginate() and custom find with fields array, to make sure the correct count is returned. |
|
| 1237 | + * |
|
| 1238 | + * @return void |
|
| 1239 | + */ |
|
| 1240 | 1240 | public function testPaginateCustomFindFieldsArray() { |
| 1241 | 1241 | $Controller = new Controller($this->request); |
| 1242 | 1242 | $Controller->uses = array('PaginatorCustomPost'); |
@@ -1265,10 +1265,10 @@ discard block |
||
| 1265 | 1265 | $this->assertFalse($result['prevPage']); |
| 1266 | 1266 | } |
| 1267 | 1267 | /** |
| 1268 | - * test paginate() and custom find with customFind key, to make sure the correct count is returned. |
|
| 1269 | - * |
|
| 1270 | - * @return void |
|
| 1271 | - */ |
|
| 1268 | + * test paginate() and custom find with customFind key, to make sure the correct count is returned. |
|
| 1269 | + * |
|
| 1270 | + * @return void |
|
| 1271 | + */ |
|
| 1272 | 1272 | public function testPaginateCustomFindWithCustomFindKey() { |
| 1273 | 1273 | $Controller = new Controller($this->request); |
| 1274 | 1274 | $Controller->uses = array('PaginatorCustomPost'); |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function find($conditions = null, $fields = array(), $order = null, $recursive = null) { |
| 94 | 94 | if ($conditions === 'popular') { |
| 95 | - $conditions = array($this->name . '.' . $this->primaryKey . ' > ' => '1'); |
|
| 95 | + $conditions = array($this->name.'.'.$this->primaryKey.' > ' => '1'); |
|
| 96 | 96 | $options = Hash::merge($fields, compact('conditions')); |
| 97 | 97 | return parent::find('all', $options); |
| 98 | 98 | } |
@@ -260,7 +260,7 @@ discard block |
||
| 260 | 260 | */ |
| 261 | 261 | protected function _findTotalsOperation($state, $query, $results = array()) { |
| 262 | 262 | if ($state === 'before') { |
| 263 | - if (!empty($query['operation']) && $query['operation'] === 'count') { |
|
| 263 | + if ( ! empty($query['operation']) && $query['operation'] === 'count') { |
|
| 264 | 264 | unset($query['limit']); |
| 265 | 265 | $query['recursive'] = -1; |
| 266 | 266 | $query['fields'] = array('COUNT(DISTINCT author_id) AS count'); |
@@ -452,7 +452,7 @@ discard block |
||
| 452 | 452 | $result = $Controller->Paginator->paginate('PaginatorControllerPost'); |
| 453 | 453 | $this->assertEquals(1, $Controller->params['paging']['PaginatorControllerPost']['page']); |
| 454 | 454 | $this->assertEquals(array(1, 2, 3), Hash::extract($result, '{n}.PaginatorControllerPost.id')); |
| 455 | - $this->assertTrue(!isset($Controller->PaginatorControllerPost->lastQueries[1]['contain'])); |
|
| 455 | + $this->assertTrue( ! isset($Controller->PaginatorControllerPost->lastQueries[1]['contain'])); |
|
| 456 | 456 | |
| 457 | 457 | $Controller->request->params['named'] = array('page' => '-1'); |
| 458 | 458 | $Controller->Paginator->settings = array( |
@@ -588,7 +588,7 @@ discard block |
||
| 588 | 588 | $Controller->params['url'] = array(); |
| 589 | 589 | $Controller->constructClasses(); |
| 590 | 590 | $Controller->PaginatorControllerPost->order = array( |
| 591 | - $Controller->PaginatorControllerPost->alias . '.created' => 'desc' |
|
| 591 | + $Controller->PaginatorControllerPost->alias.'.created' => 'desc' |
|
| 592 | 592 | ); |
| 593 | 593 | |
| 594 | 594 | $Controller->Paginator->settings = array( |
@@ -1204,7 +1204,7 @@ discard block |
||
| 1204 | 1204 | $data = array('author_id' => 3, 'title' => 'Fourth Article', 'body' => 'Article Body, unpublished', 'published' => 'N'); |
| 1205 | 1205 | $Controller->PaginatorCustomPost->create($data); |
| 1206 | 1206 | $result = $Controller->PaginatorCustomPost->save(); |
| 1207 | - $this->assertTrue(!empty($result)); |
|
| 1207 | + $this->assertTrue( ! empty($result)); |
|
| 1208 | 1208 | |
| 1209 | 1209 | $result = $Controller->paginate(); |
| 1210 | 1210 | $this->assertEquals(array(1, 2, 3, 4), Hash::extract($result, '{n}.PaginatorCustomPost.id')); |
@@ -1244,7 +1244,7 @@ discard block |
||
| 1244 | 1244 | $data = array('author_id' => 3, 'title' => 'Fourth Article', 'body' => 'Article Body, unpublished', 'published' => 'N'); |
| 1245 | 1245 | $Controller->PaginatorCustomPost->create($data); |
| 1246 | 1246 | $result = $Controller->PaginatorCustomPost->save(); |
| 1247 | - $this->assertTrue(!empty($result)); |
|
| 1247 | + $this->assertTrue( ! empty($result)); |
|
| 1248 | 1248 | |
| 1249 | 1249 | $Controller->paginate = array( |
| 1250 | 1250 | 'list', |
@@ -1276,7 +1276,7 @@ discard block |
||
| 1276 | 1276 | $data = array('author_id' => 3, 'title' => 'Fourth Article', 'body' => 'Article Body, unpublished', 'published' => 'N'); |
| 1277 | 1277 | $Controller->PaginatorCustomPost->create($data); |
| 1278 | 1278 | $result = $Controller->PaginatorCustomPost->save(); |
| 1279 | - $this->assertTrue(!empty($result)); |
|
| 1279 | + $this->assertTrue( ! empty($result)); |
|
| 1280 | 1280 | |
| 1281 | 1281 | $Controller->paginate = array( |
| 1282 | 1282 | 'conditions' => array('PaginatorCustomPost.published' => 'Y'), |
@@ -1309,7 +1309,7 @@ discard block |
||
| 1309 | 1309 | $data = array('author_id' => 2, 'title' => 'Fourth Article', 'body' => 'Article Body, unpublished', 'published' => 'N'); |
| 1310 | 1310 | $Controller->PaginatorCustomPost->create($data); |
| 1311 | 1311 | $result = $Controller->PaginatorCustomPost->save(); |
| 1312 | - $this->assertTrue(!empty($result)); |
|
| 1312 | + $this->assertTrue( ! empty($result)); |
|
| 1313 | 1313 | |
| 1314 | 1314 | $Controller->paginate = array( |
| 1315 | 1315 | 'totals', |
@@ -1374,7 +1374,7 @@ discard block |
||
| 1374 | 1374 | $data = array('author_id' => 2, 'title' => 'Fourth Article', 'body' => 'Article Body, unpublished', 'published' => 'N'); |
| 1375 | 1375 | $Controller->PaginatorCustomPost->create($data); |
| 1376 | 1376 | $result = $Controller->PaginatorCustomPost->save(); |
| 1377 | - $this->assertTrue(!empty($result)); |
|
| 1377 | + $this->assertTrue( ! empty($result)); |
|
| 1378 | 1378 | |
| 1379 | 1379 | $Controller->paginate = array( |
| 1380 | 1380 | 'totalsOperation', |
@@ -79,7 +79,6 @@ |
||
| 79 | 79 | * redirect method |
| 80 | 80 | * |
| 81 | 81 | * @param string|array $url |
| 82 | - * @param mixed $code |
|
| 83 | 82 | * @param mixed $exit |
| 84 | 83 | * @return void |
| 85 | 84 | */ |
@@ -550,7 +550,7 @@ discard block |
||
| 550 | 550 | |
| 551 | 551 | // a corrupted serialized object, so we can see if it ever gets to deserialize |
| 552 | 552 | $attack = 'O:3:"App":1:{s:5:"__map";a:1:{s:3:"foo";s:7:"Hacked!";s:1:"fail"}}'; |
| 553 | - $fields .= urlencode(':' . str_rot13($attack)); |
|
| 553 | + $fields .= urlencode(':'.str_rot13($attack)); |
|
| 554 | 554 | |
| 555 | 555 | $this->Controller->request->data = array( |
| 556 | 556 | 'Model' => array('username' => 'mark', 'password' => 'foo', 'valid' => '0'), |
@@ -794,9 +794,9 @@ discard block |
||
| 794 | 794 | $unlocked = 'Model.username'; |
| 795 | 795 | $fields = array('Model.hidden', 'Model.password'); |
| 796 | 796 | $fields = urlencode(Security::hash( |
| 797 | - '/posts/index' . |
|
| 798 | - serialize($fields) . |
|
| 799 | - $unlocked . |
|
| 797 | + '/posts/index'. |
|
| 798 | + serialize($fields). |
|
| 799 | + $unlocked. |
|
| 800 | 800 | Configure::read('Security.salt')) |
| 801 | 801 | ); |
| 802 | 802 | |
@@ -822,7 +822,7 @@ discard block |
||
| 822 | 822 | $this->Controller->Security->startup($this->Controller); |
| 823 | 823 | $key = $this->Controller->request->params['_Token']['key']; |
| 824 | 824 | $fields = array('Model.hidden', 'Model.password', 'Model.username'); |
| 825 | - $fields = urlencode(Security::hash(serialize($fields) . Configure::read('Security.salt'))); |
|
| 825 | + $fields = urlencode(Security::hash(serialize($fields).Configure::read('Security.salt'))); |
|
| 826 | 826 | |
| 827 | 827 | $this->Controller->request->data = array( |
| 828 | 828 | 'Model' => array( |
@@ -847,7 +847,7 @@ discard block |
||
| 847 | 847 | $key = $this->Controller->request->params['_Token']['key']; |
| 848 | 848 | $unlocked = 'Model.username'; |
| 849 | 849 | $fields = array('Model.hidden', 'Model.password'); |
| 850 | - $fields = urlencode(Security::hash(serialize($fields) . $unlocked . Configure::read('Security.salt'))); |
|
| 850 | + $fields = urlencode(Security::hash(serialize($fields).$unlocked.Configure::read('Security.salt'))); |
|
| 851 | 851 | |
| 852 | 852 | // Tamper the values. |
| 853 | 853 | $unlocked = 'Model.username|Model.password'; |
@@ -970,9 +970,9 @@ discard block |
||
| 970 | 970 | $hashFields = array('TaxonomyData'); |
| 971 | 971 | $fields = urlencode( |
| 972 | 972 | Security::hash( |
| 973 | - '/posts/index' . |
|
| 974 | - serialize($hashFields) . |
|
| 975 | - $unlocked . |
|
| 973 | + '/posts/index'. |
|
| 974 | + serialize($hashFields). |
|
| 975 | + $unlocked. |
|
| 976 | 976 | Configure::read('Security.salt'), 'sha1') |
| 977 | 977 | ); |
| 978 | 978 | |
@@ -235,7 +235,7 @@ discard block |
||
| 235 | 235 | * index method |
| 236 | 236 | * |
| 237 | 237 | * @param mixed $testId |
| 238 | - * @param mixed $test2Id |
|
| 238 | + * @param mixed $testTwoId |
|
| 239 | 239 | * @return void |
| 240 | 240 | */ |
| 241 | 241 | public function index($testId, $testTwoId) { |
@@ -249,7 +249,7 @@ discard block |
||
| 249 | 249 | * view method |
| 250 | 250 | * |
| 251 | 251 | * @param mixed $testId |
| 252 | - * @param mixed $test2Id |
|
| 252 | + * @param mixed $testTwoId |
|
| 253 | 253 | * @return void |
| 254 | 254 | */ |
| 255 | 255 | public function view($testId, $testTwoId) { |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | */ |
| 98 | 98 | public function find($type = 'first', $options = array()) { |
| 99 | 99 | if ($type === 'popular') { |
| 100 | - $conditions = array($this->name . '.' . $this->primaryKey . ' > ' => '1'); |
|
| 100 | + $conditions = array($this->name.'.'.$this->primaryKey.' > ' => '1'); |
|
| 101 | 101 | $options = Hash::merge($options, compact('conditions')); |
| 102 | 102 | return parent::find('all', $options); |
| 103 | 103 | } |
@@ -448,9 +448,9 @@ discard block |
||
| 448 | 448 | */ |
| 449 | 449 | public function testLoadModelInPlugins() { |
| 450 | 450 | App::build(array( |
| 451 | - 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), |
|
| 452 | - 'Controller' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS), |
|
| 453 | - 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS) |
|
| 451 | + 'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS), |
|
| 452 | + 'Controller' => array(CAKE.'Test'.DS.'test_app'.DS.'Controller'.DS), |
|
| 453 | + 'Model' => array(CAKE.'Test'.DS.'test_app'.DS.'Model'.DS) |
|
| 454 | 454 | )); |
| 455 | 455 | CakePlugin::load('TestPlugin'); |
| 456 | 456 | App::uses('TestPluginAppController', 'TestPlugin.Controller'); |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | |
| 490 | 490 | unset($Controller); |
| 491 | 491 | |
| 492 | - App::build(array('Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS))); |
|
| 492 | + App::build(array('Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS))); |
|
| 493 | 493 | CakePlugin::load('TestPlugin'); |
| 494 | 494 | |
| 495 | 495 | $Controller = new Controller($request); |
@@ -567,7 +567,7 @@ discard block |
||
| 567 | 567 | $this->assertEquals($expected, $result); |
| 568 | 568 | |
| 569 | 569 | App::build(array( |
| 570 | - 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS) |
|
| 570 | + 'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS) |
|
| 571 | 571 | )); |
| 572 | 572 | $Controller = new Controller($request); |
| 573 | 573 | $Controller->response = $this->getMock('CakeResponse', array('_sendHeader')); |
@@ -626,7 +626,7 @@ discard block |
||
| 626 | 626 | */ |
| 627 | 627 | public function testRender() { |
| 628 | 628 | App::build(array( |
| 629 | - 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS) |
|
| 629 | + 'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS) |
|
| 630 | 630 | ), App::RESET); |
| 631 | 631 | ClassRegistry::flush(); |
| 632 | 632 | $request = new CakeRequest('controller_posts/index'); |
@@ -636,14 +636,14 @@ discard block |
||
| 636 | 636 | $Controller->viewPath = 'Posts'; |
| 637 | 637 | |
| 638 | 638 | $result = $Controller->render('index'); |
| 639 | - $this->assertRegExp('/posts index/', (string)$result); |
|
| 639 | + $this->assertRegExp('/posts index/', (string) $result); |
|
| 640 | 640 | |
| 641 | 641 | $Controller->view = 'index'; |
| 642 | 642 | $result = $Controller->render(); |
| 643 | - $this->assertRegExp('/posts index/', (string)$result); |
|
| 643 | + $this->assertRegExp('/posts index/', (string) $result); |
|
| 644 | 644 | |
| 645 | 645 | $result = $Controller->render('/Elements/test_element'); |
| 646 | - $this->assertRegExp('/this is the test element/', (string)$result); |
|
| 646 | + $this->assertRegExp('/this is the test element/', (string) $result); |
|
| 647 | 647 | $Controller->view = null; |
| 648 | 648 | |
| 649 | 649 | $Controller = new TestController($request, new CakeResponse()); |
@@ -678,7 +678,7 @@ discard block |
||
| 678 | 678 | public function testComponentBeforeRenderChangingViewClass() { |
| 679 | 679 | App::build(array( |
| 680 | 680 | 'View' => array( |
| 681 | - CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS |
|
| 681 | + CAKE.'Test'.DS.'test_app'.DS.'View'.DS |
|
| 682 | 682 | ) |
| 683 | 683 | ), true); |
| 684 | 684 | $Controller = new Controller($this->getMock('CakeRequest'), new CakeResponse()); |
@@ -689,7 +689,7 @@ discard block |
||
| 689 | 689 | $Controller->viewPath = 'Posts'; |
| 690 | 690 | $Controller->theme = 'TestTheme'; |
| 691 | 691 | $result = $Controller->render('index'); |
| 692 | - $this->assertRegExp('/default test_theme layout/', (string)$result); |
|
| 692 | + $this->assertRegExp('/default test_theme layout/', (string) $result); |
|
| 693 | 693 | App::build(); |
| 694 | 694 | } |
| 695 | 695 | |
@@ -757,7 +757,7 @@ discard block |
||
| 757 | 757 | $Controller->response->expects($this->once())->method('header') |
| 758 | 758 | ->with('Location', 'http://cakephp.org'); |
| 759 | 759 | |
| 760 | - $Controller->redirect('http://cakephp.org', (int)$code, false); |
|
| 760 | + $Controller->redirect('http://cakephp.org', (int) $code, false); |
|
| 761 | 761 | $this->assertFalse($Controller->autoRender); |
| 762 | 762 | } |
| 763 | 763 | |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | $components = is_array($appVars['components']) |
| 923 | 923 | ? array_merge($appVars['components'], $testVars['components']) |
| 924 | 924 | : $testVars['components']; |
| 925 | - if (!in_array('Session', $components)) { |
|
| 925 | + if ( ! in_array('Session', $components)) { |
|
| 926 | 926 | $components[] = 'Session'; |
| 927 | 927 | } |
| 928 | 928 | $helpers = is_array($appVars['helpers']) |
@@ -53,7 +53,7 @@ discard block |
||
| 53 | 53 | /** |
| 54 | 54 | * test_request_action method |
| 55 | 55 | * |
| 56 | - * @return void |
|
| 56 | + * @return string |
|
| 57 | 57 | */ |
| 58 | 58 | public function test_request_action() { |
| 59 | 59 | return 'This is a test'; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | /** |
| 74 | 74 | * normal_request_action method |
| 75 | 75 | * |
| 76 | - * @return void |
|
| 76 | + * @return string |
|
| 77 | 77 | */ |
| 78 | 78 | public function normal_request_action() { |
| 79 | 79 | return 'Hello World'; |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | /** |
| 92 | 92 | * paginate_request_action method |
| 93 | 93 | * |
| 94 | - * @return void |
|
| 94 | + * @return boolean |
|
| 95 | 95 | */ |
| 96 | 96 | public function paginate_request_action() { |
| 97 | 97 | $this->paginate(); |
@@ -110,7 +110,7 @@ discard block |
||
| 110 | 110 | /** |
| 111 | 111 | * test param passing and parsing. |
| 112 | 112 | * |
| 113 | - * @return array |
|
| 113 | + * @return CakeRequest |
|
| 114 | 114 | */ |
| 115 | 115 | public function params_pass() { |
| 116 | 116 | return $this->request; |
@@ -313,28 +313,28 @@ discard block |
||
| 313 | 313 | * @return void |
| 314 | 314 | */ |
| 315 | 315 | public function testLog() { |
| 316 | - if (file_exists(LOGS . 'error.log')) { |
|
| 317 | - unlink(LOGS . 'error.log'); |
|
| 316 | + if (file_exists(LOGS.'error.log')) { |
|
| 317 | + unlink(LOGS.'error.log'); |
|
| 318 | 318 | } |
| 319 | 319 | $this->assertTrue($this->object->log('Test warning 1')); |
| 320 | 320 | $this->assertTrue($this->object->log(array('Test' => 'warning 2'))); |
| 321 | - $result = file(LOGS . 'error.log'); |
|
| 321 | + $result = file(LOGS.'error.log'); |
|
| 322 | 322 | $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Error: Test warning 1$/', $result[0]); |
| 323 | 323 | $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Error: Array$/', $result[1]); |
| 324 | 324 | $this->assertRegExp('/^\($/', $result[2]); |
| 325 | 325 | $this->assertRegExp('/\[Test\] => warning 2$/', $result[3]); |
| 326 | 326 | $this->assertRegExp('/^\)$/', $result[4]); |
| 327 | - unlink(LOGS . 'error.log'); |
|
| 327 | + unlink(LOGS.'error.log'); |
|
| 328 | 328 | |
| 329 | 329 | $this->assertTrue($this->object->log('Test warning 1', LOG_WARNING)); |
| 330 | 330 | $this->assertTrue($this->object->log(array('Test' => 'warning 2'), LOG_WARNING)); |
| 331 | - $result = file(LOGS . 'error.log'); |
|
| 331 | + $result = file(LOGS.'error.log'); |
|
| 332 | 332 | $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Test warning 1$/', $result[0]); |
| 333 | 333 | $this->assertRegExp('/^2[0-9]{3}-[0-9]+-[0-9]+ [0-9]+:[0-9]+:[0-9]+ Warning: Array$/', $result[1]); |
| 334 | 334 | $this->assertRegExp('/^\($/', $result[2]); |
| 335 | 335 | $this->assertRegExp('/\[Test\] => warning 2$/', $result[3]); |
| 336 | 336 | $this->assertRegExp('/^\)$/', $result[4]); |
| 337 | - unlink(LOGS . 'error.log'); |
|
| 337 | + unlink(LOGS.'error.log'); |
|
| 338 | 338 | } |
| 339 | 339 | |
| 340 | 340 | /** |
@@ -440,9 +440,9 @@ discard block |
||
| 440 | 440 | */ |
| 441 | 441 | public function testRequestAction() { |
| 442 | 442 | App::build(array( |
| 443 | - 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS), |
|
| 444 | - 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS), |
|
| 445 | - 'Controller' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS) |
|
| 443 | + 'Model' => array(CAKE.'Test'.DS.'test_app'.DS.'Model'.DS), |
|
| 444 | + 'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS), |
|
| 445 | + 'Controller' => array(CAKE.'Test'.DS.'test_app'.DS.'Controller'.DS) |
|
| 446 | 446 | ), App::RESET); |
| 447 | 447 | $this->assertNull(Router::getRequest(), 'request stack should be empty.'); |
| 448 | 448 | |
@@ -454,7 +454,7 @@ discard block |
||
| 454 | 454 | $this->assertEquals($expected, $result); |
| 455 | 455 | |
| 456 | 456 | $result = $this->object->requestAction( |
| 457 | - Configure::read('App.fullBaseUrl') . '/request_action/test_request_action' |
|
| 457 | + Configure::read('App.fullBaseUrl').'/request_action/test_request_action' |
|
| 458 | 458 | ); |
| 459 | 459 | $expected = 'This is a test'; |
| 460 | 460 | $this->assertEquals($expected, $result); |
@@ -488,7 +488,7 @@ discard block |
||
| 488 | 488 | */ |
| 489 | 489 | public function testRequestActionPlugins() { |
| 490 | 490 | App::build(array( |
| 491 | - 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), |
|
| 491 | + 'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS), |
|
| 492 | 492 | ), App::RESET); |
| 493 | 493 | CakePlugin::load('TestPlugin'); |
| 494 | 494 | Router::reload(); |
@@ -525,10 +525,10 @@ discard block |
||
| 525 | 525 | */ |
| 526 | 526 | public function testRequestActionArray() { |
| 527 | 527 | App::build(array( |
| 528 | - 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS), |
|
| 529 | - 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS), |
|
| 530 | - 'Controller' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS), |
|
| 531 | - 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS) |
|
| 528 | + 'Model' => array(CAKE.'Test'.DS.'test_app'.DS.'Model'.DS), |
|
| 529 | + 'View' => array(CAKE.'Test'.DS.'test_app'.DS.'View'.DS), |
|
| 530 | + 'Controller' => array(CAKE.'Test'.DS.'test_app'.DS.'Controller'.DS), |
|
| 531 | + 'Plugin' => array(CAKE.'Test'.DS.'test_app'.DS.'Plugin'.DS) |
|
| 532 | 532 | ), App::RESET); |
| 533 | 533 | CakePlugin::load(array('TestPlugin')); |
| 534 | 534 | |