From 92aa8fbfc40037b20a490023ee579418548e5ada Mon Sep 17 00:00:00 2001
From: Olav Morken <olav.morken@uninett.no>
Date: Fri, 9 Jul 2010 06:55:09 +0000
Subject: [PATCH] Utilities: Remove unused functions.

- strleft
- array_values_equals
- checkAssocArrayRules

git-svn-id: https://simplesamlphp.googlecode.com/svn/trunk@2393 44740490-163a-0410-bde0-09ae8108e29a
---
 lib/SimpleSAML/Utilities.php | 48 +-----------------------------------
 1 file changed, 1 insertion(+), 47 deletions(-)

diff --git a/lib/SimpleSAML/Utilities.php b/lib/SimpleSAML/Utilities.php
index 5cd223ff8..9b937d885 100644
--- a/lib/SimpleSAML/Utilities.php
+++ b/lib/SimpleSAML/Utilities.php
@@ -222,10 +222,6 @@ class SimpleSAML_Utilities {
 	}
 
 
-	public static function strleft($s1, $s2) {
-		return substr($s1, 0, strpos($s1, $s2));
-	}
-	
 	public static function checkDateConditions($start=NULL, $end=NULL) {
 		$currentTime = time();
 	
@@ -272,49 +268,7 @@ class SimpleSAML_Utilities {
 		$uniqueid = substr(md5(uniqid(rand(), true)), 0, 10);
 		return $uniqueid;
 	}
-	
-	public static function array_values_equals($array, $equalsvalue) {
-		$foundkeys = array();
-		foreach ($array AS $key => $value) {
-			if ($value === $equalsvalue) $foundkeys[] = $key;
-		}
-		return $foundkeys;
-	}
-	
-	public static function checkAssocArrayRules($target, $required, $optional = array()) {
-
-		$results = array(
-			'required.found' 		=> array(),
-			'required.notfound'		=> array(),
-			'optional.found'		=> array(),
-			'optional.notfound'		=> array(),
-			'leftovers'				=> array()
-		);
-		
-		foreach ($target AS $key => $value) {
-			if(in_array($key, $required)) {
-				$results['required.found'][$key] = $value;
-			} elseif (in_array($key, $optional)) {
-				$results['optional.found'][$key] = $value;
-			} else {
-				$results['leftovers'][$key] = $value;
-			}
-		}
-		
-		foreach ($required AS $key) {
-			if (!array_key_exists($key, $target)) {
-				$results['required.notfound'][] = $key;
-			}
-		}
-		
-		foreach ($optional AS $key) {
-			if (!array_key_exists($key, $target)) {
-				$results['optional.notfound'][] = $key;
-			}
-		}
-		return $results;
-	}
-	
+
 
 	/**
 	 * Build a backtrace.
-- 
GitLab