Skip to content

Commit

Permalink
Merge branch 'master' into feature/bookdown_docs
Browse files Browse the repository at this point in the history
  • Loading branch information
settermjd committed Mar 1, 2017
2 parents 48e5393 + 8053127 commit 90fe8c8
Show file tree
Hide file tree
Showing 22 changed files with 652 additions and 214 deletions.
2 changes: 2 additions & 0 deletions .gitignore
@@ -1,2 +1,4 @@
cache/
docs/html/
vendor/
build/
187 changes: 187 additions & 0 deletions CONTRIBUTING.md
@@ -0,0 +1,187 @@
# CONTRIBUTING

## Resources

If you wish to contribute to Disco, please be sure to
read/subscribe to the following resources:

- [The PSR-2 Coding Standard](http://www.php-fig.org/psr/psr-2/)
- The Disco Contributor's IRC channel: #disco.dev on Freenode.net

If you are working on new features or refactoring [create a proposal](https://github.com/bitExpert/disco/issues/new).

## Reporting Potential Security Issues

If you have encountered a potential security vulnerability, please **DO NOT** report it on the public issue tracker: send it to us at [opensource@bitexpert.de](mailto:opensource@bitexpert.de) instead.
We will work with you to verify the vulnerability and patch it as soon as possible.

When reporting issues, please provide the following information:

- Component(s) affected
- A description indicating how to reproduce the issue
- A summary of the security vulnerability and impact

We request that you contact us via the email address above and give the project contributors a chance to resolve the vulnerability and issue a new release prior to any public exposure.
This helps protect users and provides them with a chance to upgrade and/or update in order to protect their applications.

For sensitive email communications, please use [our PGP key](http://pgp.mit.edu/pks/lookup?op=vindex&search=0x6DE7F8597CECDF13).

## Running Tests

To run tests:

1. Clone the repository:

```console
$ git clone git@github.com:bitExpert/disco.git
$ cd disco
```

2. Install dependencies via composer:

```console
$ ./composer.phar install
```

If you don't have `curl` installed, you can also download `composer.phar` from https://getcomposer.org/download/

3. Run the tests using the "test" command shipped in the `composer.json`:

```console
$ composer test
```

You can turn on conditional tests with the `phpunit.xml` file.
To do so:

- Copy `phpunit.xml.dist` file to `phpunit.xml`
- Edit `phpunit.xml` to enable any specific functionality you want to test, as well as to provide test values to utilize.

## Running Coding Standards Checks

First, ensure you've installed dependencies via composer, per the previous section on running tests.
To run CS checks only:

```console
$ composer cs-check
```

To attempt to automatically fix common CS issues:

```console
$ composer cs-fix
```

If the above fixes any CS issues, please re-run the tests to ensure they pass, and make sure you add and commit the changes after verification.

## Recommended Workflow for Contributions

Your first step is to establish a public repository from which we can pull your work into the master repository.
We recommend using [GitHub](https://github.com), as that is where the component is already hosted.

1. Setup a [GitHub account](http://github.com/), if you haven't yet
2. Fork the repository (http://github.com/bitExpert/disco)
3. Clone the canonical repository locally and enter it.

```console
$ git clone git://github.com:bitExpert/disco.git
$ cd disco
```

4. Add a remote to your fork; substitute your GitHub username in the command
below.

```console
$ git remote add {username} git@github.com:{username}/disco.git
$ git fetch {username}
```

### Keeping Up-to-Date

Periodically, you should update your fork or personal repository to match the canonical Disco repository.
Assuming you have setup your local repository per the instructions above, you can do the following:

```console
$ git checkout master
$ git fetch origin
$ git rebase origin/master
# OPTIONALLY, to keep your remote up-to-date -
$ git push {username} master:master
```

If you're tracking other branches you'll want to do the same operations for those branches; simply substitute the branch names for "master".

### Working on a patch

We recommend you do each new feature or bugfix in a new branch.
This simplifies the task of code review as well as the task of merging your changes into the canonical repository.

A typical workflow will then consist of the following:

1. Create a new local branch based off your master branch.
2. Switch to your new local branch. (This step can be combined with the
previous step with the use of `git checkout -b`.)
3. Do some work, commit, repeat as necessary.
4. Push the local branch to your remote repository.
5. Send a pull request.

The mechanics of this process are actually quite trivial.
Below, we will create a branch for fixing an issue in the tracker.

```console
$ git checkout -b hotfix/9295
Switched to a new branch 'hotfix/9295'
```

...do some work...

```console
$ git commit
```

...write your log message...

```console
$ git push {username} hotfix/9295:hotfix/9295
Counting objects: 38, done.
Delta compression using up to 2 threads.
Compression objects: 100% (18/18), done.
Writing objects: 100% (20/20), 8.19KiB, done.
Total 20 (delta 12), reused 0 (delta 0)
To ssh://git@github.com/{username}/disco.git
b5583aa..4f51698 HEAD -> master
```
### Sending a PR

Before sending a PR, run `composer.phar validate && composer.phar check`, as the Travis build will also run the command and will fail if the composer.lock file is not up-to-date with the changes in the composer.json file.

When you’ve done that, and you’re reading to send one, you have two options:

1. If using GitHub, you can do the pull request from there.
Navigate to your repository, select the branch you just created, and then select the "Pull Request" button in the upper right. Select the user/organization "bitExpert" as the recipient.

2. If using your own repository - or even if using GitHub - you can use `git format-patch` to create a patchset for us to apply; in fact, this is **recommended** for security-related patches.

#### What Branch to Issue the Pull Request Against?

Which branch should you issue a pull request against?

- For fixes against the stable release, issue the pull request against the latest release branch.
- For new features, or fixes that introduce new elements to the public API (such as new public methods or properties), issue the pull request against the "master" branch.

### Branch Cleanup

As you might imagine, if you are a frequent contributor, you'll start to get a ton of branches both locally and on your remote.
Once you know that your changes have been accepted to the master repository, we suggest doing some cleanup of these branches.

- Local branch cleanup

```console
$ git branch -d <branchname>
```

- Remote branch removal

```console
$ git push {username} :<branchname>
```
60 changes: 60 additions & 0 deletions Changelog.md
Expand Up @@ -2,6 +2,66 @@

All notable changes to this project will be documented in this file, in reverse chronological order by release.

## 0.8.0

### Added

- Nothing.

### Deprecated

- Nothing.

### Removed

- [#90](https://github.com/bitExpert/disco/pull/90) Migrate container-interop dependency to PSR-11

### Fixed

- Nothing.

## 0.7.0

### Added

- [#81](https://github.com/bitExpert/disco/pull/81) Generate unique names for helper methods
- [#80](https://github.com/bitExpert/disco/pull/80) Adds setup for simple benchmarks
- [#78](https://github.com/bitExpert/disco/pull/78) Optimize the code formatting of the generated config class
- [#73](https://github.com/bitExpert/disco/issues/73) Benchmark Disco and add results to README

### Deprecated

- Nothing.

### Removed

- [#77](https://github.com/bitExpert/disco/pull/77) Change in Travis config: Remove hhvm, add PHP 7.1 to build matrix

### Fixed

- [#76](https://github.com/bitExpert/disco/pull/76) Change visibility of wrapBeanAsLazy helper method to protected
- [#69](https://github.com/bitExpert/disco/pull/69) Use UniqueIdentifierGenerator::getIdentifier to generate unique names for helper methods
- [#68](https://github.com/bitExpert/disco/pull/68) Change visibility of wrapBeanAsLazy helper method
- [#66](https://github.com/bitExpert/disco/pull/66) APC fix as suggested by Scrutinizer

## 0.6.3

### Added

- Nothing.

### Deprecated

- Nothing.

### Removed

- Nothing.

### Fixed

- [#85](https://github.com/bitExpert/disco/pull/85) Fix bool cast for @Parameter required attribute

## 0.6.2

### Added
Expand Down
7 changes: 6 additions & 1 deletion README.md
@@ -1,6 +1,6 @@
# bitexpert/disco

This package provides a [container-interop](https://github.com/container-interop/container-interop) compatible,
This package provides a [PSR-11](http://www.php-fig.org/psr/psr-11/) compatible,
annotation-based dependency injection container. Have a look at the [disco-demos](https://github.com/bitExpert/disco-demos) project to find out how to use Disco.

[![Build Status](https://travis-ci.org/bitExpert/disco.svg?branch=master)](https://travis-ci.org/bitExpert/disco)
Expand Down Expand Up @@ -100,6 +100,11 @@ Please feel free to fork and extend existing or add new features and send
a pull request with your changes! To establish a consistent code quality,
please provide unit tests for all your changes and adapt the documentation.

## Want To Contribute?

If you feel that you have something to share, then we’d love to have you.
Check out [the contributing guide](CONTRIBUTING.md) to find out how, as well as what we expect from you.

## Resources

- sitepoint.com: [Disco with Design Patterns: A Fresh Look at Dependency Injection](https://www.sitepoint.com/disco-with-frameworks-and-design-patterns-a-fresh-look-at-dependency-injection/)
Expand Down
14 changes: 11 additions & 3 deletions composer.json
Expand Up @@ -12,14 +12,13 @@
],
"require": {
"php": "7.0.0 - 7.0.5 || ^7.0.7",
"container-interop/container-interop": "^1.1.0",
"psr/container": "^1.0.0",
"doctrine/annotations": "^1.3.0",
"ocramius/proxy-manager": "^2.0.4 <2.1.0",
"bitexpert/slf4psrlog": "^0.1.3"
},
"require-dev": {
"phpunit/php-code-coverage": "^4.0.1",
"phpunit/phpunit": "^5.6",
"phpunit/phpunit": "^6.0",
"squizlabs/php_codesniffer": "^2.6.2",
"phpdocumentor/phpdocumentor": "v2.9.0",
"monolog/monolog": "^1.21.0",
Expand All @@ -37,5 +36,14 @@
"psr-4": {
"bitExpert\\Disco\\": ["tests/bitExpert/Disco", "benchmarks/bitExpert/Disco"]
}
},
"scripts": {
"check": [
"@cs-check",
"@test"
],
"cs-check": "vendor/bin/phing sniff",
"cs-fix": "vendor/bin/phpcbf",
"test": "vendor/bin/phing unit"
}
}

0 comments on commit 90fe8c8

Please sign in to comment.