1
0
mirror of https://github.com/danielstjules/Stringy.git synced 2025-08-17 18:46:19 +02:00

Merge pull request #45 from GrahamCampbell/cs

CS Fixes
This commit is contained in:
Daniel St. Jules
2014-09-27 09:25:57 -07:00
2 changed files with 6 additions and 7 deletions

View File

@@ -777,7 +777,7 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
$encoding = $this->encoding; $encoding = $this->encoding;
foreach($needles as $needle) { foreach ($needles as $needle) {
if ($this->contains($needle, $caseSensitive)) { if ($this->contains($needle, $caseSensitive)) {
return true; return true;
} }
@@ -803,7 +803,7 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
$encoding = $this->encoding; $encoding = $this->encoding;
foreach($needles as $needle) { foreach ($needles as $needle) {
if (!$this->contains($needle, $caseSensitive)) { if (!$this->contains($needle, $caseSensitive)) {
return false; return false;
} }
@@ -1033,8 +1033,8 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
$end = 0; $end = 0;
$table = array_fill(0, $strLength + 1, array_fill(0, $otherLength + 1, 0)); $table = array_fill(0, $strLength + 1, array_fill(0, $otherLength + 1, 0));
for ($i = 1; $i <= $strLength; $i++){ for ($i = 1; $i <= $strLength; $i++) {
for ($j = 1; $j <= $otherLength; $j++){ for ($j = 1; $j <= $otherLength; $j++) {
$strChar = mb_substr($stringy->str, $i - 1, 1, $encoding); $strChar = mb_substr($stringy->str, $i - 1, 1, $encoding);
$otherChar = mb_substr($otherStr, $j - 1, 1, $encoding); $otherChar = mb_substr($otherStr, $j - 1, 1, $encoding);
@@ -1283,7 +1283,6 @@ class Stringy implements \Countable, \IteratorAggregate, \ArrayAccess
return (json_last_error() === JSON_ERROR_NONE); return (json_last_error() === JSON_ERROR_NONE);
} }
/** /**
* Returns true if the string contains only lower case chars, false * Returns true if the string contains only lower case chars, false
* otherwise. * otherwise.

View File

@@ -402,7 +402,7 @@ abstract class CommonTest extends PHPUnit_Framework_TestCase
public function containsAnyProvider() public function containsAnyProvider()
{ {
// One needle // One needle
$singleNeedle = array_map(function($array) { $singleNeedle = array_map(function ($array) {
$array[2] = array($array[2]); $array[2] = array($array[2]);
return $array; return $array;
}, $this->containsProvider()); }, $this->containsProvider());
@@ -440,7 +440,7 @@ abstract class CommonTest extends PHPUnit_Framework_TestCase
public function containsAllProvider() public function containsAllProvider()
{ {
// One needle // One needle
$singleNeedle = array_map(function($array) { $singleNeedle = array_map(function ($array) {
$array[2] = array($array[2]); $array[2] = array($array[2]);
return $array; return $array;
}, $this->containsProvider()); }, $this->containsProvider());