Completed
Pull Request — master (#11)
by Nic
08:31
created
tests/SampleManageableDataObject.php 1 patch
Doc Comments   +1 added lines, -1 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@
 block discarded – undo
20 20
     ];
21 21
 
22 22
     /**
23
-     * @return array
23
+     * @return string[]
24 24
      */
25 25
     public function providePermissions()
26 26
     {
Please login to merge, or discard this patch.
tests/ManageableDataObjectExtensionTest.php 1 patch
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -57,11 +57,11 @@  discard block
 block discarded – undo
57 57
     {
58 58
         $this->logInWithPermission('MDO_Edit');
59 59
         $object = $this->objFromFixture(SampleManageableDataObject::class, 'one');
60
-        $response = $this->get('/SampleManageableObjectPage_Controller/edit/' . $object->ID);
60
+        $response = $this->get('/SampleManageableObjectPage_Controller/edit/'.$object->ID);
61 61
         $this->assertEquals(200, $response->getStatusCode());
62 62
         $this->logOut();
63 63
 
64
-        $response2 = $this->get('/SampleManageableObjectPage_Controller/edit/' . 0);
64
+        $response2 = $this->get('/SampleManageableObjectPage_Controller/edit/'.0);
65 65
         $this->assertEquals(404, $response2->getStatusCode());
66 66
     }
67 67
 
@@ -78,10 +78,10 @@  discard block
 block discarded – undo
78 78
 
79 79
         $this->logInWithPermission('MDO_Delete');
80 80
 
81
-        $response404 = $this->get('/SampleManageableObjectPage_Controller/delete/' . 0);
81
+        $response404 = $this->get('/SampleManageableObjectPage_Controller/delete/'.0);
82 82
         $this->assertEquals(404, $response404->getStatusCode());
83 83
 
84
-        $success = $this->get('/SampleManageableObjectPage_Controller/delete/' . $id);
84
+        $success = $this->get('/SampleManageableObjectPage_Controller/delete/'.$id);
85 85
         $this->assertEquals(200, $success->getStatusCode());
86 86
         $this->assertNull(SampleManageableDataObject::get()->byID($id));
87 87
 
@@ -106,7 +106,7 @@  discard block
 block discarded – undo
106 106
 
107 107
         $record = SampleManageableDataObject::get()->filter($data)->first();
108 108
         $this->assertInstanceOf(SampleManageableDataObject::class, $record);
109
-        $this->assertTrue($record->exists());//*/
109
+        $this->assertTrue($record->exists()); //*/
110 110
     }
111 111
 
112 112
 }
113 113
\ No newline at end of file
Please login to merge, or discard this patch.
code/extensions/ManageableDataObjectExtension.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -28,14 +28,14 @@  discard block
 block discarded – undo
28 28
         if ($object->canCreate(Member::currentUser())) {
29 29
 
30 30
             $form = $this->ManageableDataObjectForm();
31
-            if($object->config()->get('add_form_cancel_button')){
31
+            if ($object->config()->get('add_form_cancel_button')) {
32 32
                 $form->Actions()->push(new CancelFormAction($this->owner->Link(), 'Cancel'));
33 33
             }
34 34
 
35 35
             return $this->owner->customise([
36 36
                 'Title' => ($this->owner->config()->get('add_item_title'))
37 37
                     ? $this->owner->config()->get('add_item_title')
38
-                    : 'Add new ' . $object->singular_name(),
38
+                    : 'Add new '.$object->singular_name(),
39 39
                 'ManageableDataObjectForm' => $form,
40 40
             ]);
41 41
         }
@@ -57,7 +57,7 @@  discard block
 block discarded – undo
57 57
                 $form = $this->ManageableDataObjectForm($item);
58 58
 
59 59
                 return $this->owner->customise([
60
-                    'Title' => 'Edit ' . $item->singular_name(),
60
+                    'Title' => 'Edit '.$item->singular_name(),
61 61
                     'ManageableDataObjectForm' => $form,
62 62
                     'Item' => $item,
63 63
                 ]);
Please login to merge, or discard this patch.