From 1938f9025bd191ab18b1b0d3065424c8dc1c353a Mon Sep 17 00:00:00 2001 From: Sveneld Date: Fri, 24 May 2024 20:56:32 +0200 Subject: [PATCH] rent system fix style --- src/Rent/AbstractRentSystem.php | 6 +++--- src/Rent/RentSystemFactory.php | 2 +- src/Rent/RentSystemInterface.php | 2 +- src/Rent/RentSystemQR.php | 8 +++++--- src/Rent/RentSystemSms.php | 5 +++-- src/Rent/RentSystemWeb.php | 5 +++-- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/Rent/AbstractRentSystem.php b/src/Rent/AbstractRentSystem.php index da07265..4409997 100644 --- a/src/Rent/AbstractRentSystem.php +++ b/src/Rent/AbstractRentSystem.php @@ -23,7 +23,7 @@ abstract class AbstractRentSystem implements RentSystemInterface */ protected $creditSystem; /** - * @var User + * @var User */ protected $user; /** @@ -296,7 +296,7 @@ private function changecreditendrental($bike, $userid) //ak vrati a znova pozica bike do 10 min tak free time nebude maƄ. $oldRetrun = $this->db->query("SELECT time FROM history WHERE bikeNum=$bike AND userId=$userid AND (action='RETURN' OR action='FORCERETURN') ORDER BY time DESC LIMIT 1"); - if ($oldRetrun->rowCount()==1) { + if ($oldRetrun->rowCount() == 1) { $oldRow = $oldRetrun->fetchAssoc(); $returntime = strtotime($oldRow["time"]); if (($starttime - $returntime) < 10 * 60 && $timediff > 5 * 60) { @@ -355,4 +355,4 @@ private function logResult($number, $message) { logresult($number, $message); } -} \ No newline at end of file +} diff --git a/src/Rent/RentSystemFactory.php b/src/Rent/RentSystemFactory.php index 3b6fe9f..0d210bf 100644 --- a/src/Rent/RentSystemFactory.php +++ b/src/Rent/RentSystemFactory.php @@ -51,4 +51,4 @@ public static function create($type) throw new \InvalidArgumentException('Invalid rent system type'); } } -} \ No newline at end of file +} diff --git a/src/Rent/RentSystemInterface.php b/src/Rent/RentSystemInterface.php index 5af4016..9d1f43a 100644 --- a/src/Rent/RentSystemInterface.php +++ b/src/Rent/RentSystemInterface.php @@ -7,4 +7,4 @@ interface RentSystemInterface public function rentBike($userId, $bikeId, $force = false); public function returnBike($userId, $bikeId, $standName, $note = '', $force = false); -} \ No newline at end of file +} diff --git a/src/Rent/RentSystemQR.php b/src/Rent/RentSystemQR.php index 9f4c203..b93806a 100644 --- a/src/Rent/RentSystemQR.php +++ b/src/Rent/RentSystemQR.php @@ -25,7 +25,8 @@ public function returnBike($userId, $bikeId, $standName, $note = '', $force = fa $bikeNumber = $result->rowCount(); if ($bikeNumber > 1) { - $message = _('You have') . ' ' . $bikeNumber . ' ' . _('rented bikes currently. QR code return can be used only when 1 bike is rented. Please, use web'); + $message = _('You have') . ' ' . $bikeNumber . ' ' + . _('rented bikes currently. QR code return can be used only when 1 bike is rented. Please, use web'); if ($this->connectorsConfig["sms"]) { $message .= _(' or SMS'); } @@ -37,7 +38,8 @@ public function returnBike($userId, $bikeId, $standName, $note = '', $force = fa return parent::returnBike($userId, $bikeId, $standName, $note, $force); } - protected function getRentSystemType() { + protected function getRentSystemType() + { return 'qr'; } -} \ No newline at end of file +} diff --git a/src/Rent/RentSystemSms.php b/src/Rent/RentSystemSms.php index 6e2c2c4..e461fa1 100644 --- a/src/Rent/RentSystemSms.php +++ b/src/Rent/RentSystemSms.php @@ -77,7 +77,8 @@ public function returnBike($number, $bikeId, $standName, $note = '', $force = fa return parent::returnBike($userId, $bikeId, $standName, $note, $force); } - protected function getRentSystemType() { + protected function getRentSystemType() + { return 'sms'; } @@ -85,4 +86,4 @@ protected function response($message, $error = 0) { $this->smsSender->send($this->number, strip_tags($message)); } -} \ No newline at end of file +} diff --git a/src/Rent/RentSystemWeb.php b/src/Rent/RentSystemWeb.php index 7d5b675..433769b 100644 --- a/src/Rent/RentSystemWeb.php +++ b/src/Rent/RentSystemWeb.php @@ -4,7 +4,8 @@ class RentSystemWeb extends AbstractRentSystem implements RentSystemInterface { - protected function getRentSystemType() { + protected function getRentSystemType() + { return 'web'; } @@ -17,4 +18,4 @@ protected function response($message, $error = 0) echo $json; exit; } -} \ No newline at end of file +}