-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from Nekland/doc/reference
Add a reference to the README and contribute part
- Loading branch information
Showing
3 changed files
with
110 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
Contributing | ||
============ | ||
|
||
Issues | ||
------ | ||
|
||
An issue will be **automatically** close without a test case failing. | ||
|
||
Pull-Request | ||
------------ | ||
|
||
Any Pull-Request **MUST** have following parts: | ||
|
||
1. Test case for new feature or bugfix | ||
2. Reference documentation updated in case of new feature | ||
3. Code update | ||
|
||
Otherwise it may be refuse. | ||
|
||
Please also specify following in the description: | ||
|
||
* Bugfix ? | ||
* New feature ? | ||
* [BC Break](http://stackoverflow.com/questions/8891005/what-does-bc-break-mean) ? | ||
|
||
Thanks! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2013 Nekland | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy of | ||
this software and associated documentation files (the "Software"), to deal in | ||
the Software without restriction, including without limitation the rights to | ||
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of | ||
the Software, and to permit persons to whom the Software is furnished to do so, | ||
subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS | ||
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR | ||
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER | ||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN | ||
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,75 @@ | ||
Nekland Tools | ||
============= | ||
|
||
[![Build Status](https://travis-ci.org/Nekland/Tools.svg?branch=master)](https://travis-ci.org/Nekland/Tools) | ||
|
||
Just some classes helping to code with PHP in general. | ||
|
||
**This repository follows semver.** | ||
|
||
Installation | ||
------------ | ||
|
||
Inside your `composer.json` file: | ||
|
||
```json | ||
{ | ||
"require": { | ||
"nekland/tools": "dev-master" | ||
}, | ||
"repositories": [ | ||
{ | ||
"type": "vcs", | ||
"url": "https://github.com/Nekland/Tools" | ||
} | ||
] | ||
} | ||
```bash | ||
composer require "nekland/tools" | ||
``` | ||
|
||
Reference | ||
--------- | ||
|
||
### StrinTools class | ||
|
||
**Encoding arguments are optionals.** | ||
|
||
#### ::camelize | ||
|
||
```php | ||
StringTools::camelize($str, $from) : string | ||
``` | ||
|
||
Then `composer update nekland/tools`. | ||
* `$str` string input | ||
* `$from` (optional, default "\_") string entry format (can be "-" or "\_") | ||
|
||
#### ::startsWith | ||
|
||
```php | ||
StringTools::startsWith($str, $start, $encoding) : bool | ||
``` | ||
|
||
* `$str` string input | ||
* `$start` string it should starts with | ||
|
||
#### ::endsWith | ||
|
||
```php | ||
StringTools::endsWith($str, $end, $encoding) : bool | ||
``` | ||
|
||
* `$str` string input | ||
* `$end` string it should ends with | ||
|
||
#### ::removeStart | ||
|
||
```php | ||
StringTools::removeStart($str, $toRemove, $encoding) : string | ||
``` | ||
|
||
* `$str` string input | ||
* `$toRemove` string to remove at the start of `$str` | ||
|
||
#### ::contains | ||
|
||
```php | ||
StringTools::contains($str, $needle, $encoding) : bool | ||
``` | ||
|
||
* `$str` string input | ||
* `$needle` potentially contained string | ||
|
||
### EqualableInterface | ||
|
||
Helps you equals on objects on a similar way as [java](http://stackoverflow.com/questions/1643067/whats-the-difference-between-equals-and). | ||
|
||
#### equals | ||
|
||
Method that you must implements to check if the object taking as parameter is equals or not. |