for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace Stu\Orm\Repository;
use Doctrine\ORM\EntityRepository;
use Stu\Orm\Entity\WeaponShieldInterface;
use Stu\Orm\Entity\WeaponShield;
/**
* @extends EntityRepository<WeaponShield>
*/
final class WeaponShieldRepository extends EntityRepository implements WeaponShieldRepositoryInterface
{
public function prototype(): WeaponShieldInterface
return new WeaponShield();
}
public function save(WeaponShieldInterface $weaponshield): void
$em = $this->getEntityManager();
$em->persist($weaponshield);
public function delete(WeaponShieldInterface $weaponshield): void
$em->remove($weaponshield);
public function getByModuleAndWeapon(
int $moduleId,
int $weaponId
): ?WeaponShieldInterface {
return $this->findOneBy([
'module_id' => $moduleId,
'weapon_id' => $weaponId
]);
public function getFactionByModule($moduleid): ?WeaponShieldInterface
for ($index = 1; $index <= 5; $index++) {
PostIncNode
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.
return
die
exit
function fx() { try { doSomething(); return true; } catch (\Exception $e) { return false; } return false; }
In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.
return false
return $this->findOneBy(
[
'faction_id' => $index,
'module_id' => $moduleid
]
);
This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.
Unreachable code is most often the result of
return,dieorexitstatements that have been added for debug purposes.In the above example, the last
return falsewill never be executed, because a return statement has already been met in every possible execution path.