GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

PlayerBonusManager::addFactionBonus()   F
last analyzed

Complexity

Conditions 14
Paths 8192

Size

Total Lines 63
Code Lines 36

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 14
eloc 36
nc 8192
nop 1
dl 0
loc 63
rs 2.8462
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
3
namespace Asylamba\Modules\Zeus\Manager;
4
5
use Asylamba\Classes\Exception\ErrorException;
6
7
use Asylamba\Classes\Container\StackList;
8
9
use Asylamba\Modules\Zeus\Model\Player;
10
use Asylamba\Modules\Zeus\Model\PlayerBonus;
11
use Asylamba\Modules\Promethee\Model\Technology;
12
use Asylamba\Modules\Demeter\Model\Law\Law;
13
use Asylamba\Modules\Demeter\Resource\LawResources;
14
15
use Asylamba\Modules\Demeter\Manager\Law\LawManager;
16
use Asylamba\Modules\Demeter\Manager\ColorManager;
17
use Asylamba\Modules\Promethee\Manager\TechnologyManager;
18
use Asylamba\Modules\Promethee\Helper\TechnologyHelper;
19
use Asylamba\Classes\Library\Session\SessionWrapper;
20
21
use Asylamba\Modules\Demeter\Resource\ColorResource;
22
23
class PlayerBonusManager
24
{
25
	/** @var LawManager **/
26
	protected $lawManager;
27
	/** @var ColorManager **/
28
	protected $colorManager;
29
	/** @var TechnologyManager **/
30
	protected $technologyManager;
31
	/** @var TechnologyHelper **/
32
	protected $technologyHelper;
33
	/** @var SessionWrapper **/
34
	protected $sessionWrapper;
35
	
36
	/**
37
	 * @param LawManager $lawManager
38
	 * @param ColorManager $colorManager
39
	 * @param TechnologyManager $technologyManager
40
	 * @param TechnologyHelper $technologyHelper
41
	 * @param SessionWrapper $session
42
	 */
43
	public function __construct(
44
		LawManager $lawManager,
45
		ColorManager $colorManager,
46
		TechnologyManager $technologyManager,
47
		TechnologyHelper $technologyHelper,
48
		SessionWrapper $session
49
	)
50
	{
0 ignored issues
show
Coding Style introduced by
The closing parenthesis and the opening brace of a multi-line function declaration must be on the same line
Loading history...
51
		$this->lawManager = $lawManager;
52
		$this->colorManager = $colorManager;
53
		$this->technologyManager = $technologyManager;
54
		$this->technologyHelper = $technologyHelper;
55
		$this->sessionWrapper = $session;
56
	}
57
	
58
	/**
59
	 * @param Player $player
60
	 * @return PlayerBonus
61
	 */
62
	public function getBonusByPlayer(Player $player)
63
	{
64
		$playerBonus = new PlayerBonus();
65
		$playerBonus->rPlayer = $player->id;
66
		$playerBonus->synchronized = $player->isSynchronized();
67
		$playerBonus->playerColor = $player->rColor;
68
		$playerBonus->bonus = new StackList();
69
		return $playerBonus;
70
	}
71
72
	public function initialize(PlayerBonus $playerBonus) {
73
		# remplissage des bonus avec les technologies
74
		$playerBonus->technology = $this->technologyManager->getPlayerTechnology($playerBonus->rPlayer);
75
		
76
		$this->fillFromTechnology($playerBonus);
77
		$this->addFactionBonus($playerBonus);
78
		$this->addLawBonus($playerBonus);
79
80
		if ($playerBonus->synchronized) {
81
			for ($i = 0; $i < PlayerBonus::BONUS_QUANTITY; $i++) { 
82
				$this->sessionWrapper->get('playerBonus')->add($i, ($playerBonus->bonus->exist($i)) ? $playerBonus->bonus->get($i) : 0);
83
			}
84
		}
85
	}
86
87
	public function load(PlayerBonus $playerBonus) {
88
		$playerBonus->technology = new Technology($playerBonus->rPlayer);
0 ignored issues
show
Unused Code introduced by
The call to Technology::__construct() has too many arguments starting with $playerBonus->rPlayer.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
89
		if ($playerBonus->synchronized) {
90
			// chargement de l'objet avec le contrôleur
91
			for ($i = 0; $i < PlayerBonus::BONUS_QUANTITY; $i++) { 
92
				$playerBonus->bonus->add($i, $this->sessionWrapper->get('playerBonus')->get($i));
93
			}
94
		} else {				
95
			// remplissage de l'objet normalement
96
			// remplissage avec les technologies
97
			$this->fillFromTechnology($playerBonus);
98
			$this->addFactionBonus($playerBonus);
99
			$this->addLawBonus($playerBonus);
100
101
			# remplissage avec les cartes
102
			// ...
103
		}
104
	}
105
	
106
	private function fillFromTechnology(PlayerBonus $playerBonus) {
107
		$this->addTechnoToBonus($playerBonus, Technology::GENERATOR_SPEED, PlayerBonus::GENERATOR_SPEED);
108
		$this->addTechnoToBonus($playerBonus, Technology::REFINERY_REFINING, PlayerBonus::REFINERY_REFINING);
109
		$this->addTechnoToBonus($playerBonus, Technology::REFINERY_STORAGE, PlayerBonus::REFINERY_STORAGE);
110
		$this->addTechnoToBonus($playerBonus, Technology::DOCK1_SPEED, PlayerBonus::DOCK1_SPEED);
111
		$this->addTechnoToBonus($playerBonus, Technology::DOCK2_SPEED, PlayerBonus::DOCK2_SPEED);
112
		$this->addTechnoToBonus($playerBonus, Technology::TECHNOSPHERE_SPEED, PlayerBonus::TECHNOSPHERE_SPEED);
113
		$this->addTechnoToBonus($playerBonus, Technology::COMMERCIAL_INCOME, PlayerBonus::COMMERCIAL_INCOME);
114
		$this->addTechnoToBonus($playerBonus, Technology::GRAVIT_MODULE, PlayerBonus::GRAVIT_MODULE);
115
		$this->addTechnoToBonus($playerBonus, Technology::DOCK3_SPEED, PlayerBonus::DOCK3_SPEED);
116
		$this->addTechnoToBonus($playerBonus, Technology::POPULATION_TAX, PlayerBonus::POPULATION_TAX);
117
		$this->addTechnoToBonus($playerBonus, Technology::COMMANDER_INVEST, PlayerBonus::COMMANDER_INVEST);
118
		$this->addTechnoToBonus($playerBonus, Technology::UNI_INVEST, PlayerBonus::UNI_INVEST);
119
		$this->addTechnoToBonus($playerBonus, Technology::ANTISPY_INVEST, PlayerBonus::ANTISPY_INVEST);
120
		$this->addTechnoToBonus($playerBonus, Technology::SPACESHIPS_SPEED, PlayerBonus::SHIP_SPEED);
121
		$this->addTechnoToBonus($playerBonus, Technology::SPACESHIPS_CONTAINER, PlayerBonus::SHIP_CONTAINER);
122
		$this->addTechnoToBonus($playerBonus, Technology::BASE_QUANTITY, PlayerBonus::BASE_QUANTITY);
123
		$this->addTechnoToBonus($playerBonus, Technology::FIGHTER_SPEED, PlayerBonus::FIGHTER_SPEED);
124
		$this->addTechnoToBonus($playerBonus, Technology::FIGHTER_ATTACK, PlayerBonus::FIGHTER_ATTACK);
125
		$this->addTechnoToBonus($playerBonus, Technology::FIGHTER_DEFENSE, PlayerBonus::FIGHTER_DEFENSE);
126
		$this->addTechnoToBonus($playerBonus, Technology::CORVETTE_SPEED, PlayerBonus::CORVETTE_SPEED);
127
		$this->addTechnoToBonus($playerBonus, Technology::CORVETTE_ATTACK, PlayerBonus::CORVETTE_ATTACK);
128
		$this->addTechnoToBonus($playerBonus, Technology::CORVETTE_DEFENSE, PlayerBonus::CORVETTE_DEFENSE);
129
		$this->addTechnoToBonus($playerBonus, Technology::FRIGATE_SPEED, PlayerBonus::FRIGATE_SPEED);
130
		$this->addTechnoToBonus($playerBonus, Technology::FRIGATE_ATTACK, PlayerBonus::FRIGATE_ATTACK);
131
		$this->addTechnoToBonus($playerBonus, Technology::FRIGATE_DEFENSE, PlayerBonus::FRIGATE_DEFENSE);
132
		$this->addTechnoToBonus($playerBonus, Technology::DESTROYER_SPEED, PlayerBonus::DESTROYER_SPEED);
133
		$this->addTechnoToBonus($playerBonus, Technology::DESTROYER_ATTACK, PlayerBonus::DESTROYER_ATTACK);
134
		$this->addTechnoToBonus($playerBonus, Technology::DESTROYER_DEFENSE, PlayerBonus::DESTROYER_DEFENSE);
135
	}
136
137
	private function addTechnoToBonus(PlayerBonus $playerBonus, $techno, $bonus) {
138
		$totalBonus = 0;
139
		for ($i = 0; $i <= $playerBonus->technology->getTechnology($techno); $i++) { 
140
			$totalBonus += $this->technologyHelper->getImprovementPercentage($techno, $i);
141
		}
142
		$playerBonus->bonus->add($bonus, $totalBonus);
143
	}
144
145
	private function addLawBonus(PlayerBonus $playerBonus) {
146
		$laws = $this->lawManager->getByFactionAndStatements($playerBonus->playerColor, [Law::EFFECTIVE]);
147
		foreach ($laws as $law) {
148
			switch ($law->type) {
149
				case 5:
150
					$playerBonus->bonus->increase(PlayerBonus::DOCK1_SPEED, LawResources::getInfo($law->type, 'bonus'));
151
					$playerBonus->bonus->increase(PlayerBonus::DOCK2_SPEED, LawResources::getInfo($law->type, 'bonus'));
152
					$playerBonus->bonus->increase(PlayerBonus::REFINERY_REFINING, -10);
153
					$playerBonus->bonus->increase(PlayerBonus::REFINERY_REFINING, -10);
154
					break;
155
				case 6:
156
					#subvention technologique
157
					$playerBonus->bonus->increase(PlayerBonus::TECHNOSPHERE_SPEED, LawResources::getInfo($law->type, 'bonus'));
158
					break;	
159
				default:
160
					break;
161
			}
162
		}
163
	}
164
	
165
	private function addFactionBonus(PlayerBonus $playerBonus) {
166
		$color = $this->colorManager->get($playerBonus->playerColor);
167
168
		if (in_array(ColorResource::DEFENSELITTLESHIPBONUS, $color->bonus)) {
169
			$playerBonus->bonus->increase(PlayerBonus::FIGHTER_DEFENSE, 5);
170
			$playerBonus->bonus->increase(PlayerBonus::CORVETTE_DEFENSE, 5);
171
			$playerBonus->bonus->increase(PlayerBonus::FRIGATE_DEFENSE, 5);
172
			$playerBonus->bonus->increase(PlayerBonus::DESTROYER_DEFENSE, 5);
173
		}
174
		
175
		if (in_array(ColorResource::SPEEDLITTLESHIPBONUS, $color->bonus)) {
176
			$playerBonus->bonus->increase(PlayerBonus::FIGHTER_SPEED, 10);
177
			$playerBonus->bonus->increase(PlayerBonus::CORVETTE_SPEED, 10);
178
		}
179
180
		if (in_array(ColorResource::DEFENSELITTLESHIPMALUS, $color->bonus)) {
181
			$playerBonus->bonus->increase(PlayerBonus::FRIGATE_DEFENSE, -5);
182
			$playerBonus->bonus->increase(PlayerBonus::DESTROYER_DEFENSE, -5);
183
		}
184
		
185
		if (in_array(ColorResource::COMMERCIALROUTEBONUS, $color->bonus)) {
186
			$playerBonus->bonus->increase(PlayerBonus::COMMERCIAL_INCOME, 5);
187
		}
188
		
189
		if (in_array(ColorResource::TAXBONUS, $color->bonus)) {
190
			$playerBonus->bonus->increase(PlayerBonus::POPULATION_TAX, 3);
191
		}		
192
193
		if (in_array(ColorResource::LOOTRESOURCESMALUS, $color->bonus)) {
194
			$playerBonus->bonus->increase(PlayerBonus::SHIP_CONTAINER, -5);
195
		}
196
		
197
		if (in_array(ColorResource::RAFINERYBONUS, $color->bonus)) {	
198
			$playerBonus->bonus->increase(PlayerBonus::REFINERY_REFINING, 4);
199
		}
200
201
		if (in_array(ColorResource::STORAGEBONUS, $color->bonus)) {	
202
			$playerBonus->bonus->increase(PlayerBonus::REFINERY_STORAGE, 4);
203
		}
204
		
205
		if (in_array(ColorResource::BIGACADEMICBONUS, $color->bonus)) {
206
			$playerBonus->bonus->increase(PlayerBonus::UNI_INVEST, 4);
207
		}
208
		
209
		if (in_array(ColorResource::COMMANDERSCHOOLBONUS, $color->bonus)) {
210
			$playerBonus->bonus->increase(PlayerBonus::COMMANDER_INVEST, 6);
211
		}
212
213
		if (in_array(ColorResource::LITTLEACADEMICBONUS, $color->bonus)) {
214
			$playerBonus->bonus->increase(PlayerBonus::UNI_INVEST, 2);
215
		}
216
217
		if (in_array(ColorResource::TECHNOLOGYBONUS, $color->bonus)) {
218
			$playerBonus->bonus->increase(PlayerBonus::TECHNOSPHERE_SPEED, 2);
219
		}
220
221
		if (in_array(ColorResource::DEFENSELITTLESHIPBONUS, $color->bonus)) {
222
			$playerBonus->bonus->increase(PlayerBonus::FIGHTER_DEFENSE, 5);
223
			$playerBonus->bonus->increase(PlayerBonus::CORVETTE_DEFENSE, 5);
224
			$playerBonus->bonus->increase(PlayerBonus::FRIGATE_DEFENSE, 5);
225
			$playerBonus->bonus->increase(PlayerBonus::DESTROYER_DEFENSE, 5);		
226
		}
227
	}
228
229
	public function increment(PlayerBonus $playerBonus, $bonusId, $increment) {
230
		if ($bonusId >= 0 && $bonusId < PlayerBonus::BONUS_QUANTITY) {
231
			if ($increment > 0) {
232
				$playerBonus->bonus->add($bonusId, $playerBonus->bonus->get($bonusId) + $increment);
233
				if ($playerBonus->synchronized) {
234
					$this->sessionWrapper->get('playerBonus')->add($bonusId, $playerBonus->bonus->get($bonusId));
235
				}
236
			} else {
237
				throw new ErrorException('incrémentation de bonus impossible - l\'incrément doit être positif');
238
			}
239
		} else {
240
			throw new ErrorException('incrémentation de bonus impossible - bonus invalide');
241
		}
242
	}
243
244
	public function decrement(PlayerBonus $playerBonus, $bonusId, $decrement) {
245
		if ($bonusId >= 0 && $bonusId < PlayerBonus::BONUS_QUANTITY) {
246
			if ($increment > 0) {
247
				if ($increment <= $playerBonus->bonus->get($bonusId)) {
0 ignored issues
show
Bug introduced by
The variable $increment does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
248
					$playerBonus->bonus->add($bonusId, $playerBonus->bonus->get($bonusId) - $decrement);
249
					if ($playerBonus->synchronized) {
250
						$this->sessionWrapper->get('playerBonus')->add($bonusId, $playerBonus->bonus->get($bonusId));
251
					}
252
				} else {
253
					throw new ErrorException('décrémentation de bonus impossible - le décrément est plus grand que le bonus');
254
				}
255
			} else {
256
				throw new ErrorException('décrémentation de bonus impossible - le décrément doit être positif');
257
			}
258
		} else {
259
			throw new ErrorException('décrémentation de bonus impossible - bonus invalide');
260
		}
261
	}
262
263
	public function updateTechnoBonus(PlayerBonus $playerBonus, $techno, $level) {
0 ignored issues
show
Unused Code introduced by
The parameter $level is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
264
		switch ($techno) {
265
			case Technology::GENERATOR_SPEED: $bonusId = PlayerBonus::GENERATOR_SPEED; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
266
			case Technology::REFINERY_REFINING: $bonusId = PlayerBonus::REFINERY_REFINING; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
267
			case Technology::REFINERY_STORAGE: $bonusId = PlayerBonus::REFINERY_STORAGE; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
268
			case Technology::DOCK1_SPEED: $bonusId = PlayerBonus::DOCK1_SPEED; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
269
			case Technology::DOCK2_SPEED: $bonusId = PlayerBonus::DOCK2_SPEED; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
270
			case Technology::TECHNOSPHERE_SPEED: $bonusId = PlayerBonus::TECHNOSPHERE_SPEED; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
271
			case Technology::COMMERCIAL_INCOME: $bonusId = PlayerBonus::COMMERCIAL_INCOME; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
272
			case Technology::GRAVIT_MODULE: $bonusId = PlayerBonus::GRAVIT_MODULE; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
273
			case Technology::DOCK3_SPEED: $bonusId = PlayerBonus::DOCK3_SPEED; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
274
			case Technology::POPULATION_TAX: $bonusId = PlayerBonus::POPULATION_TAX; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
275
			case Technology::COMMANDER_INVEST: $bonusId = PlayerBonus::COMMANDER_INVEST; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
276
			case Technology::UNI_INVEST: $bonusId = PlayerBonus::UNI_INVEST; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
277
			case Technology::ANTISPY_INVEST: $bonusId = PlayerBonus::ANTISPY_INVEST; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
278
			case Technology::SPACESHIPS_SPEED: $bonusId = PlayerBonus::SHIP_SPEED; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
279
			case Technology::SPACESHIPS_CONTAINER: $bonusId = PlayerBonus::SHIP_CONTAINER; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
280
			case Technology::BASE_QUANTITY: $bonusId = PlayerBonus::BASE_QUANTITY; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
281
			case Technology::FIGHTER_SPEED: $bonusId = PlayerBonus::FIGHTER_SPEED; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
282
			case Technology::FIGHTER_ATTACK: $bonusId = PlayerBonus::FIGHTER_ATTACK; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
283
			case Technology::FIGHTER_DEFENSE: $bonusId = PlayerBonus::FIGHTER_DEFENSE; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
284
			case Technology::CORVETTE_SPEED: $bonusId = PlayerBonus::CORVETTE_SPEED; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
285
			case Technology::CORVETTE_ATTACK: $bonusId = PlayerBonus::CORVETTE_ATTACK; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
286
			case Technology::CORVETTE_DEFENSE: $bonusId = PlayerBonus::CORVETTE_DEFENSE; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
287
			case Technology::FRIGATE_SPEED: $bonusId = PlayerBonus::FRIGATE_SPEED; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
288
			case Technology::FRIGATE_ATTACK: $bonusId = PlayerBonus::FRIGATE_ATTACK; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
289
			case Technology::FRIGATE_DEFENSE: $bonusId = PlayerBonus::FRIGATE_DEFENSE; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
290
			case Technology::DESTROYER_SPEED: $bonusId = PlayerBonus::DESTROYER_SPEED; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
291
			case Technology::DESTROYER_ATTACK: $bonusId = PlayerBonus::DESTROYER_ATTACK; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
292
			case Technology::DESTROYER_DEFENSE: $bonusId = PlayerBonus::DESTROYER_DEFENSE; break;
0 ignored issues
show
Coding Style introduced by
The case body in a switch statement must start on the line following the statement.

According to the PSR-2, the body of a case statement must start on the line immediately following the case statement.

switch ($expr) {
case "A":
    doSomething(); //right
    break;
case "B":

    doSomethingElse(); //wrong
    break;

}

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
Terminating statement must be on a line by itself

As per the PSR-2 coding standard, the break (or other terminating) statement must be on a line of its own.

switch ($expr) {
     case "A":
         doSomething();
         break; //wrong
     case "B":
         doSomething();
         break; //right
     case "C:":
         doSomething();
         return true; //right
 }

To learn more about the PSR-2 coding standard, please refer to the PHP-Fig.

Loading history...
Coding Style introduced by
It is generally recommended to place each PHP statement on a line by itself.

Let’s take a look at an example:

// Bad
$a = 5; $b = 6; $c = 7;

// Good
$a = 5;
$b = 6;
$c = 7;
Loading history...
293
			default:
294
				throw new ErrorException('mise à jour du bonus de technologie impossible - technologie invalide');
295
		}
296
		$this->addTechnoToBonus($playerBonus, $techno, $bonusId);
297
298
		if ($playerBonus->synchronized) {
299
			$totalBonus = 0;
300
			for ($i = 0; $i <= $playerBonus->technology->getTechnology($techno); $i++) { 
301
				$totalBonus += $this->technologyHelper->getImprovementPercentage($techno, $i);
302
			}
303
			$this->sessionWrapper->get('playerBonus')->add($bonusId, $totalBonus);
304
		}
305
	}
306
}