Passed
Push — master ( 8b0281...9e9f0c )
by Anthony
02:44
created
Service/Version.php 2 patches
Indentation   +175 added lines, -175 removed lines patch added patch discarded remove patch
@@ -15,179 +15,179 @@
 block discarded – undo
15 15
 
16 16
 class Version
17 17
 {
18
-    /**
19
-     * @var EntityManagerInterface
20
-     */
21
-    private $em;
22
-
23
-    /**
24
-     * @var HttpClientInterface
25
-     */
26
-    private $client;
27
-
28
-    /**
29
-     * @var ParameterBagInterface
30
-     */
31
-    private $parameter;
32
-
33
-    /**
34
-     * @var PackagistApi
35
-     */
36
-    private $packagist;
37
-
38
-    /**
39
-     * @var mixed
40
-     */
41
-    private $local_token;
42
-
43
-    /**
44
-     * @var Package
45
-     */
46
-    private $package;
47
-
48
-    private $messages = [];
49
-
50
-    /**
51
-     * Version constructor.
52
-     * @param EntityManagerInterface $em
53
-     * @param HttpClientInterface $client
54
-     * @param ParameterBagInterface $parameter
55
-     * @param PackagistApi $packagist
56
-     */
57
-    public function __construct(EntityManagerInterface $em, HttpClientInterface $client, ParameterBagInterface $parameter, PackagistApi $packagist)
58
-    {
59
-        $this->em = $em;
60
-        $this->client = $client;
61
-        $this->parameter = $parameter;
62
-        $this->packagist = $packagist;
63
-        $this->local_token = $parameter->get("ribs_admin.packages_token");
64
-    }
65
-
66
-    /**
67
-     * @return array
68
-     */
69
-    public function getMessages(): array
70
-    {
71
-        return $this->messages;
72
-    }
73
-
74
-    /**
75
-     * @param Package $package
76
-     */
77
-    public function setPackageEntity(Package $package) {
78
-        $this->package = $package;
79
-    }
80
-
81
-    /**
82
-     * @return mixed|null
83
-     */
84
-    private function getToken()
85
-    {
86
-        $token = null;
87
-        $response = $this->client->request("GET", $this->package->getProjectUrl()."ribs-admin/packages/send-token/");
88
-        $datas = $response->getStatusCode() == 200 ? $response->getContent() : null;
89
-
90
-        if ($datas) {
91
-            $token = json_decode($datas, true)["token"];
92
-        }
93
-
94
-        return $token;
95
-    }
96
-
97
-    /**
98
-     * @return mixed|null
99
-     * @throws ClientExceptionInterface
100
-     * @throws RedirectionExceptionInterface
101
-     * @throws ServerExceptionInterface
102
-     * @throws TransportExceptionInterface
103
-     */
104
-    private function getComposerLockJson()
105
-    {
106
-        if ($this->package && !$this->package->isIsLocal()) {
107
-            $response = $this->client->request("GET", $this->package->getProjectUrl().$this->package->getComposerLockUrl());
108
-            $composer_lock = $response->getStatusCode() == 200 ? $response->getContent() : null;
109
-        } else {
110
-            $composer_lock = file_get_contents('../composer.lock');
111
-        }
112
-
113
-        if ($composer_lock) {
114
-            return json_decode($composer_lock, true);
115
-        }
116
-
117
-        return null;
118
-    }
119
-
120
-    /**
121
-     * @return mixed|null
122
-     * @throws ClientExceptionInterface
123
-     * @throws RedirectionExceptionInterface
124
-     * @throws ServerExceptionInterface
125
-     * @throws TransportExceptionInterface
126
-     */
127
-    public function getPackage()
128
-    {
129
-        $composer_lock = $this->getComposerLockJson();
130
-        if ($composer_lock) {
131
-            $packages = $composer_lock["packages"];
132
-            $key = array_search($this->package->getPackageName(), array_column($packages, 'name'));
133
-
134
-            if ($key) {
135
-                return $packages[$key];
136
-            }
137
-        }
138
-
139
-        $this->messages["composer_lock"] = "Composer lock not found at " . $this->package->getProjectUrl();
140
-
141
-        return null;
142
-    }
143
-
144
-    /**
145
-     * @return mixed|null
146
-     */
147
-    public function getVersion()
148
-    {
149
-        return $this->getPackage($this->package->getPackageName()) ? $this->getPackage($this->package->getPackageName())["version"] : null;
150
-    }
151
-
152
-    /**
153
-     * @return DateTime|null
154
-     * @throws Exception
155
-     */
156
-    public function getVersionDate(): ?DateTime
157
-    {
158
-        $string_date = $this->getPackage($this->package->getPackageName()) ? explode("T", $this->getPackage($this->package->getPackageName())["time"])[0] : null;
159
-        $version_date = null;
160
-
161
-        if ($string_date) {
162
-            $version_date = new DateTime($string_date);
163
-        }
164
-
165
-        return $version_date;
166
-    }
167
-
168
-    /**
169
-     * @param $package_guid
170
-     * @throws Exception
171
-     */
172
-    public function save($package_guid)
173
-    {
174
-        $package = $this->em->getRepository(Package::class)->findOneBy(["guid" => $package_guid]);
175
-
176
-        if ($package) {
177
-            $this->setPackageEntity($package);
178
-
179
-            if (!$this->getToken() || $this->getToken() !== $this->local_token) {
180
-                $this->messages["token_error"] = "Token not matching on : " . $this->package->getProjectUrl();
181
-                return;
182
-            }
183
-
184
-            $package->setVersion($this->getVersion());
185
-            $package->setVersionDate($this->getVersionDate());
186
-            $package->setLastPackagistVersion($this->packagist->getLastPackagistVersion($package->getPackageName()));
187
-            $package->setLastCheck(new DateTime());
188
-
189
-            $this->em->persist($package);
190
-            $this->em->flush();
191
-        }
192
-    }
18
+				/**
19
+				 * @var EntityManagerInterface
20
+				 */
21
+				private $em;
22
+
23
+				/**
24
+				 * @var HttpClientInterface
25
+				 */
26
+				private $client;
27
+
28
+				/**
29
+				 * @var ParameterBagInterface
30
+				 */
31
+				private $parameter;
32
+
33
+				/**
34
+				 * @var PackagistApi
35
+				 */
36
+				private $packagist;
37
+
38
+				/**
39
+				 * @var mixed
40
+				 */
41
+				private $local_token;
42
+
43
+				/**
44
+				 * @var Package
45
+				 */
46
+				private $package;
47
+
48
+				private $messages = [];
49
+
50
+				/**
51
+				 * Version constructor.
52
+				 * @param EntityManagerInterface $em
53
+				 * @param HttpClientInterface $client
54
+				 * @param ParameterBagInterface $parameter
55
+				 * @param PackagistApi $packagist
56
+				 */
57
+				public function __construct(EntityManagerInterface $em, HttpClientInterface $client, ParameterBagInterface $parameter, PackagistApi $packagist)
58
+				{
59
+								$this->em = $em;
60
+								$this->client = $client;
61
+								$this->parameter = $parameter;
62
+								$this->packagist = $packagist;
63
+								$this->local_token = $parameter->get("ribs_admin.packages_token");
64
+				}
65
+
66
+				/**
67
+				 * @return array
68
+				 */
69
+				public function getMessages(): array
70
+				{
71
+								return $this->messages;
72
+				}
73
+
74
+				/**
75
+				 * @param Package $package
76
+				 */
77
+				public function setPackageEntity(Package $package) {
78
+								$this->package = $package;
79
+				}
80
+
81
+				/**
82
+				 * @return mixed|null
83
+				 */
84
+				private function getToken()
85
+				{
86
+								$token = null;
87
+								$response = $this->client->request("GET", $this->package->getProjectUrl()."ribs-admin/packages/send-token/");
88
+								$datas = $response->getStatusCode() == 200 ? $response->getContent() : null;
89
+
90
+								if ($datas) {
91
+												$token = json_decode($datas, true)["token"];
92
+								}
93
+
94
+								return $token;
95
+				}
96
+
97
+				/**
98
+				 * @return mixed|null
99
+				 * @throws ClientExceptionInterface
100
+				 * @throws RedirectionExceptionInterface
101
+				 * @throws ServerExceptionInterface
102
+				 * @throws TransportExceptionInterface
103
+				 */
104
+				private function getComposerLockJson()
105
+				{
106
+								if ($this->package && !$this->package->isIsLocal()) {
107
+												$response = $this->client->request("GET", $this->package->getProjectUrl().$this->package->getComposerLockUrl());
108
+												$composer_lock = $response->getStatusCode() == 200 ? $response->getContent() : null;
109
+								} else {
110
+												$composer_lock = file_get_contents('../composer.lock');
111
+								}
112
+
113
+								if ($composer_lock) {
114
+												return json_decode($composer_lock, true);
115
+								}
116
+
117
+								return null;
118
+				}
119
+
120
+				/**
121
+				 * @return mixed|null
122
+				 * @throws ClientExceptionInterface
123
+				 * @throws RedirectionExceptionInterface
124
+				 * @throws ServerExceptionInterface
125
+				 * @throws TransportExceptionInterface
126
+				 */
127
+				public function getPackage()
128
+				{
129
+								$composer_lock = $this->getComposerLockJson();
130
+								if ($composer_lock) {
131
+												$packages = $composer_lock["packages"];
132
+												$key = array_search($this->package->getPackageName(), array_column($packages, 'name'));
133
+
134
+												if ($key) {
135
+																return $packages[$key];
136
+												}
137
+								}
138
+
139
+								$this->messages["composer_lock"] = "Composer lock not found at " . $this->package->getProjectUrl();
140
+
141
+								return null;
142
+				}
143
+
144
+				/**
145
+				 * @return mixed|null
146
+				 */
147
+				public function getVersion()
148
+				{
149
+								return $this->getPackage($this->package->getPackageName()) ? $this->getPackage($this->package->getPackageName())["version"] : null;
150
+				}
151
+
152
+				/**
153
+				 * @return DateTime|null
154
+				 * @throws Exception
155
+				 */
156
+				public function getVersionDate(): ?DateTime
157
+				{
158
+								$string_date = $this->getPackage($this->package->getPackageName()) ? explode("T", $this->getPackage($this->package->getPackageName())["time"])[0] : null;
159
+								$version_date = null;
160
+
161
+								if ($string_date) {
162
+												$version_date = new DateTime($string_date);
163
+								}
164
+
165
+								return $version_date;
166
+				}
167
+
168
+				/**
169
+				 * @param $package_guid
170
+				 * @throws Exception
171
+				 */
172
+				public function save($package_guid)
173
+				{
174
+								$package = $this->em->getRepository(Package::class)->findOneBy(["guid" => $package_guid]);
175
+
176
+								if ($package) {
177
+												$this->setPackageEntity($package);
178
+
179
+												if (!$this->getToken() || $this->getToken() !== $this->local_token) {
180
+																$this->messages["token_error"] = "Token not matching on : " . $this->package->getProjectUrl();
181
+																return;
182
+												}
183
+
184
+												$package->setVersion($this->getVersion());
185
+												$package->setVersionDate($this->getVersionDate());
186
+												$package->setLastPackagistVersion($this->packagist->getLastPackagistVersion($package->getPackageName()));
187
+												$package->setLastCheck(new DateTime());
188
+
189
+												$this->em->persist($package);
190
+												$this->em->flush();
191
+								}
192
+				}
193 193
 }
Please login to merge, or discard this patch.
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -84,7 +84,7 @@  discard block
 block discarded – undo
84 84
     private function getToken()
85 85
     {
86 86
         $token = null;
87
-        $response = $this->client->request("GET", $this->package->getProjectUrl()."ribs-admin/packages/send-token/");
87
+        $response = $this->client->request("GET", $this->package->getProjectUrl() . "ribs-admin/packages/send-token/");
88 88
         $datas = $response->getStatusCode() == 200 ? $response->getContent() : null;
89 89
 
90 90
         if ($datas) {
@@ -104,7 +104,7 @@  discard block
 block discarded – undo
104 104
     private function getComposerLockJson()
105 105
     {
106 106
         if ($this->package && !$this->package->isIsLocal()) {
107
-            $response = $this->client->request("GET", $this->package->getProjectUrl().$this->package->getComposerLockUrl());
107
+            $response = $this->client->request("GET", $this->package->getProjectUrl() . $this->package->getComposerLockUrl());
108 108
             $composer_lock = $response->getStatusCode() == 200 ? $response->getContent() : null;
109 109
         } else {
110 110
             $composer_lock = file_get_contents('../composer.lock');
Please login to merge, or discard this patch.
Service/PackagistApi.php 2 patches
Indentation   +61 added lines, -61 removed lines patch added patch discarded remove patch
@@ -7,76 +7,76 @@
 block discarded – undo
7 7
 
8 8
 class PackagistApi
9 9
 {
10
-    /**
11
-     * @var HttpClientInterface
12
-     */
13
-    private $client;
10
+				/**
11
+				 * @var HttpClientInterface
12
+				 */
13
+				private $client;
14 14
 
15
-    /**
16
-     * @var string
17
-     */
18
-    private $package_name = null;
15
+				/**
16
+				 * @var string
17
+				 */
18
+				private $package_name = null;
19 19
 
20
-    /**
21
-     * @var array
22
-     */
23
-    private $package_info = [];
20
+				/**
21
+				 * @var array
22
+				 */
23
+				private $package_info = [];
24 24
 
25
-    /**
26
-     * PackagistApi constructor.
27
-     * @param HttpClientInterface $client
28
-     */
29
-    public function __construct(HttpClientInterface $client)
30
-    {
31
-        $this->client = $client;
32
-    }
25
+				/**
26
+				 * PackagistApi constructor.
27
+				 * @param HttpClientInterface $client
28
+				 */
29
+				public function __construct(HttpClientInterface $client)
30
+				{
31
+								$this->client = $client;
32
+				}
33 33
 
34
-    /**
35
-     * @return false|mixed
36
-     */
37
-    private function getPackageInformation()
38
-    {
39
-        if ($this->package_info) {
40
-            return $this->package_info;
41
-        }
34
+				/**
35
+				 * @return false|mixed
36
+				 */
37
+				private function getPackageInformation()
38
+				{
39
+								if ($this->package_info) {
40
+												return $this->package_info;
41
+								}
42 42
 
43
-        if (!$this->package_name || !strpos($this->package_name, "/")) {
44
-            return false;
45
-        }
43
+								if (!$this->package_name || !strpos($this->package_name, "/")) {
44
+												return false;
45
+								}
46 46
 
47
-        $packgist_url = "https://repo.packagist.org/p/".$this->package_name.".json";
48
-        $response = $this->client->request("GET", $packgist_url);
47
+								$packgist_url = "https://repo.packagist.org/p/".$this->package_name.".json";
48
+								$response = $this->client->request("GET", $packgist_url);
49 49
 
50
-        if ($response->getStatusCode() == 200) {
51
-            $content = json_decode($response->getContent(), true);
52
-            if (is_array($content) && $content["packages"] && $content["packages"][$this->package_name]) {
53
-                $this->package_info = $content["packages"][$this->package_name];
54
-                return $this->package_info;
55
-            }
56
-        }
50
+								if ($response->getStatusCode() == 200) {
51
+												$content = json_decode($response->getContent(), true);
52
+												if (is_array($content) && $content["packages"] && $content["packages"][$this->package_name]) {
53
+																$this->package_info = $content["packages"][$this->package_name];
54
+																return $this->package_info;
55
+												}
56
+								}
57 57
 
58
-        return false;
59
-    }
58
+								return false;
59
+				}
60 60
 
61
-    /**
62
-     * @param string $package_name
63
-     * @return false|int|string|null
64
-     */
65
-    public function getLastPackagistVersion(string $package_name)
66
-    {
67
-        $this->package_name = $package_name;
68
-        if ($package = $this->getPackageInformation()) {
69
-            return array_key_first($package);
70
-        }
61
+				/**
62
+				 * @param string $package_name
63
+				 * @return false|int|string|null
64
+				 */
65
+				public function getLastPackagistVersion(string $package_name)
66
+				{
67
+								$this->package_name = $package_name;
68
+								if ($package = $this->getPackageInformation()) {
69
+												return array_key_first($package);
70
+								}
71 71
 
72
-        return false;
73
-    }
72
+								return false;
73
+				}
74 74
 
75
-    public function getAllPackagistVersions(string $package_name)
76
-    {
77
-        $this->package_name = $package_name;
78
-        if ($package = $this->getPackageInformation()) {
79
-            return array_keys($package);
80
-        }
81
-    }
75
+				public function getAllPackagistVersions(string $package_name)
76
+				{
77
+								$this->package_name = $package_name;
78
+								if ($package = $this->getPackageInformation()) {
79
+												return array_keys($package);
80
+								}
81
+				}
82 82
 }
Please login to merge, or discard this patch.
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -44,7 +44,7 @@
 block discarded – undo
44 44
             return false;
45 45
         }
46 46
 
47
-        $packgist_url = "https://repo.packagist.org/p/".$this->package_name.".json";
47
+        $packgist_url = "https://repo.packagist.org/p/" . $this->package_name . ".json";
48 48
         $response = $this->client->request("GET", $packgist_url);
49 49
 
50 50
         if ($response->getStatusCode() == 200) {
Please login to merge, or discard this patch.
Controller/PackageController.php 1 patch
Indentation   +93 added lines, -93 removed lines patch added patch discarded remove patch
@@ -15,110 +15,110 @@
 block discarded – undo
15 15
 
16 16
 class PackageController extends AbstractController
17 17
 {
18
-    /**
19
-     * @Route("/packages/", name="ribsadmin_packages")
20
-     * @param EntityManagerInterface $em
21
-     * @return Response
22
-     */
23
-    public function index(EntityManagerInterface $em): Response
24
-    {
25
-        $packages = $em->getRepository(Package::class)->findAll();
18
+				/**
19
+				 * @Route("/packages/", name="ribsadmin_packages")
20
+				 * @param EntityManagerInterface $em
21
+				 * @return Response
22
+				 */
23
+				public function index(EntityManagerInterface $em): Response
24
+				{
25
+								$packages = $em->getRepository(Package::class)->findAll();
26 26
         
27
-        return $this->render("@RibsAdmin/packages/list.html.twig", ["packages" => $packages]);
28
-    }
27
+								return $this->render("@RibsAdmin/packages/list.html.twig", ["packages" => $packages]);
28
+				}
29 29
 
30
-    /**
31
-     * @Route("/packages/create/", name="ribsadmin_packages_create")
32
-     * @Route("/packages/show/{guid}", name="ribsadmin_packages_show")
33
-     * @Route("/packages/edit/{guid}", name="ribsadmin_packages_edit")
34
-     * @param Request $request
35
-     * @param EntityManagerInterface $em
36
-     * @param PackagistApi $packagist
37
-     * @param string|null $guid
38
-     * @return Response
39
-     */
40
-    public function edit(Request $request, EntityManagerInterface $em, PackagistApi $packagist, string $guid = null): Response
41
-    {
42
-        $disabled_form = strpos($request->get("_route"), "_show") ? true : false;
43
-        if (!$guid) {
44
-            $package = new Package();
45
-            $text = "created";
46
-        } else {
47
-            $package = $em->getRepository(Package::class)->findOneBy(["guid" => $guid]);
48
-            $text = "edited";
49
-        }
30
+				/**
31
+				 * @Route("/packages/create/", name="ribsadmin_packages_create")
32
+				 * @Route("/packages/show/{guid}", name="ribsadmin_packages_show")
33
+				 * @Route("/packages/edit/{guid}", name="ribsadmin_packages_edit")
34
+				 * @param Request $request
35
+				 * @param EntityManagerInterface $em
36
+				 * @param PackagistApi $packagist
37
+				 * @param string|null $guid
38
+				 * @return Response
39
+				 */
40
+				public function edit(Request $request, EntityManagerInterface $em, PackagistApi $packagist, string $guid = null): Response
41
+				{
42
+								$disabled_form = strpos($request->get("_route"), "_show") ? true : false;
43
+								if (!$guid) {
44
+												$package = new Package();
45
+												$text = "created";
46
+								} else {
47
+												$package = $em->getRepository(Package::class)->findOneBy(["guid" => $guid]);
48
+												$text = "edited";
49
+								}
50 50
 
51
-        $form = $this->createForm(\PiouPiou\RibsAdminBundle\Form\Package::class, $package, ["disabled" => $disabled_form]);
52
-        $form->handleRequest($request);
51
+								$form = $this->createForm(\PiouPiou\RibsAdminBundle\Form\Package::class, $package, ["disabled" => $disabled_form]);
52
+								$form->handleRequest($request);
53 53
 
54
-        if ($form->isSubmitted() && $form->isValid()) {
55
-            /** @var Package $data */
56
-            $data = $form->getData();
57
-            $em->persist($data);
58
-            $em->flush();
59
-            $this->addFlash("success-flash", "Package " . $data->getProjectName() . " was " . $text);
54
+								if ($form->isSubmitted() && $form->isValid()) {
55
+												/** @var Package $data */
56
+												$data = $form->getData();
57
+												$em->persist($data);
58
+												$em->flush();
59
+												$this->addFlash("success-flash", "Package " . $data->getProjectName() . " was " . $text);
60 60
 
61
-            return $this->redirectToRoute("ribsadmin_packages");
62
-        }
61
+												return $this->redirectToRoute("ribsadmin_packages");
62
+								}
63 63
 
64
-        return $this->render("@RibsAdmin/packages/edit.html.twig", [
65
-            "disabled_form" => $disabled_form,
66
-            "form" => $form->createView(),
67
-            "form_errors" => $form->getErrors(),
68
-            "package" => $package,
69
-            "versions" => $packagist->getAllPackagistVersions($package->getPackageName())
70
-        ]);
71
-    }
64
+								return $this->render("@RibsAdmin/packages/edit.html.twig", [
65
+												"disabled_form" => $disabled_form,
66
+												"form" => $form->createView(),
67
+												"form_errors" => $form->getErrors(),
68
+												"package" => $package,
69
+												"versions" => $packagist->getAllPackagistVersions($package->getPackageName())
70
+								]);
71
+				}
72 72
 
73
-    /**
74
-     * @Route("/packages/delete/{guid}", name="ribsadmin_packages_delete")
75
-     * @param EntityManagerInterface $em
76
-     * @param string $guid
77
-     * @return RedirectResponse
78
-     */
79
-    public function delete(EntityManagerInterface $em, string $guid): RedirectResponse
80
-    {
81
-        $package = $em->getRepository(Package::class)->findOneBy(["guid" => $guid]);
73
+				/**
74
+				 * @Route("/packages/delete/{guid}", name="ribsadmin_packages_delete")
75
+				 * @param EntityManagerInterface $em
76
+				 * @param string $guid
77
+				 * @return RedirectResponse
78
+				 */
79
+				public function delete(EntityManagerInterface $em, string $guid): RedirectResponse
80
+				{
81
+								$package = $em->getRepository(Package::class)->findOneBy(["guid" => $guid]);
82 82
 
83
-        if ($package) {
84
-            $em->remove($package);
85
-            $em->flush();
86
-            $this->addFlash("success-flash", "The project package was deleted");
87
-        } else {
88
-            $this->addFlash("error-flash", "The project package was not found");
89
-        }
83
+								if ($package) {
84
+												$em->remove($package);
85
+												$em->flush();
86
+												$this->addFlash("success-flash", "The project package was deleted");
87
+								} else {
88
+												$this->addFlash("error-flash", "The project package was not found");
89
+								}
90 90
 
91
-        return $this->redirectToRoute("ribsadmin_packages");
92
-    }
91
+								return $this->redirectToRoute("ribsadmin_packages");
92
+				}
93 93
 
94
-    /**
95
-     * @Route("/packages/update/{guid}", name="ribsadmin_packages_update")
96
-     * @param Version $version
97
-     * @param string $guid
98
-     * @return RedirectResponse
99
-     * @throws Exception
100
-     */
101
-    public function updatePackage(Version $version, string $guid): RedirectResponse
102
-    {
103
-        if ($guid) {
104
-            $version->save($guid);
94
+				/**
95
+				 * @Route("/packages/update/{guid}", name="ribsadmin_packages_update")
96
+				 * @param Version $version
97
+				 * @param string $guid
98
+				 * @return RedirectResponse
99
+				 * @throws Exception
100
+				 */
101
+				public function updatePackage(Version $version, string $guid): RedirectResponse
102
+				{
103
+								if ($guid) {
104
+												$version->save($guid);
105 105
 
106
-            if ($version->getMessages()) {
107
-                $message = "<ul>";
108
-                $message .= "<li>The project package was not well updated</li>";
109
-                foreach ($version->getMessages() as $version_message) {
110
-                    $message .= "<li>".$version_message."</li>";
111
-                }
112
-                $message .= "</ul>";
106
+												if ($version->getMessages()) {
107
+																$message = "<ul>";
108
+																$message .= "<li>The project package was not well updated</li>";
109
+																foreach ($version->getMessages() as $version_message) {
110
+																				$message .= "<li>".$version_message."</li>";
111
+																}
112
+																$message .= "</ul>";
113 113
 
114
-                $this->addFlash("info-flash", $message);
115
-            } else {
116
-                $this->addFlash("success-flash", "The project package was updated");
117
-            }
118
-        } else {
119
-            $this->addFlash("error-flash", "The project package was not found");
120
-        }
114
+																$this->addFlash("info-flash", $message);
115
+												} else {
116
+																$this->addFlash("success-flash", "The project package was updated");
117
+												}
118
+								} else {
119
+												$this->addFlash("error-flash", "The project package was not found");
120
+								}
121 121
 
122
-        return $this->redirectToRoute("ribsadmin_packages");
123
-    }
122
+								return $this->redirectToRoute("ribsadmin_packages");
123
+				}
124 124
 }
Please login to merge, or discard this patch.