From 918bdc9839111326b4b58fa19f7a3230b06fd7bd Mon Sep 17 00:00:00 2001 From: "Daniel St. Jules" Date: Sun, 28 Jul 2013 23:39:20 -0400 Subject: [PATCH] Add changelog, make few small doc corrections --- CHANGELOG.md | 3 +++ README.md | 18 ++++++++---------- composer.json | 4 ++-- src/Stringy/StaticStringy.php | 20 ++++++++++---------- src/Stringy/Stringy.php | 28 ++++++++++++++-------------- 5 files changed, 37 insertions(+), 36 deletions(-) create mode 100644 CHANGELOG.md diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..0d5836b --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +### 1.0.0-rc.1 (2013-07-28) + + * Release candidate diff --git a/README.md b/README.md index 0fe26b3..cc78d9d 100644 --- a/README.md +++ b/README.md @@ -6,8 +6,6 @@ A PHP library with a variety of string manipulation functions with multibyte sup [![Total Downloads](https://poser.pugx.org/danielstjules/Stringy/downloads.png)](https://packagist.org/packages/danielstjules/stringy) [![Latest Stable Version](https://poser.pugx.org/danielstjules/Stringy/v/stable.png)](https://packagist.org/packages/danielstjules/stringy) -Note: The methods listed below are subject to change until we reach a 1.0.0 release. - * [Requiring/Loading](#requiringloading) * [OO and Procedural](#oo-and-procedural) * [Methods](#methods) @@ -175,7 +173,7 @@ Returns true if $haystack contains $needle, false otherwise. ```php S::create('Ο συγγραφέας είπε', 'UTF-8')->contains('συγγραφέας'); -S::contains('Ο συγγραφέας είπε', 'συγγραφέας', 'UTF-8') // true +S::contains('Ο συγγραφέας είπε', 'συγγραφέας', 'UTF-8'); // true ``` #### count @@ -189,7 +187,7 @@ mb_substr_count() ```php S::create('Ο συγγραφέας είπε', 'UTF-8')->count('α'); -S::count('Ο συγγραφέας είπε', 'α', 'UTF-8') // 2 +S::count('Ο συγγραφέας είπε', 'α', 'UTF-8'); // 2 ``` #### create @@ -542,7 +540,7 @@ Replaces all occurrences of $search with $replace in $str. ```php S::create('fòô bàř fòô bàř', 'UTF-8')->replace('fòô ', ''); -S::replace('fòô bàř fòô bàř', 'fòô ', '', 'UTF-8') // 'bàř bàř' +S::replace('fòô bàř fòô bàř', 'fòô ', '', 'UTF-8'); // 'bàř bàř' ``` #### reverse @@ -585,7 +583,7 @@ in a string. ```php S::create('fòô bàř', 'UTF-8')->shuffle(); -S::shuffle('fòô bàř', 'UTF-8') // 'àôřb òf' +S::shuffle('fòô bàř', 'UTF-8'); // 'àôřb òf' ``` #### slugify @@ -601,7 +599,7 @@ dashes. The string is also converted to lowercase. ```php S::create('Using strings like fòô bàř')->slugify(); -S::slugify('Using strings like fòô bàř') // 'using-strings-like-foo-bar' +S::slugify('Using strings like fòô bàř'); // 'using-strings-like-foo-bar' ``` #### standardize @@ -716,7 +714,7 @@ $tabLength. By default, each tab is converted to 4 consecutive spaces. ```php S::create(' String speech = "Hi"')->toSpaces(); -S::toSpaces(' String speech = "Hi"') // ' String speech = "Hi"' +S::toSpaces(' String speech = "Hi"'); // ' String speech = "Hi"' ``` #### toTabs @@ -731,7 +729,7 @@ converted to a tab. ```php S::create(' fòô bàř')->toTabs(); -S::toTabs(' fòô bàř') // ' fòô bàř' +S::toTabs(' fòô bàř'); // ' fòô bàř' ``` #### trim @@ -744,7 +742,7 @@ Trims $str. An alias for PHP's trim() function. ```php S::create('fòô bàř', 'UTF-8')->trim(); -S::trim(' fòô bàř ') // 'fòô bàř' +S::trim(' fòô bàř '); // 'fòô bàř' ``` #### truncate diff --git a/composer.json b/composer.json index bd40f08..e766940 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,9 @@ { "name": "danielstjules/stringy", - "description": "A small string manipulation library with multibyte support", + "description": "A string manipulation library with multibyte support", "keywords": [ "multibyte", "string", "manipulation", "utility", "methods", "utf-8", - "helpers", "utils" + "helpers", "utils", "utf" ], "license": "MIT", "authors": [ diff --git a/src/Stringy/StaticStringy.php b/src/Stringy/StaticStringy.php index 2d6ddd3..afff10a 100644 --- a/src/Stringy/StaticStringy.php +++ b/src/Stringy/StaticStringy.php @@ -585,8 +585,8 @@ class StaticStringy /** * Returns true if $str contains only alphabetic chars, false otherwise. * - * @param string $str String to check - * @param string $encoding The character encoding + * @param string $str String to check + * @param string $encoding The character encoding * @return bool Whether or not $str contains only alphabetic chars */ public static function isAlpha($str, $encoding = null) @@ -598,8 +598,8 @@ class StaticStringy * Returns true if $str contains only alphabetic and numeric chars, false * otherwise. * - * @param string $str String to check - * @param string $encoding The character encoding + * @param string $str String to check + * @param string $encoding The character encoding * @return bool Whether or not $str contains only alphanumeric chars */ public static function isAlphanumeric($str, $encoding = null) @@ -610,8 +610,8 @@ class StaticStringy /** * Returns true if $str contains only whitespace chars, false otherwise. * - * @param string $str String to check - * @param string $encoding The character encoding + * @param string $str String to check + * @param string $encoding The character encoding * @return bool Whether or not $str contains only whitespace characters */ public static function isBlank($str, $encoding = null) @@ -622,8 +622,8 @@ class StaticStringy /** * Returns true if $str contains only lower case chars, false otherwise. * - * @param string $str String to check - * @param string $encoding The character encoding + * @param string $str String to check + * @param string $encoding The character encoding * @return bool Whether or not $str contains only lower case characters */ public static function isLowerCase($str, $encoding = null) @@ -634,8 +634,8 @@ class StaticStringy /** * Returns true if $str contains only upper case chars, false otherwise. * - * @param string $str String to check - * @param string $encoding The character encoding + * @param string $str String to check + * @param string $encoding The character encoding * @return bool Whether or not $str contains only upper case characters */ public static function isUpperCase($str, $encoding = null) diff --git a/src/Stringy/Stringy.php b/src/Stringy/Stringy.php index 0fc0b37..00d4bc5 100644 --- a/src/Stringy/Stringy.php +++ b/src/Stringy/Stringy.php @@ -190,7 +190,7 @@ class Stringy * Also accepts an array, $ignore, allowing you to list words not to be * capitalized. * - * @param array $ignore An array of words not to capitalize + * @param array $ignore An array of words not to capitalize * @return Stringy Object with a titleized $str */ public function titleize($ignore = null) @@ -390,8 +390,8 @@ class Stringy * Pads $str to a given length from the begining of the string. * Alias for pad($length, $padStr, 'left') * - * @param int $length Desired string length after padding - * @param string $padStr String used to pad, defaults to space + * @param int $length Desired string length after padding + * @param string $padStr String used to pad, defaults to space * @return Stringy Object with a left padded $str */ public function padLeft($length, $padStr = ' ') @@ -403,8 +403,8 @@ class Stringy * Pads $str to a given length from the end of the string. * Alias for pad($length, $padStr, 'left') * - * @param int $length Desired string length after padding - * @param string $padStr String used to pad, defaults to space + * @param int $length Desired string length after padding + * @param string $padStr String used to pad, defaults to space * @return string Object with a right padded $str */ public function padRight($length, $padStr = ' ') @@ -416,8 +416,8 @@ class Stringy * Pads $str to a given length such that both sides of the string string are * padded. Alias for pad($str, $length, $padStr, 'both', $encoding) * - * @param int $length Desired string length after padding - * @param string $padStr String used to pad, defaults to space + * @param int $length Desired string length after padding + * @param string $padStr String used to pad, defaults to space * @return Stringy The padded string */ public function padBoth($length, $padStr = ' ') @@ -529,7 +529,7 @@ class Stringy /** * Returns true if $str contains $needle, false otherwise. * - * @param string $needle Substring to look for + * @param string $needle Substring to look for * @return bool Whether or not $str contains $needle */ public function contains($needle) @@ -580,8 +580,8 @@ class Stringy * truncating occurs, the string is further truncated so that the substring * may be appended without exceeding the desired length. * - * @param int $length Desired length of the truncated string - * @param string $substring The substring to append if it can fit + * @param int $length Desired length of the truncated string + * @param string $substring The substring to append if it can fit * @return Stringy Object with the resulting $str after truncating */ public function truncate($length, $substring = '') @@ -606,8 +606,8 @@ class Stringy * is further truncated so that the substring may be appended without * exceeding the desired length. * - * @param int $length Desired length of the truncated string - * @param string $substring The substring to append if it can fit + * @param int $length Desired length of the truncated string + * @param string $substring The substring to append if it can fit * @return Stringy Object with the resulting $str after truncating */ public function safeTruncate($length, $substring = '') @@ -999,8 +999,8 @@ class Stringy * Returns the number of occurences of $substring in $str. An alias for * mb_substr_count() * - * @param string $substring The substring to search for - * @return int The number of $substring occurences + * @param string $substring The substring to search for + * @return int The number of $substring occurences */ public function count($substring) {