Code Duplication    Length = 18-18 lines in 2 locations

source/MySQLiByDanielGPnumbers.php 1 location

@@ 88-105 (lines=18) @@
85
        return ['M' => '???'];
86
    }
87
88
    private function setFldLmtsExact($cTp)
89
    {
90
        $xct     = [
91
            'bigint'    => ['l' => -9223372036854775808, 'L' => 9223372036854775807, 's' => 21, 'sUS' => 20],
92
            'int'       => ['l' => -2147483648, 'L' => 2147483647, 's' => 11, 'sUS' => 10],
93
            'mediumint' => ['l' => -8388608, 'L' => 8388607, 's' => 9, 'sUS' => 8],
94
            'smallint'  => ['l' => -32768, 'L' => 32767, 's' => 6, 'sUS' => 5],
95
            'tinyint'   => ['l' => -128, 'L' => 127, 's' => 4, 'sUS' => 3],
96
        ];
97
        $aReturn = null;
98
        if (array_key_exists($cTp, $xct)) {
99
            $aReturn = ['m' => $xct[$cTp]['l'], 'M' => $xct[$cTp]['L'], 'l' => $xct[$cTp]['s']];
100
            if (strpos($cTp, 'unsigned') !== false) {
101
                $aReturn = ['m' => 0, 'M' => ($xct[$cTp]['L'] - $xct[$cTp]['l']), 'l' => $xct[$cTp]['sUS']];
102
            }
103
        }
104
        return $aReturn;
105
    }
106
}
107

source/MySQLiByDanielGPstructures.php 1 location

@@ 277-294 (lines=18) @@
274
        return ['M' => '???'];
275
    }
276
277
    private function setFldLmtsExact($cTp)
278
    {
279
        $xct     = [
280
            'bigint'    => ['l' => -9223372036854775808, 'L' => 9223372036854775807, 's' => 21, 'sUS' => 20],
281
            'int'       => ['l' => -2147483648, 'L' => 2147483647, 's' => 11, 'sUS' => 10],
282
            'mediumint' => ['l' => -8388608, 'L' => 8388607, 's' => 9, 'sUS' => 8],
283
            'smallint'  => ['l' => -32768, 'L' => 32767, 's' => 6, 'sUS' => 5],
284
            'tinyint'   => ['l' => -128, 'L' => 127, 's' => 4, 'sUS' => 3],
285
        ];
286
        $aReturn = null;
287
        if (array_key_exists($cTp, $xct)) {
288
            $aReturn = ['m' => $xct[$cTp]['l'], 'M' => $xct[$cTp]['L'], 'l' => $xct[$cTp]['s']];
289
            if (strpos($cTp, 'unsigned') !== false) {
290
                $aReturn = ['m' => 0, 'M' => ($xct[$cTp]['L'] - $xct[$cTp]['l']), 'l' => $xct[$cTp]['sUS']];
291
            }
292
        }
293
        return $aReturn;
294
    }
295
}
296