From 48aa6331f2863a1faa40b18c6cadc3c77ed15d7a Mon Sep 17 00:00:00 2001 From: "Nek (Maxime Veber)" Date: Thu, 3 Nov 2016 19:34:39 +0100 Subject: [PATCH 1/3] Add a reference to the README --- README.md | 79 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 65 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 042a8d6..6976db1 100644 --- a/README.md +++ b/README.md @@ -1,26 +1,77 @@ 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" ``` Then `composer update nekland/tools`. + +Reference +--------- + +### StrinTools class + +**Encoding arguments are optionals.** + +#### ::camelize + +```php +StringTools::camelize($str, $from) : string +``` + +* `$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. From 12fbe326f5a72b5b8864670a9bb16ba0df22a997 Mon Sep 17 00:00:00 2001 From: "Nek (Maxime Veber)" Date: Thu, 3 Nov 2016 19:37:16 +0100 Subject: [PATCH 2/3] Add contribute --- CONTRIBUTING.md | 26 ++++++++++++++++++++++++++ LICENCE | 20 ++++++++++++++++++++ 2 files changed, 46 insertions(+) create mode 100644 CONTRIBUTING.md create mode 100644 LICENCE diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..d116b27 --- /dev/null +++ b/CONTRIBUTING.md @@ -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! diff --git a/LICENCE b/LICENCE new file mode 100644 index 0000000..3d7cf52 --- /dev/null +++ b/LICENCE @@ -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. From adce340e52fa81ef3f03297d44c342df15f8583b Mon Sep 17 00:00:00 2001 From: "Nek (Maxime Veber)" Date: Thu, 3 Nov 2016 19:51:25 +0100 Subject: [PATCH 3/3] Fix missing removal in README --- README.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.md b/README.md index 6976db1..5aff196 100644 --- a/README.md +++ b/README.md @@ -14,8 +14,6 @@ Installation composer require "nekland/tools" ``` -Then `composer update nekland/tools`. - Reference ---------