Skip to content

Commit 58adc1e

Browse files
authored
Merge pull request #1644 from 0b10011/contributing
Update CONTRIBUTING to match reality and add issue templates for bug reports, feature requests, and usage questions
2 parents 7768c56 + b13aa70 commit 58adc1e

File tree

6 files changed

+97
-41
lines changed

6 files changed

+97
-41
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help improve PHPWord
4+
labels: Bug Report
5+
6+
---
7+
8+
### Describe the Bug
9+
10+
A clear and concise description of what the bug is.
11+
12+
### Steps to Reproduce
13+
14+
Please provide a code sample that reproduces the issue.
15+
16+
```php
17+
<?php
18+
require __DIR__ . '/vendor/autoload.php';
19+
20+
$phpWord = new \PhpOffice\PhpWord\PhpWord();
21+
$section = $phpWord->addSection();
22+
$section->...
23+
```
24+
25+
### Expected Behavior
26+
27+
A clear and concise description of what you expected to happen.
28+
29+
### Current Behavior
30+
31+
What is the current behavior?
32+
33+
### Context
34+
35+
Please fill in your environment information:
36+
37+
- PHP Version:
38+
- PHPWord Version:
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
labels: Change Request
5+
6+
---
7+
8+
### Is your feature request related to a problem? Please describe.
9+
10+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
11+
12+
### Describe the solution you'd like
13+
14+
A clear and concise description of what you want to happen.
15+
16+
### Describe alternatives you've considered
17+
18+
A clear and concise description of any alternative solutions or features you've considered.
19+
20+
### Additional context
21+
22+
Add any other context or screenshots about the feature request here.

.github/ISSUE_TEMPLATE/how-to-use.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
name: How to Use PHPWord
3+
about: Find out how to use PHPWord
4+
labels: WontFix
5+
6+
---
7+
8+
***Please do not use the issue tracker to ask how to use PHPWord.***
9+
10+
Documentation is available on [Read the Docs](https://phpword.readthedocs.io/en/latest/).
11+
12+
Sample code is in the [`/samples/` directory](https://github.com/PHPOffice/PHPWord/tree/develop/samples).
13+
14+
Usage questions belong on [Stack Overflow](https://stackoverflow.com/questions/tagged/phpword).
File renamed without changes.

CONTRIBUTING.md

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,30 @@
11
# Contributing to PHPWord
22

3-
PHPWord is built by the crowd and for the crowd. Every contribution is welcome; either by [submitting](https://github.com/PHPOffice/PHPWord/issues) bug issues or suggesting improvements, or in a more active form like [requesting](https://github.com/PHPOffice/PHPWord/pulls) a pull.
3+
PHPWord is built by the crowd and for the crowd. Every contribution is welcome; either by [reporting a bug](https://github.com/PHPOffice/PHPWord/issues/new?labels=Bug+Report&template=bug_report.md) or [suggesting improvements](https://github.com/PHPOffice/PHPWord/issues/new?labels=Change+Request&template=feature_request.md), or in a more active form like [requesting a pull](https://github.com/PHPOffice/PHPWord/pulls).
44

5-
We want to create a high quality document writer and reader library that people can use with more confidence and less bugs. We want to collaborate happily, code joyfully, and get alive merrily. Thus, below are some guidelines, that we expect to be followed by each contributor.
5+
We want to create a high quality document writer and reader library that people can use with more confidence and fewer bugs. We want to collaborate happily, code joyfully, and live merrily. Thus, below are some guidelines that we expect to be followed by each contributor:
66

7-
- **Be brief, but be bold**. State your issues briefly. But speak out your ideas loudly, even if you can't or don't know how to implement it right away. The world will be better with limitless innovations.
8-
- **Follow PHP-FIG standards**. We follow PHP Standards Recommendations (PSRs) by [PHP Framework Interoperability Group](http://www.php-fig.org/). If you're not familiar with these standards, please, [familiarize yourself now](https://github.com/php-fig/fig-standards). Also, please, use [PHPCodeSniffer](http://pear.php.net/package/PHP_CodeSniffer/) to validate your code against PSRs.
9-
- **Test your code**. Nobody else knows your code better than you. So, it's completely your mission to test the changes you made before pull request submission. We use [PHPUnit](https://phpunit.de/) for our testing purposes and recommend you using this tool too. [Here](https://phpunit.readthedocs.io) you can find documentation on how to write tests with PHPUnit, which helps us making PHPWord better day to day. Do not hesitate to smoke it carefully. It's a great investment in quality of your work, and it saves you years of life.
10-
- **Request pull in separate branch**. Do not submit your request to the master branch. But create a separate branch named specifically for the issue that you addressed. Read [GitHub manual](https://help.github.com/articles/using-pull-requests) to find out more about this. If you are new to GitHub, read [this short manual](https://help.github.com/articles/fork-a-repo) to get yourself familiar with forks and how git works in general. [This video](http://www.youtube.com/watch?v=-zvHQXnBO6c) explains how to synchronize your Github Fork with the Branch of PHPWord.
7+
- **Be brief, but be bold**. State your issues briefly. But speak out your ideas loudly, even if you can't or don't know how to implement them right away. The world will be better with limitless innovations.
8+
- **Follow PHP-FIG standards**. We follow PHP Standards Recommendations (PSRs) by [PHP Framework Interoperability Group](http://www.php-fig.org/). If you're not familiar with these standards, [familiarize yourself now](https://github.com/php-fig/fig-standards). Also, please run `composer fix` to automatically fix your code to match these recommendations.
9+
- **Test your code**. No one knows your code better than you, so we depend on you to test the changes you make before pull request submission. We use [PHPUnit](https://phpunit.de/) for our testing purposes and request that you use this tool too. Tests can be ran with `composer test`. [Documentation for writing tests with PHPUnit is available on Read the Docs.](https://phpunit.readthedocs.io)
10+
- **Use best practices when submitting pull requests**. Create a separate branch named specifically for the issue that you are addressing. Read the [GitHub manual](https://help.github.com/articles/about-pull-requests) to learn more about pull requests and GitHub. If you are new to GitHub, read [this short manual](https://help.github.com/articles/fork-a-repo) to get yourself familiar with forks and how git works in general. [This video](http://www.youtube.com/watch?v=-zvHQXnBO6c) explains how to synchronize your fork on GitHub with the upstream branch from PHPWord.
11+
12+
## Getting Started
13+
14+
1. [Clone](https://help.github.com/en/articles/cloning-a-repository) [PHPWord](https://github.com/PHPOffice/PHPWord/)
15+
2. [Install Composer](https://getcomposer.org/download/) if you don't already have it
16+
3. Open your terminal and:
17+
1. Switch to the directory PHPWord was cloned to (e.g., `cd ~/Projects/PHPWord/`)
18+
2. Run `composer install` to install the dependencies
19+
20+
You're ready to start working on PHPWord! Tests belong in the `/tests/PhpWord/` directory, the source code is in `/src/PhpWord/`, and any documentation should go in `/docs/`. Familiarize yourself with the codebase and try your hand at fixing [one of our outstanding issues](https://github.com/PHPOffice/PHPWord/issues). Before you get started, check the [existing pull requests](https://github.com/PHPOffice/PHPWord/pulls) to make sure no one else is already working on it.
21+
22+
Once you have an issue you want to start working on, you'll need to write tests for it, and then you can start implementing the changes necessary to pass the new tests. To run the tests, you can run one of the following commands in your terminal:
23+
24+
- `composer test-no-coverage` to run all of the tests
25+
- `composer test` to run all of the tests and generate test coverage reports
26+
27+
When you're ready to submit your new (and fully tested) feature, ensure `composer check` passes and [submit a pull request to PHPWord](https://github.com/PHPOffice/PHPWord/issues/new).
1128

1229
That's it. Thank you for your interest in PHPWord, and welcome!
1330

docs/ISSUE_TEMPLATE.md

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

0 commit comments

Comments
 (0)