Removed unused variables.

This commit is contained in:
Jan Böhmer 2020-03-29 22:37:27 +02:00
parent 3671c94844
commit 0fe83c7b3a
18 changed files with 14 additions and 29 deletions

View file

@ -49,7 +49,6 @@ class RevertLogColumn extends AbstractColumn
public function render($value, $context)
{
$revertable = true;
if (
$context instanceof CollectionElementDeleted
|| ($context instanceof ElementDeletedLogEntry && $context->hasOldDataInformations())

View file

@ -329,8 +329,6 @@ final class PartsDataTable implements DataTableTypeInterface
private function buildCriteria(QueryBuilder $builder, array $options): void
{
$em = $builder->getEntityManager();
if (isset($options['category'])) {
$category = $options['category'];
$list = $this->treeBuilder->typeToNodesList(Category::class, $category);

View file

@ -163,7 +163,7 @@ class EventLoggerSubscriber implements EventSubscriber
*/
public function hasFieldRestrictions(AbstractDBElement $element): bool
{
foreach (static::FIELD_BLACKLIST as $class => $blacklist) {
foreach (array_keys(static::FIELD_BLACKLIST) as $class) {
if (is_a($element, $class)) {
return true;
}

View file

@ -53,8 +53,6 @@ use Symfony\Component\Security\Core\Security;
final class LogoutOnDisabledUserListener implements EventSubscriberInterface
{
private $security;
private $translator;
private $flashBag;
private $urlGenerator;
public function __construct(Security $security, UrlGeneratorInterface $urlGenerator)

View file

@ -69,9 +69,6 @@ class OrderdetailType extends AbstractType
public function buildForm(FormBuilderInterface $builder, array $options): void
{
/** @var Orderdetail $orderdetail */
$orderdetail = $builder->getData();
$builder->add('supplierpartnr', TextType::class, [
'label' => 'orderdetails.edit.supplierpartnr',
'attr' => [

View file

@ -86,7 +86,7 @@ class PermissionsType extends AbstractType
{
$groups = $this->perm_structure['groups'];
foreach ($groups as $key => $group) {
foreach (array_keys($groups) as $key) {
$builder->add($key, PermissionGroupType::class, [
'group_name' => $key,
'mapped' => false,

View file

@ -102,7 +102,7 @@ class CurrencyEntityType extends StructuralEntityType
$level -= $parent->getLevel() - 1;
}
$tmp = str_repeat('   ', $choice->getLevel()); //Use 3 spaces for intendation
$tmp = str_repeat('   ', $level); //Use 3 spaces for intendation
if (empty($choice->getIsoCode())) {
$tmp .= htmlspecialchars($choice->getName());
} else {

View file

@ -272,7 +272,7 @@ class StructuralEntityType extends AbstractType
$level -= $parent->getLevel() - 1;
}
$tmp = str_repeat('   ', $choice->getLevel()); //Use 3 spaces for intendation
$tmp = str_repeat('   ', $level); //Use 3 spaces for intendation
$tmp .= htmlspecialchars($choice->getName());
return $tmp;

View file

@ -46,11 +46,6 @@ use JsonSerializable;
final class TreeViewNodeState implements JsonSerializable
{
/**
* @var bool|null
*/
private $checked = null;
/**
* @var bool|null
*/

View file

@ -41,7 +41,7 @@ final class Version1 extends AbstractMigration
try {
//Check if we can use this migration method:
$version = (int) $this->connection->fetchColumn("SELECT keyValue AS version FROM `internal` WHERE `keyName` = 'dbVersion'");
$this->skipIf(true, 'Old Part-DB Database detected! Continue with upgrade...');
$this->skipIf($version > 0, 'Old Part-DB Database detected! Continue with upgrade...');
} catch (DBALException $dBALException) {
//when the table was not found, we can proceed, because we have an empty DB!
}

View file

@ -44,7 +44,8 @@ class DBElementRepository extends EntityRepository
->setParameter(1, $element->getID())
->getQuery();
$p = $q->execute();
//Do the renaming
$q->execute();
$this->setField($element, 'id', $new_id);
}

View file

@ -142,7 +142,6 @@ class ElementPermissionListener
return;
}
$em = $eventArgs->getEntityManager();
$unitOfWork = $eventArgs->getEntityManager()->getUnitOfWork();
$reflectionClass = new ReflectionClass($element);

View file

@ -383,7 +383,7 @@ class EntityURLGenerator
//Check if we have an direct mapping for the given class
if (! array_key_exists($class, $map)) {
//Check if we need to check inheritance by looping through our map
foreach ($map as $key => $value) {
foreach (array_keys($map) as $key) {
if (is_a($entity, $key)) {
return $map[$key];
}

View file

@ -31,7 +31,7 @@ class EventCommentHelper
public function __construct()
{
$message = null;
$this->message = null;
}
/**

View file

@ -37,7 +37,7 @@ class EventUndoHelper
public function __construct()
{
$undone_event = null;
$this->undone_event = null;
$this->mode = self::MODE_UNDO;
}

View file

@ -69,7 +69,7 @@ class ParameterExtractor
$matches = [];
\preg_match($regex, $input, $matches);
if (! empty($matches)) {
[$raw, $name, $value] = $matches;
[, $name, $value] = $matches;
$value = trim($value);
//Dont allow empty names or values (these are a sign of an invalid extracted string)

View file

@ -30,12 +30,10 @@ use Twig\TwigFunction;
class LastUserExtension extends AbstractExtension
{
private $em;
private $repo;
public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
$this->repo = $em->getRepository(AbstractLogEntry::class);
}

View file

@ -87,7 +87,7 @@ abstract class AbstractAdminControllerTest extends WebTestCase
$client->catchExceptions(false);
//Test read/list access by access /new overview page
$crawler = $client->request('GET', static::$base_path.'/new');
$client->request('GET', static::$base_path.'/new');
$this->assertFalse($client->getResponse()->isRedirect());
$this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!');
$this->assertSame($read, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!');
@ -112,7 +112,7 @@ abstract class AbstractAdminControllerTest extends WebTestCase
}
//Test read/list access by access /new overview page
$crawler = $client->request('GET', static::$base_path.'/1');
$client->request('GET', static::$base_path.'/1');
$this->assertFalse($client->getResponse()->isRedirect());
$this->assertSame($read, $client->getResponse()->isSuccessful(), 'Controller was not successful!');
$this->assertSame($read, ! $client->getResponse()->isForbidden(), 'Permission Checking not working!');
@ -148,7 +148,7 @@ abstract class AbstractAdminControllerTest extends WebTestCase
}
//Test read/list access by access /new overview page
$crawler = $client->request('DELETE', static::$base_path.'/7');
$client->request('DELETE', static::$base_path.'/7');
//Page is redirected to '/new', when delete was successful
$this->assertSame($delete, $client->getResponse()->isRedirect(static::$base_path.'/new'));