Skip to content

Commit 7e88d7c

Browse files
committed
Declare strict types.
1 parent e6acc46 commit 7e88d7c

File tree

10 files changed

+19
-1
lines changed

10 files changed

+19
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,6 @@ $stmt = getCompiledSQL( $columns, $parameter )->run_mysqli( $conn );
5151
Differences with Java library
5252
=============================
5353

54-
1. SQL libary: this PHP library uses, for this POC, the standard library `mysqli` and `mysqli_stmt` in CompiledStatement: methods `getPreparedStatement_mysqli` and `run_mysqli`. To avoid being library-specific, there is also the library-independent method `CompiledStatement::getPreparedStatement`.
54+
1. SQL libary: this PHP library uses, for this POC, the standard library `mysqli` and `mysqli_stmt` in `CompiledStatement`: methods `getPreparedStatement_mysqli` and `run_mysqli`. To avoid being library-specific, there is also the library-independent method `CompiledStatement::getPreparedStatement`.
5555

5656
2. Types of arguments: `CompiledStatement` has a supplementary method `addParam` to append a non-string parameter (integer, double, blob), see [`mysqli_stmt_bin_param`](https://www.php.net/manual/en/mysqli-stmt.bind-param.php).

examples/test.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare( strict_types=1 );
4+
35
use SQLTrees\SQLDSL;
46
use SQLTrees\CompiledStatement;
57
use function SQLTrees\{select,from,where,order_by,limit,tupleArray,tuple,eq,operator,andExpr,orExp,id,str,num};

src/AST.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare( strict_types=1 );
4+
35
namespace SQLTrees;
46

57
use mysqli;

src/CompiledStatement.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare( strict_types=1 );
4+
35
namespace SQLTrees;
46

57
use \mysqli;

src/CompiledStatementError.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare( strict_types=1 );
4+
35
namespace SQLTrees;
46

57
use \RuntimeException;

src/OperatorAST.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare( strict_types=1 );
4+
35
namespace SQLTrees;
46

57
final class OperatorAST extends AST {

src/ReservedWords.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare( strict_types=1 );
4+
35
namespace SQLTrees;
46

57
final class ReservedWords {

src/SQLDSL.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare( strict_types=1 );
4+
35
namespace SQLTrees;
46

57
final class SQLDSL {

src/StrLit.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare( strict_types=1 );
4+
35
namespace SQLTrees;
46

57
class StrLit extends AST {

src/functions.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
<?php
22

3+
declare( strict_types=1 );
4+
35
namespace SQLTrees;
46

57
function select( AST ...$elements ) : AST {

0 commit comments

Comments
 (0)