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

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