@@ -6,98 +6,98 @@ |
||
6 | 6 | |
7 | 7 | class Version |
8 | 8 | { |
9 | - /** |
|
10 | - * @var EntityManagerInterface |
|
11 | - */ |
|
12 | - private $em; |
|
13 | - |
|
14 | - /** |
|
15 | - * Version constructor. |
|
16 | - * @param EntityManagerInterface $em |
|
17 | - */ |
|
18 | - public function __construct(EntityManagerInterface $em) |
|
19 | - { |
|
20 | - $this->em = $em; |
|
21 | - } |
|
22 | - |
|
23 | - /** |
|
24 | - * @return mixed|null |
|
25 | - */ |
|
26 | - private function getComposerLockJson() |
|
27 | - { |
|
28 | - $composer_lock = file_get_contents('../composer.lock'); |
|
29 | - |
|
30 | - if ($composer_lock) { |
|
31 | - return json_decode($composer_lock, true); |
|
32 | - } |
|
33 | - |
|
34 | - return null; |
|
35 | - } |
|
36 | - |
|
37 | - /** |
|
38 | - * @param $package_name |
|
39 | - * @return mixed|null |
|
40 | - */ |
|
41 | - private function getPackage($package_name) |
|
42 | - { |
|
43 | - $composer_lock = $this->getComposerLockJson(); |
|
44 | - if ($composer_lock) { |
|
45 | - $packages = $composer_lock["packages"]; |
|
46 | - $key = array_search($package_name, array_column($packages, 'name')); |
|
47 | - |
|
48 | - if ($key) { |
|
49 | - return $packages[$key]; |
|
50 | - } |
|
51 | - } |
|
52 | - |
|
53 | - return null; |
|
54 | - } |
|
55 | - |
|
56 | - /** |
|
57 | - * @param $package_name |
|
58 | - * @return mixed|null |
|
59 | - */ |
|
60 | - public function getVersion($package_name) |
|
61 | - { |
|
62 | - return $this->getPackage($package_name) ? $this->getPackage($package_name)["version"] : null; |
|
63 | - } |
|
64 | - |
|
65 | - /** |
|
66 | - * @param $package_name |
|
67 | - * @return mixed|null |
|
68 | - */ |
|
69 | - public function getVersionDate($package_name) |
|
70 | - { |
|
71 | - $string_date = $this->getPackage($package_name) ? explode("T", $this->getPackage($package_name)["time"])[0] : null; |
|
72 | - $version_date = null; |
|
73 | - |
|
74 | - if ($string_date) { |
|
75 | - $version_date = new \DateTime($string_date); |
|
76 | - } |
|
77 | - |
|
78 | - return $version_date; |
|
79 | - } |
|
80 | - |
|
81 | - /** |
|
82 | - * @param $package_name |
|
83 | - */ |
|
84 | - public function save($package_name) |
|
85 | - { |
|
86 | - $version = $this->em->getRepository(\PiouPiou\RibsAdminBundle\Entity\Version::class)->findOneBy(["package_name" => $package_name]); |
|
87 | - |
|
88 | - if (!$version) { |
|
89 | - $version = new \PiouPiou\RibsAdminBundle\Entity\Version(); |
|
90 | - $version->setProjectName($package_name); |
|
91 | - $version->setPackageName($package_name); |
|
92 | - $version->setProjectUrl($package_name); |
|
93 | - $version->setCheckVersionUrl($package_name); |
|
94 | - } |
|
95 | - |
|
96 | - $version->setVersion($this->getVersion($package_name)); |
|
97 | - $version->setVersionDate($this->getVersionDate($package_name)); |
|
98 | - $version->setLastCheck(new \DateTime()); |
|
99 | - |
|
100 | - $this->em->persist($version); |
|
101 | - $this->em->flush(); |
|
102 | - } |
|
9 | + /** |
|
10 | + * @var EntityManagerInterface |
|
11 | + */ |
|
12 | + private $em; |
|
13 | + |
|
14 | + /** |
|
15 | + * Version constructor. |
|
16 | + * @param EntityManagerInterface $em |
|
17 | + */ |
|
18 | + public function __construct(EntityManagerInterface $em) |
|
19 | + { |
|
20 | + $this->em = $em; |
|
21 | + } |
|
22 | + |
|
23 | + /** |
|
24 | + * @return mixed|null |
|
25 | + */ |
|
26 | + private function getComposerLockJson() |
|
27 | + { |
|
28 | + $composer_lock = file_get_contents('../composer.lock'); |
|
29 | + |
|
30 | + if ($composer_lock) { |
|
31 | + return json_decode($composer_lock, true); |
|
32 | + } |
|
33 | + |
|
34 | + return null; |
|
35 | + } |
|
36 | + |
|
37 | + /** |
|
38 | + * @param $package_name |
|
39 | + * @return mixed|null |
|
40 | + */ |
|
41 | + private function getPackage($package_name) |
|
42 | + { |
|
43 | + $composer_lock = $this->getComposerLockJson(); |
|
44 | + if ($composer_lock) { |
|
45 | + $packages = $composer_lock["packages"]; |
|
46 | + $key = array_search($package_name, array_column($packages, 'name')); |
|
47 | + |
|
48 | + if ($key) { |
|
49 | + return $packages[$key]; |
|
50 | + } |
|
51 | + } |
|
52 | + |
|
53 | + return null; |
|
54 | + } |
|
55 | + |
|
56 | + /** |
|
57 | + * @param $package_name |
|
58 | + * @return mixed|null |
|
59 | + */ |
|
60 | + public function getVersion($package_name) |
|
61 | + { |
|
62 | + return $this->getPackage($package_name) ? $this->getPackage($package_name)["version"] : null; |
|
63 | + } |
|
64 | + |
|
65 | + /** |
|
66 | + * @param $package_name |
|
67 | + * @return mixed|null |
|
68 | + */ |
|
69 | + public function getVersionDate($package_name) |
|
70 | + { |
|
71 | + $string_date = $this->getPackage($package_name) ? explode("T", $this->getPackage($package_name)["time"])[0] : null; |
|
72 | + $version_date = null; |
|
73 | + |
|
74 | + if ($string_date) { |
|
75 | + $version_date = new \DateTime($string_date); |
|
76 | + } |
|
77 | + |
|
78 | + return $version_date; |
|
79 | + } |
|
80 | + |
|
81 | + /** |
|
82 | + * @param $package_name |
|
83 | + */ |
|
84 | + public function save($package_name) |
|
85 | + { |
|
86 | + $version = $this->em->getRepository(\PiouPiou\RibsAdminBundle\Entity\Version::class)->findOneBy(["package_name" => $package_name]); |
|
87 | + |
|
88 | + if (!$version) { |
|
89 | + $version = new \PiouPiou\RibsAdminBundle\Entity\Version(); |
|
90 | + $version->setProjectName($package_name); |
|
91 | + $version->setPackageName($package_name); |
|
92 | + $version->setProjectUrl($package_name); |
|
93 | + $version->setCheckVersionUrl($package_name); |
|
94 | + } |
|
95 | + |
|
96 | + $version->setVersion($this->getVersion($package_name)); |
|
97 | + $version->setVersionDate($this->getVersionDate($package_name)); |
|
98 | + $version->setLastCheck(new \DateTime()); |
|
99 | + |
|
100 | + $this->em->persist($version); |
|
101 | + $this->em->flush(); |
|
102 | + } |
|
103 | 103 | } |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | */ |
44 | 44 | private $module; |
45 | 45 | |
46 | - /** |
|
47 | - * @var Api |
|
48 | - */ |
|
49 | - private $api; |
|
46 | + /** |
|
47 | + * @var Api |
|
48 | + */ |
|
49 | + private $api; |
|
50 | 50 | |
51 | 51 | /** |
52 | 52 | * @var User |
@@ -56,17 +56,17 @@ discard block |
||
56 | 56 | /** @var TokenStorageInterface */ |
57 | 57 | private $token_storage; |
58 | 58 | |
59 | - /** |
|
60 | - * AccessRights constructor. |
|
61 | - * @param ContainerInterface $container |
|
62 | - * @param RouterInterface $router |
|
63 | - * @param SessionInterface $session |
|
64 | - * @param RequestStack $request |
|
65 | - * @param TokenStorageInterface $tokenStorage |
|
66 | - * @param Globals $globals |
|
67 | - * @param ModuleService $module |
|
68 | - * @param Api $api |
|
69 | - */ |
|
59 | + /** |
|
60 | + * AccessRights constructor. |
|
61 | + * @param ContainerInterface $container |
|
62 | + * @param RouterInterface $router |
|
63 | + * @param SessionInterface $session |
|
64 | + * @param RequestStack $request |
|
65 | + * @param TokenStorageInterface $tokenStorage |
|
66 | + * @param Globals $globals |
|
67 | + * @param ModuleService $module |
|
68 | + * @param Api $api |
|
69 | + */ |
|
70 | 70 | public function __construct(ContainerInterface $container, RouterInterface $router, SessionInterface $session, RequestStack $request, TokenStorageInterface $tokenStorage, Globals $globals, ModuleService $module, Api $api) |
71 | 71 | { |
72 | 72 | $this->container = $container; |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | $this->api = $api; |
79 | 79 | $this->token_storage = $tokenStorage; |
80 | 80 | if ($this->token_storage->getToken() && is_object($this->token_storage->getToken()->getUser()) && $this->token_storage->getToken()->getUser()->getUser()) { |
81 | - $this->user = $this->token_storage->getToken()->getUser()->getUser(); |
|
82 | - } |
|
81 | + $this->user = $this->token_storage->getToken()->getUser()->getUser(); |
|
82 | + } |
|
83 | 83 | } |
84 | 84 | |
85 | 85 | public function onKernelController() |
@@ -107,8 +107,8 @@ discard block |
||
107 | 107 | $this->user = $this->token_storage->getToken()->getUser()->getUser(); |
108 | 108 | |
109 | 109 | if ($this->testIsOpenUrl($route)) { |
110 | - return; |
|
111 | - } |
|
110 | + return; |
|
111 | + } |
|
112 | 112 | |
113 | 113 | $route_right = $this->in_array_recursive($route, $ribs_admin_rights); |
114 | 114 | |
@@ -124,25 +124,25 @@ discard block |
||
124 | 124 | |
125 | 125 | throw new AccessDeniedException("No access"); |
126 | 126 | } else if ($api && strpos($route, "login") === false && strpos($route, "register") === false) { |
127 | - if ($this->api->userIslogged($this->request->getCurrentRequest()->get("infos"), $this->request->getCurrentRequest()->get("token")) === false) { |
|
128 | - throw new AccessDeniedException("User is not connected"); |
|
129 | - } |
|
130 | - } |
|
127 | + if ($this->api->userIslogged($this->request->getCurrentRequest()->get("infos"), $this->request->getCurrentRequest()->get("token")) === false) { |
|
128 | + throw new AccessDeniedException("User is not connected"); |
|
129 | + } |
|
130 | + } |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | private function testIsOpenUrl($route) |
134 | - { |
|
135 | - $open_urls = json_decode(file_get_contents($this->globals->getBaseBundlePath() . "/Resources/json/ribsadmin_open_url.json"), true); |
|
134 | + { |
|
135 | + $open_urls = json_decode(file_get_contents($this->globals->getBaseBundlePath() . "/Resources/json/ribsadmin_open_url.json"), true); |
|
136 | 136 | |
137 | - if ($open_urls && $open_urls["items"] && in_array($route, $open_urls["items"])) { |
|
138 | - return true; |
|
139 | - } |
|
137 | + if ($open_urls && $open_urls["items"] && in_array($route, $open_urls["items"])) { |
|
138 | + return true; |
|
139 | + } |
|
140 | 140 | |
141 | - return false; |
|
142 | - } |
|
141 | + return false; |
|
142 | + } |
|
143 | 143 | |
144 | 144 | /** |
145 | - * function that allow to test a right directly in the view |
|
145 | + * function that allow to test a right directly in the view |
|
146 | 146 | * @param string $right |
147 | 147 | * @return bool |
148 | 148 | */ |
@@ -153,9 +153,9 @@ discard block |
||
153 | 153 | |
154 | 154 | $all_rights = array_merge($user_rights, $list_rights); |
155 | 155 | |
156 | - if (in_array("*", $all_rights)) { |
|
157 | - return true; |
|
158 | - } |
|
156 | + if (in_array("*", $all_rights)) { |
|
157 | + return true; |
|
158 | + } |
|
159 | 159 | |
160 | 160 | if (in_array($right, $all_rights)) { |
161 | 161 | return true; |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | } |
166 | 166 | |
167 | 167 | /** |
168 | - * test if route_right is found in users rights |
|
168 | + * test if route_right is found in users rights |
|
169 | 169 | * @param array $route_right |
170 | 170 | * @return bool |
171 | 171 | */ |
@@ -177,8 +177,8 @@ discard block |
||
177 | 177 | $all_rights = array_merge($user_rights, $list_rights); |
178 | 178 | |
179 | 179 | if (in_array("*", $all_rights)) { |
180 | - return true; |
|
181 | - } |
|
180 | + return true; |
|
181 | + } |
|
182 | 182 | |
183 | 183 | foreach ($all_rights as $right) { |
184 | 184 | if (in_array($right, $route_right)) { |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | } |
191 | 191 | |
192 | 192 | /** |
193 | - * function that search if the right contain an url or more |
|
193 | + * function that search if the right contain an url or more |
|
194 | 194 | * @param $needle |
195 | 195 | * @param $haystack |
196 | 196 | * @return bool|mixed |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | } |
215 | 215 | |
216 | 216 | /** |
217 | - * function that retun a array that contain all user rights or empty array if no right found |
|
217 | + * function that retun a array that contain all user rights or empty array if no right found |
|
218 | 218 | * @return array |
219 | 219 | */ |
220 | 220 | private function getUserRights(): array |
@@ -229,7 +229,7 @@ discard block |
||
229 | 229 | } |
230 | 230 | |
231 | 231 | /** |
232 | - * function that retun a array that contain all rights of rattached list right of the current user |
|
232 | + * function that retun a array that contain all rights of rattached list right of the current user |
|
233 | 233 | * @return array |
234 | 234 | */ |
235 | 235 | private function getRightsListOfUser(): array |
@@ -14,115 +14,115 @@ |
||
14 | 14 | |
15 | 15 | class VersionController extends AbstractController |
16 | 16 | { |
17 | - /** |
|
18 | - * @Route("/versions/", name="ribsadmin_versions") |
|
19 | - * @param EntityManagerInterface $em |
|
20 | - * @return Response |
|
21 | - */ |
|
22 | - public function index(EntityManagerInterface $em): Response |
|
23 | - { |
|
24 | - $versions = $em->getRepository(Version::class)->findAll(); |
|
17 | + /** |
|
18 | + * @Route("/versions/", name="ribsadmin_versions") |
|
19 | + * @param EntityManagerInterface $em |
|
20 | + * @return Response |
|
21 | + */ |
|
22 | + public function index(EntityManagerInterface $em): Response |
|
23 | + { |
|
24 | + $versions = $em->getRepository(Version::class)->findAll(); |
|
25 | 25 | |
26 | - return $this->render("@RibsAdmin/versions/list.html.twig", ["verions" => $versions]); |
|
27 | - } |
|
28 | - |
|
29 | - /** |
|
30 | - * @Route("/versions/create/", name="ribsadmin_versions_create") |
|
31 | - * @Route("/versions/show/{guid}", name="ribsadmin_versions_show") |
|
32 | - * @Route("/versions/edit/{guid}", name="ribsadmin_versions_edit") |
|
33 | - * @param Request $request |
|
34 | - * @param EntityManagerInterface $em |
|
35 | - * @param string|null $guid |
|
36 | - * @return Response |
|
37 | - */ |
|
38 | - public function edit(Request $request, EntityManagerInterface $em, string $guid = null): Response |
|
39 | - { |
|
40 | - if (!$guid) { |
|
41 | - $version = new Version(); |
|
42 | - $text = "created"; |
|
43 | - } else { |
|
44 | - $version = $em->getRepository(Version::class)->findOneBy(["guid" => $guid]); |
|
45 | - $text = "edited"; |
|
46 | - } |
|
47 | - |
|
48 | - $form = $this->createForm(\PiouPiou\RibsAdminBundle\Form\Version::class, $version); |
|
49 | - $form->handleRequest($request); |
|
50 | - |
|
51 | - if ($form->isSubmitted() && $form->isValid()) { |
|
52 | - /** @var Version $data */ |
|
53 | - $data = $form->getData(); |
|
54 | - $em->persist($data); |
|
55 | - $em->flush(); |
|
56 | - $this->addFlash("success-flash", "Version " . $data->getProjectName() . " was " . $text); |
|
57 | - |
|
58 | - return $this->redirectToRoute("ribsadmin_versions"); |
|
59 | - } |
|
60 | - |
|
61 | - return $this->render("@RibsAdmin/versions/edit.html.twig", [ |
|
62 | - "form" => $form->createView(), |
|
63 | - "form_errors" => $form->getErrors(), |
|
64 | - "version" => $version |
|
65 | - ]); |
|
66 | - } |
|
67 | - |
|
68 | - /** |
|
69 | - * @Route("/versions/delete/{guid}", name="ribsadmin_versions_delete") |
|
70 | - * @param EntityManagerInterface $em |
|
71 | - * @param string $guid |
|
72 | - * @return RedirectResponse |
|
73 | - */ |
|
74 | - public function delete(EntityManagerInterface $em, string $guid): RedirectResponse |
|
75 | - { |
|
76 | - $version = $em->getRepository(Version::class)->findOneBy(["guid" => $guid]); |
|
77 | - |
|
78 | - if ($version) { |
|
79 | - $em->remove($version); |
|
80 | - $em->flush(); |
|
81 | - $this->addFlash("success-flash", "The project version was deleted"); |
|
82 | - } else { |
|
83 | - $this->addFlash("error-flash", "The project version was not found"); |
|
84 | - } |
|
85 | - |
|
86 | - return $this->redirectToRoute("ribsadmin_versions"); |
|
87 | - } |
|
88 | - |
|
89 | - /** |
|
90 | - * @Route("/versions/update/{guid}", name="ribsadmin_versions_update") |
|
91 | - * @param EntityManagerInterface $em |
|
92 | - * @param \PiouPiou\RibsAdminBundle\Service\Version $version |
|
93 | - * @param string $guid |
|
94 | - * @return RedirectResponse |
|
95 | - */ |
|
96 | - public function updateVersion(EntityManagerInterface $em, \PiouPiou\RibsAdminBundle\Service\Version $version, string $guid): RedirectResponse |
|
97 | - { |
|
98 | - $version_entity = $em->getRepository(Version::class)->findOneBy(["guid" => $guid]); |
|
99 | - |
|
100 | - if ($version_entity) { |
|
101 | - $version_entity->setVersion($version->getVersion($version_entity->getPackageName())); |
|
102 | - $version_entity->setVersionDate($version->getVersionDate($version_entity->getPackageName())); |
|
103 | - $version_entity->setLastCheck(new \DateTime()); |
|
104 | - $em->persist($version_entity); |
|
105 | - $em->flush(); |
|
106 | - |
|
107 | - $this->addFlash("success-flash", "The project version was updated"); |
|
108 | - } else { |
|
109 | - $this->addFlash("error-flash", "The project version was not found"); |
|
110 | - } |
|
111 | - |
|
112 | - return $this->redirectToRoute("ribsadmin_versions"); |
|
113 | - } |
|
114 | - |
|
115 | - /** |
|
116 | - * @Route("/versions/send-version/{package_name}", name="ribsadmin_versions_send", requirements={"package_name"=".+"}) |
|
117 | - * @param \PiouPiou\RibsAdminBundle\Service\Version $version |
|
118 | - * @param string $package_name |
|
119 | - * @return mixed|null |
|
120 | - */ |
|
121 | - public function sendPackageInformations(\PiouPiou\RibsAdminBundle\Service\Version $version, string $package_name): JsonResponse |
|
122 | - { |
|
123 | - return new JsonResponse([ |
|
124 | - "version" => $version->getVersion($package_name), |
|
125 | - "version_date" => $version->getVersionDate($package_name) |
|
126 | - ]); |
|
127 | - } |
|
26 | + return $this->render("@RibsAdmin/versions/list.html.twig", ["verions" => $versions]); |
|
27 | + } |
|
28 | + |
|
29 | + /** |
|
30 | + * @Route("/versions/create/", name="ribsadmin_versions_create") |
|
31 | + * @Route("/versions/show/{guid}", name="ribsadmin_versions_show") |
|
32 | + * @Route("/versions/edit/{guid}", name="ribsadmin_versions_edit") |
|
33 | + * @param Request $request |
|
34 | + * @param EntityManagerInterface $em |
|
35 | + * @param string|null $guid |
|
36 | + * @return Response |
|
37 | + */ |
|
38 | + public function edit(Request $request, EntityManagerInterface $em, string $guid = null): Response |
|
39 | + { |
|
40 | + if (!$guid) { |
|
41 | + $version = new Version(); |
|
42 | + $text = "created"; |
|
43 | + } else { |
|
44 | + $version = $em->getRepository(Version::class)->findOneBy(["guid" => $guid]); |
|
45 | + $text = "edited"; |
|
46 | + } |
|
47 | + |
|
48 | + $form = $this->createForm(\PiouPiou\RibsAdminBundle\Form\Version::class, $version); |
|
49 | + $form->handleRequest($request); |
|
50 | + |
|
51 | + if ($form->isSubmitted() && $form->isValid()) { |
|
52 | + /** @var Version $data */ |
|
53 | + $data = $form->getData(); |
|
54 | + $em->persist($data); |
|
55 | + $em->flush(); |
|
56 | + $this->addFlash("success-flash", "Version " . $data->getProjectName() . " was " . $text); |
|
57 | + |
|
58 | + return $this->redirectToRoute("ribsadmin_versions"); |
|
59 | + } |
|
60 | + |
|
61 | + return $this->render("@RibsAdmin/versions/edit.html.twig", [ |
|
62 | + "form" => $form->createView(), |
|
63 | + "form_errors" => $form->getErrors(), |
|
64 | + "version" => $version |
|
65 | + ]); |
|
66 | + } |
|
67 | + |
|
68 | + /** |
|
69 | + * @Route("/versions/delete/{guid}", name="ribsadmin_versions_delete") |
|
70 | + * @param EntityManagerInterface $em |
|
71 | + * @param string $guid |
|
72 | + * @return RedirectResponse |
|
73 | + */ |
|
74 | + public function delete(EntityManagerInterface $em, string $guid): RedirectResponse |
|
75 | + { |
|
76 | + $version = $em->getRepository(Version::class)->findOneBy(["guid" => $guid]); |
|
77 | + |
|
78 | + if ($version) { |
|
79 | + $em->remove($version); |
|
80 | + $em->flush(); |
|
81 | + $this->addFlash("success-flash", "The project version was deleted"); |
|
82 | + } else { |
|
83 | + $this->addFlash("error-flash", "The project version was not found"); |
|
84 | + } |
|
85 | + |
|
86 | + return $this->redirectToRoute("ribsadmin_versions"); |
|
87 | + } |
|
88 | + |
|
89 | + /** |
|
90 | + * @Route("/versions/update/{guid}", name="ribsadmin_versions_update") |
|
91 | + * @param EntityManagerInterface $em |
|
92 | + * @param \PiouPiou\RibsAdminBundle\Service\Version $version |
|
93 | + * @param string $guid |
|
94 | + * @return RedirectResponse |
|
95 | + */ |
|
96 | + public function updateVersion(EntityManagerInterface $em, \PiouPiou\RibsAdminBundle\Service\Version $version, string $guid): RedirectResponse |
|
97 | + { |
|
98 | + $version_entity = $em->getRepository(Version::class)->findOneBy(["guid" => $guid]); |
|
99 | + |
|
100 | + if ($version_entity) { |
|
101 | + $version_entity->setVersion($version->getVersion($version_entity->getPackageName())); |
|
102 | + $version_entity->setVersionDate($version->getVersionDate($version_entity->getPackageName())); |
|
103 | + $version_entity->setLastCheck(new \DateTime()); |
|
104 | + $em->persist($version_entity); |
|
105 | + $em->flush(); |
|
106 | + |
|
107 | + $this->addFlash("success-flash", "The project version was updated"); |
|
108 | + } else { |
|
109 | + $this->addFlash("error-flash", "The project version was not found"); |
|
110 | + } |
|
111 | + |
|
112 | + return $this->redirectToRoute("ribsadmin_versions"); |
|
113 | + } |
|
114 | + |
|
115 | + /** |
|
116 | + * @Route("/versions/send-version/{package_name}", name="ribsadmin_versions_send", requirements={"package_name"=".+"}) |
|
117 | + * @param \PiouPiou\RibsAdminBundle\Service\Version $version |
|
118 | + * @param string $package_name |
|
119 | + * @return mixed|null |
|
120 | + */ |
|
121 | + public function sendPackageInformations(\PiouPiou\RibsAdminBundle\Service\Version $version, string $package_name): JsonResponse |
|
122 | + { |
|
123 | + return new JsonResponse([ |
|
124 | + "version" => $version->getVersion($package_name), |
|
125 | + "version_date" => $version->getVersionDate($package_name) |
|
126 | + ]); |
|
127 | + } |
|
128 | 128 | } |