Skip to content

Commit

Permalink
Merge pull request #204 from CauanCabral/feature/ValidationDateNumber
Browse files Browse the repository at this point in the history
Implement methods to validate date and decimal on localized form
  • Loading branch information
dereuromark authored May 14, 2021
2 parents 7449d9f + 1df3f1d commit d3a8a8a
Show file tree
Hide file tree
Showing 42 changed files with 446 additions and 1 deletion.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
},
"require": {
"php": ">=7.2",
"cakephp/cakephp": "^4.0.0"
"cakephp/cakephp": "^4.1.0"
},
"require-dev": {
"cakephp/cakephp-codesniffer": "^4.0",
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/AtValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class AtValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'de_AT';

/**
* Checks a postal code.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/AuValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class AuValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'en_AU';

/**
* Checks a postal code for Australia.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/BdValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class BdValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'bn_BD';

/**
* Checks a postal code.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/BeValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class BeValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'nl_BE';

/**
* Checks a postal code for Belgium.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/BrValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
*/
class BrValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'pt_BR';

/**
* Checks a phone number for Brazil.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/CaValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class CaValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'en_CA';

/**
* Checks a postal code for Canada.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/ChValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class ChValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'de_CH';

/**
* Checks a postal code for Switzerland & Liechtenstein
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/CnValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
*/
class CnValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'zh_CN';

/**
* Checks phone numbers for The Peoples Republic of China (mainland)
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/CzValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class CzValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'cs_CZ';

/**
* Checks a postal code for Czech Republic
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/DeValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class DeValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'de_DE';

/**
* Checks a postal code for Germany.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/DkValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
*/
class DkValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'da_DK';

/**
* Checks a social security number for Denmark.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/EsValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
*/
class EsValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'es_ES';

/**
* The list of allowed personId codes. Sorted as wee need them.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/FiValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class FiValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'fi_FI';

/**
* Checks a postal code for Finland.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/FrValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
*/
class FrValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'fr_FR';

/**
* Checks a phone number for France.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/GbValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,14 @@
*/
class GbValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'en_GB';

/**
* Checks a postal code for The United Kingdom
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/HrValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@
*/
class HrValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'hr_HR';

/**
* Checks a postal code for Croatia.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/IdValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class IdValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'id_ID';

/**
* Checks a postal code for Indonesia.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/InValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class InValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'en_IN';

/**
* Validate postal code
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/IrValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
*/
class IrValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'fa_IR';

/**
* Checks for Persian/Farsi characters and number an zero width non-joiner space.
* Also accepts latin numbers preventing potential problem until PHP becomes fully unicode compatible.
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/ItValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class ItValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'it_IT';

/**
* Checks a phone number for Italy.
*
Expand Down
8 changes: 8 additions & 0 deletions src/Validation/JpValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,14 @@
*/
class JpValidation extends LocalizedValidation
{
/**
* Define locale to be used by that localized
* validation set
*
* @var string
*/
protected static $validationLocale = 'ja_JP';

/**
* Checks a phone number for Japan.
* Accepts the following format.
Expand Down
Loading

0 comments on commit d3a8a8a

Please sign in to comment.