Skip to content

Commit 8e1c282

Browse files
authored
Merge pull request #24 from o0h/travis-php-74
Updated to official travis php 74
2 parents 4518680 + 53e1a6d commit 8e1c282

File tree

10 files changed

+67
-74
lines changed

10 files changed

+67
-74
lines changed

.travis.yml

Lines changed: 9 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@ services:
44
- mysql
55

66
php:
7-
- 7.0
87
- 7.1
98
- 7.2
109
- 7.3
10+
- 7.4
1111

1212
sudo: false
1313

@@ -22,17 +22,14 @@ matrix:
2222
fast_finish: true
2323

2424
include:
25-
- php: 7.3
25+
- php: 7.4
2626
env: PREFER_LOWEST="" DB=mysql db_user=root db_host=0.0.0.0 db_name=cakephp_test
2727

28-
- php: '7.4snapshot'
29-
env: PREFER_LOWEST="" DB=mysql db_user=root db_host=0.0.0.0 db_name=cakephp_test
30-
31-
- php: 7.3
32-
env: PHPCS=1 DEFAULT=0 PREFER_LOWEST="
28+
- php: 7.4
29+
env: PHPCS=1 DEFAULT=0 PREFER_LOWEST=""
3330

34-
- php: 7.3
35-
env: PHPSTAN=1 DEFAULT=0 PREFER_LOWEST="
31+
- php: 7.4
32+
env: PHPSTAN=1 DEFAULT=0 PREFER_LOWEST=""
3633

3734

3835
cache:
@@ -41,8 +38,6 @@ cache:
4138
- $HOME/.composer/cache
4239

4340
before_script:
44-
- if [[ $TRAVIS_PHP_VERSION != '7.4snapshot' ]]; then phpenv config-rm xdebug.ini; fi
45-
4641
- composer self-update
4742
- composer update --prefer-stable --prefer-dist --no-interaction $PREFER_LOWEST
4843

@@ -51,19 +46,16 @@ before_script:
5146
- if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:"^3.0"; fi
5247
- if [[ $PHPSTAN = 1 ]]; then composer require phpstan/phpstan; fi
5348

54-
# see: https://github.com/cakephp/chronos/issues/106
55-
- if [[ $TRAVIS_PHP_VERSION != 7.0 && $PREFER_LOWEST != "" ]]; then composer require --prefer-stable --prefer-dist --no-interaction $PREFER_LOWEST cakephp/chronos:^1.0.1; fi
56-
5749
script:
58-
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.3 ]]; then vendor/bin/phpunit; fi
59-
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.3 ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml; fi
50+
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.4 ]]; then vendor/bin/phpunit; fi
51+
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.4 ]]; then phpdbg -qrr vendor/bin/phpunit --coverage-clover=clover.xml; fi
6052

6153
- if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -n -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi
6254
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -c phpstan.neon -l 7 src; fi
6355

6456
after_success:
6557
- |
66-
if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.3 ]]; then
58+
if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.4 ]]; then
6759
curl -s https://codecov.io/bash > codecov
6860
sed -i -e 's/TRAVIS_.*_VERSION/^TRAVIS_.*_VERSION=/' codecov
6961
bash codecov

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ CakePHP behavior plugin for easily some complicated queries.
1010

1111
## Requirements
1212

13-
- PHP 7.0+
14-
- CakePHP 3.5+
13+
- PHP 7.1+
14+
- CakePHP 3.6+
1515
- MySQL 5.6+
1616

1717
## Installation

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,10 @@
2626
"source": "https://github.com/itosho/easy-query"
2727
},
2828
"require": {
29-
"cakephp/orm": "^3.5"
29+
"cakephp/orm": "^3.6"
3030
},
3131
"require-dev": {
32-
"cakephp/cakephp": "^3.5",
32+
"cakephp/cakephp": "^3.6",
3333
"phpunit/phpunit": "^5.7.14|^6.0"
3434
},
3535
"autoload": {

phpstan.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
parameters:
2+
checkMissingIterableValueType: false
23
ignoreErrors: []

src/Model/Behavior/InsertBehavior.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class InsertBehavior extends Behavior
2222
* @var array
2323
*/
2424
protected $_defaultConfig = [
25-
'event' => ['beforeSave' => true]
25+
'event' => ['beforeSave' => true],
2626
];
2727

2828
/**
@@ -127,7 +127,7 @@ private function buildTmpTableSelectQuery($escapedData)
127127
}
128128

129129
$tmpTable = TableRegistry::getTableLocator()->get('tmp', [
130-
'schema' => $this->_table->getSchema()
130+
'schema' => $this->_table->getSchema(),
131131
]);
132132
$query = $tmpTable
133133
->find()

src/Model/Behavior/UpsertBehavior.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ class UpsertBehavior extends Behavior
2121
protected $_defaultConfig = [
2222
'updateColumns' => null,
2323
'uniqueColumns' => null,
24-
'event' => ['beforeSave' => true]
24+
'event' => ['beforeSave' => true],
2525
];
2626

2727
/**

tests/Fixture/ArticlesFixture.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,30 @@ class ArticlesFixture extends TestFixture
1414
'created' => 'datetime',
1515
'modified' => 'datetime',
1616
'_constraints' => [
17-
'primary' => ['type' => 'primary', 'columns' => ['id']]
18-
]
17+
'primary' => ['type' => 'primary', 'columns' => ['id']],
18+
],
1919
];
2020
public $records = [
2121
[
2222
'title' => 'First Article',
2323
'body' => 'First Article Body',
2424
'published' => 1,
2525
'created' => '2017-09-01 00:00:00',
26-
'modified' => '2017-09-01 00:00:00'
26+
'modified' => '2017-09-01 00:00:00',
2727
],
2828
[
2929
'title' => 'Second Article',
3030
'body' => 'Second Article Body',
3131
'published' => 1,
3232
'created' => '2017-09-01 00:00:00',
33-
'modified' => '2017-09-01 00:00:00'
33+
'modified' => '2017-09-01 00:00:00',
3434
],
3535
[
3636
'title' => 'Third Article',
3737
'body' => 'Third Article Body',
3838
'published' => 1,
3939
'created' => '2017-09-01 00:00:00',
40-
'modified' => '2017-09-01 00:00:00'
41-
]
40+
'modified' => '2017-09-01 00:00:00',
41+
],
4242
];
4343
}

tests/Fixture/TagsFixture.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,27 @@ class TagsFixture extends TestFixture
1414
'modified' => 'datetime',
1515
'_constraints' => [
1616
'primary' => ['type' => 'primary', 'columns' => ['id']],
17-
'unique' => ['type' => 'unique', 'columns' => ['name']]
18-
]
17+
'unique' => ['type' => 'unique', 'columns' => ['name']],
18+
],
1919
];
2020
public $records = [
2121
[
2222
'name' => 'tag1',
2323
'description' => 'tag1 description',
2424
'created' => '2017-09-01 00:00:00',
25-
'modified' => '2017-09-01 00:00:00'
25+
'modified' => '2017-09-01 00:00:00',
2626
],
2727
[
2828
'name' => 'tag2',
2929
'description' => 'tag2 description',
3030
'created' => '2017-09-01 00:00:00',
31-
'modified' => '2017-09-01 00:00:00'
31+
'modified' => '2017-09-01 00:00:00',
3232
],
3333
[
3434
'name' => 'tag3',
3535
'description' => 'tag3 description',
3636
'created' => '2017-09-01 00:00:00',
37-
'modified' => '2017-09-01 00:00:00'
38-
]
37+
'modified' => '2017-09-01 00:00:00',
38+
],
3939
];
4040
}

tests/TestCase/Model/Behavior/InsertBehaviorTest.php

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function testBulkInsertNoBeforeSave()
110110
{
111111
$this->Articles->removeBehavior('Insert');
112112
$this->Articles->addBehavior('Itosho/EasyQuery.Insert', [
113-
'event' => ['beforeSave' => false]
113+
'event' => ['beforeSave' => false],
114114
]);
115115

116116
$records = $this->getBaseInsertRecords();
@@ -159,7 +159,7 @@ public function testInsertOnce()
159159
$newData = [
160160
'title' => 'New Article',
161161
'body' => 'New Article Body',
162-
'published' => 1
162+
'published' => 1,
163163
];
164164
$entity = $this->Articles->newEntity($newData);
165165

@@ -185,7 +185,7 @@ public function testInsertOnceAddTimestampBehavior()
185185
$newData = [
186186
'title' => 'New Article',
187187
'body' => 'New Article Body',
188-
'published' => 1
188+
'published' => 1,
189189
];
190190
$entity = $this->Articles->newEntity($newData);
191191
$now = FrozenTime::now();
@@ -209,7 +209,7 @@ public function testInsertOnceWhenDuplicated()
209209
$duplicatedData = [
210210
'title' => 'First Article',
211211
'body' => 'First Article Body',
212-
'published' => 1
212+
'published' => 1,
213213
];
214214
$entity = $this->Articles->newEntity($duplicatedData);
215215

@@ -233,7 +233,7 @@ public function testInsertOnceWhenIsNull()
233233
$newData = [
234234
'title' => 'First Article',
235235
'body' => null,
236-
'published' => 1
236+
'published' => 1,
237237
];
238238
$entity = $this->Articles->newEntity($newData);
239239

@@ -244,7 +244,7 @@ public function testInsertOnceWhenIsNull()
244244
->where([
245245
'title' => 'First Article',
246246
'body IS' => null,
247-
'published' => 1
247+
'published' => 1,
248248
])
249249
->all();
250250

@@ -261,7 +261,7 @@ public function testInsertOnceWithConditions()
261261
$newData = [
262262
'title' => 'First Article',
263263
'body' => 'First Article Body',
264-
'published' => 0
264+
'published' => 0,
265265
];
266266
$entity = $this->Articles->newEntity($newData);
267267

@@ -276,7 +276,7 @@ public function testInsertOnceWithConditions()
276276
->find()
277277
->where([
278278
'title' => 'First Article',
279-
'body' => 'First Article Body'
279+
'body' => 'First Article Body',
280280
])
281281
->all();
282282

@@ -293,7 +293,7 @@ public function testInsertOnceWhenDuplicatedWithConditions()
293293
$newData = [
294294
'title' => 'First Article',
295295
'body' => 'First Article Body',
296-
'published' => 0
296+
'published' => 0,
297297
];
298298
$entity = $this->Articles->newEntity($newData);
299299

@@ -323,18 +323,18 @@ private function getBaseInsertRecords()
323323
[
324324
'title' => 'Fourth Article',
325325
'body' => 'Fourth Article Body',
326-
'published' => 1
326+
'published' => 1,
327327
],
328328
[
329329
'title' => 'Fifth Article',
330330
'body' => 'Fifth Article Body',
331-
'published' => 1
331+
'published' => 1,
332332
],
333333
[
334334
'title' => 'Sixth Article',
335335
'body' => 'Sixth Article Body',
336-
'published' => 1
337-
]
336+
'published' => 1,
337+
],
338338
];
339339
}
340340
}

0 commit comments

Comments
 (0)