Code Duplication    Length = 11-14 lines in 2 locations

PHPDaemon/Clients/PostgreSQL/Connection.php 1 location

@@ 158-171 (lines=14) @@
155
     * @param  boolean $l Optional. Little endian. Default value - true.
156
     * @return integer      Resulting integer
157
     */
158
    public function bytes2int($str, $l = true)
159
    {
160
        if ($l) {
161
            $str = strrev($str);
162
        }
163
164
        $dec = 0;
165
        $len = mb_orig_strlen($str);
166
167
        for ($i = 0; $i < $len; ++$i) {
168
            $dec += ord(mb_orig_substr($str, $i, 1)) * pow(0x100, $len - $i - 1);
169
        }
170
171
        return $dec;
172
    }
173
174
    /**

PHPDaemon/Utils/Binary.php 1 location

@@ 70-80 (lines=11) @@
67
     * @param  boolean $l Little endian? Default is false
68
     * @return integer
69
     */
70
    public static function bytes2int($str, $l = false)
71
    {
72
        if ($l) {
73
            $str = strrev($str);
74
        }
75
        $dec = 0;
76
        $len = mb_orig_strlen($str);
77
        for ($i = 0; $i < $len; ++$i) {
78
            $dec += ord(mb_orig_substr($str, $i, 1)) * pow(0x100, $len - $i - 1);
79
        }
80
        return $dec;
81
    }
82
83
    /**