Skip to content

Commit

Permalink
Merge pull request #2 from Nekland/doc/reference
Browse files Browse the repository at this point in the history
Add a reference to the README and contribute part
  • Loading branch information
Nek- authored Nov 3, 2016
2 parents 424e733 + adce340 commit 91036cd
Show file tree
Hide file tree
Showing 3 changed files with 110 additions and 15 deletions.
26 changes: 26 additions & 0 deletions CONTRIBUTING.md
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!
20 changes: 20 additions & 0 deletions LICENCE
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.
79 changes: 64 additions & 15 deletions README.md
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.

0 comments on commit 91036cd

Please sign in to comment.