Code Duplication    Length = 11-11 lines in 2 locations

src/Datium.php 2 locations

@@ 263-273 (lines=11) @@
260
   * @param $value string
261
   * @return object
262
   */
263
  public function add( $value ) {
264
265
    $this->date_interval_expression = str_replace( $this->config['date_simple'], $this->config['date_interval'], $value );
266
267
    $this->date_interval_expression = str_replace( ' ', '', 'P' . $this->date_interval_expression );
268
269
    $this->date_time->add( new DateInterval( $this->date_interval_expression ) );
270
271
    return $this;
272
273
  }
274
275
  /**
276
   * Sub date from current date
@@ 280-290 (lines=11) @@
277
   * @param $value
278
   * @return obejct
279
   */
280
  public function sub( $value ) {
281
282
    $this->date_interval_expression = str_replace( $this->config['date_simple'], $this->config['date_interval'], $value );
283
284
    $this->date_interval_expression = str_replace( ' ', '', 'P' . $this->date_interval_expression );
285
286
    $this->date_time->sub( new DateInterval( $this->date_interval_expression ) );
287
288
    return $this;
289
290
  }
291
292
  /**
293
   * Check if current year is leap or not