Skip to content

Commit 4cceca7

Browse files
author
itosho
authored
Merge pull request #18 from itosho/correspond-to-3.5-or-more
Update CakePHP 3.6
2 parents baa9fe3 + ab30985 commit 4cceca7

File tree

10 files changed

+29
-16
lines changed

10 files changed

+29
-16
lines changed

.semver

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
:major: 1
33
:minor: 1
4-
:patch: 0
4+
:patch: 1
55
:special: ''
66
:metadata: ''

.travis.yml

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ language: php
33
php:
44
- 7.0
55
- 7.1
6+
- 7.2
67

78
sudo: false
89

@@ -17,26 +18,32 @@ matrix:
1718
fast_finish: true
1819

1920
include:
20-
- php: 7.0
21+
- php: 7.1
2122
env: PHPCS=1 DEFAULT=0
2223

24+
- php: 7.1
25+
env: PHPSTAN=1 DEFAULT=0
26+
2327
before_script:
24-
- if [[ $TRAVIS_PHP_VERSION != 7.0 ]]; then phpenv config-rm xdebug.ini; fi
28+
- if [[ $TRAVIS_PHP_VERSION != 7.1 ]]; then phpenv config-rm xdebug.ini; fi
2529

2630
- composer self-update
2731
- composer install --prefer-dist --no-interaction
2832

2933
- if [[ $DB = 'mysql' ]]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi
3034

3135
- if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:"^3.0"; fi
36+
- if [[ $PHPSTAN = 1 ]]; then composer require phpstan/phpstan; fi
3237

3338
script:
34-
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.0 ]]; then vendor/bin/phpunit; fi
35-
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.0 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml; fi
39+
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.1 ]]; then vendor/bin/phpunit; fi
40+
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.1 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml; fi
41+
3642
- if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -n -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi
43+
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -c phpstan.neon -l 7 src; fi
3744

3845
after_success:
39-
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.0 ]]; then bash <(curl -s https://codecov.io/bash); fi
46+
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.1 ]]; then bash <(curl -s https://codecov.io/bash); fi
4047

4148
notifications:
4249
email: false

CHANGES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# CHANGES
22

3+
## v1.1.1
4+
- :up: Correspond to CakePHP 3.5 or higher version.
5+
- :green_heart: Improve CI.
6+
37
## v1.1.0
48
- :wrench: Add event config dispatch beforeSave event.
59
- :memo: support CHANGES.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ CakePHP behavior plugin for easily some complicated queries like upsert, bulk up
1111
## Requirements
1212

1313
- PHP 7.0+
14-
- CakePHP 3.5.0+
14+
- CakePHP 3.5+
1515
- MySQL 5.6+
1616

1717
## Installation
@@ -83,7 +83,7 @@ $entities = $this->Articles->newEntities($data);
8383
$this->Articles->bulkInsert($entities);
8484
```
8585

86-
### Notice from v1.1.0
86+
### Advanced
8787
Need to use `Timestamp` behavior, if you want to update `created` and `modified` fields automatically.
8888
And you can change the action manually by using `event` config like this.
8989

composer.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
"source": "https://github.com/itosho/easy-query"
2525
},
2626
"require": {
27-
"cakephp/orm": "3.5.*"
27+
"cakephp/orm": "^3.5"
2828
},
2929
"require-dev": {
30-
"cakephp/cakephp": "3.5.*",
30+
"cakephp/cakephp": "^3.5",
3131
"phpunit/phpunit": "^5.7"
3232
},
3333
"autoload": {

phpstan.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parameters:
2+
ignoreErrors: []

src/Model/Behavior/InsertBehavior.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function bulkInsert(array $entities)
4545
$query = $this->_table
4646
->query()
4747
->insert($fields);
48-
$query->clause('values')->values($saveData);
48+
$query->clause('values')->setValues($saveData);
4949

5050
return $query->execute();
5151
}

src/Model/Behavior/UpsertBehavior.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ public function bulkUpsert(array $entities)
115115
->query()
116116
->insert($fields)
117117
->epilog($expression);
118-
$query->clause('values')->values($saveData);
118+
$query->clause('values')->setValues($saveData);
119119

120120
return $query->execute();
121121
}

tests/TestCase/Model/Behavior/InsertBehaviorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class InsertBehaviorTest extends TestCase
3030
public function setUp()
3131
{
3232
parent::setUp();
33-
$this->Articles = TableRegistry::get('Itosho/EasyQuery.Articles');
33+
$this->Articles = TableRegistry::getTableLocator()->get('Itosho/EasyQuery.Articles');
3434
$this->Articles->addBehavior('Itosho/EasyQuery.Insert');
3535
}
3636

@@ -40,7 +40,7 @@ public function setUp()
4040
public function tearDown()
4141
{
4242
parent::tearDown();
43-
TableRegistry::clear();
43+
TableRegistry::getTableLocator()->clear();
4444
unset($this->Articles);
4545
}
4646

tests/TestCase/Model/Behavior/UpsertBehaviorTest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class UpsertBehaviorTest extends TestCase
3030
public function setUp()
3131
{
3232
parent::setUp();
33-
$this->Tags = TableRegistry::get('Itosho/EasyQuery.Tags');
33+
$this->Tags = TableRegistry::getTableLocator()->get('Itosho/EasyQuery.Tags');
3434
$this->Tags->addBehavior('Itosho/EasyQuery.Upsert', [
3535
'uniqueColumns' => ['name'],
3636
'updateColumns' => ['description', 'modified']
@@ -43,7 +43,7 @@ public function setUp()
4343
public function tearDown()
4444
{
4545
parent::tearDown();
46-
TableRegistry::clear();
46+
TableRegistry::getTableLocator()->clear();
4747
unset($this->Tags);
4848
}
4949

0 commit comments

Comments
 (0)