Permalink
Browse files

QA: formatting and docblock changes.

  • Loading branch information...
1 parent b625b33 commit 827e14f0898095f7f0ce121e4bd502ddfec9ede5 @daschl daschl committed Dec 14, 2011
View
@@ -13,14 +13,14 @@
/**
* Base message class for any URI based request/response.
+ *
* @see http://tools.ietf.org/html/rfc3986#section-1.1.1
* @see http://en.wikipedia.org/wiki/URI_scheme#Generic_syntax
- *
*/
class Message extends \lithium\core\Object {
/**
- * The uri scheme
+ * The URI scheme.
*
* @var string
*/
@@ -34,7 +34,7 @@ class Message extends \lithium\core\Object {
public $host = 'localhost';
/**
- * The port
+ * The port for this endpoint.
*
* @var string
*/
@@ -48,14 +48,14 @@ class Message extends \lithium\core\Object {
public $path = null;
/**
- * The username
+ * The username for this endpoint.
*
* @var string
*/
public $username = null;
/**
- * Absolute path of the request.
+ * The password for this endpoint.
*
* @var string
*/
View
@@ -9,21 +9,21 @@
namespace lithium\net;
/**
- * Abstract class for connecting to sockets with various adapters
- * Curl, Stream, Context adapters are available.
+ * Abstract class for connecting to sockets with various adapters.
*
+ * Currently, Curl, Stream and Context adapters are available.
*/
abstract class Socket extends \lithium\core\Object {
/**
- * the resource for the current connection
+ * The resource for the current connection.
*
* @var resource
*/
protected $_resource = null;
/**
- * the classes for the socket
+ * The classes for the socket.
*
* @var array
*/
@@ -33,8 +33,9 @@
);
/**
- * Auto config
+ * Auto config.
*
+ * @var array
*/
protected $_autoConfig = array('classes' => 'merge');
@@ -64,7 +65,7 @@ public function __construct(array $config = array()) {
/**
* Opens the socket and sets `Socket::$_resource`.
*
- * @param array $options update the config settings
+ * @param array $options Update the config settings.
* @return mixed The open resource on success, `false` otherwise.
*/
public function open(array $options = array()) {
@@ -41,6 +41,7 @@ public function __construct(array $config = array()) {
/**
* Opens the socket and sets its timeout value.
*
+ * @param array $options Update the config settings.
* @return mixed Returns `false` if the socket configuration does not contain the
* `'scheme'` or `'host'` settings, or if configuration fails, otherwise returns a
* resource stream.
@@ -776,4 +776,4 @@ protected function _generators($method, $name, $options) {
}
}
-?>
+?>
@@ -170,9 +170,10 @@ public function testRenderWithDataArray() {
);
$this->assertEqual($expected, $controller->response->data);
}
-
+
/**
- * Verifies that Controller does not modify data when passed an array (or RecordSet) with a single element
+ * Verifies that the Controller does not modify data when passed an array (or RecordSet)
+ * with a single element.
*
* @return void
*/
@@ -304,9 +304,11 @@ public function testRouteExporting() {
'template' => '/images/image_{:width}x{:height}.{:format}',
'params' => array('format' => 'png')
));
+
+ $pattern = '@^/images/image_(?P<width>[^\\/]+)x(?P<height>[^\\/]+)\\.(?P<format>[^\\/]+)?$@';
$expected = array(
'template' => '/images/image_{:width}x{:height}.{:format}',
- 'pattern' => '@^/images/image_(?P<width>[^\\/]+)x(?P<height>[^\\/]+)\\.(?P<format>[^\\/]+)?$@',
+ 'pattern' => $pattern,
'params' => array('format' => 'png', 'action' => 'index'),
'match' => array('action' => 'index'),
'meta' => array(),
@@ -611,7 +613,7 @@ public function testValidPatternGeneration() {
public function testTwoParameterRoutes() {
$route = new Route(array(
'template' => '/personnel/{:personnel_id}/position/{:position_id}/actions/create',
- 'params' => array('controller' => 'actions', 'action' => 'create'),
+ 'params' => array('controller' => 'actions', 'action' => 'create')
));
$route->compile();
@@ -421,7 +421,7 @@ public function testCustomCheckbox() {
$this->assertTags($result, array(
array('input' => array('type' => 'hidden', 'value' => '', 'name' => 'foo')),
array('input' => array(
- 'type' => 'checkbox', 'value' => '1', 'name' => 'foo',
+ 'type' => 'checkbox', 'value' => '1', 'name' => 'foo',
'id' => 'MockFormPostFoo', 'checked' => 'checked'
))
));
@@ -319,15 +319,15 @@ public function testUnsetInForeach() {
'Delete me'
);
$collection = new Collection(array('data' => $data));
-
+
$this->assertIdentical($data, $collection->to('array'));
-
+
foreach ($collection as $i => $word) {
if ($word == 'Delete me') {
unset($collection[$i]);
}
}
-
+
$expected = array(0 => 'Hello', 6 => 'Hello again!');
$results = $collection->to('array');
$this->assertIdentical($expected, $results);
@@ -955,22 +955,22 @@ public function testCheckPasses() {
$result = Validator::check($data, $rules);
$this->assertTrue(empty($result));
}
-
+
public function testCheckSkipEmpty() {
$rules = array(
'email' => array('email', 'skipEmpty' => true, 'message' => 'email is not valid')
);
-
+
// empty string should pass
$data = array('email' => '');
$result = Validator::check($data, $rules);
$this->assertTrue(empty($result));
-
+
// null value should pass
$data = array('email' => null);
$result = Validator::check($data, $rules);
$this->assertTrue(empty($result));
-
+
// string with spaces should NOT pass
$data = array('email' => ' ');
$result = Validator::check($data, $rules);
View
@@ -446,7 +446,7 @@ public static function check(array $values, array $rules, array $options = array
$values = $params['values'];
$rules = $params['rules'];
$options = $params['options'];
-
+
$errors = array();
$events = (array) (isset($options['events']) ? $options['events'] : null);
$values = Set::flatten($values);
@@ -479,7 +479,7 @@ public static function check(array $values, array $rules, array $options = array
if (!$self::rule($name, $values[$field], $rule['format'], $rule + $options)) {
$errors[$field][] = $rule['message'] ?: $key;
-
+
if ($rule['last']) {
break;
}

0 comments on commit 827e14f

Please sign in to comment.