Skip to content
This repository was archived by the owner on Sep 10, 2023. It is now read-only.

Commit 65e61bd

Browse files
committed
Improved code formatting quality
1 parent 8fb62d6 commit 65e61bd

4 files changed

Lines changed: 19 additions & 39 deletions

File tree

demo/convert-document.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,10 @@
2121
$binaryData = $reportingCloud->convertDocument($sourceFilename, 'PDF');
2222

2323
if ($binaryData) {
24-
2524
var_dump("{$sourceFilename} was converted");
26-
2725
file_put_contents($destinationFilename, $binaryData);
28-
2926
var_dump("And written to {$destinationFilename}");
3027
} else {
31-
3228
var_dump("Error converting {$sourceFilename}");
3329
}
3430

demo/find-and-replace-document.php

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,18 @@
2020
];
2121

2222
$mergeSettings = [
23-
24-
'creation_date' => time(),
25-
'last_modification_date' => time(),
26-
23+
'author' => 'James Henry Trotter',
24+
'creation_date' => time(),
25+
'creator_application' => 'The Giant Peach',
26+
'document_subject' => 'The Old Green Grasshopper',
27+
'document_title' => 'James and the Giant Peach',
28+
'last_modification_date' => time(),
29+
'merge_html' => false,
2730
'remove_empty_blocks' => true,
2831
'remove_empty_fields' => true,
2932
'remove_empty_images' => true,
3033
'remove_trailing_whitespace' => true,
31-
32-
'author' => 'James Henry Trotter',
33-
'creator_application' => 'The Giant Peach',
34-
'document_subject' => 'The Old Green Grasshopper',
35-
'document_title' => 'James and the Giant Peach',
36-
37-
'user_password' => '1',
34+
'user_password' => '1',
3835
];
3936

4037
$binaryData = $reportingCloud->findAndReplaceDocument($findAndReplaceData, 'PDF', null, $sourceFilename, $mergeSettings);

demo/merge-document-advanced.php

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
// ---------------------------------------------------------------------------------------------------------------------
1515

1616
$mergeData = [
17-
0 => [
17+
[
1818
'yourcompany_companyname' => 'Text Control, LLC',
1919
'yourcompany_zip' => '28226',
2020
'yourcompany_city' => 'Charlotte',
@@ -44,15 +44,15 @@
4444
'recipient_street' => '1 Washington Dr',
4545
'recipient_phone' => '887 267 3356',
4646
'item' => [
47-
0 => [
47+
[
4848
'qty' => '1',
4949
'item_no' => '1',
5050
'item_description' => 'Item description 1',
5151
'item_unitprice' => '2663',
5252
'item_discount' => '20',
5353
'item_total' => '2130.40',
5454
],
55-
1 => [
55+
[
5656
'qty' => '1',
5757
'item_no' => '2',
5858
'item_description' => 'Item description 2',
@@ -110,21 +110,18 @@
110110
// mergeSettings are set
111111

112112
$mergeSettings = [
113-
114-
'creation_date' => time(),
115-
'last_modification_date' => time(),
116-
113+
'author' => 'James Henry Trotter',
114+
'creation_date' => time(),
115+
'creator_application' => 'The Giant Peach',
116+
'document_subject' => 'The Old Green Grasshopper',
117+
'document_title' => 'James and the Giant Peach',
118+
'last_modification_date' => time(),
119+
'merge_html' => false,
117120
'remove_empty_blocks' => true,
118121
'remove_empty_fields' => true,
119122
'remove_empty_images' => true,
120123
'remove_trailing_whitespace' => true,
121-
122-
'author' => 'James Henry Trotter',
123-
'creator_application' => 'The Giant Peach',
124-
'document_subject' => 'The Old Green Grasshopper',
125-
'document_title' => 'James and the Giant Peach',
126-
127-
'user_password' => '1',
124+
'user_password' => '1',
128125
];
129126

130127
$sourceFilename = REPORTING_CLOUD_DEMO_MEDIA_PATH . '/test_template.tx';

demo/template-management.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,10 @@
2323
// Uploaded, if it is not
2424

2525
if (!$reportingCloud->templateExists($templateName)) {
26-
2726
var_dump("{$templateName} is not in template storage");
28-
2927
if ($reportingCloud->uploadTemplate($sourceFilename)) {
30-
3128
var_dump("Uploaded {$sourceFilename}");
3229
} else {
33-
3430
var_dump("Error uploading {$sourceFilename}");
3531
}
3632
}
@@ -50,14 +46,10 @@
5046
$binaryData = $reportingCloud->downloadTemplate($templateName);
5147

5248
if ($binaryData) {
53-
5449
var_dump("{$templateName} was downloaded");
55-
5650
file_put_contents($destinationFilename, $binaryData);
57-
5851
var_dump("{$templateName} was written to {$destinationFilename}");
5952
} else {
60-
6153
var_dump("Error downloading {$templateName}");
6254
}
6355

@@ -90,10 +82,8 @@
9082
// Delete a template in template storage
9183

9284
if ($reportingCloud->deleteTemplate($templateName)) {
93-
9485
var_dump("{$templateName} was deleted");
9586
} else {
96-
9787
var_dump("Error deleting {$templateName}");
9888
}
9989

0 commit comments

Comments
 (0)