Skip to content

Commit 61b5fc1

Browse files
committed
Release 3.2.0
- Switched from PSR-2 to PSR-12 - Added roave/security-advisories & squizlabs/php_codesniffer as dev requirements - Switched from LGPL to ISC - Switched from Travis to GitHub actions - Added CODE_OF_CONDUCT - Added issue templates - Added pull request template - Switched from BMC to GitHub sponsors - Applied small bugfixes - Fixed some spelling issues
1 parent 445efd2 commit 61b5fc1

22 files changed

+510
-2037
lines changed

.github/FUNDING.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# These are supported funding model platforms
2+
3+
github: softcreatr # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
4+
patreon: # Replace with a single Patreon username
5+
open_collective: # Replace with a single Open Collective username
6+
ko_fi: # Replace with a single Ko-fi username
7+
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8+
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9+
liberapay: # Replace with a single Liberapay username
10+
issuehunt: # Replace with a single IssueHunt username
11+
otechie: # Replace with a single Otechie username
12+
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']

.github/ISSUE_TEMPLATE/bug.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: 🐛 Bug Report
3+
about: Submit a bug report, to help us improve.
4+
labels: "bug"
5+
---
6+
7+
## 🐛 Bug Report
8+
9+
(A clear and concise description of what the bug is)
10+
11+
## Have you spent some time to check if this issue has been raised before?
12+
13+
[ ] I have read googled for a similar issue or checked our older issues for a similar bug
14+
15+
### Have you read the [Code of Conduct](https://github.com/SoftCreatR/php-mime-detector/blob/main/CODE_OF_CONDUCT.md)?
16+
17+
[ ] I have read the Code of Conduct
18+
19+
## To Reproduce
20+
21+
(Write your steps here:)
22+
23+
## Expected behavior
24+
25+
<!--
26+
How did you expect your project to behave?
27+
It’s fine if you’re not sure your understanding is correct.
28+
Write down what you thought would happen.
29+
-->
30+
31+
(Write what you thought would happen.)
32+
33+
## Actual Behavior
34+
35+
<!--
36+
Did something go wrong?
37+
Is something broken, or not behaving as you expected?
38+
Describe this section in detail, and attach screenshots if possible.
39+
Don't only say "it doesn't work"!
40+
-->
41+
42+
(Write what happened. Add screenshots, if applicable.)
43+
44+
## Your Environment
45+
46+
<!-- Include as many relevant details about the environment you experienced the bug in -->
47+
48+
(Write Environment, Operating system and version etc.)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
name: 📚 Documentation
3+
about: Report an issue related to documentation.
4+
labels: "documentation"
5+
---
6+
7+
## 📚 Documentation
8+
9+
(A clear and concise description of what the issue is.)
10+
11+
### Have you read the [Code of Conduct](https://github.com/SoftCreatR/php-mime-detector/blob/main/CODE_OF_CONDUCT.md)?
12+
13+
[ ] I have read the Code of Conduct

.github/ISSUE_TEMPLATE/feature.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
name: 💡 Feature / Idea
3+
about: Submit a proposal for a new feature.
4+
labels: "feature"
5+
---
6+
7+
## 💡 Feature / Idea
8+
9+
(A clear and concise description of what the feature is.)
10+
11+
## Have you spent some time to check if this issue has been raised before?
12+
13+
[ ] I have read googled for a similar issue or checked our older issues for a similar idea
14+
15+
### Have you read the [Code of Conduct](https://github.com/SoftCreatR/php-mime-detector/blob/main/CODE_OF_CONDUCT.md)?
16+
17+
[ ] I have read the Code of Conduct
18+
19+
## Pitch
20+
21+
(Please explain why this feature should be implemented and how it would be used. Add examples, if applicable.)

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<!--
2+
Thank you for sending the PR! We appreciate you spending the time to work on these changes.
3+
4+
Help us understand your motivation by explaining why you decided to make this change.
5+
6+
Happy contributing!
7+
8+
-->
9+
10+
# 🔀 Pull Request
11+
12+
## What does this PR do?
13+
14+
(Provide a description of what this PR does.)
15+
16+
## Test Plan
17+
18+
(Write your test plan here. If you changed any code, please provide us with clear instructions on how you verified your changes work.)
19+
20+
## Related PRs and Issues
21+
22+
(If this PR is related to any other PR or resolves any issue or related to any issue link all related PR and issues here.)

.github/workflows/Test.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
---
2+
name: Test
3+
4+
on:
5+
push:
6+
paths:
7+
- '**.php'
8+
- 'composer.json'
9+
branches:
10+
- 'main'
11+
pull_request:
12+
paths:
13+
- '**.php'
14+
- 'composer.json'
15+
branches:
16+
- 'main'
17+
workflow_dispatch:
18+
19+
jobs:
20+
run:
21+
runs-on: ubuntu-latest
22+
strategy:
23+
matrix:
24+
php: [ '7.2', '7.3', '7.4', '8.0' ]
25+
continue-on-error: ${{ matrix.php == '8.0' }}
26+
name: PHP ${{ matrix.php }} Test
27+
28+
steps:
29+
- name: Git checkout
30+
uses: actions/checkout@v2
31+
32+
- name: Checkout submodules
33+
run: git submodule update --init --recursive
34+
35+
- name: Setup PHP
36+
uses: shivammathur/setup-php@v2
37+
with:
38+
php-version: ${{ matrix.php }}
39+
coverage: pcov
40+
env:
41+
COMPOSER_TOKEN: ${{ secrets.GITHUB_TOKEN }}
42+
43+
- name: Setup problem matchers for PHPUnit
44+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
45+
46+
- name: Install dependencies
47+
run: composer update --prefer-dist --no-interaction
48+
49+
- name: Run phpcs
50+
run: composer cs-check -- -v
51+
52+
- name: Execute tests
53+
run: composer test -- -v --coverage-clover=coverage.xml
54+
55+
- name: Run codecov
56+
uses: codecov/codecov-action@v1

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
composer.phar
2+
composer.lock
23
/vendor/
34
.idea
45
phpunit.xml
56
.phpunit.result.cache
7+
.phpcs-cache
8+
.php_cs.cache

.travis.yml

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

CODE_OF_CONDUCT.md

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity, expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ Before submitting a pull request:
4040

4141
If the project maintainer has any additional requirements, you will find them listed here.
4242

43-
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)**
43+
- **[PSR-12 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-12-extended-coding-style-guide.md)**
4444
- The easiest way to apply the conventions is to install [PHP Code Sniffer](http://pear.php.net/package/PHP_CodeSniffer).
4545

4646
- **Add tests!**

LICENSE.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
ISC License
2+
3+
Copyright (c) 2020, Sascha Greuel <[email protected]> and Contributors
4+
5+
Permission to use, copy, modify, and/or distribute this software for any
6+
purpose with or without fee is hereby granted, provided that the above
7+
copyright notice and this permission notice appear in all copies.
8+
9+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10+
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11+
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12+
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13+
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14+
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15+
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

0 commit comments

Comments
 (0)