From e3936374a5ae359ddacc69e39c4db1fe08afb67a Mon Sep 17 00:00:00 2001 From: JNapolitanoIT Date: Thu, 2 Mar 2023 21:22:16 -0800 Subject: [PATCH 1/2] Minor changes --- composer.lock | 39 ++++++++++++++++++++------------------- src/Entity.php | 8 -------- src/ORM/HasAll.php | 2 +- src/ORM/HasFind.php | 2 +- src/ORM/HasFirst.php | 2 +- src/ORM/HasJoin.php | 2 +- src/ORM/HasLike.php | 2 +- src/ORM/HasNot.php | 2 +- src/ORM/HasWhere.php | 2 +- 9 files changed, 27 insertions(+), 34 deletions(-) diff --git a/composer.lock b/composer.lock index 3fe9464..a8fae60 100644 --- a/composer.lock +++ b/composer.lock @@ -305,23 +305,23 @@ }, { "name": "phpunit/php-code-coverage", - "version": "9.2.24", + "version": "9.2.25", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed" + "reference": "0e2b40518197a8c0d4b08bc34dfff1c99c508954" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2cf940ebc6355a9d430462811b5aaa308b174bed", - "reference": "2cf940ebc6355a9d430462811b5aaa308b174bed", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/0e2b40518197a8c0d4b08bc34dfff1c99c508954", + "reference": "0e2b40518197a8c0d4b08bc34dfff1c99c508954", "shasum": "" }, "require": { "ext-dom": "*", "ext-libxml": "*", "ext-xmlwriter": "*", - "nikic/php-parser": "^4.14", + "nikic/php-parser": "^4.15", "php": ">=7.3", "phpunit/php-file-iterator": "^3.0.3", "phpunit/php-text-template": "^2.0.2", @@ -370,7 +370,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.24" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.25" }, "funding": [ { @@ -378,7 +378,7 @@ "type": "github" } ], - "time": "2023-01-26T08:26:55+00:00" + "time": "2023-02-25T05:32:00+00:00" }, { "name": "phpunit/php-file-iterator", @@ -623,16 +623,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.3", + "version": "9.6.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555" + "reference": "9125ee085b6d95e78277dc07aa1f46f9e0607b8d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/e7b1615e3e887d6c719121c6d4a44b0ab9645555", - "reference": "e7b1615e3e887d6c719121c6d4a44b0ab9645555", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/9125ee085b6d95e78277dc07aa1f46f9e0607b8d", + "reference": "9125ee085b6d95e78277dc07aa1f46f9e0607b8d", "shasum": "" }, "require": { @@ -705,7 +705,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.3" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.4" }, "funding": [ { @@ -721,7 +721,7 @@ "type": "tidelift" } ], - "time": "2023-02-04T13:37:15+00:00" + "time": "2023-02-27T13:06:37+00:00" }, { "name": "sebastian/cli-parser", @@ -1689,16 +1689,16 @@ }, { "name": "squizlabs/php_codesniffer", - "version": "3.7.1", + "version": "3.7.2", "source": { "type": "git", "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619" + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/1359e176e9307e906dc3d890bcc9603ff6d90619", - "reference": "1359e176e9307e906dc3d890bcc9603ff6d90619", + "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/ed8e00df0a83aa96acf703f8c2979ff33341f879", + "reference": "ed8e00df0a83aa96acf703f8c2979ff33341f879", "shasum": "" }, "require": { @@ -1734,14 +1734,15 @@ "homepage": "https://github.com/squizlabs/PHP_CodeSniffer", "keywords": [ "phpcs", - "standards" + "standards", + "static analysis" ], "support": { "issues": "https://github.com/squizlabs/PHP_CodeSniffer/issues", "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, - "time": "2022-06-18T07:21:10+00:00" + "time": "2023-02-22T23:07:41+00:00" }, { "name": "theseer/tokenizer", diff --git a/src/Entity.php b/src/Entity.php index 5d19b09..75ed1ac 100644 --- a/src/Entity.php +++ b/src/Entity.php @@ -23,14 +23,6 @@ class Entity // ORM Plugins use ORM\HasConfig; use ORM\HasTable; - use ORM\HasWhere; - use ORM\HasFirst; - use ORM\HasJoin; - use ORM\HasFind; - use ORM\HasLast; - use ORM\HasLike; - use ORM\HasAll; - use ORM\HasNot; /** * ID of a record for updating diff --git a/src/ORM/HasAll.php b/src/ORM/HasAll.php index b7e3641..9401260 100644 --- a/src/ORM/HasAll.php +++ b/src/ORM/HasAll.php @@ -19,7 +19,7 @@ trait HasAll { public static function all(string $columns = '*'): Builder { - return Facades\DB::table(static::table())->select($columns); + return Facades\DB::table(static::table())->select($columns)->toArray(); } } } diff --git a/src/ORM/HasFind.php b/src/ORM/HasFind.php index 2aa1c9a..32179f5 100644 --- a/src/ORM/HasFind.php +++ b/src/ORM/HasFind.php @@ -18,7 +18,7 @@ trait HasFind { public static function find(int $id, string $columns = '*') { - return DB::table(static::table())->select($columns)->where('id', '=', $id); + return DB::table(static::table())->select($columns)->where('id', '=', $id)->toArray(); } } } diff --git a/src/ORM/HasFirst.php b/src/ORM/HasFirst.php index 1dde7a9..eed1484 100644 --- a/src/ORM/HasFirst.php +++ b/src/ORM/HasFirst.php @@ -20,7 +20,7 @@ trait HasFirst { public static function first(string $columns = '*') { - return DB::table(static::table())->select($columns)->orderBy('id', 'ASC')->limit(1)->toArray(); + return DB::table(static::table())->select($columns)->orderBy('id', 'ASC')->limit(1); } } } diff --git a/src/ORM/HasJoin.php b/src/ORM/HasJoin.php index fba5388..5d9bf8c 100644 --- a/src/ORM/HasJoin.php +++ b/src/ORM/HasJoin.php @@ -18,7 +18,7 @@ trait HasJoin { public static function join(string $table, array $on, string $columns = '*') { - return DB::table(static::table())->join($table, $on, $columns); + return DB::table(static::table())->join($table, $on, $columns)->toArray(); } } } diff --git a/src/ORM/HasLike.php b/src/ORM/HasLike.php index 4cfb124..fb7aedd 100644 --- a/src/ORM/HasLike.php +++ b/src/ORM/HasLike.php @@ -20,7 +20,7 @@ trait HasLike { public static function like(string $field, string $pattern, string $columns = '*'): Builder { - return DB::table(static::table())->select($columns)->like($field, $pattern); + return DB::table(static::table())->select($columns)->like($field, $pattern)->toArray(); } } } diff --git a/src/ORM/HasNot.php b/src/ORM/HasNot.php index dccb1ac..af585f1 100644 --- a/src/ORM/HasNot.php +++ b/src/ORM/HasNot.php @@ -19,7 +19,7 @@ trait HasNot { public static function whereNot($key = null, $value = null, string $columns = '*') { - return DB::table(static::table())->select($columns)->whereNot($key, $value); + return DB::table(static::table())->select($columns)->whereNot($key, $value)->toArray(); } } } diff --git a/src/ORM/HasWhere.php b/src/ORM/HasWhere.php index 658f8ff..c29e119 100644 --- a/src/ORM/HasWhere.php +++ b/src/ORM/HasWhere.php @@ -20,7 +20,7 @@ trait HasWhere { public static function where($key, $is = null, $value = null, string $columns = '*') { - return DB::table(static::table())->select($columns)->where($key, $is, $value); + return DB::table(static::table())->select($columns)->where($key, $is, $value)->toArray(); } } } From 8f7d75bdec7fd99d66fe1f13eff3421954e91110 Mon Sep 17 00:00:00 2001 From: JNapolitanoIT Date: Thu, 2 Mar 2023 21:38:37 -0800 Subject: [PATCH 2/2] Update README --- README.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/README.md b/README.md index 2e55021..8070587 100644 --- a/README.md +++ b/README.md @@ -11,6 +11,11 @@ for production use. |-------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------------------------------------|----------------------------------------------------------------| | [![Build Status](https://app.travis-ci.com/jason-napolitano/DatabaseFactory.svg?branch=master)](https://app.travis-ci.com/jason-napolitano/DatabaseFactory) | [View Here](https://databasefactory.github.io/framework/) | [View Here](https://github.com/DatabaseFactory/framework/wiki) | + +```bash +$ composer require database-factory/framework +``` + ### License © 2023 - **DatabaseFactory** and all related components are released under