Skip to content

Commit f0f252d

Browse files
authored
Merge pull request #43 from UseMuffin/deprecations
Fix deprecation warnings
2 parents 6fb7673 + fc3ce91 commit f0f252d

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,10 @@ php:
66
- 7.1
77
- 7.2
88

9+
services:
10+
- mysql
11+
- postgresql
12+
913
env:
1014
matrix:
1115
- DB=mysql db_dsn='mysql://root@127.0.0.1/cakephp_test'
@@ -37,7 +41,7 @@ before_script:
3741
- if [[ $DB = 'mysql' ]]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi
3842
- if [[ $DB = 'pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
3943

40-
- if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer; fi
44+
- if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:^3.0; fi
4145
- if [[ $PHPSTAN = 1 ]]; then composer require phpstan/phpstan; fi
4246

4347
script:

src/Model/Entity/TagAwareTrait.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,8 @@ public function untag($tags = null)
5757

5858
foreach ($untags as $untag) {
5959
foreach ($tags as $k => $tag) {
60-
if ((empty($untag[$pk]) || $tag[$pk] === $untag[$pk]) &&
60+
if (
61+
(empty($untag[$pk]) || $tag[$pk] === $untag[$pk]) &&
6162
(empty($untag[$df]) || $tag[$df] === $untag[$df])
6263
) {
6364
unset($tags[$k]);

src/Model/Table/TagsTable.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,11 @@ public function initialize(array $config)
1818
$this->setTable('tags_tags');
1919
$this->setDisplayField('label');
2020
$this->addBehavior('Timestamp');
21-
if (Plugin::loaded('Muffin/Slug')) {
21+
$method = 'isLoaded';
22+
if (!method_exists(Plugin::class, 'isLoaded')) {
23+
$method = 'loaded';
24+
}
25+
if (Plugin::{$method}('Muffin/Slug')) {
2226
$this->addBehavior('Muffin/Slug.Slug');
2327
}
2428
}

tests/bootstrap.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,3 @@
3030
}
3131

3232
require $root . '/vendor/cakephp/cakephp/tests/bootstrap.php';
33-
34-
\Cake\Core\Plugin::load('Muffin/Tags', ['path' => dirname(dirname(__FILE__)) . DS]);

0 commit comments

Comments
 (0)