Code Duplication    Length = 15-15 lines in 3 locations

packages/core/src/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).

packages/selfprice/src/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).

packages/core/src/Models/User/Base/User.php 1 location

@@ 1239-1253 (lines=15) @@
1236
     *
1237
     * @return int Hashcode
1238
     */
1239
    public function hashCode()
1240
    {
1241
        $validPk = null !== $this->getId();
1242
1243
        $validPrimaryKeyFKs = 0;
1244
        $primaryKeyFKs = [];
1245
1246
        if ($validPk) {
1247
            return crc32(json_encode($this->getPrimaryKey(), JSON_UNESCAPED_UNICODE));
1248
        } elseif ($validPrimaryKeyFKs) {
1249
            return crc32(json_encode($primaryKeyFKs, JSON_UNESCAPED_UNICODE));
1250
        }
1251
1252
        return spl_object_hash($this);
1253
    }
1254
1255
    /**
1256
     * Returns the primary key for this object (row).