We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.
@@ -224,10 +224,10 @@ |
||
224 | 224 | // add the details_row button to the first column |
225 | 225 | if ($this->getOperationSetting('detailsRow')) { |
226 | 226 | $details_row_button = \View::make('crud::columns.inc.details_row_button') |
227 | - ->with('crud', $this) |
|
228 | - ->with('entry', $entry) |
|
229 | - ->with('row_number', $rowNumber) |
|
230 | - ->render(); |
|
227 | + ->with('crud', $this) |
|
228 | + ->with('entry', $entry) |
|
229 | + ->with('row_number', $rowNumber) |
|
230 | + ->render(); |
|
231 | 231 | $row_items[0] = $details_row_button.$row_items[0]; |
232 | 232 | } |
233 | 233 |
@@ -33,35 +33,35 @@ |
||
33 | 33 | $old_primary_dependency = old_empty_or_null($primary_dependency['name'], false) ?? false; |
34 | 34 | $old_secondary_dependency = old_empty_or_null($secondary_dependency['name'], false) ?? false; |
35 | 35 | |
36 | - //for update form, get initial state of the entity |
|
37 | - if (isset($id) && $id) { |
|
36 | + //for update form, get initial state of the entity |
|
37 | + if (isset($id) && $id) { |
|
38 | 38 | |
39 | 39 | //get entity with relations for primary dependency |
40 | - $entity_dependencies = $entity_model->with($primary_dependency['entity']) |
|
41 | - ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary']) |
|
42 | - ->find($id); |
|
40 | + $entity_dependencies = $entity_model->with($primary_dependency['entity']) |
|
41 | + ->with($primary_dependency['entity'].'.'.$primary_dependency['entity_secondary']) |
|
42 | + ->find($id); |
|
43 | 43 | |
44 | - $secondaries_from_primary = []; |
|
44 | + $secondaries_from_primary = []; |
|
45 | 45 | |
46 | - //convert relation in array |
|
47 | - $primary_array = $entity_dependencies->{$primary_dependency['entity']}->toArray(); |
|
46 | + //convert relation in array |
|
47 | + $primary_array = $entity_dependencies->{$primary_dependency['entity']}->toArray(); |
|
48 | 48 | |
49 | - $secondary_ids = []; |
|
50 | - //create secondary dependency from primary relation, used to check what checkbox must be checked from second checklist |
|
51 | - if ($old_primary_dependency) { |
|
52 | - foreach ($old_primary_dependency as $primary_item) { |
|
53 | - foreach ($dependencyArray[$primary_item] as $second_item) { |
|
54 | - $secondary_ids[$second_item] = $second_item; |
|
55 | - } |
|
56 | - } |
|
57 | - } else { //create dependencies from relation if not from validate error |
|
58 | - foreach ($primary_array as $primary_item) { |
|
59 | - foreach ($primary_item[$secondary_dependency['entity']] as $second_item) { |
|
60 | - $secondary_ids[$second_item['id']] = $second_item['id']; |
|
61 | - } |
|
62 | - } |
|
63 | - } |
|
64 | - } |
|
49 | + $secondary_ids = []; |
|
50 | + //create secondary dependency from primary relation, used to check what checkbox must be checked from second checklist |
|
51 | + if ($old_primary_dependency) { |
|
52 | + foreach ($old_primary_dependency as $primary_item) { |
|
53 | + foreach ($dependencyArray[$primary_item] as $second_item) { |
|
54 | + $secondary_ids[$second_item] = $second_item; |
|
55 | + } |
|
56 | + } |
|
57 | + } else { //create dependencies from relation if not from validate error |
|
58 | + foreach ($primary_array as $primary_item) { |
|
59 | + foreach ($primary_item[$secondary_dependency['entity']] as $second_item) { |
|
60 | + $secondary_ids[$second_item['id']] = $second_item['id']; |
|
61 | + } |
|
62 | + } |
|
63 | + } |
|
64 | + } |
|
65 | 65 | |
66 | 66 | //json encode of dependency matrix |
67 | 67 | $dependencyJson = json_encode($dependencyArray); |
@@ -17,10 +17,10 @@ |
||
17 | 17 | |
18 | 18 | public function testItCanEnableAndDisableGroupedErrors() |
19 | 19 | { |
20 | - $this->crudPanel->setOperation('create'); |
|
21 | - $this->crudPanel->enableGroupedErrors(); |
|
22 | - $this->assertTrue($this->crudPanel->groupedErrorsEnabled()); |
|
23 | - $this->crudPanel->disableGroupedErrors(); |
|
24 | - $this->assertFalse($this->crudPanel->groupedErrorsEnabled()); |
|
20 | + $this->crudPanel->setOperation('create'); |
|
21 | + $this->crudPanel->enableGroupedErrors(); |
|
22 | + $this->assertTrue($this->crudPanel->groupedErrorsEnabled()); |
|
23 | + $this->crudPanel->disableGroupedErrors(); |
|
24 | + $this->assertFalse($this->crudPanel->groupedErrorsEnabled()); |
|
25 | 25 | } |
26 | 26 | } |
@@ -6,12 +6,12 @@ |
||
6 | 6 | */ |
7 | 7 | class CrudPanelAutofocusTest extends BaseCrudPanelTest |
8 | 8 | { |
9 | - public function testItCanEnableAndDisableAutofocus() |
|
10 | - { |
|
11 | - $this->crudPanel->setOperation('create'); |
|
12 | - $this->crudPanel->enableAutoFocus(); |
|
13 | - $this->assertTrue($this->crudPanel->getAutoFocusOnFirstField()); |
|
14 | - $this->crudPanel->disableAutofocus(); |
|
15 | - $this->assertFalse($this->crudPanel->getAutoFocusOnFirstField()); |
|
16 | - } |
|
9 | + public function testItCanEnableAndDisableAutofocus() |
|
10 | + { |
|
11 | + $this->crudPanel->setOperation('create'); |
|
12 | + $this->crudPanel->enableAutoFocus(); |
|
13 | + $this->assertTrue($this->crudPanel->getAutoFocusOnFirstField()); |
|
14 | + $this->crudPanel->disableAutofocus(); |
|
15 | + $this->assertFalse($this->crudPanel->getAutoFocusOnFirstField()); |
|
16 | + } |
|
17 | 17 | } |
@@ -7,26 +7,26 @@ |
||
7 | 7 | */ |
8 | 8 | class CrudPanelMacroTest extends BaseCrudPanelTest |
9 | 9 | { |
10 | - public function testItCanRegisterMacro() |
|
11 | - { |
|
12 | - $this->crudPanel::macro('validMacro',function() { |
|
13 | - return true; |
|
14 | - }); |
|
10 | + public function testItCanRegisterMacro() |
|
11 | + { |
|
12 | + $this->crudPanel::macro('validMacro',function() { |
|
13 | + return true; |
|
14 | + }); |
|
15 | 15 | |
16 | - $this->assertTrue($this->crudPanel->validMacro()); |
|
17 | - } |
|
16 | + $this->assertTrue($this->crudPanel->validMacro()); |
|
17 | + } |
|
18 | 18 | |
19 | 19 | public function testThrowsErrorIfMacroExists() |
20 | 20 | { |
21 | - try { |
|
22 | - $this->crudPanel::macro('setModel',function() { |
|
23 | - return true; |
|
24 | - }); |
|
25 | - } catch (\Throwable $e) { |
|
26 | - } |
|
27 | - $this->assertEquals( |
|
28 | - new \Symfony\Component\HttpKernel\Exception\HttpException(500, 'Cannot register \'setModel\' macro. \'setModel()\' already exists on Backpack\CRUD\app\Library\CrudPanel\CrudPanel'), |
|
29 | - $e |
|
30 | - ); |
|
21 | + try { |
|
22 | + $this->crudPanel::macro('setModel',function() { |
|
23 | + return true; |
|
24 | + }); |
|
25 | + } catch (\Throwable $e) { |
|
26 | + } |
|
27 | + $this->assertEquals( |
|
28 | + new \Symfony\Component\HttpKernel\Exception\HttpException(500, 'Cannot register \'setModel\' macro. \'setModel()\' already exists on Backpack\CRUD\app\Library\CrudPanel\CrudPanel'), |
|
29 | + $e |
|
30 | + ); |
|
31 | 31 | } |
32 | 32 | } |
@@ -24,13 +24,13 @@ |
||
24 | 24 | ]; |
25 | 25 | } |
26 | 26 | |
27 | - // allow us to run crud panel private/protected methods like `inferFieldTypeFromDbColumnType` |
|
28 | - public function invokeMethod(&$object, $methodName, array $parameters = []) |
|
29 | - { |
|
30 | - $reflection = new \ReflectionClass(get_class($object)); |
|
31 | - $method = $reflection->getMethod($methodName); |
|
32 | - $method->setAccessible(true); |
|
27 | + // allow us to run crud panel private/protected methods like `inferFieldTypeFromDbColumnType` |
|
28 | + public function invokeMethod(&$object, $methodName, array $parameters = []) |
|
29 | + { |
|
30 | + $reflection = new \ReflectionClass(get_class($object)); |
|
31 | + $method = $reflection->getMethod($methodName); |
|
32 | + $method->setAccessible(true); |
|
33 | 33 | |
34 | - return $method->invokeArgs($object, $parameters); |
|
35 | - } |
|
34 | + return $method->invokeArgs($object, $parameters); |
|
35 | + } |
|
36 | 36 | } |