Skip to content

Commit 1618bf0

Browse files
committed
PHP Code standar Error fixed
1 parent 5e99af0 commit 1618bf0

Some content is hidden

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

75 files changed

+130
-195
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
],
2121
"require": {
2222
"php": "^8.0",
23-
"laravel/framework": "^8.0",
23+
"laravel/framework": "^9.0|^10.0",
2424
"digitaldream/dbreader": "~1.0"
2525
},
2626
"require-dev": {

src/lara-crud/Builder/Controller/Api/DestroyMethod.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Controller\Api;
54

65
use LaraCrud\Builder\Controller\DestroyMethod as ParentDestroyMethod;
76
use LaraCrud\Contracts\Controller\ApiArrayResponseMethod;
87

98
class DestroyMethod extends ParentDestroyMethod implements ApiArrayResponseMethod
109
{
11-
1210
public function array(): array
1311
{
1412
return [

src/lara-crud/Builder/Controller/Api/ForceDeleteMethod.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Controller\Api;
54

65
use LaraCrud\Builder\Controller\ForceDeleteMethod as ParentForceDeleteMethod;
76
use LaraCrud\Contracts\Controller\ApiArrayResponseMethod;
87

98
class ForceDeleteMethod extends ParentForceDeleteMethod implements ApiArrayResponseMethod
109
{
11-
1210
public function array(): array
1311
{
1412
return [

src/lara-crud/Builder/Controller/Api/IndexMethod.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Controller\Api;
54

65
use LaraCrud\Builder\Controller\IndexMethod as ParentIndexMethod;
@@ -12,5 +11,4 @@ public function isCollection(): bool
1211
{
1312
return true;
1413
}
15-
1614
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Controller\Api;
54

65
use LaraCrud\Builder\Controller\RestoreMethod as ParentRestoreMethod;
76
use LaraCrud\Contracts\Controller\ApiResourceResponseMethod;
87

98
class RestoreMethod extends ParentRestoreMethod implements ApiResourceResponseMethod
109
{
11-
1210
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Controller\Api;
54

65
use LaraCrud\Builder\Controller\ShowMethod as ParentShowMethod;
76
use LaraCrud\Contracts\Controller\ApiResourceResponseMethod;
87

98
class ShowMethod extends ParentShowMethod implements ApiResourceResponseMethod
109
{
11-
1210
}
Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Controller\Api;
54

65
use LaraCrud\Builder\Controller\StoreMethod as ParentStoreMethod;
76
use LaraCrud\Contracts\Controller\ApiResourceResponseMethod;
87

98
class StoreMethod extends ParentStoreMethod implements ApiResourceResponseMethod
109
{
11-
1210
}
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,10 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Controller\Api;
54

65
use LaraCrud\Builder\Controller\UpdateMethod as ParentUpdateMethod;
76
use LaraCrud\Contracts\Controller\ApiResourceResponseMethod;
87

98
class UpdateMethod extends ParentUpdateMethod implements ApiResourceResponseMethod
109
{
11-
12-
1310
}
Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Controller;
54

6-
75
class Constructor extends ControllerMethod
86
{
9-
107
}

src/lara-crud/Builder/Controller/ForceDeleteMethod.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,4 @@ public function phpDocComment(): string
3232
{
3333
return sprintf('Remove the specified %s from the bin permanently.', $this->getModelShortName());
3434
}
35-
3635
}

src/lara-crud/Builder/Controller/Web/DestroyMethod.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
class DestroyMethod extends ParentDestroyMethod implements RedirectAbleMethod
99
{
10-
1110
/**
1211
* Name of the Route user will be redirected after successfully Delete.
1312
*
@@ -17,5 +16,4 @@ public function redirectToRouteMethodName(): string
1716
{
1817
return 'index';
1918
}
20-
2119
}

src/lara-crud/Builder/Controller/Web/EditMethod.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
*/
88
class EditMethod extends ShowMethod
99
{
10-
1110
public function phpDocComment(): string
1211
{
1312
return sprintf('Show the form for editing the specified %s.', $this->getModelShortName());

src/lara-crud/Builder/Controller/Web/ForceDeleteMethod.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Controller\Web;
54

65
use LaraCrud\Builder\Controller\ForceDeleteMethod as ParentForceDeleteMethod;
@@ -15,5 +14,4 @@ public function redirectToRouteMethodName(): string
1514
{
1615
return 'index';
1716
}
18-
1917
}

src/lara-crud/Builder/Controller/Web/IndexMethod.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77

88
class IndexMethod extends ParentIndexMethod implements ViewAbleMethod
99
{
10-
1110
}

src/lara-crud/Builder/Controller/Web/RestoreMethod.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77

88
class RestoreMethod extends ParentRestoreMethod implements RedirectAbleMethod
99
{
10-
1110
}

src/lara-crud/Builder/Controller/Web/ShowMethod.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,4 @@
77

88
class ShowMethod extends ParentShowMethod implements ViewAbleMethod
99
{
10-
1110
}

src/lara-crud/Builder/Controller/Web/StoreMethod.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,4 @@
99

1010
class StoreMethod extends ParentStoreMethod implements RedirectAbleMethod
1111
{
12-
1312
}

src/lara-crud/Builder/Model.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,8 @@ public function fillable()
231231
public function dates()
232232
{
233233
//Check if it is a data time column. If so then add it to $protected $dates=[]
234-
if (in_array($this->column->dataType(), ['time', 'date', 'datetime', 'timestamp'])
234+
if (
235+
in_array($this->column->dataType(), ['time', 'date', 'datetime', 'timestamp'])
235236
&& !in_array($this->column->name(), config('laracrud.model.protectedColumns'))
236237
) {
237238
$this->dates[] = "\t" . "'" . $this->column->name() . "'";
@@ -281,9 +282,7 @@ public function mutators()
281282
'column' => $this->column->name(),
282283
]);
283284
$this->mutators[] = $tempMan->get();
284-
285285
} elseif (in_array($this->column->dataType(), ['varchar', 'text', 'tinytext', 'bigtext'])) {
286-
287286
$tempMan = new TemplateManager('model/setAttributeText.txt', [
288287
'columnLabel' => $label,
289288
'column' => $this->column->name(),

src/lara-crud/Builder/Test/Methods/ControllerMethod.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,5 +221,4 @@ protected function setFakeStorage(): self
221221
}
222222
return $this;
223223
}
224-
225224
}

src/lara-crud/Builder/Test/Methods/DestroyMethod.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Test\Methods;
54

6-
75
use LaraCrud\Helpers\TemplateManager;
86

97
class DestroyMethod extends ControllerMethod
108
{
11-
129
public function before()
1310
{
1411
if ($this->isAuthRequired()) {
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Test\Methods;
54

6-
75
use LaraCrud\Helpers\TemplateManager;
86

97
class IndexMethod extends ControllerMethod
108
{
11-
129
public function before()
1310
{
1411
if ($this->isAuthRequired()) {
@@ -18,5 +15,4 @@ public function before()
1815
$this->testMethods[] = (new TemplateManager('test/api/index/a_guest_can_see_list_of_available_models.txt', $this->getGlobalVariables()));
1916
}
2017
}
21-
2218
}

src/lara-crud/Builder/Test/Methods/ShowMethod.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,17 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Test\Methods;
54

6-
75
use LaraCrud\Helpers\TemplateManager;
86

97
class ShowMethod extends ControllerMethod
108
{
11-
129
public function before()
1310
{
1411
if ($this->isAuthRequired()) {
1512
$this->testMethods[] = (new TemplateManager('test/api/show/a_user_can_see_a_model_that_he_created.txt', $this->getGlobalVariables()));
1613
$this->testMethods[] = (new TemplateManager('test/api/show/a_guest_cannot_see_a_model.txt', $this->getGlobalVariables()));
1714
$this->testMethods[] = (new TemplateManager('test/api/show/a_user_cannot_see_others_model.txt', $this->getGlobalVariables('$secondUser')));
18-
1915
} else {
2016
$this->testMethods[] = (new TemplateManager('test/api/show/a_guest_can_see_a_model.txt', $this->getGlobalVariables()));
2117
}

src/lara-crud/Builder/Test/Methods/StoreMethod.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\Test\Methods;
54

6-
75
use LaraCrud\Helpers\TemplateManager;
86

97
class StoreMethod extends ControllerMethod
108
{
11-
129
public function before()
1310
{
1411
if ($this->isAuthRequired()) {
@@ -17,7 +14,7 @@ public function before()
1714
array_merge($this->getGlobalVariables(), ['data' => $this->generatePostData()])
1815
));
1916
}
20-
17+
2118
$this->testMethods[] = (new TemplateManager(
2219
'test/api/store/a_user_can_create_a_new_model.txt',
2320
array_merge($this->getGlobalVariables(), ['data' => $this->generatePostData()])
@@ -33,5 +30,4 @@ public function before()
3330
array_merge($this->getGlobalVariables(), ['data' => $this->generateDataProvider()])
3431
));
3532
}
36-
3733
}

src/lara-crud/Builder/View/TableCell.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
<?php
22

3-
43
namespace LaraCrud\Builder\View;
54

6-
75
use LaraCrud\Contracts\ColumnContract;
86

97
class TableCell

src/lara-crud/Console/Controller.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Created by PhpStorm.
45
* User: Tuhin
@@ -149,7 +150,6 @@ private function checkModelExists()
149150
exit();
150151
}
151152
}
152-
153153
}
154154

155155
/**
@@ -207,5 +207,4 @@ private function isSoftDeleteAble(): bool
207207
{
208208
return in_array(SoftDeletes::class, class_uses($this->model));
209209
}
210-
211210
}

src/lara-crud/Console/Factory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
class Factory extends Command
1010
{
1111
use Helper;
12+
1213
/**
1314
* The name and signature of the console command.
1415
*

src/lara-crud/Console/Migration.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ public function handle()
5959
}
6060
}
6161
} catch (\Exception $ex) {
62-
$this->error($ex->getMessage().' on line '.$ex->getLine().' in '.$ex->getFile());
62+
$this->error($ex->getMessage() . ' on line ' . $ex->getLine() . ' in ' . $ex->getFile());
6363
}
6464
}
6565
}

src/lara-crud/Console/Mvc.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ public function handle()
105105
$this->error($e->getMessage());
106106
}
107107
} catch (\Exception $ex) {
108-
$this->error($ex->getMessage().' on line '.$ex->getLine().' in '.$ex->getFile());
108+
$this->error($ex->getMessage() . ' on line ' . $ex->getLine() . ' in ' . $ex->getFile());
109109
}
110110
}
111111
}

src/lara-crud/Console/Package.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
/**
34
* Created by PhpStorm.
45
* User: Tuhin
@@ -41,7 +42,7 @@ public function handle()
4142

4243
$this->info('Package successfully created');
4344
} catch (\Exception $ex) {
44-
$this->error($ex->getMessage().' on line '.$ex->getLine().' in '.$ex->getFile());
45+
$this->error($ex->getMessage() . ' on line ' . $ex->getLine() . ' in ' . $ex->getFile());
4546
}
4647
}
4748
}

src/lara-crud/Console/Request.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
class Request extends Command
1212
{
1313
use Helper;
14+
1415
/**
1516
* The name and signature of the console command.
1617
*

0 commit comments

Comments
 (0)