Only numeric types are allowed in +/-

parent 0a57e8ed
......@@ -110,5 +110,11 @@ parameters:
paths:
- %currentWorkingDirectory%/src/Schema/AbstractSchemaManager.php
- %currentWorkingDirectory%/src/Schema/Column.php
# https://github.com/phpstan/phpstan/issues/3146
-
message: '~^Only numeric types are allowed in -, int<1, max>\|false given on the left side\.~'
paths:
- %currentWorkingDirectory%/src/Platforms/SQLServer2012Platform.php
includes:
- vendor/phpstan/phpstan-strict-rules/rules.neon
......@@ -6,7 +6,6 @@ use Doctrine\DBAL\Platforms\DB2Platform;
use Doctrine\DBAL\Types\Type;
use const CASE_LOWER;
use function array_change_key_case;
use function is_resource;
use function preg_match;
use function str_replace;
use function strpos;
......@@ -201,11 +200,11 @@ class DB2SchemaManager extends AbstractSchemaManager
protected function _getPortableViewDefinition($view)
{
$view = array_change_key_case($view, CASE_LOWER);
// sadly this still segfaults on PDO_IBM, see http://pecl.php.net/bugs/bug.php?id=17199
//$view['text'] = (is_resource($view['text']) ? stream_get_contents($view['text']) : $view['text']);
if (! is_resource($view['text'])) {
$pos = strpos($view['text'], ' AS ');
$sql = substr($view['text'], $pos+4);
$position = strpos($view['text'], ' AS ');
if ($position !== false) {
$sql = substr($view['text'], $position + 4);
} else {
$sql = '';
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment