Code Duplication    Length = 11-11 lines in 2 locations

src/Datium.php 2 locations

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