summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Soares de Lima <ricardo.soaresdelima@gmail.com>2012-12-08 17:23:10 -0200
committerChristian Weiske <cweiske@cweiske.de>2013-03-21 06:39:23 +0100
commit72269aa1d6790b5e9d0643fa348b9c1df6a8cfc7 (patch)
tree9e62346a0d946cea4562203cf428fa1bcb33e029
parentc4ba9ef2d295f85897557ce1f841a8bb368ed5ee (diff)
downloadsemanticscuttle-72269aa1d6790b5e9d0643fa348b9c1df6a8cfc7.tar.gz
semanticscuttle-72269aa1d6790b5e9d0643fa348b9c1df6a8cfc7.tar.bz2
Using a foreach loop avoids Notice warnings when the array doesn't have sequential indexes, ex: 0, 1, 3...
-rw-r--r--src/SemanticScuttle/Service/Bookmark2Tag.php2
-rw-r--r--src/SemanticScuttle/Service/Tag.php2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/SemanticScuttle/Service/Bookmark2Tag.php b/src/SemanticScuttle/Service/Bookmark2Tag.php
index 6505a5a..6e8e28c 100644
--- a/src/SemanticScuttle/Service/Bookmark2Tag.php
+++ b/src/SemanticScuttle/Service/Bookmark2Tag.php
@@ -98,7 +98,7 @@ class SemanticScuttle_Service_Bookmark2Tag extends SemanticScuttle_DbService
$tags_count = is_array($tags)?count($tags):0;
- for ($i = 0; $i < $tags_count; $i++) {
+ foreach($tags as $i => $tag) {
$tags[$i] = trim(utf8_strtolower($tags[$i]));
if ($fromApi) {
include_once 'SemanticScuttle/functions.php';
diff --git a/src/SemanticScuttle/Service/Tag.php b/src/SemanticScuttle/Service/Tag.php
index 39147b8..bd6bf70 100644
--- a/src/SemanticScuttle/Service/Tag.php
+++ b/src/SemanticScuttle/Service/Tag.php
@@ -144,7 +144,7 @@ class SemanticScuttle_Service_Tag extends SemanticScuttle_DbService
$tags = utf8_strtolower(trim($tags));
} else {
$tags = array_filter($tags);//remove empty values
- for($i=0; $i<count($tags); $i++) {
+ foreach($tags as $i => $tag) {
$tags[$i] = utf8_strtolower(trim($tags[$i]));
}
}