Code Duplication    Length = 18-20 lines in 3 locations

controller/apicontroller.php 1 location

@@ 54-73 (lines=20) @@
51
	/** @var Folder */
52
	private $userFolder;
53
54
	public function __construct($appname,
55
								IRequest $request,
56
								IURLGenerator $urlGenerator,
57
								TrackBusinessLayer $trackbusinesslayer,
58
								ArtistBusinessLayer $artistbusinesslayer,
59
								AlbumBusinessLayer $albumbusinesslayer,
60
								Scanner $scanner,
61
								$userId,
62
								$l10n,
63
								Folder $userFolder){
64
		parent::__construct($appname, $request);
65
		$this->l10n = $l10n;
66
		$this->trackBusinessLayer = $trackbusinesslayer;
67
		$this->artistBusinessLayer = $artistbusinesslayer;
68
		$this->albumBusinessLayer = $albumbusinesslayer;
69
		$this->scanner = $scanner;
70
		$this->userId = $userId;
71
		$this->urlGenerator = $urlGenerator;
72
		$this->userFolder = $userFolder;
73
	}
74
75
	/**
76
	 * Extracts the id from an unique slug (id-slug)

controller/settingcontroller.php 1 location

@@ 40-59 (lines=20) @@
37
	private $secureRandom;
38
	private $l10n;
39
40
	public function __construct($appname,
41
								IRequest $request,
42
								AmpacheUserMapper $ampacheUserMapper,
43
								Scanner $scanner,
44
								$userId,
45
								Folder $userFolder,
46
								IConfig $configManager,
47
								ISecureRandom $secureRandom,
48
								$l10n){
49
		parent::__construct($appname, $request);
50
51
		$this->appname = $appname;
52
		$this->ampacheUserMapper = $ampacheUserMapper;
53
		$this->scanner = $scanner;
54
		$this->userId = $userId;
55
		$this->userFolder = $userFolder;
56
		$this->configManager = $configManager;
57
		$this->secureRandom = $secureRandom;
58
		$this->l10n = $l10n;
59
	}
60
61
	/**
62
	 * @NoAdminRequired

controller/playlistapicontroller.php 1 location

@@ 41-58 (lines=18) @@
38
	private $trackBusinessLayer;
39
	private $urlGenerator;
40
41
	public function __construct($appname,
42
								IRequest $request,
43
								IURLGenerator $urlGenerator,
44
								PlaylistBusinessLayer $playlistBusinessLayer,
45
								ArtistBusinessLayer $artistBusinessLayer,
46
								AlbumBusinessLayer $albumBusinessLayer,
47
								TrackBusinessLayer $trackBusinessLayer,
48
								Folder $userFolder,
49
								$userId){
50
		parent::__construct($appname, $request);
51
		$this->userId = $userId;
52
		$this->userFolder = $userFolder;
53
		$this->urlGenerator = $urlGenerator;
54
		$this->playlistBusinessLayer = $playlistBusinessLayer;
55
		$this->artistBusinessLayer = $artistBusinessLayer;
56
		$this->albumBusinessLayer = $albumBusinessLayer;
57
		$this->trackBusinessLayer = $trackBusinessLayer;
58
	}
59
60
	/**
61
	 * lists all playlists