Skip to content

Commit

Permalink
Merge pull request #31 from dimitriBouteille/17-saveorfail-doesnt-thr…
Browse files Browse the repository at this point in the history
…ow-queryexception

#17 saveOrFail doesnt throw QueryException
  • Loading branch information
dimitriBouteille authored Mar 10, 2024
2 parents 602650c + f3dd1bb commit 76bee93
Show file tree
Hide file tree
Showing 10 changed files with 390 additions and 155 deletions.
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/extension-installer": "^1.3",
"roots/wordpress": "6.4.3",
"rector/rector": "1.0.2"
"rector/rector": "1.0.2",
"szepeviktor/phpstan-wordpress": "^1.3"
},
"config": {
"allow-plugins": {
Expand Down
2 changes: 0 additions & 2 deletions phpstan.neon
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,3 @@ parameters:
paths:
- src
- tests
excludePaths:
- src/Orm/Database.php
2 changes: 1 addition & 1 deletion phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit cacheResult="false" stopOnError="true">
<phpunit cacheResult="false" stopOnError="true" bootstrap="./tests/Bootstrap.php" processIsolation="true">
<testsuites>
<testsuite name="Tests">
<directory>tests/</directory>
Expand Down
5 changes: 3 additions & 2 deletions src/Orm/Builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

namespace Dbout\WpOrm\Orm;

use Illuminate\Database\ConnectionInterface;
use Illuminate\Database\Query\Builder as EloquentBuilder;

class Builder extends EloquentBuilder
Expand All @@ -31,9 +32,9 @@ public function addWhereExistsQuery(EloquentBuilder $query, $boolean = 'and', $n
}

/**
* @return Database|\Illuminate\Database\ConnectionInterface
* @inheritDoc
*/
public function getConnection()
public function getConnection(): ConnectionInterface
{
return Database::getInstance();
}
Expand Down
Loading

0 comments on commit 76bee93

Please sign in to comment.