Skip to content

Commit 3d53dd5

Browse files
committed
Rebasing on 2.0 and fixing several issues. Remvoing strict types, it's annoying.
1 parent a3eee3c commit 3d53dd5

22 files changed

+23
-116
lines changed

src/AbstractStatement.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* @license http://opensource.org/licenses/MIT
66
*/
77

8-
declare(strict_types=1);
9-
108
namespace FaaPz\PDO;
119

1210
use PDO;

src/AdvancedStatement.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
abstract class AdvancedStatement extends AbstractStatement
1111
{
12-
/** @var Clause\Join[] */
12+
/** @var Clause\Join[] $join */
1313
protected $join = [];
1414

1515
/** @var Clause\Conditional $where */

src/Clause/Conditional.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* @license http://opensource.org/licenses/MIT
66
*/
77

8-
declare(strict_types=1);
9-
108
namespace FaaPz\PDO\Clause;
119

1210
use FaaPz\PDO\QueryInterface;

src/Clause/Grouping.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* @license http://opensource.org/licenses/MIT
66
*/
77

8-
declare(strict_types=1);
9-
108
namespace FaaPz\PDO\Clause;
119

1210
class Grouping extends Conditional

src/Clause/Join.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
namespace FaaPz\PDO\Clause;
99

10-
use FaaPz\PDO\DatabaseException;
1110
use FaaPz\PDO\QueryInterface;
1211
use FaaPz\PDO\Statement\Select;
1312

@@ -44,7 +43,6 @@ public function getValues(): array
4443

4544
/**
4645
* @return string
47-
* @throws DatabaseException
4846
*/
4947
public function __toString(): string
5048
{
@@ -53,7 +51,7 @@ public function __toString(): string
5351
reset($this->subject);
5452
$alias = key($this->subject);
5553
if (!is_string($alias)) {
56-
throw new DatabaseException('Invalid subject array, use string keys for alias');
54+
trigger_error('Invalid subject array, use string keys for alias', E_USER_ERROR);
5755
}
5856

5957
$table = $this->subject[$alias];
@@ -62,7 +60,7 @@ public function __toString(): string
6260
}
6361
$table .= " AS {$alias}";
6462
} elseif (!is_string($this->subject)) {
65-
throw new DatabaseException('Invalid subject value, use array with string key for alias');
63+
trigger_error('Invalid subject value, use array with string key for alias', E_USER_ERROR);
6664
}
6765

6866
$sql = "JOIN {$table} ON {$this->on}";

src/Clause/Limit.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* @license http://opensource.org/licenses/MIT
66
*/
77

8-
declare(strict_types=1);
9-
108
namespace FaaPz\PDO\Clause;
119

1210
use FaaPz\PDO\QueryInterface;

src/Clause/Method.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* @license http://opensource.org/licenses/MIT
66
*/
77

8-
declare(strict_types=1);
9-
108
namespace FaaPz\PDO\Clause;
119

1210
use FaaPz\PDO\QueryInterface;

src/DatabaseException.php

Lines changed: 0 additions & 28 deletions
This file was deleted.

src/Statement/Call.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99

1010
use FaaPz\PDO\AbstractStatement;
1111
use FaaPz\PDO\Clause;
12-
use FaaPz\PDO\DatabaseException;
1312
use PDO;
1413
use PDOStatement;
1514

@@ -56,12 +55,11 @@ public function getValues(): array
5655

5756
/**
5857
* @return string
59-
* @throws DatabaseException
6058
*/
6159
public function __toString(): string
6260
{
6361
if (!$this->method instanceof Clause\Method) {
64-
throw new DatabaseException('No method set for call statement');
62+
trigger_error('No method set for call statement', E_USER_ERROR);
6563
}
6664

6765
return "CALL {$this->method}";

src/Statement/Delete.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
* @license http://opensource.org/licenses/MIT
66
*/
77

8-
declare(strict_types=1);
9-
108
namespace FaaPz\PDO\Statement;
119

1210
use FaaPz\PDO\AdvancedStatement;

0 commit comments

Comments
 (0)