Code Duplication    Length = 7-10 lines in 2 locations

src/Notifynder/Notifications/ExtraParams.php 1 location

@@ 143-149 (lines=7) @@
140
     * @param $value
141
     * @return bool
142
     */
143
    public function isJson($value)
144
    {
145
        if (!is_string($value)) return false;
146
147
        json_decode($value);
148
        return (json_last_error() == JSON_ERROR_NONE);
149
    }
150
}

src/Notifynder/Parsers/NotifynderParser.php 1 location

@@ 130-139 (lines=10) @@
127
     * @param $value
128
     * @return bool
129
     */
130
    protected function isJson($value)
131
    {
132
        if ( ! is_string($value)) {
133
            return false;
134
        }
135
136
        json_decode($value);
137
138
        return (json_last_error() == JSON_ERROR_NONE);
139
    }
140
141
142
    /**