Completed
Push — feature/fixing_cost ( 99877f...28fa1e )
by Laurent
02:45
created
Infrastructure/Common/Routes/RouteManager.php 1 patch
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -38,8 +38,8 @@  discard block
 block discarded – undo
38 38
      *
39 39
      * @throws \Exception
40 40
      */
41
-    public function add(Route $route){
42
-        if(isset($this->routes[$route->getName()])){
41
+    public function add(Route $route) {
42
+        if (isset($this->routes[$route->getName()])) {
43 43
             throw new \Exception('Route exists');
44 44
         }
45 45
 
@@ -51,8 +51,8 @@  discard block
 block discarded – undo
51 51
      *
52 52
      * @throws \Exception
53 53
      */
54
-    public function load(array $routes){
55
-        foreach($routes as $currentRoute){
54
+    public function load(array $routes) {
55
+        foreach ($routes as $currentRoute) {
56 56
             $this->add($currentRoute);
57 57
         }
58 58
     }
@@ -62,7 +62,7 @@  discard block
 block discarded – undo
62 62
      */
63 63
     public function loadGuards($routesGuards)
64 64
     {
65
-        foreach($routesGuards as $guard){
65
+        foreach ($routesGuards as $guard) {
66 66
             $this->guards[$guard->getRouteName()] = $guard;
67 67
         }
68 68
     }
@@ -73,8 +73,8 @@  discard block
 block discarded – undo
73 73
      * @param $routeName
74 74
      * @return bool
75 75
      */
76
-    public function isAuthorized(User $user, $routeName){
77
-        if(!isset($this->guards[$routeName])){
76
+    public function isAuthorized(User $user, $routeName) {
77
+        if (!isset($this->guards[$routeName])) {
78 78
             return true;
79 79
         }
80 80
 
@@ -92,11 +92,11 @@  discard block
 block discarded – undo
92 92
      */
93 93
     public function __invoke($name, User $user)
94 94
     {
95
-        if(!isset($this->routes[$name])){
95
+        if (!isset($this->routes[$name])) {
96 96
             throw new \Exception('Route not found');
97 97
         }
98 98
 
99
-        if(!$this->isAuthorized($user, $name)){
99
+        if (!$this->isAuthorized($user, $name)) {
100 100
             throw new \Exception('Action not allowed');
101 101
         }
102 102
 
Please login to merge, or discard this patch.
class/actions_flightlog.class.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -58,8 +58,8 @@  discard block
 block discarded – undo
58 58
      *
59 59
      * @return int
60 60
      */
61
-    public function showLinkedObjectBlock(array $params = [], $object){
62
-        if(!isset($object->linkedObjectsIds) || !isset($object->linkedObjectsIds['flightlog_damage'])){
61
+    public function showLinkedObjectBlock(array $params = [], $object) {
62
+        if (!isset($object->linkedObjectsIds) || !isset($object->linkedObjectsIds['flightlog_damage'])) {
63 63
             return 0;
64 64
         }
65 65
 
@@ -69,7 +69,7 @@  discard block
 block discarded – undo
69 69
         dol_include_once('/flightlog/flightlog.inc.php');
70 70
         $queryRepository = new \FlightLog\Infrastructure\Damage\Query\Repository\GetDamageQueryRepository($db);
71 71
 
72
-        foreach($object->linkedObjectsIds['flightlog_damage'] as $damageId){
72
+        foreach ($object->linkedObjectsIds['flightlog_damage'] as $damageId) {
73 73
             try {
74 74
                 $object->linkedObjects['flightlog_damage'][$damageId] = $queryRepository->query($damageId);
75 75
             } catch (Exception $e) {
@@ -99,7 +99,7 @@  discard block
 block discarded – undo
99 99
         return $sql;
100 100
     }
101 101
 
102
-    public function completeListOfReferent(){
102
+    public function completeListOfReferent() {
103 103
         dol_include_once('/flightlog/class/bbcvols.class.php');
104 104
 
105 105
         $this->results['flightlog'] = [
Please login to merge, or discard this patch.
damage/tpl/linkedobjectblock.tpl.php 1 patch
Spacing   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -47,7 +47,7 @@
 block discarded – undo
47 47
 ?>
48 48
     <tr <?php echo $GLOBALS['bc'][$var]; ?> >
49 49
         <td><?php echo $langs->trans("Dégâts"); ?></td>
50
-        <td><a href="<?php echo sprintf(DOL_URL_ROOT.'/flightlog/index.php?id=%s&r=%s', $damage->getId(), 'get_one_damage');?>"><?php echo $damage->getId()?></a></td>
50
+        <td><a href="<?php echo sprintf(DOL_URL_ROOT . '/flightlog/index.php?id=%s&r=%s', $damage->getId(), 'get_one_damage'); ?>"><?php echo $damage->getId()?></a></td>
51 51
         <td align="center"><?php echo $damage->getAuthorName(); ?></td>
52 52
         <td align="center"></td>
53 53
         <td align="right"><?echo price($damage->getAmount()) ?>€</td>
Please login to merge, or discard this patch.