Skip to content

Commit d43f423

Browse files
Added documentation and links
1 parent 827a681 commit d43f423

4 files changed

Lines changed: 54 additions & 39 deletions

File tree

CODE_OF_CONDUCT.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
The Moon Autoloader code of conduct is derived from the Ruby code of conduct. Any violations of the code of conduct may be reported to Damiano Petrungaro (damianopetrungaro@gmail.com).
2+
3+
- Participants will be tolerant of opposing views.
4+
5+
- Participants must ensure that their language and actions are free of personal attacks and disparaging personal remarks.
6+
7+
- When interpreting the words and actions of others, participants should always assume good intentions.
8+
9+
- Behavior which can be reasonably considered harassment will not be tolerated.

CONTRIBUTING.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# How to Contribute
2+
3+
The contribution guideline is derived from the SlimPHP contribution guideline
4+
5+
## Pull Requests
6+
7+
1. Fork the Moon Autoloader repository
8+
2. Create a new branch for each feature or improvement
9+
3. Send a pull request from each feature branch to the **develop** branch
10+
11+
It is very important to separate new features or improvements into separate feature branches, and to send a
12+
pull request for each branch.
13+
14+
This allows me to review and pull in new features or improvements individually.
15+
16+
## Style Guide
17+
18+
All pull requests must adhere to the [PSR-2 standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md).
19+
20+
## Unit Testing
21+
22+
All pull requests must be accompanied by passing unit tests and complete code coverage. The Moon Autoloader uses phpunit for testing.
23+
24+
[Learn about PHPUnit](https://github.com/sebastianbergmann/phpunit/)

README.md

Lines changed: 21 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,34 @@
11
# Moon - Container
2-
A very simple Container
32

4-
[![Code Climate](https://codeclimate.com/github/moon-php/container/badges/gpa.svg)](https://codeclimate.com/github/moon-php/container) [![Build Status](https://travis-ci.org/moon-php/container.svg?branch=master)](https://travis-ci.org/moon-php/container)
3+
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/moon-php/container/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/moon-php/container/?branch=master)
4+
[![Code Coverage](https://scrutinizer-ci.com/g/moon-php/container/badges/coverage.png?b=master)](https://scrutinizer-ci.com/g/moon-php/container/?branch=master)
5+
[![Build Status](https://scrutinizer-ci.com/g/moon-php/container/badges/build.png?b=master)](https://scrutinizer-ci.com/g/moon-php/container/build-status/master)
56

6-
## Introduction
7+
###[Documentation](http://moon-php.com/docs/container/)
78

8-
Container is a standalone component incredibly easy.
9-
It's a container (yes, really) that implements only the container-interop interface (waiting the PSR-11) without other method.
9+
## Tests
1010

11-
## Usage
12-
The container accept as constructor argument, an associative array.
13-
The key (a.k.a alias) always has an entry.
11+
To execute the test suite, you'll need phpunit.
12+
_It's a dev-dependency of this package_
1413

15-
#### Init Container
14+
```bash
15+
$ php vendon/bin/phpunit
16+
```
1617

17-
$entries = [
18-
'alias' => function () {
19-
return new App\Acme\Class();
20-
}
21-
];
22-
$container = new Container($entries);
23-
24-
The entry can be anything: an integer, a string, a closure or an instance.
18+
## Contributing
2519

26-
#### Check if entry exists by alias
20+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
2721

28-
$entries = [...];
29-
$container = new Moon\Container($entries);
30-
$container->has('alias'); // Return true or false
22+
## Learn More
3123

32-
#### Getting an entry
24+
Learn more at these links:
3325

34-
$entries = [...];
35-
$c = new Moon\Container($entries);
36-
$container->get('alias'); // Return the instance or throw a Moon\Container\Exception\NotFoundException
37-
26+
- [Website](http://moon-php.com)
3827

39-
#### Entry with container resolution
28+
## Security
4029

41-
An entry may require an instance of the container for other entries.
42-
In this case, just use an argument in the function where the container instance will be bound.
43-
44-
$entries = [];
45-
$entries['ten'] = 10;
46-
$entries['two'] = 2;
47-
$entries['multiply'] = function ($c) {
48-
return $c->get('ten') * $c->get('two');
49-
};
50-
$c = new Moon\Container($entries);
51-
$c->get('multiply'); // Return 20
30+
If you discover security related issues, please email damianopetrungaro@gmail.com instead of using the issue tracker.
31+
32+
## License
33+
34+
The Moon Container is licensed under the MIT license. See [License File](LICENSE.md) for more information.

src/Container.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
namespace Moon\Container;
66

77
use Moon\Container\Exception\NotFoundException;
8-
use Psr\Container\ContainerExceptionInterface;
98
use Psr\Container\ContainerInterface;
109

1110
class Container implements ContainerInterface

0 commit comments

Comments
 (0)