Skip to content

Commit e2fd029

Browse files
ORM Corrections
Corrected return types in ORM modules
1 parent 8f2b134 commit e2fd029

File tree

8 files changed

+8
-8
lines changed

8 files changed

+8
-8
lines changed

src/ORM/HasAll.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
trait HasAll
1919
{
20-
public static function all(string $columns = '*'): Builder
20+
public static function all(string $columns = '*'): array
2121
{
2222
return Facades\DB::table(static::table())->select($columns)->toArray();
2323
}

src/ORM/HasFind.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
trait HasFind
1818
{
19-
public static function find(int $id, string $columns = '*')
19+
public static function find(int $id, string $columns = '*'): array
2020
{
2121
return DB::table(static::table())->select($columns)->where('id', '=', $id)->toArray();
2222
}

src/ORM/HasFirst.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
trait HasFirst
2020
{
21-
public static function first(string $columns = '*')
21+
public static function first(string $columns = '*'): array
2222
{
2323
return DB::table(static::table())->select($columns)->orderBy('id', 'ASC')->limit(1);
2424
}

src/ORM/HasJoin.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
*/
1717
trait HasJoin
1818
{
19-
public static function join(string $table, array $on, string $columns = '*')
19+
public static function join(string $table, array $on, string $columns = '*'): array
2020
{
2121
return DB::table(static::table())->join($table, $on, $columns)->toArray();
2222
}

src/ORM/HasLast.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
trait HasLast
2020
{
21-
public static function last(string $columns = '*')
21+
public static function last(string $columns = '*'): array
2222
{
2323
return DB::table(static::table())->select($columns)->orderBy('id', 'DESC')->limit(1)->toArray();
2424
}

src/ORM/HasLike.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
trait HasLike
2020
{
21-
public static function like(string $field, string $pattern, string $columns = '*'): Builder
21+
public static function like(string $field, string $pattern, string $columns = '*'): array
2222
{
2323
return DB::table(static::table())->select($columns)->like($field, $pattern)->toArray();
2424
}

src/ORM/HasNot.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818
trait HasNot
1919
{
20-
public static function whereNot($key = null, $value = null, string $columns = '*')
20+
public static function whereNot($key = null, $value = null, string $columns = '*'): array
2121
{
2222
return DB::table(static::table())->select($columns)->whereNot($key, $value)->toArray();
2323
}

src/ORM/HasWhere.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
*/
1919
trait HasWhere
2020
{
21-
public static function where($key, $is = null, $value = null, string $columns = '*')
21+
public static function where($key, $is = null, $value = null, string $columns = '*'): array
2222
{
2323
return DB::table(static::table())->select($columns)->where($key, $is, $value)->toArray();
2424
}

0 commit comments

Comments
 (0)