Skip to content

Commit da89b99

Browse files
committed
Vervang var->prop === null door !isset(var->prop)
1 parent 693526d commit da89b99

20 files changed

+38
-38
lines changed

htdocs/bar/controller/Barsysteem.class.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function isBeheer() {
3636
}
3737

3838
function getCsrfToken() {
39-
if ($this->csrfToken === null) {
39+
if (!isset($this->csrfToken)) {
4040
if ($this->isBeheer()) {
4141
$this->csrfToken = md5('Barsysteem CSRF-token C.S.R. Delft' . $_COOKIE['barsysteembeheer']);
4242
} else {

lib/common/Doctrine/Type/Serializer/SafeJsonSerializer.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ protected function unserializeObject($value)
7070
*/
7171
protected function classAllowed($className)
7272
{
73-
return $this->allowedClasses === null ||
73+
return !isset($this->allowedClasses) ||
7474
in_array($className, $this->allowedClasses);
7575
}
7676
}

lib/controller/ProfielController.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -282,7 +282,7 @@ private function profielBewerken(Profiel $profiel, $alleenFormulier = false)
282282
$this->addFlash(FlashType::INFO, 'Geen wijzigingen');
283283
} else {
284284
$nieuw =
285-
$profiel->uid === null ||
285+
!isset($profiel->uid) ||
286286
$this->profielRepository->find($profiel->uid) == null;
287287
$changeEntry = ProfielRepository::changelog($diff, $this->getUid());
288288
foreach ($diff as $change) {

lib/controller/fiscaat/PinTransactieController.php

+12-12
Original file line numberDiff line numberDiff line change
@@ -153,11 +153,11 @@ public function aanmaken()
153153
PinTransactieMatch::class
154154
);
155155

156-
if ($pinTransactieMatch->bestelling !== null) {
156+
if (isset($pinTransactieMatch->bestelling)) {
157157
throw new CsrGebruikerException('Er bestaat al een bestelling.');
158158
}
159159

160-
if ($pinTransactieMatch->transactie === null) {
160+
if (!isset($pinTransactieMatch->transactie)) {
161161
throw new CsrGebruikerException(
162162
'Geen transactie gevonden om een bestelling voor aan te maken'
163163
);
@@ -249,11 +249,11 @@ public function ontkoppel()
249249
PinTransactieMatch::class
250250
);
251251

252-
if ($pinTransactieMatch->bestelling === null) {
252+
if (!isset($pinTransactieMatch->bestelling)) {
253253
throw new CsrGebruikerException(
254254
'Ontoppelen niet mogelijk, geen bestelling gevonden.'
255255
);
256-
} elseif ($pinTransactieMatch->transactie === null) {
256+
} elseif (!isset($pinTransactieMatch->transactie)) {
257257
throw new CsrGebruikerException(
258258
'Ontkoppelen niet mogelijk, geen transactie gevonden.'
259259
);
@@ -318,16 +318,16 @@ public function koppel()
318318
$pinTransactieMatch2
319319
) {
320320
if (
321-
$pinTransactieMatch1->bestelling === null &&
322-
$pinTransactieMatch2->transactie === null
321+
!isset($pinTransactieMatch1->bestelling) &&
322+
!isset($pinTransactieMatch2->transactie)
323323
) {
324324
$nieuwePinTransactieMatch = $this->koppelMatches(
325325
$pinTransactieMatch2,
326326
$pinTransactieMatch1
327327
);
328328
} elseif (
329-
$pinTransactieMatch2->bestelling === null &&
330-
$pinTransactieMatch1->transactie === null
329+
!isset($pinTransactieMatch2->bestelling) &&
330+
!isset($pinTransactieMatch1->transactie)
331331
) {
332332
$nieuwePinTransactieMatch = $this->koppelMatches(
333333
$pinTransactieMatch1,
@@ -408,11 +408,11 @@ public function crediteer()
408408
$form = new PinBestellingCrediterenForm($oudePinTransactieMatch);
409409
$values = $form->getValues();
410410

411-
if ($oudePinTransactieMatch->transactie !== null) {
411+
if (isset($oudePinTransactieMatch->transactie)) {
412412
throw new CsrGebruikerException('Er bestaat wel een transactie.');
413413
}
414414

415-
if ($oudePinTransactieMatch->bestelling === null) {
415+
if (!isset($oudePinTransactieMatch->bestelling)) {
416416
throw new CsrGebruikerException(
417417
'Geen bestelling gevonden om een creditbestelling voor aan te maken'
418418
);
@@ -511,13 +511,13 @@ public function update()
511511
$form = new PinBestellingVeranderenForm($oudePinTransactieMatch);
512512
$values = $form->getValues();
513513

514-
if ($oudePinTransactieMatch->transactie === null) {
514+
if (!isset($oudePinTransactieMatch->transactie)) {
515515
throw new CsrGebruikerException(
516516
'Geen transactie gevonden voor verkeerd bedrag'
517517
);
518518
}
519519

520-
if ($oudePinTransactieMatch->bestelling === null) {
520+
if (!isset($oudePinTransactieMatch->bestelling)) {
521521
throw new CsrGebruikerException(
522522
'Geen bestelling gevonden voor verkeerd bedrag'
523523
);

lib/entity/corvee/CorveeTaak.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ public function getPuntenPrognose()
153153

154154
public function getLaatstGemaildDate()
155155
{
156-
if ($this->wanneer_gemaild === null) {
156+
if (!isset($this->wanneer_gemaild)) {
157157
return null;
158158
}
159159
$pos = strpos($this->wanneer_gemaild, '
');
@@ -170,7 +170,7 @@ public function getLaatstGemaildDate()
170170
*/
171171
public function getAantalKeerGemaild()
172172
{
173-
if ($this->wanneer_gemaild === null) {
173+
if (!isset($this->wanneer_gemaild)) {
174174
return 0;
175175
}
176176
return substr_count($this->wanneer_gemaild, '
');

lib/entity/declaratie/Declaratie.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ public function valideer(): array
395395
if (empty($this->omschrijving)) {
396396
$fouten[] = 'Geef een duidelijke omschrijving van de declaratie';
397397
}
398-
if ($this->csrPas === null) {
398+
if (!isset($this->csrPas)) {
399399
$fouten[] = 'Selecteer de betaalwijze';
400400
} elseif ($this->csrPas === true) {
401401
if (empty($this->naam)) {
@@ -490,7 +490,7 @@ public function naarObject(UrlGeneratorInterface $generator): array
490490
{
491491
$eigenRekening =
492492
$this->csrPas ||
493-
$this->csrPas === null ||
493+
!isset($this->csrPas) ||
494494
($this->rekening === $this->indiener->bankrekening &&
495495
$this->naam === $this->indiener->getNaam('voorletters'));
496496
return [

lib/entity/declaratie/DeclaratieRegel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function valideer($bonIndex, $regelIndex): array
177177
if (empty($this->bedrag)) {
178178
$toFill[] = 'het bedrag';
179179
}
180-
if ($this->inclBtw === null) {
180+
if (!isset($this->inclBtw)) {
181181
$toFill[] = 'het btw-percentage';
182182
}
183183

lib/entity/pin/PinTransactieMatch.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,9 @@ public function getVerschil()
353353
*/
354354
public function logischeStatus()
355355
{
356-
if ($this->bestelling === null) {
356+
if (!isset($this->bestelling)) {
357357
return PinTransactieMatchStatusEnum::STATUS_MISSENDE_BESTELLING;
358-
} elseif ($this->transactie === null) {
358+
} elseif (!isset($this->transactie)) {
359359
return PinTransactieMatchStatusEnum::STATUS_MISSENDE_TRANSACTIE;
360360
} else {
361361
$bestellingInhoud = $this->bestelling->getProduct(

lib/model/entity/profiel/ProfielCreateLogGroup.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function toHtml()
2424
{
2525
return "<div class='ProfielLogEntry'>Aangemaakt door " .
2626
ProfielRepository::getLink($this->editor) .
27-
($this->timestamp === null
27+
(!isset($this->timestamp)
2828
? '?'
2929
: DateUtil::reldate($this->timestamp->format('Y-m-d H:i:s'))) .
3030
'</div>';

lib/model/entity/profiel/ProfielUpdateLogGroup.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ public function toHtml()
4343
<div class='metadata'>Gewijzigd door " .
4444
ProfielRepository::getLink($this->editor, 'civitas') .
4545
' ' .
46-
($this->timestamp === null
46+
(!isset($this->timestamp)
4747
? '?'
4848
: DateUtil::reldate($this->timestamp->format('Y-m-d H:i:s'))) .
4949
"</div>

lib/repository/corvee/CorveeTakenRepository.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ public function getKomendeTakenVoorLid(Profiel $profiel)
258258
public function saveTaak(CorveeTaak $taak)
259259
{
260260
return $this->_em->transactional(function () use ($taak) {
261-
if ($taak->taak_id === null) {
261+
if (!isset($taak->taak_id)) {
262262
$taak = $this->newTaak($taak);
263263
} else {
264264
$oldTaak = $this->getEntityManager()

lib/repository/forum/ForumDradenRepository.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ public function getPaginaVoorDraad(ForumDraad $draad)
175175
if ($draad->plakkerig) {
176176
return 1;
177177
}
178-
if ($this->aantal_plakkerig === null) {
178+
if (!isset($this->aantal_plakkerig)) {
179179
$qb = $this->createQueryBuilder('d');
180180
$qb->select('count(d.draad_id)');
181181
$qb->where(

lib/service/LidZoekerService.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,7 @@ public function getSortableVelden()
246246

247247
public function count()
248248
{
249-
if ($this->result === null) {
249+
if (!isset($this->result)) {
250250
$this->search();
251251
}
252252
return count($this->result);
@@ -491,7 +491,7 @@ public function searched()
491491

492492
public function getLeden()
493493
{
494-
if ($this->result === null) {
494+
if (!isset($this->result)) {
495495
$this->search();
496496
}
497497
return $this->result;

lib/service/Roodschopper.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public static function getDefaults()
6363
*/
6464
public function getLeden()
6565
{
66-
if ($this->teschoppen === null) {
66+
if (!isset($this->teschoppen)) {
6767
$this->generateMails();
6868
}
6969
$leden = [];
@@ -155,7 +155,7 @@ public function replace($invoer, $profiel, $saldo)
155155
*/
156156
public function preview()
157157
{
158-
if ($this->teschoppen === null) {
158+
if (!isset($this->teschoppen)) {
159159
$this->generateMails();
160160
}
161161
foreach ($this->teschoppen as $uid => $bericht) {
@@ -172,7 +172,7 @@ public function preview()
172172
*/
173173
public function sendMails()
174174
{
175-
if ($this->teschoppen === null) {
175+
if (!isset($this->teschoppen)) {
176176
$this->generateMails();
177177
}
178178

lib/view/formulier/CsrfField.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public function getType()
4747

4848
public function getHtml()
4949
{
50-
if ($this->token === null) {
50+
if (!isset($this->token)) {
5151
return '';
5252
}
5353

lib/view/formulier/invoervelden/InputField.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ public function __construct(
9090
static::class
9191
);
9292

93-
if ($this->description === null) {
93+
if (!isset($this->description)) {
9494
$this->labelClassName .= ' d-none';
9595
$this->fieldClassName = str_replace(
9696
'col-9',

lib/view/maalcie/forms/CorveeRepetitieForm.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public function __construct(CorveeRepetitie $repetitie)
5555
']=' .
5656
$functie->standaard_punten .
5757
';';
58-
if ($repetitie->standaard_punten === null) {
58+
if (!isset($repetitie->standaard_punten)) {
5959
$repetitie->standaard_punten = $functie->standaard_punten;
6060
}
6161
}

lib/view/maalcie/forms/MaaltijdRepetitieForm.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public function __construct($model, $verplaats = null)
3939
'/maaltijden/repetities/opslaan/' . $model->mlt_repetitie_id
4040
);
4141

42-
if ($model->mlt_repetitie_id === null) {
42+
if (!isset($model->mlt_repetitie_id)) {
4343
$this->titel = 'Maaltijdrepetitie aanmaken';
4444
} else {
4545
$this->titel = 'Maaltijdrepetitie wijzigen';

lib/view/maalcie/forms/TaakForm.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public function __construct(CorveeTaak $taak, $action)
4848
];
4949
$functiePunten .=
5050
'punten["' . $functie->naam . '"]=' . $functie->standaard_punten . ';';
51-
if ($taak->punten === null) {
51+
if (!isset($taak->punten)) {
5252
$taak->punten = $functie->standaard_punten;
5353
}
5454
}

lib/view/maalcie/forms/VrijstellingForm.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@ public function __construct(CorveeVrijstelling $vrijstelling)
2525
parent::__construct(
2626
$vrijstelling,
2727
'/corvee/vrijstellingen/opslaan' .
28-
($vrijstelling->uid === null ? '' : '/' . $vrijstelling->uid)
28+
(isset($vrijstelling->uid) ? '/' . $vrijstelling->uid : '')
2929
);
3030

31-
if ($vrijstelling->uid === null) {
31+
if (!isset($vrijstelling->uid)) {
3232
$this->titel = 'Vrijstelling aanmaken';
3333
} else {
3434
$this->titel = 'Vrijstelling wijzigen';

0 commit comments

Comments
 (0)