Skip to content

Commit 4aac217

Browse files
authored
Merge pull request #46 from UseMuffin/cake-4.x
Cake 4.x
2 parents f0f252d + 3e4292c commit 4aac217

30 files changed

+342
-161
lines changed

.editorconfig

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@ root = true
66
[*]
77
indent_style = space
88
indent_size = 4
9+
charset = "utf-8"
910
end_of_line = lf
1011
insert_final_newline = true
1112
trim_trailing_whitespace = true
1213

13-
[*.bat]
14-
end_of_line = crlf
15-
1614
[*.yml]
17-
indent_style = space
18-
indent_size = 2
15+
indent_size = 2

.gitattributes

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# Remove files for archives generated using `git archive`
2+
CONTRIBUTING.md export-ignore
23
.editorconfig export-ignore
34
.gitattributes export-ignore
45
.gitignore export-ignore
5-
.semver export-ignore
66
phpunit.xml.dist export-ignore
77
.travis.yml export-ignore
8+
.scrutinizer.yml export-ignore
89
tests export-ignore
10+
docs export-ignore
11+
.github export-ignore

.gitignore

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1-
/composer.lock
2-
/plugins
3-
/vendor
1+
*.pyc
2+
docs/_build
3+
phpunit.xml
4+
vendor/
5+
composer.lock
6+
tmp
7+
.phpunit.result.cache

.stickler.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

.travis.yml

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

33
php:
4-
- 5.6
5-
- 7.0
6-
- 7.1
74
- 7.2
5+
- 7.3
6+
- 7.4
87

98
services:
109
- mysql
@@ -19,40 +18,41 @@ env:
1918
global:
2019
- DEFAULT=1
2120

21+
services:
22+
- mysql
23+
- postgresql
24+
2225
matrix:
2326
fast_finish: true
2427

2528
include:
26-
- php: 7.1
29+
- php: 7.3
2730
env: PHPCS=1 DEFAULT=0
2831

29-
- php: 7.1
30-
env: PHPSTAN=1 DEFAULT=0
31-
32-
- php: 5.6
33-
env: PREFER_LOWEST=1
32+
- php: 7.3
33+
env: STATIC_ANALYSIS=1 DEFAULT=0
3434

3535
before_script:
36-
- if [[ $TRAVIS_PHP_VERSION != 7.0 ]]; then phpenv config-rm xdebug.ini; fi
36+
- if [[ $TRAVIS_PHP_VERSION != 7.2 ]]; then phpenv config-rm xdebug.ini; fi
3737

38-
- if [[ $PREFER_LOWEST != 1 ]]; then composer update --no-interaction ; fi
39-
- if [[ $PREFER_LOWEST == 1 ]]; then composer update --no-interaction --prefer-lowest ; fi
38+
- if [[ $PREFER_LOWEST != 1 ]]; then composer update --no-interaction; fi
39+
- if [[ $PREFER_LOWEST == 1 ]]; then composer update --no-interaction --prefer-lowest --prefer-stable; fi
4040

41-
- if [[ $DB = 'mysql' ]]; then mysql -e 'CREATE DATABASE cakephp_test;'; fi
41+
- if [[ $DB = 'mysql' ]]; then mysql -u root -e 'CREATE DATABASE cakephp_test;'; fi
4242
- if [[ $DB = 'pgsql' ]]; then psql -c 'CREATE DATABASE cakephp_test;' -U postgres; fi
4343

44-
- if [[ $PHPCS = 1 ]]; then composer require cakephp/cakephp-codesniffer:^3.0; fi
45-
- if [[ $PHPSTAN = 1 ]]; then composer require phpstan/phpstan; fi
44+
- if [[ $PHPCS == 1 ]]; then composer require cakephp/cakephp-codesniffer:^4.0; fi
45+
- if [[ $STATIC_ANALYSIS == 1 ]]; then composer require --dev phpstan/phpstan:^0.12 psalm/phar:^3.8; fi
4646

4747
script:
48-
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION != 7.0 ]]; then vendor/bin/phpunit; fi
49-
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.0 ]]; then vendor/bin/phpunit --coverage-clover=clover.xml; fi
48+
- if [[ $DEFAULT == 1 && $TRAVIS_PHP_VERSION != 7.2 ]]; then vendor/bin/phpunit; fi
49+
50+
- if [[ $PHPCS == 1 ]]; then vendor/bin/phpcs -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi
5051

51-
- if [[ $PHPCS = 1 ]]; then vendor/bin/phpcs -p --standard=vendor/cakephp/cakephp-codesniffer/CakePHP ./src ./tests; fi
52-
- if [[ $PHPSTAN = 1 ]]; then vendor/bin/phpstan analyse -l 5 src; fi
52+
- if [[ $STATIC_ANALYSIS == 1 ]]; then vendor/bin/phpstan.phar analyse src && vendor/bin/psalm.phar --show-info=false; fi
5353

5454
after_success:
55-
- if [[ $DEFAULT = 1 && $TRAVIS_PHP_VERSION = 7.0 ]]; then bash <(curl -s https://codecov.io/bash); fi
55+
- if [[ $DEFAULT == 1 && $TRAVIS_PHP_VERSION == 7.2 ]]; then bash <(curl -s https://codecov.io/bash); fi
5656

5757
notifications:
5858
email: false

CONTRIBUTING.md

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# How to contribute
2+
3+
Tags loves to welcome your contributions. There are several ways to help out:
4+
* Create a ticket in GitHub, if you have found a bug
5+
* Write testcases for open bug tickets
6+
* Write patches for open bug/feature tickets, preferably with testcases included
7+
* Contribute to the documentation/readme
8+
9+
There are a few guidelines that we need contributors to follow so that we have a
10+
chance of keeping on top of things.
11+
12+
## Getting Started
13+
14+
* Make sure you have a [GitHub account](https://github.com/signup/free)
15+
* Submit a ticket for your issue, assuming one does not already exist.
16+
* Clearly describe the issue including steps to reproduce when it is a bug.
17+
* Make sure you fill in the earliest version that you know has the issue.
18+
* Fork the repository on GitHub.
19+
20+
## Making Changes
21+
22+
* Create a topic branch from where you want to base your work.
23+
* This is usually the develop branch
24+
* To quickly create a topic branch based on master; `git branch
25+
master/my_contribution master` then checkout the new branch with `git
26+
checkout master/my_contribution`. Better avoid working directly on the
27+
`master` branch, to avoid conflicts if you pull in updates from origin.
28+
* Make commits of logical units.
29+
* Check for unnecessary whitespace with `git diff --check` before committing.
30+
* Use descriptive commit messages and reference the #ticket number
31+
* Core testcases should continue to pass. You can run tests locally or enable
32+
[travis-ci](https://travis-ci.org/) for your fork, so all tests and codesniffs
33+
will be executed.
34+
* Your work should apply the CakePHP coding standards.
35+
36+
## Which branch to base the work
37+
38+
* Bugfix branches will be based on develop branch.
39+
* New features that are backwards compatible will be based on develop branch
40+
* New features or other non-BC changes will go in the next major release branch.
41+
42+
## Submitting Changes
43+
44+
* Push your changes to a topic branch in your fork of the repository.
45+
* Submit a pull request to the repository with the correct target branch.
46+
47+
## Testcases and codesniffer
48+
49+
Tags tests requires [PHPUnit](http://www.phpunit.de/manual/current/en/installation.html)
50+
8.5.0 or higher. To run the testcases locally use the following command:
51+
52+
phpunit
53+
54+
To run the sniffs for CakePHP coding standards
55+
56+
phpcs -n -p --extensions=php --standard=vendor/cakephp/cakephp-codesniffer/CakePHP --ignore=vendor --ignore=docs src/ tests/
57+
58+
Check the [cakephp-codesniffer](https://github.com/cakephp/cakephp-codesniffer)
59+
repository to setup the CakePHP standard. The README contains installation info
60+
for the sniff and phpcs.
61+
62+
# Additional Resources
63+
64+
* [CakePHP coding standards](https://book.cakephp.org/4/en/contributing/cakephp-coding-conventions.html)
65+
* [Bug tracker](https://github.com/UseMuffin/Tags/issues)
66+
* [General GitHub documentation](https://help.github.com/)
67+
* [GitHub pull request documentation](https://help.github.com/send-pull-requests/)
68+
* #cakephp IRC channel on freenode.org

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2015 Use Muffin
1+
Copyright (c) 2015-Present Use Muffin
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,16 @@ composer require muffin/tags
1717

1818
You then need to load the plugin. You can use the shell command:
1919

20-
```php
20+
```
2121
bin/cake plugin load Muffin/Tags
2222
```
2323

24+
or by manually adding the following line to `src/Application.php`:
25+
26+
```php
27+
$this->addPlugin('Muffin/Obfuscate');
28+
```
29+
2430
## Usage
2531

2632
## Quick Start Guide
@@ -63,7 +69,7 @@ http://github.com/usemuffin/tags/issues
6369

6470
## License
6571

66-
Copyright (c) 2015, [Use Muffin] and licensed under [The MIT License][mit].
72+
Copyright (c) 2015-Present, [Use Muffin] and licensed under [The MIT License][mit].
6773

6874
[cakephp]:http://cakephp.org
6975
[composer]:http://getcomposer.org

composer.json

Lines changed: 57 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,58 @@
11
{
2-
"name" : "muffin/tags",
3-
"description" : "Tags plugin for CakePHP 3.x",
4-
"type" : "cakephp-plugin",
5-
"keywords" : [
6-
"cakephp",
7-
"muffin",
8-
"tags"
9-
],
10-
"homepage" : "https://github.com/usemuffin/tags",
11-
"license" : "MIT",
12-
"authors" : [{
13-
"name" : "Jad Bitar",
14-
"homepage" : "http://jadb.io",
15-
"role" : "Author"
16-
}, {
17-
"name" : "ADmad",
18-
"homepage" : "https://github.com/ADmad",
19-
"role" : "Author"
20-
}, {
21-
"name" : "Others",
22-
"homepage" : "https://github.com/usemuffin/tags/graphs/contributors"
23-
}
24-
],
25-
"support" : {
26-
"issues" : "https://github.com/usemuffin/tags/issues",
27-
"source" : "https://github.com/usemuffin/tags"
28-
},
29-
"require" : {
30-
"cakephp/orm" : "^3.5",
31-
"cakephp/migrations" : "^2.0"
32-
},
33-
"require-dev" : {
34-
"cakephp/cakephp" : "^3.5",
35-
"phpunit/phpunit" : "^5.7.14|^6.0",
36-
"muffin/slug" : "^1.4"
37-
},
38-
"autoload" : {
39-
"psr-4" : {
40-
"Muffin\\Tags\\" : "src"
41-
}
42-
},
43-
"autoload-dev" : {
44-
"psr-4" : {
45-
"Muffin\\Tags\\Test\\" : "tests"
46-
}
47-
}
48-
}
2+
"name": "muffin/tags",
3+
"description": "Tags plugin for CakePHP",
4+
"type": "cakephp-plugin",
5+
"keywords": [
6+
"cakephp",
7+
"muffin",
8+
"tags"
9+
],
10+
"homepage": "https://github.com/usemuffin/tags",
11+
"license": "MIT",
12+
"authors": [
13+
{
14+
"name": "Jad Bitar",
15+
"homepage": "http://jadb.io",
16+
"role": "Author"
17+
},
18+
{
19+
"name": "ADmad",
20+
"homepage": "https://github.com/ADmad",
21+
"role": "Author"
22+
},
23+
{
24+
"name": "Others",
25+
"homepage": "https://github.com/usemuffin/tags/graphs/contributors"
26+
}
27+
],
28+
"support": {
29+
"issues": "https://github.com/usemuffin/tags/issues",
30+
"source": "https://github.com/usemuffin/tags"
31+
},
32+
"require": {
33+
"cakephp/orm": "^4.0",
34+
"cakephp/utility": "^4.0"
35+
},
36+
"require-dev": {
37+
"cakephp/cakephp": "^4.0",
38+
"cakephp/cakephp-codesniffer": "^4.0",
39+
"phpunit/phpunit": "~8.5.0"
40+
},
41+
"suggest": {
42+
"muffin/slug": "For adding slugs to tags"
43+
},
44+
"autoload": {
45+
"psr-4": {
46+
"Muffin\\Tags\\": "src"
47+
}
48+
},
49+
"autoload-dev": {
50+
"psr-4": {
51+
"Muffin\\Tags\\Test\\": "tests",
52+
"Muffin\\Tags\\Test\\App\\": "tests/test_app/src"
53+
}
54+
},
55+
"config": {
56+
"sort-packages": true
57+
}
58+
}

phpstan.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
level: 6
3+
checkGenericClassInNonGenericObjectType: false
4+
checkMissingIterableValueType: false

0 commit comments

Comments
 (0)