Code Duplication    Length = 15-15 lines in 6 locations

src/cli/Database/Base/Channel.php 1 location

@@ 1044-1058 (lines=15) @@
1041
     *
1042
     * @return int Hashcode
1043
     */
1044
    public function hashCode()
1045
    {
1046
        $validPk = null !== $this->getId();
1047
1048
        $validPrimaryKeyFKs = 0;
1049
        $primaryKeyFKs = [];
1050
1051
        if ($validPk) {
1052
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
1053
        } elseif ($validPrimaryKeyFKs) {
1054
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
1055
        }
1056
1057
        return spl_object_hash($this);
1058
    }
1059
1060
    /**
1061
     * Returns the primary key for this object (row).

src/cli/Database/Base/Connection.php 1 location

@@ 1223-1237 (lines=15) @@
1220
     *
1221
     * @return int Hashcode
1222
     */
1223
    public function hashCode()
1224
    {
1225
        $validPk = null !== $this->getId();
1226
1227
        $validPrimaryKeyFKs = 0;
1228
        $primaryKeyFKs = [];
1229
1230
        if ($validPk) {
1231
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
1232
        } elseif ($validPrimaryKeyFKs) {
1233
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
1234
        }
1235
1236
        return spl_object_hash($this);
1237
    }
1238
1239
    /**
1240
     * Returns the primary key for this object (row).

src/cli/Database/Base/User.php 1 location

@@ 1095-1109 (lines=15) @@
1092
     *
1093
     * @return int Hashcode
1094
     */
1095
    public function hashCode()
1096
    {
1097
        $validPk = null !== $this->getId();
1098
1099
        $validPrimaryKeyFKs = 0;
1100
        $primaryKeyFKs = [];
1101
1102
        if ($validPk) {
1103
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
1104
        } elseif ($validPrimaryKeyFKs) {
1105
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
1106
        }
1107
1108
        return spl_object_hash($this);
1109
    }
1110
1111
    /**
1112
     * Returns the primary key for this object (row).

src/cli/Database/Base/Input.php 1 location

@@ 1286-1300 (lines=15) @@
1283
     *
1284
     * @return int Hashcode
1285
     */
1286
    public function hashCode()
1287
    {
1288
        $validPk = null !== $this->getUuid();
1289
1290
        $validPrimaryKeyFKs = 0;
1291
        $primaryKeyFKs = [];
1292
1293
        if ($validPk) {
1294
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
1295
        } elseif ($validPrimaryKeyFKs) {
1296
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
1297
        }
1298
1299
        return spl_object_hash($this);
1300
    }
1301
1302
    /**
1303
     * Returns the primary key for this object (row).

src/cli/Database/Base/Instance.php 1 location

@@ 1069-1083 (lines=15) @@
1066
     *
1067
     * @return int Hashcode
1068
     */
1069
    public function hashCode()
1070
    {
1071
        $validPk = null !== $this->getName();
1072
1073
        $validPrimaryKeyFKs = 0;
1074
        $primaryKeyFKs = [];
1075
1076
        if ($validPk) {
1077
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
1078
        } elseif ($validPrimaryKeyFKs) {
1079
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
1080
        }
1081
1082
        return spl_object_hash($this);
1083
    }
1084
1085
    /**
1086
     * Returns the primary key for this object (row).

src/cli/Database/Base/Subscription.php 1 location

@@ 1547-1561 (lines=15) @@
1544
     *
1545
     * @return int Hashcode
1546
     */
1547
    public function hashCode()
1548
    {
1549
        $validPk = null !== $this->getId();
1550
1551
        $validPrimaryKeyFKs = 0;
1552
        $primaryKeyFKs = [];
1553
1554
        if ($validPk) {
1555
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
1556
        } elseif ($validPrimaryKeyFKs) {
1557
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
1558
        }
1559
1560
        return spl_object_hash($this);
1561
    }
1562
1563
    /**
1564
     * Returns the primary key for this object (row).