Code Duplication    Length = 11-11 lines in 2 locations

src/Datium.php 2 locations

@@ 220-230 (lines=11) @@
217
   * @param $value string
218
   * @return object
219
   */
220
  public function add( $value ) {
221
222
    $this->date_interval_expression = str_replace( $this->config['date_simple'], $this->config['date_interval'], $value );
223
224
    $this->date_interval_expression = str_replace( ' ', '', 'P' . $this->date_interval_expression );
225
226
    $this->date_time->add( new DateInterval( $this->date_interval_expression ) );
227
228
    return $this;
229
230
  }
231
232
  /**
233
   * Sub date from current date
@@ 237-247 (lines=11) @@
234
   * @param $value
235
   * @return obejct
236
   */
237
  public function sub( $value ) {
238
239
    $this->date_interval_expression = str_replace( $this->config['date_simple'], $this->config['date_interval'], $value );
240
241
    $this->date_interval_expression = str_replace( ' ', '', 'P' . $this->date_interval_expression );
242
243
    $this->date_time->sub( new DateInterval( $this->date_interval_expression ) );
244
245
    return $this;
246
247
  }
248
249
  /**
250
   * Check if current year is leap or not