Forráskód Böngészése

patches in php
tiny additions in documentation

Franco Ponticelli 16 éve
szülő
commit
7052396f40
5 módosított fájl, 16 hozzáadás és 5 törlés
  1. 6 0
      std/IntIter.hx
  2. 6 2
      std/Lambda.hx
  3. 2 2
      std/Type.hx
  4. 1 1
      std/php/Boot.hx
  5. 1 0
      std/php/db/Manager.hx

+ 6 - 0
std/IntIter.hx

@@ -40,10 +40,16 @@ class IntIter {
 		this.max = max;
 	}
 
+	/**
+		Returns true if the iterator has other items, false otherwise.
+	**/
 	public function hasNext() {
 		return min < max;
 	}
 
+	/**
+		Moves to the next item of the iterator.
+	**/
 	public function next() {
 		return min++;
 	}

+ 6 - 2
std/Lambda.hx

@@ -72,7 +72,11 @@ class Lambda {
 	}
 
 	/**
-		Tells if the element is part of an iterable
+		Tells if the element is part of an iterable. The comparison
+		is made using the [==] operator. Optionally you can pass as
+		a third parameter a function that performs the comparison.
+		That function must take as arguments the two items to
+		compare and returns a boolean value.
 	**/
 	public static function has<A>( it : Iterable<A>, elt : A, ?cmp : A -> A -> Bool ) : Bool {
 		if( cmp == null ) {
@@ -88,7 +92,7 @@ class Lambda {
 	}
 
 	/**
-		Tells if at least one element of the iterable if found by using the specific function.
+		Tells if at least one element of the iterable is found by using the specific function.
 	**/
 	public static function exists<A>( it : Iterable<A>, f : A -> Bool ) {
 		for( x in it )

+ 2 - 2
std/Type.hx

@@ -405,7 +405,7 @@ class Type {
 			if(untyped c.__qname__ == 'Array') return  ['push', 'concat', 'join', 'pop', 'reverse', 'shift', 'slice', 'sort', 'splice', 'toString', 'copy', 'unshift', 'insert', 'remove', 'iterator', 'length'];
 			untyped __php__("
 			$rfl = $c->__rfl__();
-			if($rfl === null) return array();
+			if($rfl === null) return new _hx_array(array());
 			$ms = $rfl->getMethods();
 			$ps = $rfl->getProperties();
 			$r = array();
@@ -454,7 +454,7 @@ class Type {
 			if(untyped c.__qname__ == 'Array')  return [];
 			untyped __php__("
 			$rfl = $c->__rfl__();
-			if($rfl === null) return array();
+			if($rfl === null) return new _hx_array(array());
 			$ms = $rfl->getMethods();
 			$ps = $rfl->getProperties();
 			$r = array();

+ 1 - 1
std/php/Boot.hx

@@ -530,7 +530,7 @@ class _hx_type {
 	private $rfl = false;
 	public function __rfl__() {
 		if($this->rfl !== false) return $this->rfl;
-		if(class_exists($this->__tname__))
+		if(class_exists($this->__tname__) || interface_exists($this->__tname__))
 			$this->rfl = new ReflectionClass($this->__tname__);
 		else
 			$this->rfl = null;

+ 1 - 0
std/php/db/Manager.hx

@@ -75,6 +75,7 @@ class Manager<T : Object> {
 
 		var instance_fields = Type.getInstanceFields(cls);
 		var scls = Type.getSuperClass(cls);
+		while (Type.getSuperClass(scls) != null) scls = Type.getSuperClass(scls);
 		if(scls != null) {
 			for(remove in Type.getInstanceFields(scls))
 				instance_fields.remove(remove);