Code Duplication    Length = 15-15 lines in 8 locations

src/mrcnpdlk/Teryt/NativeApi.php 8 locations

@@ 334-348 (lines=15) @@
331
     *
332
     * @return \SplFileObject
333
     */
334
    public function PobierzZmianyTercUrzedowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
335
    {
336
        $toDate  = $toDate ?? new \DateTime();
337
        $res     = $this->oClient->request(
338
            'PobierzZmianyTercUrzedowy',
339
            [
340
                'stanod' => $fromDate->format('Y-m-d'),
341
                'stando' => $toDate->format('Y-m-d'),
342
            ],
343
            false);
344
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
345
        $content = base64_decode($res->plik_zawartosc);
346
347
        return Helper::saveFile($sPath, $content);
348
    }
349
350
    /**
351
     * Zmiany w katalogu TERC w wersji adresowej rejestru
@@ 358-372 (lines=15) @@
355
     *
356
     * @return \SplFileObject
357
     */
358
    public function PobierzZmianyTercAdresowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
359
    {
360
        $toDate  = $toDate ?? new \DateTime();
361
        $res     = $this->oClient->request(
362
            'PobierzZmianyTercAdresowy',
363
            [
364
                'stanod' => $fromDate->format('Y-m-d'),
365
                'stando' => $toDate->format('Y-m-d'),
366
            ],
367
            false);
368
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
369
        $content = base64_decode($res->plik_zawartosc);
370
371
        return Helper::saveFile($sPath, $content);
372
    }
373
374
    /**
375
     * Zmiany w katalogu TERC w wersji adresowej rejestru
@@ 382-396 (lines=15) @@
379
     *
380
     * @return \SplFileObject
381
     */
382
    public function PobierzZmianyNTS(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
383
    {
384
        $toDate  = $toDate ?? new \DateTime();
385
        $res     = $this->oClient->request(
386
            'PobierzZmianyNTS',
387
            [
388
                'stanod' => $fromDate->format('Y-m-d'),
389
                'stando' => $toDate->format('Y-m-d'),
390
            ],
391
            false);
392
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
393
        $content = base64_decode($res->plik_zawartosc);
394
395
        return Helper::saveFile($sPath, $content);
396
    }
397
398
    /**
399
     * Zmiany w katalogu SIMC w wersji urzędowej rejestru
@@ 406-420 (lines=15) @@
403
     *
404
     * @return \SplFileObject
405
     */
406
    public function PobierzZmianySimcUrzedowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
407
    {
408
        $toDate  = $toDate ?? new \DateTime();
409
        $res     = $this->oClient->request(
410
            'PobierzZmianySimcUrzedowy',
411
            [
412
                'stanod' => $fromDate->format('Y-m-d'),
413
                'stando' => $toDate->format('Y-m-d'),
414
            ],
415
            false);
416
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
417
        $content = base64_decode($res->plik_zawartosc);
418
419
        return Helper::saveFile($sPath, $content);
420
    }
421
422
    /**
423
     * Zmiany w katalogu SIMC w wersji adresowej rejestru
@@ 430-444 (lines=15) @@
427
     *
428
     * @return \SplFileObject
429
     */
430
    public function PobierzZmianySimcAdresowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
431
    {
432
        $toDate  = $toDate ?? new \DateTime();
433
        $res     = $this->oClient->request(
434
            'PobierzZmianySimcAdresowy',
435
            [
436
                'stanod' => $fromDate->format('Y-m-d'),
437
                'stando' => $toDate->format('Y-m-d'),
438
            ],
439
            false);
440
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
441
        $content = base64_decode($res->plik_zawartosc);
442
443
        return Helper::saveFile($sPath, $content);
444
    }
445
446
    /**
447
     * Zmiany w katalogu SIMC w wersji statystycznej rejestru
@@ 454-468 (lines=15) @@
451
     *
452
     * @return \SplFileObject
453
     */
454
    public function PobierzZmianySimcStatystyczny(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
455
    {
456
        $toDate  = $toDate ?? new \DateTime();
457
        $res     = $this->oClient->request(
458
            'PobierzZmianySimcStatystyczny',
459
            [
460
                'stanod' => $fromDate->format('Y-m-d'),
461
                'stando' => $toDate->format('Y-m-d'),
462
            ],
463
            false);
464
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
465
        $content = base64_decode($res->plik_zawartosc);
466
467
        return Helper::saveFile($sPath, $content);
468
    }
469
470
    /**
471
     * Zmiany w katalogu ULIC w wersji urzędowej rejestru
@@ 478-492 (lines=15) @@
475
     *
476
     * @return \SplFileObject
477
     */
478
    public function PobierzZmianyUlicUrzedowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
479
    {
480
        $toDate  = $toDate ?? new \DateTime();
481
        $res     = $this->oClient->request(
482
            'PobierzZmianyUlicUrzedowy',
483
            [
484
                'stanod' => $fromDate->format('Y-m-d'),
485
                'stando' => $toDate->format('Y-m-d'),
486
            ],
487
            false);
488
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
489
        $content = base64_decode($res->plik_zawartosc);
490
491
        return Helper::saveFile($sPath, $content);
492
    }
493
494
    /**
495
     * Zmiany w katalogu ULIC w wersji adresowej rejestru
@@ 502-516 (lines=15) @@
499
     *
500
     * @return \SplFileObject
501
     */
502
    public function PobierzZmianyUlicAdresowy(\DateTime $fromDate, \DateTime $toDate = null): \SplFileObject
503
    {
504
        $toDate  = $toDate ?? new \DateTime();
505
        $res     = $this->oClient->request(
506
            'PobierzZmianyUlicAdresowy',
507
            [
508
                'stanod' => $fromDate->format('Y-m-d'),
509
                'stando' => $toDate->format('Y-m-d'),
510
            ],
511
            false);
512
        $sPath   = sprintf('%s/%s.zip', sys_get_temp_dir(), $res->nazwa_pliku);
513
        $content = base64_decode($res->plik_zawartosc);
514
515
        return Helper::saveFile($sPath, $content);
516
    }
517
518
    /**
519
     * Zwraca listę rodzajów jednostek