Skip to content

Commit d9cc7d4

Browse files
committed
Finish upgrade
2 parents 2e8a3ae + 9ebaac4 commit d9cc7d4

File tree

11 files changed

+64
-31
lines changed

11 files changed

+64
-31
lines changed

.github/workflows/ci.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,23 @@ name: CI
22

33
on:
44
push:
5-
branches:
6-
- 4.x
75
pull_request:
8-
branches:
9-
- '*'
6+
workflow_dispatch:
107

118
jobs:
129
testsuite:
1310
runs-on: ubuntu-22.04
1411
strategy:
1512
fail-fast: false
1613
matrix:
17-
php-version: ['8.1', '8.2']
14+
php-version: ['8.1', '8.3']
1815
prefer-lowest: ['']
1916
include:
2017
- php-version: '8.1'
2118
prefer-lowest: 'prefer-lowest'
2219

2320
steps:
24-
- uses: actions/checkout@v3
21+
- uses: actions/checkout@v4
2522

2623
- name: Setup PHP
2724
uses: shivammathur/setup-php@v2
@@ -59,7 +56,7 @@ jobs:
5956
- name: Run PHPUnit
6057
run: |
6158
if [[ ${{ matrix.php-version }} == '8.1' ]]; then
62-
export CODECOVERAGE=1 && vendor/bin/phpunit --verbose --coverage-clover=coverage.xml
59+
export CODECOVERAGE=1 && vendor/bin/phpunit --coverage-clover=coverage.xml
6360
else
6461
vendor/bin/phpunit
6562
fi
@@ -73,7 +70,7 @@ jobs:
7370
runs-on: ubuntu-22.04
7471

7572
steps:
76-
- uses: actions/checkout@v3
73+
- uses: actions/checkout@v4
7774

7875
- name: Setup PHP
7976
uses: shivammathur/setup-php@v2

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,5 @@
33
/vendor/
44
/.idea/
55
/.phpunit.result.cache
6+
./phpunit.xml.dist
7+
/phpstan.neon

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# CakePHP Localized plugin
22

33
![Build Status](https://github.com/cakephp/localized/actions/workflows/ci.yml/badge.svg)
4+
[![Coverage Status](https://img.shields.io/codecov/c/github/cakephp/localized/4.x.svg?style=flat-square)](https://app.codecov.io/gh/cakephp/localized/tree/4.x)
45
[![Latest Stable Version](https://img.shields.io/github/v/release/cakephp/localized?sort=semver&style=flat-square)](https://packagist.org/packages/cakephp/localized)
56
[![Total Downloads](https://img.shields.io/packagist/dt/cakephp/localized?style=flat-square)](https://packagist.org/packages/cakephp/localized/stats)
67
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE)
@@ -45,7 +46,7 @@ class PostsTable extends Table
4546
$validator->setProvider('fr', FrValidation::class);
4647
$validator->add('phoneField', 'myCustomRuleNameForPhone', [
4748
'rule' => 'phone',
48-
'provider' => 'fr'
49+
'provider' => 'fr',
4950
]);
5051
}
5152
}

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,8 @@
5050
"@stan",
5151
"@psalm"
5252
],
53-
"cs-check": "phpcs --colors --parallel=16 -p src/ tests/",
54-
"cs-fix": "phpcbf --colors --parallel=16 -p src/ tests/",
53+
"cs-check": "phpcs --colors --parallel=16 -p",
54+
"cs-fix": "phpcbf --colors --parallel=16 -p",
5555
"test": "phpunit --stderr",
5656
"stan": "phpstan analyse src/",
5757
"psalm": "php vendor/psalm/phar/psalm.phar --show-info=false src/",

phpcs.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22
<ruleset name="localized">
33
<config name="installed_paths" value="../../cakephp/cakephp-codesniffer"/>
44

5+
<file>src/</file>
6+
<file>tests/</file>
7+
58
<rule ref="CakePHP"/>
69

710
<rule ref="Generic.Files.LineLength">

phpunit.xml.dist

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit bootstrap="tests/bootstrap.php" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="tests/bootstrap.php" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd">
33
<php>
44
<ini name="memory_limit" value="-1"/>
55
<ini name="apc.enable_cli" value="1"/>
66
</php>
77

8-
<!-- Add any additional test suites you want to run here -->
98
<testsuites>
10-
<testsuite name="Localized Test Suite">
9+
<testsuite name="localized">
1110
<directory>./tests/TestCase</directory>
1211
</testsuite>
1312
</testsuites>
1413

15-
14+
<source>
15+
<include>
16+
<directory suffix=".php">src/</directory>
17+
</include>
18+
</source>
1619
</phpunit>

resources/locales/vi/cake.po

Lines changed: 31 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ msgid ""
66
msgstr ""
77
"Project-Id-Version: PROJECT VERSION\n"
88
"POT-Creation-Date: 2015-11-05 12:39+0000\n"
9-
"PO-Revision-Date: 2016-06-13 14:34+0700\n"
10-
"Last-Translator: ANH TUAN NGUYEN <ANHTUANK7C@HOTMAIL.COM>\n"
9+
"PO-Revision-Date: 2023-06-02 10:00-0700\n"
10+
"Last-Translator: TOMMY DO <DHHUY0704@GMAIL.COM>\n"
1111
"Language-Team: LANGUAGE <EMAIL@ADDRESS>\n"
1212
"MIME-Version: 1.0\n"
1313
"Content-Type: text/plain; charset=utf-8\n"
@@ -83,7 +83,7 @@ msgstr "vừa xong"
8383

8484
#: I18n/Time.php:428
8585
msgid "about a second ago"
86-
msgstr "khoảng một giấy trước"
86+
msgstr "khoảng một giây trước"
8787

8888
#: I18n/Time.php:429
8989
msgid "about a minute ago"
@@ -173,11 +173,11 @@ msgstr[1] "{0} giây"
173173

174174
#: Network/Response.php:1438
175175
msgid "The requested file was not found"
176-
msgstr "Tệp tin yêu cầu không tồn tại"
176+
msgstr "Tập tin yêu cầu không tồn tại"
177177

178178
#: ORM/RulesChecker.php:49
179179
msgid "This value is already in use"
180-
msgstr "Giá trị đã được sử dụng"
180+
msgstr "Giá trị này đã được sử dụng"
181181

182182
#: ORM/RulesChecker.php:83
183183
msgid "This value does not exist"
@@ -189,15 +189,15 @@ msgstr "và"
189189

190190
#: Validation/Validator.php:102
191191
msgid "This field is required"
192-
msgstr "Trường này cần nhập liệu"
192+
msgstr "Trường này cần được điền vào"
193193

194194
#: Validation/Validator.php:103
195195
msgid "This field cannot be left empty"
196196
msgstr "Trường này không được để trống"
197197

198198
#: Validation/Validator.php:663
199199
msgid "The provided value is invalid"
200-
msgstr "Giá trị nhập vào không đúng"
200+
msgstr "Giá trị nhập vào không hợp lệ"
201201

202202
#: View/Helper/FormHelper.php:925
203203
msgid "New %s"
@@ -263,3 +263,27 @@ msgstr "Tháng Mười Một"
263263
msgid "December"
264264
msgstr "Tháng Mười Hai"
265265

266+
#: Http/Middleware/CsrfProtectionMiddleware.php:286
267+
msgid "Missing or incorrect CSRF cookie type."
268+
msgstr "Thiếu hoặc không đúng định dạng CSRF cookie."
269+
270+
#: Http/Middleware/CsrfProtectionMiddleware.php:290
271+
msgid "Missing or invalid CSRF cookie."
272+
msgstr "Thiếu hoặc CSRF cookie không hợp lệ."
273+
274+
#: Http/Middleware/CsrfProtectionMiddleware.php:311
275+
msgid "CSRF token from either the request body or request headers did not match or is missing."
276+
msgstr "Mã CSRF từ nội dung yêu cầu hoặc tiêu đề yêu cầu không khớp hoặc bị thiếu."
277+
278+
#: Http/Response.php:1490
279+
msgid "The requested file contains `..` and will not be read."
280+
msgstr "Trong tập tin yêu cầu có chứa `..` và nó không thể đọc được"
281+
282+
#: ORM/RulesChecker.php:224
283+
msgid "Cannot modify row: a constraint for the `{0}` association fails."
284+
msgstr "Không thể chỉnh sửa dòng: ràng buộc cho liên kết `{0}` không đúng."
285+
286+
#: ORM/RulesChecker.php:262
287+
msgid "The count does not match {0}{1}"
288+
msgstr "Số lượng không khớp với {0}{1}"
289+

src/Plugin.php renamed to src/LocalizedPlugin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
use Cake\Core\BasePlugin;
2121

22-
class Plugin extends BasePlugin
22+
class LocalizedPlugin extends BasePlugin
2323
{
2424
/**
2525
* Plugin name.

tests/TestCase/Validation/FiValidationTest.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class FiValidationTest extends TestCase
3131
*
3232
* @return array
3333
*/
34-
public function personIdProvider()
34+
public static function personIdProvider()
3535
{
3636
return [
3737
['120553-128K', true],
@@ -50,7 +50,7 @@ public function personIdProvider()
5050
*
5151
* @return array
5252
*/
53-
public function postalProvider()
53+
public static function postalProvider()
5454
{
5555
return [
5656
['00000', true],
@@ -64,7 +64,7 @@ public function postalProvider()
6464
/**
6565
* @return array
6666
*/
67-
public function businessIdProvider()
67+
public static function businessIdProvider()
6868
{
6969
return [
7070
['16067584', true],
@@ -77,7 +77,7 @@ public function businessIdProvider()
7777
/**
7878
* @return array
7979
*/
80-
public function creditorReferenceProvider()
80+
public static function creditorReferenceProvider()
8181
{
8282
return [
8383
['RF6110032', true],
@@ -90,7 +90,7 @@ public function creditorReferenceProvider()
9090
/**
9191
* @return array
9292
*/
93-
public function referenceNumberProvider()
93+
public static function referenceNumberProvider()
9494
{
9595
return [
9696
['00001234561', true],

tests/TestCase/Validation/LvValidationTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class LvValidationTest extends TestCase
3131
*
3232
* @return array
3333
*/
34-
public function personIdProvider()
34+
public static function personIdProvider()
3535
{
3636
return [
3737
['030972-10200', true],

tests/bootstrap.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
<?php
22
declare(strict_types=1);
33

4+
use Cake\Core\Configure;
45
use Cake\Core\Plugin;
6+
use Cake\Localized\LocalizedPlugin;
57

68
$findRoot = function ($root) {
79
do {
@@ -28,11 +30,12 @@
2830
define('DS', DIRECTORY_SEPARATOR);
2931
}
3032

31-
Cake\Core\Configure::write('debug', true);
33+
Configure::write('debug', true);
3234

3335
require $root . '/vendor/cakephp/cakephp/tests/bootstrap.php';
36+
require $root . '/vendor/cakephp/cakephp/src/functions.php';
3437

35-
Plugin::getCollection()->add(new Cake\Localized\Plugin([
38+
Plugin::getCollection()->add(new LocalizedPlugin([
3639
'path' => dirname(dirname(__FILE__)) . DS,
3740
'routes' => false,
3841
]));

0 commit comments

Comments
 (0)