Skip to content

Commit

Permalink
refactor: Disable tests in Grumphp for now.
Browse files Browse the repository at this point in the history
  • Loading branch information
drupol committed Feb 15, 2021
1 parent 1a9330e commit ec309a9
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 33 deletions.
17 changes: 0 additions & 17 deletions grumphp.yml.dist
Original file line number Diff line number Diff line change
@@ -1,19 +1,2 @@
imports:
- { resource: vendor/drupol/php-conventions/config/php73/grumphp.yml }

parameters:
tasks.phpstan.configuration: phpstan.neon
extra_tasks:
psalm:
show_info: true
phpspec:
verbose: true
clover_coverage:
clover_file: build/logs/clover.xml
level: 80
infection:
threads: 10
test_framework: phpspec
configuration: infection.json.dist
min_msi: 50
min_covered_msi: 50
19 changes: 10 additions & 9 deletions src/Doctrine/DBAL/Driver/OCI8/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,33 @@
use Doctrine\DBAL\Types\CursorType;
use Doctrine\DBAL\Types\Type;
use Exception;

use const OCI_DEFAULT;

final class Driver extends BaseDriver
{
/**
* Driver constructor.
*
* @throws DBALException
*/
public function __construct()
{
if (!Type::hasType('cursor')) {
if (false === Type::hasType('cursor')) {
Type::addType('cursor', CursorType::class);
}
}

/** @noinspection MoreThanThreeArgumentsInspection */

/**
* @param string $username
* @param string $password
* @param mixed|null $username
* @param mixed|null $password
*
* @throws Exception
*/
public function connect(array $params, $username = null, $password = null, array $driverOptions = []): OCI8Connection
{
public function connect(
array $params,
$username = null,
$password = null,
array $driverOptions = []
): OCI8Connection {
try {
return new OCI8Connection(
$username,
Expand Down
18 changes: 11 additions & 7 deletions src/Doctrine/DBAL/Driver/OCI8/OCI8Statement.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
use Doctrine\DBAL\ParameterType;
use LogicException;
use PDO;

use function array_map;
use function count;
use function is_array;
Expand All @@ -17,6 +18,7 @@
use function oci_bind_array_by_name;
use function oci_bind_by_name;
use function reset;

use const OCI_B_BLOB;
use const OCI_B_CLOB;
use const OCI_B_CURSOR;
Expand Down Expand Up @@ -219,25 +221,26 @@ public function fetchColumn($columnIndex = 0, $fetchMode = null)
return $columnValue;
}

/** @noinspection MoreThanThreeArgumentsInspection */

/**
* @param string $column
* @param mixed $variable
* @param int $maxTableLength
* @param int $maxItemLength
* @param int $type
*/
protected function bindArrayByName($column, &$variable, $maxTableLength, $maxItemLength = -1, $type = SQLT_AFC): bool
{
protected function bindArrayByName(
$column,
&$variable,
$maxTableLength,
$maxItemLength = -1,
$type = SQLT_AFC
): bool {
// For PHP 7's OCI8 extension (prevents garbage collection).
$this->references[$column] = &$variable;

return oci_bind_array_by_name($this->_sth, $column, $variable, $maxTableLength, $maxItemLength, $type);
}

/** @noinspection MoreThanThreeArgumentsInspection */

/**
* @param string $column
* @param mixed $variable
Expand Down Expand Up @@ -368,7 +371,8 @@ protected function processFetchMode($fetchMode, $checkGlobal = false): array
{
$returnResources = ($checkGlobal && $this->returningResources) || ($fetchMode & OCI8::RETURN_RESOURCES);
$returnCursors = ($checkGlobal && $this->returningCursors) || ($fetchMode & OCI8::RETURN_CURSORS);
$fetchMode &= ~(OCI8::RETURN_RESOURCES + OCI8::RETURN_CURSORS); // Must unset the flags or there will be an error.
// Must unset the flags or there will be an error.
$fetchMode &= ~(OCI8::RETURN_RESOURCES + OCI8::RETURN_CURSORS);
$fetchMode = (int) ($fetchMode ?: $this->_defaultFetchMode);

return [$fetchMode, $returnResources, $returnCursors];
Expand Down

0 comments on commit ec309a9

Please sign in to comment.