Code Duplication    Length = 12-13 lines in 2 locations

src/Governor/Framework/Domain/GenericEventMessage.php 1 location

@@ 86-98 (lines=13) @@
83
     * @param array $metadata
84
     * @return GenericEventMessage
85
     */
86
    public function andMetaData(array $metadata = [])
87
    {
88
        if (empty($metadata)) {
89
            return $this;
90
        }
91
92
        return new GenericEventMessage(
93
            $this->getPayload(),
94
            $this->getMetaData()->mergeWith($metadata),
95
            $this->getIdentifier(),
96
            $this->getTimestamp()
97
        );
98
    }
99
100
    /**
101
     * @param array $metadata

src/Governor/Framework/Domain/GenericMessage.php 1 location

@@ 104-115 (lines=12) @@
101
     * @param array $metadata
102
     * @return GenericMessage
103
     */
104
    public function andMetaData(array $metadata = [])
105
    {
106
        if (empty($metadata)) {
107
            return $this;
108
        }
109
110
        return new GenericMessage(
111
            $this->getPayload(),
112
            $this->getMetaData()->mergeWith($metadata),
113
            $this->getIdentifier()
114
        );
115
    }
116
117
    /**
118
     * @param array $metadata