Code Duplication    Length = 23-23 lines in 4 locations

application/models/Site_Model.php 4 locations

@@ 701-723 (lines=23) @@
698
	}
699
}
700
701
class KireiCake extends Site_Model {
702
	public $site          = 'KireiCake';
703
	public $titleFormat   = '/^[a-z0-9_]+$/';
704
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
705
706
	public function getFullTitleURL(string $title_url) : string {
707
		return "https://reader.kireicake.com/series/{$title_url}";
708
	}
709
710
	public function getChapterData(string $title_url, string $chapter) : array {
711
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
712
		$chapter_parts = explode('/', $chapter);
713
		return [
714
			'url'    => "https://reader.kireicake.com/read/{$title_url}/{$chapter}/",
715
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
716
		];
717
	}
718
719
	public function getTitleData(string $title_url) {
720
		$fullURL = $this->getFullTitleURL($title_url);
721
		return $this->parseFoolSlide($fullURL, $title_url);
722
	}
723
}
724
725
class GameOfScanlation extends Site_Model {
726
	public $site          = 'GameOfScanlation';
@@ 836-858 (lines=23) @@
833
	}
834
}
835
836
class SeaOtterScans extends Site_Model {
837
	public $site          = 'SeaOtterScans';
838
	public $titleFormat   = '/^[a-z0-9_]+$/';
839
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
840
841
	public function getFullTitleURL(string $title_url) : string {
842
		return "https://reader.seaotterscans.com/series/{$title_url}";
843
	}
844
845
	public function getChapterData(string $title_url, string $chapter) : array {
846
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
847
		$chapter_parts = explode('/', $chapter);
848
		return [
849
			'url'    => "https://reader.seaotterscans.com/read/{$title_url}/{$chapter}/",
850
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
851
		];
852
	}
853
854
	public function getTitleData(string $title_url) {
855
		$fullURL = $this->getFullTitleURL($title_url);
856
		return $this->parseFoolSlide($fullURL, $title_url);
857
	}
858
}
859
860
class HelveticaScans extends Site_Model {
861
	public $site          = 'HelveticaScans';
@@ 860-882 (lines=23) @@
857
	}
858
}
859
860
class HelveticaScans extends Site_Model {
861
	public $site          = 'HelveticaScans';
862
	public $titleFormat   = '/^[a-z0-9_]+$/';
863
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
864
865
	public function getFullTitleURL(string $title_url) : string {
866
		return "http://helveticascans.com/reader/series/{$title_url}";
867
	}
868
869
	public function getChapterData(string $title_url, string $chapter) : array {
870
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
871
		$chapter_parts = explode('/', $chapter);
872
		return [
873
			'url'    => "http://helveticascans.com/reader/read/{$title_url}/{$chapter}/",
874
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
875
		];
876
	}
877
878
	public function getTitleData(string $title_url) {
879
		$fullURL = $this->getFullTitleURL($title_url);
880
		return $this->parseFoolSlide($fullURL, $title_url);
881
	}
882
}
883
884
class SenseScans extends Site_Model {
885
	public $site          = 'SenseScans';
@@ 884-906 (lines=23) @@
881
	}
882
}
883
884
class SenseScans extends Site_Model {
885
	public $site          = 'SenseScans';
886
	public $titleFormat   = '/^[a-z0-9_]+$/';
887
	public $chapterFormat = '/^en\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+(?:\/[0-9]+)?)?)?$/';
888
889
	public function getFullTitleURL(string $title_url) : string {
890
		return "http://reader.sensescans.com/series/{$title_url}";
891
	}
892
893
	public function getChapterData(string $title_url, string $chapter) : array {
894
		//LANG/VOLUME/CHAPTER/CHAPTER_EXTRA(/page/)
895
		$chapter_parts = explode('/', $chapter);
896
		return [
897
			'url'    => "http://reader.sensescans.com/read/{$title_url}/{$chapter}/",
898
			'number' => ($chapter_parts[1] !== '0' ? "v{$chapter_parts[1]}/" : '') . "c{$chapter_parts[2]}" . (isset($chapter_parts[3]) ? ".{$chapter_parts[3]}" : '')/*)*/
899
		];
900
	}
901
902
	public function getTitleData(string $title_url) {
903
		$fullURL = $this->getFullTitleURL($title_url);
904
		return $this->parseFoolSlide($fullURL, $title_url);
905
	}
906
}
907