summaryrefslogtreecommitdiff
path: root/src/Controllers
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-11-06 13:43:57 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2019-11-06 13:43:57 +0100
commit8b5b9e2c65193171a12bf99a8df860a66e6900a5 (patch)
treeeed7c815dfa7f6b034dff3e758e6578d26e3d81e /src/Controllers
parent2cce967eb09edd6ef35238c68f8ff5ed2348f5fd (diff)
src/: Formatting, doc block hints and cleanup
Diffstat (limited to 'src/Controllers')
-rw-r--r--src/Controllers/Metrics/Stats.php5
-rw-r--r--src/Controllers/PasswordResetController.php2
2 files changed, 4 insertions, 3 deletions
diff --git a/src/Controllers/Metrics/Stats.php b/src/Controllers/Metrics/Stats.php
index 7098d94f..af453cde 100644
--- a/src/Controllers/Metrics/Stats.php
+++ b/src/Controllers/Metrics/Stats.php
@@ -43,6 +43,7 @@ class Stats
->distinct();
$query->where(function ($query) use ($working) {
+ /** @var QueryBuilder $query */
if ($working) {
$query
->whereNotNull('ShiftEntry.SID')
@@ -271,7 +272,7 @@ class Stats
{
$start = microtime(true);
- EventConfig::findOrNew('last_metrics');
+ (new EventConfig())->findOrNew('last_metrics');
return microtime(true) - $start;
}
@@ -281,7 +282,7 @@ class Stats
*/
public function databaseWrite()
{
- $config = EventConfig::findOrNew('last_metrics');
+ $config = (new EventConfig())->findOrNew('last_metrics');
$config
->setAttribute('name', 'last_metrics')
->setAttribute('value', new Carbon());
diff --git a/src/Controllers/PasswordResetController.php b/src/Controllers/PasswordResetController.php
index 505ed8eb..a1460104 100644
--- a/src/Controllers/PasswordResetController.php
+++ b/src/Controllers/PasswordResetController.php
@@ -74,7 +74,7 @@ class PasswordResetController extends BaseController
/** @var User $user */
$user = User::whereEmail($data['email'])->first();
if ($user) {
- $reset = PasswordReset::findOrNew($user->id);
+ $reset = (new PasswordReset)->findOrNew($user->id);
$reset->user_id = $user->id;
$reset->token = md5(random_bytes(64));
$reset->save();