Skip to content

Commit 6206c17

Browse files
committed
Update for Cake 3.6.0.
1 parent e54b4e8 commit 6206c17

File tree

10 files changed

+24
-24
lines changed

10 files changed

+24
-24
lines changed

.travis.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
language: php
22

33
php:
4-
- 7.1
54
- 7.0
5+
- 7.2
6+
- 7.1
67
- 5.6
7-
- 5.5
88

99
dist: trusty
1010

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@
4141
"require": {
4242
},
4343
"require-dev": {
44-
"cakephp/cakephp": ">=3.2",
45-
"cakephp/cakephp-codesniffer": "2.*",
46-
"phpunit/phpunit": "<6.0"
44+
"cakephp/cakephp": "^3.6",
45+
"cakephp/cakephp-codesniffer": "^3.0",
46+
"phpunit/phpunit": "5.7.14|^6.0"
4747
},
4848
"autoload": {
4949
"psr-4": {

src/AbstractDriver.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ abstract class AbstractDriver implements LoggerAwareInterface
4444
public function __construct($config = [])
4545
{
4646
if (!empty($config)) {
47-
$this->config($config);
47+
$this->setConfig($config);
4848
}
4949

5050
$this->initialize();

src/Marshaller.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function one(array $data, array $options = [])
5555
$resourceClass = $this->_endpoint->resourceClass();
5656
/* @var \Muffin\Webservice\Model\Resource $entity */
5757
$entity = new $resourceClass();
58-
$entity->source($this->_endpoint->registryAlias());
58+
$entity->setSource($this->_endpoint->registryAlias());
5959

6060
if (isset($options['accessibleFields'])) {
6161
foreach ((array)$options['accessibleFields'] as $key => $value) {
@@ -79,7 +79,7 @@ public function one(array $data, array $options = [])
7979

8080
if (!isset($options['fieldList'])) {
8181
$entity->set($properties);
82-
$entity->errors($errors);
82+
$entity->setErrors($errors);
8383

8484
return $entity;
8585
}
@@ -110,10 +110,10 @@ protected function _validate($data, $options, $isNew)
110110
return [];
111111
}
112112
if ($options['validate'] === true) {
113-
$options['validate'] = $this->_endpoint->validator('default');
113+
$options['validate'] = $this->_endpoint->getValidator('default');
114114
}
115115
if (is_string($options['validate'])) {
116-
$options['validate'] = $this->_endpoint->validator($options['validate']);
116+
$options['validate'] = $this->_endpoint->getValidator($options['validate']);
117117
}
118118
if (!is_object($options['validate'])) {
119119
throw new RuntimeException(

src/Model/Endpoint.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -839,11 +839,11 @@ public function save(EntityInterface $resource, $options = [])
839839
'checkExisting' => false,
840840
]);
841841

842-
if ($resource->errors()) {
842+
if ($resource->getErrors()) {
843843
return false;
844844
}
845845

846-
if ($resource->isNew() === false && !$resource->dirty()) {
846+
if ($resource->isNew() === false && !$resource->isDirty()) {
847847
return $resource;
848848
}
849849

src/Model/Resource.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public function __construct(array $properties = [], array $options = [])
4141
];
4242

4343
if (!empty($options['source'])) {
44-
$this->source($options['source']);
44+
$this->setSource($options['source']);
4545
}
4646

4747
if ($options['markNew'] !== null) {

src/Query.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function clause($name)
175175
public function endpoint(Endpoint $endpoint = null)
176176
{
177177
if ($endpoint === null) {
178-
return $this->repository();
178+
return $this->getRepository();
179179
}
180180

181181
$this->repository($endpoint);
@@ -206,7 +206,7 @@ public function webservice(WebserviceInterface $webservice = null)
206206
*/
207207
public function find($finder, array $options = [])
208208
{
209-
return $this->repository()->callFinder($finder, $this, $options);
209+
return $this->getRepository()->callFinder($finder, $this, $options);
210210
}
211211

212212
/**
@@ -224,7 +224,7 @@ public function firstOrFail()
224224
}
225225
throw new RecordNotFoundException(sprintf(
226226
'Record not found in endpoint "%s"',
227-
$this->repository()->endpoint()
227+
$this->getRepository()->endpoint()
228228
));
229229
}
230230

@@ -466,12 +466,12 @@ public function first()
466466
public function triggerBeforeFind()
467467
{
468468
if (!$this->_beforeFindFired && $this->action() === self::ACTION_READ) {
469-
$endpoint = $this->repository();
469+
$endpoint = $this->getRepository();
470470
$this->_beforeFindFired = true;
471471
$endpoint->dispatchEvent('Model.beforeFind', [
472472
$this,
473473
new ArrayObject($this->_options),
474-
!$this->eagerLoaded()
474+
!$this->isEagerLoaded()
475475
]);
476476
}
477477
}

tests/TestCase/Model/ResourceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public function testSoureConstruct()
2323
$resource = new Resource([], [
2424
'source' => $endpoint
2525
]);
26-
$this->assertEquals($endpoint, $resource->source());
26+
$this->assertEquals($endpoint, $resource->getSource());
2727
}
2828

2929
public function testConstructUseSettersOff()

tests/TestCase/Webservice/WebserviceTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public function testCreateResource()
173173

174174
$this->assertInstanceOf('\Muffin\Webservice\Model\Resource', $resource);
175175
$this->assertFalse($resource->isNew());
176-
$this->assertFalse($resource->dirty());
176+
$this->assertFalse($resource->isDirty());
177177
}
178178

179179
public function testTransformResults()

tests/bootstrap.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@
6868
'defaults' => 'php'
6969
]);
7070

71-
Cache::config([
71+
Cache::setConfig([
7272
'_cake_core_' => [
7373
'engine' => 'File',
7474
'prefix' => 'cake_core_',
@@ -97,10 +97,10 @@
9797
];
9898

9999
// Use the test connection for 'debug_kit' as well.
100-
ConnectionManager::config('test', $config);
101-
ConnectionManager::config('test_webservice', $config);
100+
ConnectionManager::setConfig('test', $config);
101+
ConnectionManager::setConfig('test_webservice', $config);
102102

103-
Log::config([
103+
Log::setConfig([
104104
'debug' => [
105105
'engine' => 'Cake\Log\Engine\FileLog',
106106
'levels' => ['notice', 'info', 'debug'],

0 commit comments

Comments
 (0)