Code Duplication    Length = 15-15 lines in 3 locations

app/Models/Task/Base/Task.php 1 location

@@ 979-993 (lines=15) @@
976
     *
977
     * @return int Hashcode
978
     */
979
    public function hashCode()
980
    {
981
        $validPk = null !== $this->getId();
982
983
        $validPrimaryKeyFKs = 0;
984
        $primaryKeyFKs = [];
985
986
        if ($validPk) {
987
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
988
        } elseif ($validPrimaryKeyFKs) {
989
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
990
        }
991
992
        return spl_object_hash($this);
993
    }
994
995
    /**
996
     * Returns the primary key for this object (row).

app/Models/User/Base/User.php 1 location

@@ 1211-1225 (lines=15) @@
1208
     *
1209
     * @return int Hashcode
1210
     */
1211
    public function hashCode()
1212
    {
1213
        $validPk = null !== $this->getId();
1214
1215
        $validPrimaryKeyFKs = 0;
1216
        $primaryKeyFKs = [];
1217
1218
        if ($validPk) {
1219
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
1220
        } elseif ($validPrimaryKeyFKs) {
1221
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
1222
        }
1223
1224
        return spl_object_hash($this);
1225
    }
1226
1227
    /**
1228
     * Returns the primary key for this object (row).

packages/Price/Models/Selfprice/Base/Selfprice.php 1 location

@@ 1018-1032 (lines=15) @@
1015
     *
1016
     * @return int Hashcode
1017
     */
1018
    public function hashCode()
1019
    {
1020
        $validPk = null !== $this->getId();
1021
1022
        $validPrimaryKeyFKs = 0;
1023
        $primaryKeyFKs = [];
1024
1025
        if ($validPk) {
1026
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
1027
        } elseif ($validPrimaryKeyFKs) {
1028
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
1029
        }
1030
1031
        return spl_object_hash($this);
1032
    }
1033
1034
    /**
1035
     * Returns the primary key for this object (row).