Skip to content

Commit b66bfbc

Browse files
committed
formatted php files
1 parent 821e0a4 commit b66bfbc

File tree

591 files changed

+4743
-6979
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

591 files changed

+4743
-6979
lines changed

app/Casts/Currency.php

+8-10
Original file line numberDiff line numberDiff line change
@@ -6,29 +6,27 @@
66
use Illuminate\Database\Eloquent\Model;
77
use NumberFormatter as NF;
88

9-
class Currency implements CastsAttributes
10-
{
11-
public function __construct()
12-
{
9+
class Currency implements CastsAttributes {
10+
public function __construct() {
1311
}
12+
1413
/**
1514
* Cast the given value.
1615
*
17-
* @param array<string, mixed> $attributes
16+
* @param array<string, mixed> $attributes
1817
*/
19-
public function get(Model $model, string $key, mixed $value, array $attributes): mixed
20-
{
18+
public function get(Model $model, string $key, mixed $value, array $attributes): mixed {
2119
$formatter = new NF('en_BD', NF::DEFAULT_STYLE);
20+
2221
return $formatter->format($value);
2322
}
2423

2524
/**
2625
* Prepare the given value for storage.
2726
*
28-
* @param array<string, mixed> $attributes
27+
* @param array<string, mixed> $attributes
2928
*/
30-
public function set(Model $model, string $key, mixed $value, array $attributes): mixed
31-
{
29+
public function set(Model $model, string $key, mixed $value, array $attributes): mixed {
3230
return $value;
3331
}
3432
}

app/Casts/Json.php

+5-8
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,22 @@
55
use Illuminate\Contracts\Database\Eloquent\CastsAttributes;
66
use Illuminate\Database\Eloquent\Model;
77

8-
class Json implements CastsAttributes
9-
{
8+
class Json implements CastsAttributes {
109
/**
1110
* Cast the given value.
1211
*
13-
* @param array<string, mixed> $attributes
12+
* @param array<string, mixed> $attributes
1413
*/
15-
public function get(Model $model, string $key, mixed $value, array $attributes): mixed
16-
{
14+
public function get(Model $model, string $key, mixed $value, array $attributes): mixed {
1715
return json_decode($value);
1816
}
1917

2018
/**
2119
* Prepare the given value for storage.
2220
*
23-
* @param array<string, mixed> $attributes
21+
* @param array<string, mixed> $attributes
2422
*/
25-
public function set(Model $model, string $key, mixed $value, array $attributes): mixed
26-
{
23+
public function set(Model $model, string $key, mixed $value, array $attributes): mixed {
2724
return json_encode($value);
2825
}
2926
}

app/Console/Kernel.php

+3-6
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,11 @@
55
use Illuminate\Console\Scheduling\Schedule;
66
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
77

8-
class Kernel extends ConsoleKernel
9-
{
8+
class Kernel extends ConsoleKernel {
109
/**
1110
* Define the application's command schedule.
1211
*/
13-
protected function schedule(Schedule $schedule): void
14-
{
12+
protected function schedule(Schedule $schedule): void {
1513
$schedule->command('queue:work --stop-when-empty')
1614
->everyMinute()
1715
->withoutOverlapping();
@@ -21,8 +19,7 @@ protected function schedule(Schedule $schedule): void
2119
/**
2220
* Register the commands for the application.
2321
*/
24-
protected function commands(): void
25-
{
22+
protected function commands(): void {
2623
$this->load(__DIR__.'/Commands');
2724

2825
require base_path('routes/console.php');
+4-10
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,24 @@
11
<?php
2+
23
namespace App\DTOs\CustomService;
3-
use App\Enums\PageName;
4+
45
use App\Http\Requests\CustomService\CustomServiceRequest;
56

6-
class CustomServiceDto
7-
{
7+
class CustomServiceDto {
88
public function __construct(
99
public readonly string $title,
1010
public readonly string $description,
1111
public readonly string $link,
1212
public readonly string $page_name,
13-
1413
) {
1514
}
1615

17-
public static function transformRequest(CustomServiceRequest $request) : self
18-
{
16+
public static function transformRequest(CustomServiceRequest $request): self {
1917
return new self(
2018
$request->title,
2119
$request->description,
2220
$request->link,
2321
$request->page_name,
2422
);
2523
}
26-
2724
}
28-
29-
30-
?>

app/DTOs/Image/ImageDto.php

+4-9
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,14 @@
1-
<?php
1+
<?php
2+
23
namespace App\DTOs\Image;
34

4-
class ImageDto
5-
{
5+
class ImageDto {
66
public function __construct(
77
public readonly string $imageable_id,
88
public readonly string $imageable_type,
99
public readonly string $path,
1010
public readonly ?string $url,
1111
public readonly ?string $mime_type,
12-
)
13-
{
12+
) {
1413
}
1514
}
16-
17-
18-
19-
?>

app/Enums/PageName.php

+3-8
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,8 @@
11
<?php
2-
namespace App\Enums;
3-
42

3+
namespace App\Enums;
54

6-
enum PageName: string
7-
{
8-
case Home = 'homepage';
5+
enum PageName: string {
6+
case Home = 'homepage';
97
case Account = 'account';
108
}
11-
12-
13-
?>

app/Exceptions/Handler.php

+4-9
Original file line numberDiff line numberDiff line change
@@ -5,24 +5,21 @@
55
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
66
use Throwable;
77

8-
class Handler extends ExceptionHandler
9-
{
8+
class Handler extends ExceptionHandler {
109
/**
1110
* A list of exception types with their corresponding custom log levels.
1211
*
13-
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
12+
* @var array<class-string<Throwable>, \Psr\Log\LogLevel::*>
1413
*/
1514
protected $levels = [
16-
//
1715
];
1816

1917
/**
2018
* A list of the exception types that are not reported.
2119
*
22-
* @var array<int, class-string<\Throwable>>
20+
* @var array<int, class-string<Throwable>>
2321
*/
2422
protected $dontReport = [
25-
//
2623
];
2724

2825
/**
@@ -39,10 +36,8 @@ class Handler extends ExceptionHandler
3936
/**
4037
* Register the exception handling callbacks for the application.
4138
*/
42-
public function register(): void
43-
{
39+
public function register(): void {
4440
$this->reportable(function (Throwable $e) {
45-
//
4641
});
4742
}
4843
}

app/Filter/InvoiceFilter.php

+1-6
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,7 @@
22

33
namespace App\Filter;
44

5-
use App\Filter\QueryFilter;
6-
use Illuminate\Http\Request;
7-
8-
9-
class InvoiceFilter extends QueryFilter
10-
{
5+
class InvoiceFilter extends QueryFilter {
116
protected $allowedParams = [
127
'client' => ['eq'],
138
'reference' => ['eq'],

app/Filter/QueryFilter.php

+6-10
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@
44

55
use Illuminate\Http\Request;
66

7-
class QueryFilter
8-
{
7+
class QueryFilter {
98
protected $allowedParams = [];
109
protected $columnMap = [];
1110

12-
1311
protected $operatorMap = [
1412
'eq' => '=',
1513
'ne' => '!=',
@@ -22,9 +20,7 @@ class QueryFilter
2220
'in' => 'IN',
2321
];
2422

25-
26-
public function transform(Request $request)
27-
{
23+
public function transform(Request $request) {
2824
$eloQuery = [];
2925
foreach ($this->allowedParams as $param => $operators) {
3026
$query = $request->query($param);
@@ -34,17 +30,17 @@ public function transform(Request $request)
3430
}
3531
$column = $this->columnMap[$param];
3632

37-
foreach ($operators as $operator) {
38-
33+
foreach ($operators as $operator) {
3934
if (str_contains($query, $operator)) {
4035
$index = strpos($query, ']') + 1;
4136
$value = substr($query, $index);
42-
$eloQuery[] = ($operator === 'like' || $operator === 'nl') ?
43-
[$column, $this->operatorMap[$operator], "%" . $value . "%"]
37+
$eloQuery[] = ('like' === $operator || 'nl' === $operator) ?
38+
[$column, $this->operatorMap[$operator], '%'.$value.'%']
4439
: [$column, $this->operatorMap[$operator], $value];
4540
}
4641
}
4742
}
43+
4844
return $eloQuery;
4945
}
5046
}

app/Helper/CSV.php

+10-12
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,23 @@
44

55
use Illuminate\Http\UploadedFile;
66

7-
class CSV
8-
{
7+
class CSV {
98
public $path;
10-
public function __construct(string $path = null)
11-
{
9+
10+
public function __construct(?string $path = null) {
1211
$this->path = $path;
1312
}
1413

15-
function upload(UploadedFile $file) : string {
16-
$path = saveImage(image:$file, disk: 'temp', dir: 'csv');
17-
$this->path = 'temp/'.$path;
18-
return $path;
14+
public function upload(UploadedFile $file): string {
15+
$path = saveImage(image: $file, disk: 'temp', dir: 'csv');
16+
$this->path = 'temp/'.$path;
17+
18+
return $path;
1919
}
2020

21-
public function parse()
22-
{
21+
public function parse() {
2322
$rows = [];
24-
$handle = fopen($this->path, "r");
23+
$handle = fopen($this->path, 'r');
2524
while (($row = fgetcsv($handle)) !== false) {
2625
$rows[] = $row;
2726
}
@@ -30,6 +29,5 @@ public function parse()
3029
$headers = array_shift($rows);
3130

3231
return compact('headers', 'rows');
33-
3432
}
3533
}

app/Helper/Flash.php

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
<?php
2-
namespace App\Helper;
1+
<?php
32

4-
class Flash{
3+
namespace App\Helper;
54

5+
class Flash {
66
}
7-
?>

0 commit comments

Comments
 (0)