Skip to content

Commit 19a8897

Browse files
committed
Fix PossiblyFalseOperand issues
1 parent 7a33a6b commit 19a8897

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

lib/Doctrine/DBAL/Schema/DB2SchemaManager.php

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

88
use function array_change_key_case;
99
use function assert;
10-
use function is_resource;
1110
use function preg_match;
1211
use function str_replace;
1312
use function strpos;
@@ -207,13 +206,12 @@ protected function _getPortableForeignKeyRuleDef($def)
207206
protected function _getPortableViewDefinition($view)
208207
{
209208
$view = array_change_key_case($view, CASE_LOWER);
210-
// sadly this still segfaults on PDO_IBM, see http://pecl.php.net/bugs/bug.php?id=17199
211-
//$view['text'] = (is_resource($view['text']) ? stream_get_contents($view['text']) : $view['text']);
212-
if (! is_resource($view['text'])) {
213-
$pos = strpos($view['text'], ' AS ');
209+
210+
$sql = '';
211+
$pos = strpos($view['text'], ' AS ');
212+
213+
if ($pos !== false) {
214214
$sql = substr($view['text'], $pos + 4);
215-
} else {
216-
$sql = '';
217215
}
218216

219217
return new View($view['name'], $sql);

0 commit comments

Comments
 (0)