Code Duplication    Length = 7-10 lines in 2 locations

src/Notifynder/Parsers/NotifynderParser.php 1 location

@@ 128-137 (lines=10) @@
125
     * @param $value
126
     * @return bool
127
     */
128
    protected function isJson($value)
129
    {
130
        if (! is_string($value)) {
131
            return false;
132
        }
133
134
        json_decode($value);
135
136
        return json_last_error() == JSON_ERROR_NONE;
137
    }
138
139
    /**
140
     * Get a value by dot-key of an array, object or mix of both.

src/Notifynder/Notifications/ExtraParams.php 1 location

@@ 158-164 (lines=7) @@
155
     * @param $value
156
     * @return bool
157
     */
158
    public function isJson($value)
159
    {
160
        if (! is_string($value)) {
161
            return false;
162
        }
163
164
        json_decode($value);
165
166
        return json_last_error() == JSON_ERROR_NONE;
167
    }