Skip to content

Commit

Permalink
Fix CS.
Browse files Browse the repository at this point in the history
  • Loading branch information
dereuromark committed Apr 2, 2020
1 parent 803a5fc commit c35170c
Show file tree
Hide file tree
Showing 9 changed files with 21 additions and 36 deletions.
4 changes: 1 addition & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

; More information at https://editorconfig.org
root = true

[*]
Expand All @@ -14,5 +13,4 @@ trim_trailing_whitespace = true
end_of_line = crlf

[*.yml]
indent_style = space
indent_size = 2
18 changes: 2 additions & 16 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,20 +1,6 @@
# Define the line ending behavior of the different file extensions
# Set default behaviour, in case users don't have core.autocrlf set.
* text=auto
* text eol=lf

# Explicitly declare text files we want to always be normalized and converted
# to native line endings on checkout.
*.php text
*.default text
*.ctp text
*.md text
*.po text
*.js text
*.css text
*.ini text
*.txt text
*.xml text
# Set default behavior, in case users don't have core.autocrlf set.
* text text=auto eol=lf

# Declare files that will always have CRLF line endings on checkout.
*.bat eol=crlf
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/composer.lock
/phpunit.phar
/vendor/
.idea
/.idea/
14 changes: 7 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,13 @@ language: php

php:
- 5.6
- 7.0
- 7.1
- 7.2

sudo: false
- 7.4

matrix:
fast_finish: true

include:
- php: 7.1
- php: 7.4
env: PHPCS=1

- php: 5.6
Expand All @@ -24,7 +20,11 @@ install:

script:
- sh -c "if [ '$PHPCS' != '1' ]; then vendor/bin/phpunit; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then ./vendor/bin/phpcs -n -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi"
- sh -c "if [ '$PHPCS' = '1' ]; then ./vendor/bin/phpcs -n -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP src/ tests/; fi"

cache:
directories:
- $HOME/.composer/cache

notifications:
email: false
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# CakePHP Localized plugin
[![Build Status](https://secure.travis-ci.org/cakephp/localized.svg?branch=master)](http://travis-ci.org/cakephp/localized)
[![Build Status](https://travis-ci.org/cakephp/localized.svg?branch=master)](http://travis-ci.org/cakephp/localized)
[![License](https://poser.pugx.org/cakephp/localized/license.svg)](https://packagist.org/packages/cakephp/localized)
[![Total Downloads](https://poser.pugx.org/cakephp/localized/d/total.svg)](https://packagist.org/packages/cakephp/localized)

Expand All @@ -9,12 +9,12 @@ This plugin contains various localized validation classes for specific countries

The master branch has the following requirements:

* CakePHP 3.1.0 or greater.
* PHP 5.4.16 or greater.
* CakePHP 3.5+.
* PHP 5.6+.

## Installation

You can install this plugin into your CakePHP application using [composer](http://getcomposer.org).
You can install this plugin into your CakePHP application using [composer](https://getcomposer.org).

The recommended way to install composer packages is:

Expand Down Expand Up @@ -43,7 +43,7 @@ class PostsTable extends Table
{
public function validationDefault(Validator $validator)
{
$validator->provider('fr', FrValidation::class);
$validator->setProvider('fr', FrValidation::class);
$validator->add('phoneField', 'myCustomRuleNameForPhone', [
'rule' => 'phone',
'provider' => 'fr'
Expand Down
2 changes: 1 addition & 1 deletion src/Validation/ItValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public static function cf($check)
'G' => 15, 'H' => 17, 'I' => 19, 'J' => 21, 'K' => 2, 'L' => 4,
'M' => 18, 'N' => 20, 'O' => 11, 'P' => 3, 'Q' => 6, 'R' => 8,
'S' => 12, 'T' => 14, 'U' => 16, 'V' => 10, 'W' => 22, 'X' => 25,
'Y' => 24, 'Z' => 23
'Y' => 24, 'Z' => 23,
];
$sum = 0;

Expand Down
2 changes: 1 addition & 1 deletion src/Validation/TwValidation.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static function personId($check)
'A' => 10, 'B' => 11, 'C' => 12, 'D' => 13, 'E' => 14, 'F' => 15, 'G' => 16, 'H' => 17,
'I' => 34, 'J' => 18, 'K' => 19, 'L' => 20, 'M' => 21, 'N' => 22, 'O' => 35, 'P' => 23,
'Q' => 24, 'R' => 25, 'S' => 26, 'T' => 27, 'U' => 28, 'V' => 29, 'W' => 32, 'X' => 30,
'Y' => 31, 'Z' => 33
'Y' => 31, 'Z' => 33,
];
$n1 = $keyTable[$check[0]];
$checksum = intval($n1 / 10) + ($n1 % 10) * 9;
Expand Down
4 changes: 2 additions & 2 deletions tests/TestCase/IntegrationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ class IntegrationTest extends TestCase
*/
public function testLocalizedProviderIntegration()
{
$validator = new Validator;
$validator = new Validator();
$validator->setProvider('fr', FrValidation::class);
$validator->add('phoneField', 'myCustomRuleNameForPhone', [
'rule' => 'phone',
Expand All @@ -46,7 +46,7 @@ public function testLocalizedProviderIntegration()
$this->assertCount(2, $validator);
$this->assertEmpty($validator->errors([
'phoneField' => '05 24 22 72 27',
'postalField' => '93000'
'postalField' => '93000',
]));

$errors = $validator->errors(['phoneField' => '924.227.227', 'postalField' => '0000']);
Expand Down
1 change: 1 addition & 0 deletions tests/TestCase/Validation/RuValidationTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ public function testPassport()
$this->assertFalse(RuValidation::passport('1234123456'));
$this->assertFalse(RuValidation::passport('1234 1x3456'));
}

/**
* test vatin method of RuValidation
*
Expand Down

0 comments on commit c35170c

Please sign in to comment.