Skip to content

Commit

Permalink
fix lint
Browse files Browse the repository at this point in the history
  • Loading branch information
munyanezaarmel committed Nov 21, 2024
1 parent 7f325f7 commit c74d731
Show file tree
Hide file tree
Showing 443 changed files with 852 additions and 830 deletions.
2 changes: 1 addition & 1 deletion src/backend/app/Console/Commands/AccessRateChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ public function runInCompanyScope(): void
// access-rate is defined
if ($accessRate->amount > 0) {
$accessRatePayment->debt += $accessRate->amount;
$accessRatePayment->unpaid_in_row++;
++$accessRatePayment->unpaid_in_row;
}
$accessRatePayment->save();

Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/Console/Commands/DummyDataCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ public function handle()
return;
}

for ($i = 1; $i <= $amount; $i++) {
for ($i = 1; $i <= $amount; ++$i) {
echo "$type is generating number: $i \n";
try {
DB::connection('shard')->beginTransaction();
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/Console/Commands/RoutesGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ private function appendLines(string $packageRoutesTmp, $coreRoutesTmp): void
$newLine = str_pad($value, strlen($value) + 4, ' ', STR_PAD_LEFT);
}
fwrite($tmp, $newLine);
$counter++;
++$counter;
}
fclose($tmp);
}
Expand Down
1 change: 0 additions & 1 deletion src/backend/app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class Kernel extends ConsoleKernel
/**
* Define the application's command schedule.
*
*
* @return void
*/
protected function schedule(Schedule $schedule)
Expand Down
6 changes: 3 additions & 3 deletions src/backend/app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ class Handler extends ExceptionHandler
/**
* Report or log an exception.
*
*
* @return void
*/
public function report(\Throwable $exception)
Expand All @@ -46,8 +45,9 @@ public function report(\Throwable $exception)
/**
* Render an exception into an HTTP response.
*
* @param Request $request
* @param \Throwable $exception
* @param Request $request
* @param \Throwable $exception
*
* @return \Illuminate\Http\JsonResponse
*/
public function render($request, \Exception|\Throwable $exception)
Expand Down
6 changes: 3 additions & 3 deletions src/backend/app/Helpers/MailHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private function configure(): void
}

/**
* @param null $attachment
* @param null $attachment
*
* @throws MailNotSentException
* @throws PHPMailerException
Expand All @@ -60,7 +60,7 @@ public function sendPlain($to, $title, $body, $attachment = null): void

$this->mailer->AltBody = $this->mailSettings['default_message'];

if (! $this->mailer->send()) {
if (!$this->mailer->send()) {
throw new MailNotSentException($this->mailer->ErrorInfo);
}
}
Expand All @@ -84,7 +84,7 @@ public function sendViaTemplate(string $to, string $title, string $templatePath,
$this->mailer->addAttachment($attachmentPath);
}

if (! $this->mailer->send()) {
if (!$this->mailer->send()) {
throw new MailNotSentException($this->mailer->ErrorInfo);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/Helpers/MailHelperInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
interface MailHelperInterface
{
/**
* @param null $attachment
* @param null $attachment
*
* @throws MailNotSentException
* @throws PHPMailerException
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/Helpers/MailHelperMock.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
class MailHelperMock implements MailHelperInterface
{
/**
* @param null $attachment
* @param null $attachment
*
* @throws MailNotSentException
* @throws PHPMailerException
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/Helpers/PowerConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class PowerConverter
];

/**
* @param int|string $power
* @param int|string $power
*/
public static function convert($power, $powerUnit, string $expectedUnit = 'Wh')
{
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/Helpers/RelationsManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ trait RelationsManager

public static function getAllRelations($type = null): array
{
if (! self::$relationsInitialized) {
if (!self::$relationsInitialized) {
self::initAllRelations();
}
if ($type) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public function store(CreateAgentAssignedApplianceRequest $request)
/**
* List for Web interface.
*
* @param Agent $agent
* @param Agent $agent
*
* @return ApiResource
*/
public function index($agentId, Request $request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ public function __construct(
/**
* List for Android-APP.
*
*
* @return ApiResource
*/
public function index(Request $request)
Expand Down
5 changes: 3 additions & 2 deletions src/backend/app/Http/Controllers/AgentAuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function login(Request $request)
{
$credentials = $request->only(['email', 'password']);

if (! $token = auth('agent_api')->setTTL(525600)->attempt($credentials)) {
if (!$token = auth('agent_api')->setTTL(525600)->attempt($credentials)) {
return response()->json(['data' => ['message' => 'Unauthorized', 'status' => 401]], 401);
}

Expand Down Expand Up @@ -82,7 +82,8 @@ public function refresh()
/**
* Get the token array structure.
*
* @param string $token
* @param string $token
*
* @return JsonResponse
*/
protected function respondWithToken($token)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ public function store(Agent $agent, CreateAgentBalanceHistoryRequest $request):
/**
* Display the specified resource.
*
*
* @return void
*/
public function show(AgentBalanceHistory $agent_balance_history)
Expand All @@ -48,7 +47,6 @@ public function show(AgentBalanceHistory $agent_balance_history)
/**
* Update the specified resource in storage.
*
*
* @return void
*/
public function update(Request $request, AgentBalanceHistory $agent_balance_history)
Expand All @@ -58,7 +56,6 @@ public function update(Request $request, AgentBalanceHistory $agent_balance_hist
/**
* Remove the specified resource from storage.
*
*
* @return void
*/
public function destroy(AgentBalanceHistory $agent_balance_history)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ public function index(Request $request): ApiResource
/**
* Store a newly created resource in storage.
*
*
* @return ApiResource
*/
public function store(CreateAgentCommissionRequest $request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ public function __construct(
/**
* Display a listing of the resource.
*
*
* @return ApiResource
*/
public function index(Request $request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ public function __construct(
/**
* Display a listing of the resource.
*
*
* @return ApiResource
*/
public function show($agentId, Request $request)
Expand All @@ -32,7 +31,6 @@ public function show($agentId, Request $request)
/**
* Display a listing of the resource.
*
*
* @return ApiResource
*/
public function index(Request $request)
Expand All @@ -45,7 +43,8 @@ public function index(Request $request)
/**
* Store a newly created resource in storage.
*
* @param $agentId
* @param $agentId
*
* @return ApiResource
*/
public function store(CreateAgentReceiptRequest $request)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public function show($customerId, Request $request): ApiResource
/**
* Store a newly created resource in storage.
*
*
* @return ApiResource
*/
public function store(CreateAgentSoldApplianceRequest $request)
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/Http/Controllers/AgentTicketController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public function store(CreateAgentTicketRequest $request): TicketResource
$ownerId = $ticketData['owner_id'];
$owner = $this->personService->getById($ownerId);

if (! $owner) {
if (!$owner) {
throw new TicketOwnerNotFoundException('Ticket owner with following id not found '.$ownerId);
}

Expand Down
4 changes: 2 additions & 2 deletions src/backend/app/Http/Controllers/AssetPersonController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public function __construct(
/**
* Store a newly created resource in storage.
*
* @param AssetType $assetType
* @param AssetType $assetType
*/
public function store(
Asset $asset,
Expand Down Expand Up @@ -105,7 +105,7 @@ public function store(
$this->geographicalInformationService->save($geographicalInformation);
}
if ($downPayment > 0) {
$sender = ! isset($addressData) ? '-' : $addressData['phone'];
$sender = !isset($addressData) ? '-' : $addressData['phone'];
$transaction = $this->cashTransactionService->createCashTransaction(
$user->id,
$downPayment,
Expand Down
7 changes: 4 additions & 3 deletions src/backend/app/Http/Controllers/AssetRateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ class AssetRateController extends Controller
/**
* Update the specified resource in storage.
*
* @param Request $request
* @param AssetRate $assetRate
* @param Request $request
* @param AssetRate $assetRate
*
* @return ApiResource
*/
private $cashTransactionService;
Expand All @@ -41,7 +42,7 @@ public function update(Request $request, AssetRate $applianceRate): ApiResource
if ($newCost === 0) {
$this->applianceRateService
->deleteUpdatedApplianceRateIfCostZero($applianceRate, $creatorId, $cost, $newCost);
$appliancePerson->rate_count--;
--$appliancePerson->rate_count;
} else {
$this->applianceRateService->updateApplianceRateCost($applianceRate, $creatorId, $cost, $newCost);
}
Expand Down
2 changes: 0 additions & 2 deletions src/backend/app/Http/Controllers/AssetTypeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,6 @@ public function update(AssetTypeUpdateRequest $request, AssetType $assetType): A
/**
* Remove the specified resource from storage.
*
*
*
* @throws \Exception
*/
public function destroy(AssetType $assetType): ApiResource
Expand Down
5 changes: 3 additions & 2 deletions src/backend/app/Http/Controllers/AuthController.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function login()
{
$credentials = request(['email', 'password']);

if (! $token = auth('api')->attempt($credentials)) {
if (!$token = auth('api')->attempt($credentials)) {
return response()->json(['data' => ['message' => 'Unauthorized', 'status' => 401]], 401);
}

Expand Down Expand Up @@ -75,7 +75,8 @@ public function refresh()
/**
* Get the token array structure.
*
* @param string $token
* @param string $token
*
* @return JsonResponse
*/
protected function respondWithToken($token)
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/Http/Controllers/CompanyController.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function () use ($company, $plugins) {
'-',
$mpmPlugin->tail_tag
) : null,
'adjusted' => ! isset($mpmPlugin->tail_tag),
'adjusted' => !isset($mpmPlugin->tail_tag),
];
Artisan::call($mpmPlugin->installation_command);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public function store(ManufacturerRequest $request): JsonResponse
/**
* Display the specified resource.
*
* @param int $manufacturerId
* @param int $manufacturerId
*/
public function show($manufacturerId): ApiResource
{
Expand Down
1 change: 0 additions & 1 deletion src/backend/app/Http/Controllers/MeterController.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ public function index(Request $request): ApiResource
* Create
* Stores a new meter.
*
*
* @bodyParam serial_number string required
* @bodyParam meter_type_id int required
* @bodyParam manufacturer_id int required
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function index($miniGridId): ApiResource
*
* @urlParam person required The ID of the person
*
* @param int $person
* @param int $person
*
* @responseFile responses/people/person.meter.list.json
*/
Expand All @@ -70,7 +70,7 @@ public function show(int $personId): ApiResource
*
* @bodyParam points string. Comma seperated latitude and longitude. Example 1,2
*
* @param Meter $meter
* @param Meter $meter
*/
public function update(Request $request): ApiResource
{
Expand Down
2 changes: 1 addition & 1 deletion src/backend/app/Http/Controllers/MeterTariffController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function index(Request $request): ApiResource
*
* @responseFile responses/tariffs/tariff.detail.json
*
* @param MeterTariff $tariff
* @param MeterTariff $tariff
*/
public function show(Request $request, $meterTariffId): ApiResource
{
Expand Down
4 changes: 2 additions & 2 deletions src/backend/app/Http/Controllers/MeterTypeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public function store(MeterTypeCreateRequest $request)
*
* @bodyParam id int required
*
* @param int $meterTypeId
* @param int $meterTypeId
*/
public function show($meterTypeId): ApiResource
{
Expand All @@ -72,7 +72,7 @@ public function show($meterTypeId): ApiResource
* @bodyParam phase int required
* @bodyParam max_current int required
*
* @param int $meterTypeId
* @param int $meterTypeId
*/
public function update(MeterTypeUpdateRequest $request, $meterTypeId): ApiResource
{
Expand Down
4 changes: 2 additions & 2 deletions src/backend/app/Http/Controllers/MiniGridController.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function index(Request $request): ApiResource
*
* @bodyParam id int required
*
* @param int $id
* @param int $id
*/
public function show($miniGridId, Request $request): ApiResource
{
Expand Down Expand Up @@ -66,7 +66,7 @@ public function store(StoreMiniGridRequest $request): ApiResource
*
* @bodyParam name string The name of the MiniGrid.
*
* @param MiniGrid $miniGrid
* @param MiniGrid $miniGrid
*/
public function update($miniGridId, UpdateMiniGridRequest $request): ApiResource
{
Expand Down
Loading

0 comments on commit c74d731

Please sign in to comment.