Skip to content

Commit

Permalink
Updated location for license
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonlam604 committed Sep 5, 2016
1 parent 7d5526e commit 65bca4b
Show file tree
Hide file tree
Showing 60 changed files with 93 additions and 86 deletions.
2 changes: 1 addition & 1 deletion src/Transformers/Alpha.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Alpha extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/AlphaNumeric.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class AlphaNumeric extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/AlphaNumericSpace.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class AlphaNumericSpace extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/AlphaNumericSpaceDash.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class AlphaNumericSpaceDash extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/Base64.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Base64 extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/Base64Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Base64Check extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/Between.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Between extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/Camelize.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Camelize extends Transformer implements TransformerInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/Transformers/Concat.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Concat extends Transformer implements TransformerInterface
{
Expand Down Expand Up @@ -35,7 +35,7 @@ public function __construct($value, $appendValue)
/**
* Set flag indicator to pre-append value when true
*
* @param boolean $isPreAppend
* @param boolean $isPreAppend
*/
public function setPreAppend($isPreAppend)
{
Expand All @@ -53,7 +53,7 @@ public function execute()
else
throw new \InvalidArgumentException("Missing value to concat with");
}

if ($this->isPreAppend)
return $this->appendValue . $this->getValue();
else
Expand Down
6 changes: 3 additions & 3 deletions src/Transformers/Contains.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Contains extends TransformerCaseInsensitive implements TransformerInterface
{
Expand All @@ -24,14 +24,14 @@ public function __construct($value, $needle)
public function execute()
{
if ($this->isCaseInsensitive()) {

if ((new StringFindPosition($this->getValue(), $this->needle))->enableCaseInsensitive()->execute()) {
return true;
} else {
return false;
}
} else {

if ((new StringFindPosition($this->getValue(), $this->needle))->execute()) {
return true;
} else {
Expand Down
4 changes: 2 additions & 2 deletions src/Transformers/Dasherize.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Dasherize extends Transformer implements TransformerInterface
{
Expand All @@ -23,7 +23,7 @@ public function __construct($value)
public function execute()
{
preg_match_all('((?:^|[A-Z])[^A-Z]*)', $this->getValue(), $matches);

return mb_strtolower(implode("-", $matches[0]));
}
}
2 changes: 1 addition & 1 deletion src/Transformers/Date.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Date extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/Decimal.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Decimal extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/Email.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Email extends Transformer implements TransformerInterface
{
Expand Down
4 changes: 2 additions & 2 deletions src/Transformers/EmptyCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class EmptyCheck extends Transformer implements TransformerInterface
{
Expand All @@ -22,7 +22,7 @@ public function execute()
{
$s = new Stringizer($this->getValue());
$s->removeWhitespace();

return empty(trim($s->getString()));
}
}
4 changes: 2 additions & 2 deletions src/Transformers/EndsWith.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class EndsWith extends Transformer implements TransformerInterface
{
Expand All @@ -16,7 +16,7 @@ class EndsWith extends Transformer implements TransformerInterface
public function __construct($value, $needle)
{
parent::__construct($value);

$this->needle = $needle;
}

Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/EnsureLeft.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class EnsureLeft extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/EnsureRight.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class EnsureRight extends Transformer implements TransformerInterface
{
Expand Down
8 changes: 4 additions & 4 deletions src/Transformers/HashCode.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class HashCode extends Transformer implements TransformerInterface
{
Expand All @@ -30,18 +30,18 @@ private function hashCode($s)
{
$h = 0;
$len = strlen($s);

for ($i = 0; $i < $len; $i ++) {
$h = $this->overflow32(31 * $h + ord($s[$i]));
}

return $h;
}

private function overflow32($v)
{
$v = $v % 4294967296;

if ($v > 2147483647)
return $v - 4294967296;
elseif ($v < - 2147483648)
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/HexDecimal.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class HexDecimal extends Transformer implements TransformerInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/Transformers/IndexOf.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
*
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*
*/
class IndexOf extends TransformerCaseInsensitive implements TransformerInterface
{
Expand All @@ -19,7 +19,7 @@ class IndexOf extends TransformerCaseInsensitive implements TransformerInterface
public function __construct($value, $needle, $fromIndex = 0)
{
parent::__construct($value);

$this->needle = $needle;
$this->fromIndex = $fromIndex;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/Ipv4.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Ipv4 extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/Ipv6.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Ipv6 extends Transformer implements TransformerInterface
{
Expand Down
6 changes: 3 additions & 3 deletions src/Transformers/LastIndexOf.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
*
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*
*/
class LastIndexOf extends TransformerCaseInsensitive implements TransformerInterface
{
Expand All @@ -19,7 +19,7 @@ class LastIndexOf extends TransformerCaseInsensitive implements TransformerInter
public function __construct($value, $needle, $fromIndex = 0)
{
parent::__construct($value);

$this->needle = $needle;
$this->fromIndex = $fromIndex;
}
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/Length.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Length extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/Lowercase.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Lowercase extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/LowercaseCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class LowercaseCheck extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/LowercaseFirst.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class LowercaseFirst extends Transformer implements TransformerInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/Transformers/Number.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Number extends Transformer implements TransformerInterface
{
Expand Down
10 changes: 5 additions & 5 deletions src/Transformers/Pad.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
*
* @link https://github.com/jasonlam604/Stringizer
* @copyright Copyright (c) 2016 Jason Lam
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE (MIT License)
* @license https://github.com/jasonlam604/Stringizer/blob/master/LICENSE.md (MIT License)
*/
class Pad extends Transformer implements TransformerInterface
{
Expand All @@ -20,15 +20,15 @@ class Pad extends Transformer implements TransformerInterface
public function __construct($value, $padValue, $padAmount, $padType)
{
parent::__construct($value);

if ($padType != STR_PAD_RIGHT && $padType != STR_PAD_LEFT && $padType != STR_PAD_BOTH) {
throw new \InvalidArgumentException("Invalid pad side option");
}

$this->padValue = $padValue;

$this->padType = $padType;

$this->padAmount = $padAmount;
}

Expand Down

0 comments on commit 65bca4b

Please sign in to comment.