Skip to content

Commit a94130d

Browse files
authored
Merge pull request #8909 from obozdag/patch-7
docs: Small typos in libraries/validation.rst
2 parents 66dfd8c + d0baacf commit a94130d

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

user_guide_src/source/libraries/validation.rst

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -743,7 +743,7 @@ Configuration
743743
=============
744744

745745
Once you have your views created, you need to let the Validation library know about them. Open **app/Config/Validation.php**.
746-
Inside, you'll find the ``$templates`` property where you can list as many custom views as you want, and provide an
746+
Inside, you'll find the ``$templates`` property where you can list as many custom views as you want, and provide a
747747
short alias they can be referenced by. If we were to add our example file from above, it would look something like:
748748

749749
.. literalinclude:: validation/032.php
@@ -769,7 +769,7 @@ Creating Custom Rules
769769
Using Rule Classes
770770
==================
771771

772-
Rules are stored within simple, namespaced classes. They can be stored any location you would like, as long as the
772+
Rules are stored within simple, namespaced classes. They can be stored in any location you would like, as long as the
773773
autoloader can find it. These files are called RuleSets.
774774

775775
Adding a RuleSet
@@ -781,7 +781,7 @@ add the new file to the ``$ruleSets`` array:
781781
.. literalinclude:: validation/033.php
782782

783783
You can add it as either a simple string with the fully qualified class name, or using the ``::class`` suffix as
784-
shown above. The primary benefit here is that it provides some extra navigation capabilities in more advanced IDEs.
784+
shown above. The primary benefit of using the ``::class`` suffix is that it provides some extra navigation capabilities in more advanced IDEs.
785785

786786
Creating a Rule Class
787787
---------------------
@@ -921,8 +921,9 @@ decimal No Fails if field contains anything other than
921921
``-`` sign for the number.
922922
differs Yes Fails if field does not differ from the one ``differs[field_name]``
923923
in the parameter.
924-
exact_length Yes Fails if field is not exactly the parameter ``exact_length[5]`` or ``exact_length[5,8,12]``
925-
value. One or more comma-separated values.
924+
exact_length Yes Fails if field length is not exactly ``exact_length[5]`` or ``exact_length[5,8,12]``
925+
the parameter value. One or more
926+
comma-separated values are possible.
926927
field_exists Yes Fails if field does not exist. (This rule was
927928
added in v4.5.0.)
928929
greater_than Yes Fails if field is less than or equal to ``greater_than[8]``
@@ -943,7 +944,7 @@ is_natural No Fails if field contains anything other than
943944
is_natural_no_zero No Fails if field contains anything other than
944945
a natural number, except zero: 1, 2, 3, etc.
945946
is_not_unique Yes Checks the database to see if the given value ``is_not_unique[table.field,where_field,where_value]``
946-
exist. Can ignore records by field/value to
947+
exists. Can ignore records by field/value to
947948
filter (currently accept only one filter).
948949
is_unique Yes Checks if this field value exists in the ``is_unique[table.field,ignore_field,ignore_value]``
949950
database. Optionally set a column and value
@@ -975,8 +976,8 @@ required_without Yes The field is required when any of the other
975976
fields is `empty()`_ in the data.
976977
string No A generic alternative to the alpha* rules
977978
that confirms the element is a string
978-
timezone No Fails if field does match a timezone per
979-
`timezone_identifiers_list()`_
979+
timezone No Fails if field does not match a timezone
980+
per `timezone_identifiers_list()`_
980981
valid_base64 No Fails if field contains anything other than
981982
valid Base64 characters.
982983
valid_json No Fails if field does not contain a valid JSON
@@ -1001,7 +1002,7 @@ valid_url_strict Yes Fails if field does not contain a valid URL.
10011002
valid_date Yes Fails if field does not contain a valid date. ``valid_date[d/m/Y]``
10021003
Any string that `strtotime()`_ accepts is
10031004
valid if you don't specify an optional
1004-
parameter to matches a date format.
1005+
parameter that matches a date format.
10051006
**So it is usually necessary to specify
10061007
the parameter.**
10071008
valid_cc_number Yes Verifies that the credit card number matches ``valid_cc_number[amex]``
@@ -1069,9 +1070,9 @@ uploaded Yes Fails if the name of the parameter does not
10691070
If you want the file upload to be optional
10701071
(not required), do not define this rule.
10711072

1072-
max_size Yes Fails if the uploaded file named in the ``max_size[field_name,2048]``
1073-
parameter is larger than the second
1074-
parameter in kilobytes (kb). Or if the file
1073+
max_size Yes Fails if the uploaded file is larger ``max_size[field_name,2048]``
1074+
than the second parameter
1075+
in kilobytes (kb). Or if the file
10751076
is larger than allowed maximum size declared
10761077
in php.ini config file -
10771078
``upload_max_filesize`` directive.

user_guide_src/source/libraries/validation/037.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ public function required_with($value, string $params, array $data): bool
1717

1818
// Still here? Then we fail this test if
1919
// any of the fields are present in $data
20-
// as $fields is the lis
20+
// as $fields in the list
2121
$requiredFields = [];
2222

2323
foreach ($params as $field) {

0 commit comments

Comments
 (0)