33namespace App \Http \Controllers ;
44
55use App ;
6- use App \Project ;
7- use App \Server ;
6+ use App \ProjectInterface ;
7+ use App \ServerInterface ;
88
99class ServerController extends Controller
1010{
@@ -16,10 +16,10 @@ public function __construct()
1616 /**
1717 * Display a listing of the resource.
1818 *
19- * @param Project $project
19+ * @param ProjectInterface $project
2020 * @return \Illuminate\Http\Response
2121 */
22- public function index (Project $ project )
22+ public function index (ProjectInterface $ project )
2323 {
2424 $ serversCollection = $ project ->servers ()
2525 ->orderBy ('created_at ' , 'desc ' )
@@ -30,10 +30,10 @@ public function index(Project $project)
3030 /**
3131 * Show the form for creating a new resource.
3232 *
33- * @param Project $project
33+ * @param ProjectInterface $project
3434 * @return \Illuminate\Http\Response
3535 */
36- public function create (Project $ project )
36+ public function create (ProjectInterface $ project )
3737 {
3838 $ gitBranches = (App::make ('App\GitInteractions\GitLocalInterface ' ))
3939 ->getGitBranches ($ project ->repository );
@@ -42,10 +42,10 @@ public function create(Project $project)
4242
4343 /**
4444 * Store a newly created resource in storage.
45- * @param Project $project
45+ * @param ProjectInterface $project
4646 * @return \Illuminate\Http\RedirectResponse
4747 */
48- public function store (Project $ project )
48+ public function store (ProjectInterface $ project )
4949 {
5050 $ project ->addServer ([
5151 'project_id ' => $ project ->id ,
@@ -68,22 +68,23 @@ public function store(Project $project)
6868 /**
6969 * Display the specified resource.
7070 *
71- * @param \App\Server $server
72- * @return \Illuminate\Http\Response
71+ * @param ProjectInterface $project
72+ * @param ServerInterface $server
73+ * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
7374 */
74- public function show (Project $ project , Server $ server )
75+ public function show (ProjectInterface $ project , ServerInterface $ server )
7576 {
7677 return view ('servers.show ' , compact ('project ' , 'server ' ));
7778 }
7879
7980 /**
8081 * Show the form for editing the specified resource.
8182 *
82- * @param Project $project
83- * @param Server $server
83+ * @param ProjectInterface $project
84+ * @param ServerInterface $server
8485 * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
8586 */
86- public function edit (Project $ project , Server $ server )
87+ public function edit (ProjectInterface $ project , ServerInterface $ server )
8788 {
8889 $ gitBranches = (App::make ('App\GitInteractions\GitLocalInterface ' ))
8990 ->getGitBranches ($ project ->repository );
@@ -93,23 +94,23 @@ public function edit(Project $project, Server $server)
9394 /**
9495 * Show the form for deleting the specified resource.
9596 *
96- * @param Project $project
97- * @param Server $server
97+ * @param ProjectInterface $project
98+ * @param ServerInterface $server
9899 * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
99100 */
100- public function delete (Project $ project , Server $ server )
101+ public function delete (ProjectInterface $ project , ServerInterface $ server )
101102 {
102103 return view ('servers.delete ' , compact ('project ' , 'server ' ));
103104 }
104105
105106 /**
106107 * Update the specified resource in storage.
107108 *
108- * @param Project $project
109- * @param Server $server
110- * @return Server
109+ * @param ProjectInterface $project
110+ * @param ServerInterface $server
111+ * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
111112 */
112- public function update (Project $ project , Server $ server )
113+ public function update (ProjectInterface $ project , ServerInterface $ server )
113114 {
114115 $ server ->update (request ([
115116 'name ' ,
@@ -129,12 +130,12 @@ public function update(Project $project, Server $server)
129130 /**
130131 * Remove the specified resource from storage.
131132 *
132- * @param Project $project
133- * @param Server $server
133+ * @param ProjectInterface $project
134+ * @param ServerInterface $server
134135 * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
135136 * @throws \Exception
136137 */
137- public function destroy (Project $ project , Server $ server )
138+ public function destroy (ProjectInterface $ project , ServerInterface $ server )
138139 {
139140 if (!request ('confirm ' )){
140141 $ error = \Illuminate \Validation \ValidationException::withMessages ([
0 commit comments