Code Duplication    Length = 11-11 lines in 2 locations

src/Datium.php 2 locations

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