Skip to content

Commit 1bf54d2

Browse files
committed
formatting
1 parent 07e1c5e commit 1bf54d2

1 file changed

Lines changed: 8 additions & 16 deletions

File tree

src/Illuminate/Console/Scheduling/Event.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -459,19 +459,15 @@ public function pingBefore($url)
459459
}
460460

461461
/**
462-
* Register a callback to ping a given URL before the job runs if condition is true.
462+
* Register a callback to ping a given URL before the job runs if the given condition is true.
463463
*
464-
* @param bool $condition
464+
* @param bool $value
465465
* @param string $url
466466
* @return $this
467467
*/
468-
public function pingBeforeIf(bool $condition, string $url)
468+
public function pingBeforeIf($value, $url)
469469
{
470-
if ($condition) {
471-
return $this->pingBefore($url);
472-
}
473-
474-
return $this;
470+
return $value ? $this->pingBefore($url) : $this;
475471
}
476472

477473
/**
@@ -488,19 +484,15 @@ public function thenPing($url)
488484
}
489485

490486
/**
491-
* Register a callback to ping a given URL after the job runs if condition is true.
487+
* Register a callback to ping a given URL after the job runs if the given condition is true.
492488
*
493-
* @param bool $condition
489+
* @param bool $value
494490
* @param string $url
495491
* @return $this
496492
*/
497-
public function thenPingIf(bool $condition, string $url)
493+
public function thenPingIf($value, $url)
498494
{
499-
if ($condition) {
500-
return $this->thenPing($url);
501-
}
502-
503-
return $this;
495+
return $value ? $this->thenPing($url) : $this;
504496
}
505497

506498
/**

0 commit comments

Comments
 (0)