1
0
Fork 0

Simplify conditions and inline temp variables

pull/7641/head^2
Gabriel Caruso 2018-10-14 17:48:29 -03:00 committed by Rob
parent a64b652a6b
commit 2805a69e58
1 changed files with 2 additions and 4 deletions

View File

@ -485,8 +485,7 @@ class Perforce
$resArray = explode(PHP_EOL, $result); $resArray = explode(PHP_EOL, $result);
$tags = array(); $tags = array();
foreach ($resArray as $line) { foreach ($resArray as $line) {
$index = strpos($line, 'Label'); if (strpos($line, 'Label') !== false) {
if (!($index === false)) {
$fields = explode(' ', $line); $fields = explode(' ', $line);
$tags[$fields[1]] = $this->getStream() . '@' . $fields[1]; $tags[$fields[1]] = $this->getStream() . '@' . $fields[1];
} }
@ -502,8 +501,7 @@ class Perforce
$result = $this->commandResult; $result = $this->commandResult;
$resArray = explode(PHP_EOL, $result); $resArray = explode(PHP_EOL, $result);
foreach ($resArray as $line) { foreach ($resArray as $line) {
$index = strpos($line, 'Depot'); if (strpos($line, 'Depot') !== false) {
if (!($index === false)) {
$fields = explode(' ', $line); $fields = explode(' ', $line);
if (strcmp($this->p4Depot, $fields[1]) === 0) { if (strcmp($this->p4Depot, $fields[1]) === 0) {
$this->p4DepotType = $fields[3]; $this->p4DepotType = $fields[3];