diff --git a/DataStorage/Database/DataMapperAbstract.php b/DataStorage/Database/DataMapperAbstract.php index 63fef93e1..4f64b3c66 100644 --- a/DataStorage/Database/DataMapperAbstract.php +++ b/DataStorage/Database/DataMapperAbstract.php @@ -134,7 +134,7 @@ abstract class DataMapperAbstract implements DataMapperInterface /** * Fields to load. * - * @var string[] + * @var array[] * @since 1.0.0 */ protected $fields = []; @@ -404,6 +404,8 @@ abstract class DataMapperAbstract implements DataMapperInterface if (isset(static::$hasMany[$pname]['mapper']) && static::$hasMany[$pname]['mapper'] === static::$hasMany[$pname]['relationmapper']) { $relReflectionClass = new \ReflectionClass(get_class($temp)); + } else { + // todo: init other $relReflectionClass?! } foreach ($values as $key => &$value) { @@ -853,13 +855,14 @@ abstract class DataMapperAbstract implements DataMapperInterface * Get all by custom query. * * @param Builder $query Query + * @param bool $relations Relations * * @return array * * @since 1.0.0 * @author Dennis Eichhorn */ - public function getAllByQuery(Builder $query) : array + public function getAllByQuery(Builder $query, bool $relations = true) : array { $sth = $this->db->con->prepare($query->toSql()); $sth->execute(); diff --git a/Math/Matrix/Matrix.php b/Math/Matrix/Matrix.php index b639f6e6b..4e5a3081f 100644 --- a/Math/Matrix/Matrix.php +++ b/Math/Matrix/Matrix.php @@ -339,7 +339,7 @@ class Matrix implements ArrayAccess, Iterator } $trianglize = $this->matrix; - $prod = $this->(upperTrianglize($trianglize)); + $prod = $this->upperTrianglize($trianglize); for($i = 0; $i < $this->n; $i++) { $prod *= $trianglize[$i][$i]; diff --git a/Math/Number/Numbers.php b/Math/Number/Numbers.php index 153445f12..4ab9bf792 100644 --- a/Math/Number/Numbers.php +++ b/Math/Number/Numbers.php @@ -64,8 +64,9 @@ class Numbers */ public static function selfdescribing(int $n) : bool { - foreach (str_split($n) as $place => $value) { - if (substr_count($number, $place) != $value) { + $split = str_split($n); + foreach ($split as $place => $value) { + if (substr_count($n, $place) != $value) { return false; } } @@ -85,7 +86,7 @@ class Numbers */ public static function isSquare(int $n) : bool { - $goodMask; // 0xC840C04048404040 computed below + $goodMask = 0xC840C04048404040; // 0xC840C04048404040 computed below for ($i = 0; $i < 64; ++$i) { $goodMask |= PHP_INT_MIN >> ($i*$i);