diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index d672f69..0000000 --- a/.editorconfig +++ /dev/null @@ -1,12 +0,0 @@ -root = true - -[*] -charset = utf-8 -indent_size = 4 -indent_style = space -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true - -[*.md] -trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes old mode 100644 new mode 100755 index 58ff123..2713ee2 --- a/.gitattributes +++ b/.gitattributes @@ -1,13 +1,9 @@ +/.github export-ignore /tests export-ignore CHANGELOG.md export-ignore -README.md export-ignore -README-ES.md export-ignore phpcs.xml export-ignore phpunit.xml export-ignore phpmd.xml export-ignore -.travis.yml export-ignore -.editorconfig export-ignore .gitattributes export-ignore .gitignore export-ignore -.php_cs.dist export-ignore -CONDUCT.md export-ignore \ No newline at end of file +.php-cs-fixer.dist.php export-ignore \ No newline at end of file diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md new file mode 100755 index 0000000..5d1569c --- /dev/null +++ b/.github/CODE_OF_CONDUCT.md @@ -0,0 +1,131 @@ +# Contributor Covenant Code of Conduct + +- [Our Pledge](#our-pledge) +- [Our Standards](#our-standards) +- [Enforcement Responsibilities](#enforcement-responsibilities) +- [Scope](#scope) +- [Enforcement](#enforcement) +- [Enforcement Guidelines](#enforcement-guidelines) + - [1. Correction](#1-correction) + - [2. Warning](#2-warning) + - [3. Temporary Ban](#3-temporary-ban) + - [4. Permanent Ban](#4-permanent-ban) +- [Attribution](#attribution) + +--- + +## Our Pledge + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +## Our Standards + +Examples of behavior that contributes to a positive environment for our +community include: + +- Demonstrating empathy and kindness toward other people. +- Being respectful of differing opinions, viewpoints, and experiences. +- Giving and gracefully accepting constructive feedback. +- Accepting responsibility and apologizing to those affected by our mistakes. +- Focusing on what is best for the overall community. + +Examples of unacceptable behavior include: + +- The use of sexualized language or imagery. +- Sexual attention or advances of any kind. +- Trolling, insulting or derogatory comments. +- Personal or political attacks. +- Public or private harassment. +- Publishing others' private information without their explicit permission. +- Any conduct considered inappropriate in a professional environment. + +## Enforcement Responsibilities + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for +moderation decisions when appropriate. + +## Scope + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official e-mail +address, posting via an official social media account, or acting as an +appointed representative at an online or offline event. + +## Enforcement + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +[hello@josantonius.dev](mailto:hello@josantonius.dev). +All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +## Enforcement Guidelines + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +### 1. Correction + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +### 2. Warning + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +### 3. Temporary Ban + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +### 4. Permanent Ban + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +## Attribution + +This Code of Conduct is adapted from the +[Contributor Covenant](https://www.contributor-covenant.org/), +version 2.1, available at +. diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md new file mode 100755 index 0000000..2f9e354 --- /dev/null +++ b/.github/CONTRIBUTING.md @@ -0,0 +1,314 @@ +# Contributing + +We would love for you to contribute to this project and help make it even better! +As a contributor, here are the guidelines we would like you to follow: + +--- + +- [Code of Conduct](#code-of-conduct) +- [Got a Question, Problem or Idea?](#got-a-question-problem-or-idea) +- [Add or Improve a Feature?](#add-or-improve-a-feature) +- [Found a Bug?](#found-a-bug) +- [Submitting an Issue](#submitting-an-issue) +- [Submitting a Pull Request](#submitting-a-pull-request) + - [After Your Pull Request is Merged](#after-your-pull-request-is-merged) +- [Coding Rules](#coding-rules) +- [Commit Message Conventions](#commit-message-conventions) + - [Commit Message Header](#commit-message-header) + - [Type](#type) + - [Scope](#scope) + - [Summary](#summary) + - [Commit Message Body](#commit-message-body) + - [Commit Message Footer](#commit-message-footer) + +--- + +## Code of Conduct + +Help us keep this project open and inclusive. +Please read and follow our [Code of Conduct](CODE_OF_CONDUCT.md). + +## Got a Question, Problem or Idea? + +Start a [new discussion](https://github.com/josantonius/php-hook/discussions/new) and select the +appropriate category for it: + +- `General`: Anything that is relevant to the project. +- `Ideas`: Ideas to change/improve the project or propose new features. +- `Polls`: Polls with multi options for the community to vote for and discuss. +- `Q&A`: Questions for the community to answer, in a question/answer format. +- `Show and tell`: Creations, experiments, or tests relevant to the project. + +## Add or Improve a Feature? + +- For a **Major Feature**, +first [open a new discussion](https://github.com/josantonius/php-hook/discussions/new) in the +`Ideas` category and outline your proposal so that it can be discussed. This will also allow us to +better coordinate our efforts, prevent duplication of work, and help you to craft the change so that +it is successfully accepted into the project. + +- **Small Features** can be crafted and directly +[submitted as a Pull Request](#submitting-a-pull-request). + +## Found a Bug? + +If you find a bug in the source code, you can help us by +[submitting an issue](#submitting-an-issue) to our +[repository](https://github.com/josantonius/php-hook). Even better, you can +[submit a Pull Request](#submitting-a-pull-request) with a fix. + +## Submitting an Issue + +Issues are very valuable for any project. + +Great bug reports tend to have: + +- A quick summary and/or background. +- Steps to reproduce. +- Be specific. +- Give sample code if you can. +- What you expected would happen. +- What actually happens. +- Notes; why you think this might be happening, tests that didn't work... + +You can file new issues by filling out our +[new issue form](https://github.com/josantonius/php-hook/issues/new). + +## Submitting a Pull Request + +Pull requests are a great way to put your ideas into this project or simply fix something. + +Before you submit your Pull Request (PR) consider the following guidelines: + +1. Search [GitHub](https://github.com/josantonius/php-hook/pulls) for an open or closed PR that +relates to your submission. You don't want to duplicate effort. + +1. [Fork](https://github.com/josantonius/php-hook/fork) the repository to your own GitHub account. + +1. Clone the repository to your machine. + +1. Go to the cloned repository. + + ```shell + cd php-hook + ``` + +1. Create a branch from the `main branch` with a succinct but descriptive name. + + ```shell + git checkout -b descriptive-name main + ``` + +1. Make your changes in the new git branch, including appropriate test cases. + +1. Follow our [Coding Rules](#coding-rules). + +1. Run the full repository test suite. + + ```shell + composer tests + ``` + +1. Commit your changes using a descriptive commit message that follows our + [commit message conventions](#commit-message-conventions). + + ```shell + git commit -a + ``` + + **The optional commit `-a` command line option will automatically "add" and "rm" edited files.** + +1. Push your branch to GitHub: + + ```shell + git push origin descriptive-name + ``` + +1. In GitHub, send a [pull request](https://github.com/josantonius/php-hook/compare/main..) +to `php-hook:main`. + +- If we suggest changes then: + - Make the required updates. + - Re-run the test suites to ensure tests are still passing. + - Rebase your branch and force push to your GitHub repository (this will update your Pull Request): + + ```shell + git rebase main -i + git push -f + ``` + +That's it! Thank you for your contribution! + +### After Your Pull Request is Merged + +After your pull request is merged, you can safely delete your branch and pull the changes from the +`main` (upstream) repository: + +- Delete the remote branch on GitHub either through the GitHub web UI or your local shell as follows: + + ```shell + git push origin --delete descriptive-name + ``` + +- Check out the `main` branch: + + ```shell + git checkout main -f + ``` + +- Delete the local branch: + + ```shell + git branch -D descriptive-name + ``` + +- Update your ´main´ branch with the latest upstream version: + + ```shell + git pull --ff upstream main + ``` + +## Coding Rules + +To ensure consistency throughout the source code, keep these rules in mind as you are working: + +- All features or bug fixes **must be tested** by one or more specs (unit-tests). + + You can use the following command to check the tests: + + ```shell + composer phpunit + ``` + +- All new feature **must be documented** in the `README.md` file. + +- We use `PHP CodeSniffer` and `PHP Mess Detector` to define our code standards. + + You can use the following commands to check the status of your code: + + ```shell + composer phpcs + ``` + + ```shell + composer phpmd + ``` + + You can use the following command to automatically format errors found with `PHP CodeSniffer`: + + ```shell + composer fix + ``` + +## Commit Message Conventions + +We have very precise rules over how our Git commit messages must be formatted. +This format leads to **easier to read commit history**. + +Each commit message consists of a **header**, a **body**, and a **footer**. + +```none +
+ + + +