for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Runalyze Device List.
*
* (c) RUNALYZE <[email protected]>
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
namespace Runalyze\Devices\Mapping;
class FitMapping
{
public static function guessDevice($manufactorId, $productId)
switch ($manufactorId) {
case 1:
return self::getGarminDevice($productId);
break;
break
The break statement is not necessary if it is preceded for example by a return statement:
switch ($x) { case 1: return 'foo'; break; // This break is not necessary and can be left off. }
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.
case 23:
return self::getSuuntoDevice($productId);
case 294:
return self::getCorosDevice($productId);
case 32:
return self::getWahooDevice($productId);
default:
return null;
}
public function getGarminDevice($productId)
$garmin = new GarminFitSdkMapping();
return $garmin->toInternal($productId);
public function getCorosDevice($productId)
$coros = new CorosFitSdkMapping();
return $coros->toInternal($productId);
public function getSuuntoDevice($productId)
$suunto = new SuuntoFitSdkMapping();
return $suunto->toInternal($productId);
public function getWahooDevice($productId)
$suunto = new WahooFitSdkMapping();
The break statement is not necessary if it is preceded for example by a return statement:
If you would like to keep this construct to be consistent with other case statements, you can safely mark this issue as a false-positive.