Skip to content

Commit

Permalink
[pdosqlexec] Fixed PHP 8 compat, Code Cleanup and tests (#1628)
Browse files Browse the repository at this point in the history
  • Loading branch information
siad007 committed Aug 22, 2021
1 parent bb891e1 commit 7e6e753
Show file tree
Hide file tree
Showing 16 changed files with 333 additions and 125 deletions.
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -18,3 +18,4 @@ tests/etc/tasks/system/defaultexcludestestinput/
tests/etc/types/selectors/tmp/
tests/reports/
tests/tmp/
tests/etc/tasks/ext/pdo/test.db
3 changes: 2 additions & 1 deletion composer.json
Expand Up @@ -100,6 +100,7 @@
"pear/mail_mime": "^1.10",
"pear/net_growl": "dev-master",
"pear/pear-core-minimal": "^1.10.10",
"pear/versioncontrol_git": "dev-master",
"phpunit/phpunit": "^9.4",
"scssphp/scssphp": "~1.0",
"squizlabs/php_codesniffer": "^3.5",
Expand Down Expand Up @@ -139,6 +140,6 @@
"jawira/plantuml-encoding": "Required by VisualizerTask",
"monolog/monolog": "Required by the MonologListener"
},
"minimum-stability": "dev",
"minimum-stability": "stable",
"prefer-stable": true
}
62 changes: 33 additions & 29 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions etc/phing-grammar.rng
Expand Up @@ -4908,6 +4908,12 @@
<data type="boolean"/>
</attribute>
</optional>
<optional>
<attribute name="errorproperty"/>
</optional>
<optional>
<attribute name="statementcountproperty"/>
</optional>
</interleave>
<zeroOrMore>
<ref name="fileset"/>
Expand Down
4 changes: 2 additions & 2 deletions src/Phing/Io/BufferedReader.php
Expand Up @@ -41,12 +41,12 @@ class BufferedReader extends Reader
private $in;

/**
* @param InputStreamReader $reader The reader (e.g. FileReader).
* @param Reader $reader The reader (e.g. FileReader).
* @param int $buffsize The size of the buffer we should use for reading files.
* A large buffer ensures that most files (all scripts?)
* are parsed in 1 buffer.
*/
public function __construct(InputStreamReader $reader, $buffsize = 65536)
public function __construct(Reader $reader, $buffsize = 65536)
{
$this->in = $reader;
$this->bufferSize = $buffsize;
Expand Down
2 changes: 1 addition & 1 deletion src/Phing/Task/System/Pdo/DefaultPDOQuerySplitter.php
Expand Up @@ -67,7 +67,7 @@ public function __construct(PDOSQLExecTask $parent, Reader $reader, $delimiterTy
*
* @return null|string
*/
public function nextQuery()
public function nextQuery(): ?string
{
$sql = '';
$hasQuery = false;
Expand Down
2 changes: 1 addition & 1 deletion src/Phing/Task/System/Pdo/DummyPDOQuerySplitter.php
Expand Up @@ -35,7 +35,7 @@ class DummyPDOQuerySplitter extends PDOQuerySplitter
*
* @return null|string
*/
public function nextQuery()
public function nextQuery(): ?string
{
$sql = null;

Expand Down
2 changes: 1 addition & 1 deletion src/Phing/Task/System/Pdo/PDOQuerySplitter.php
Expand Up @@ -58,5 +58,5 @@ public function __construct(PDOSQLExecTask $parent, Reader $reader)
*
* @return null|string
*/
abstract public function nextQuery();
abstract public function nextQuery(): ?string;
}

0 comments on commit 7e6e753

Please sign in to comment.