Skip to content

Commit 395cc0d

Browse files
committed
chore: apply php-cs rules
Signed-off-by: Vitor Mattos <[email protected]>
1 parent ba6f4cb commit 395cc0d

13 files changed

+27
-14
lines changed

src/Command.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace mikehaertl\pdftk;
34

45
use mikehaertl\shellcommand\Command as BaseCommand;

src/FdfFile.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace mikehaertl\pdftk;
34

45
use mikehaertl\tmp\File;
@@ -15,13 +16,13 @@
1516
class FdfFile extends File
1617
{
1718
// FDF file header
18-
const FDF_HEADER = <<<FDF
19+
private const FDF_HEADER = <<<FDF
1920
%FDF-1.2
2021
1 0 obj<</FDF<< /Fields[
2122
FDF;
2223

2324
// FDF file footer
24-
const FDF_FOOTER = <<<FDF
25+
private const FDF_FOOTER = <<<FDF
2526
] >> >>
2627
endobj
2728
trailer

src/InfoFields.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace mikehaertl\pdftk;
34

45
use ArrayObject;

src/InfoFile.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace mikehaertl\pdftk;
34

45
use Exception;

src/Pdf.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace mikehaertl\pdftk;
34

45
use mikehaertl\tmp\File;
@@ -18,7 +19,7 @@
1819
class Pdf
1920
{
2021
// The prefix for temporary files
21-
const TMP_PREFIX = 'tmp_php_pdftk_';
22+
private const TMP_PREFIX = 'tmp_php_pdftk_';
2223

2324
/**
2425
* @var bool whether to ignore any errors if some non-empty output file was
@@ -669,7 +670,7 @@ public function toString()
669670
public function getCommand()
670671
{
671672
if ($this->_command === null) {
672-
$this->_command = new Command;
673+
$this->_command = new Command();
673674
}
674675
return $this->_command;
675676
}

src/XfdfFile.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace mikehaertl\pdftk;
34

45
use mikehaertl\tmp\File;
@@ -52,15 +53,15 @@
5253
class XfdfFile extends File
5354
{
5455
// XFDF file header
55-
const XFDF_HEADER = <<<FDF
56+
private const XFDF_HEADER = <<<FDF
5657
<?xml version="1.0" encoding="UTF-8"?>
5758
<xfdf xmlns="http://ns.adobe.com/xfdf/" xml:space="preserve">
5859
<fields>
5960
6061
FDF;
6162

6263
// XFDF file footer
63-
const XFDF_FOOTER = <<<FDF
64+
private const XFDF_FOOTER = <<<FDF
6465
</fields>
6566
</xfdf>
6667
@@ -198,14 +199,14 @@ protected function writeXml($fields)
198199
protected function writeFields($fp, $fields)
199200
{
200201
foreach ($fields as $key => $value) {
201-
$key = $this->xmlEncode(substr($key,1));
202+
$key = $this->xmlEncode(substr($key, 1));
202203
fwrite($fp, "<field name=\"$key\">\n");
203204
if (!is_array($value)) {
204205
$value = array($value);
205206
}
206207
if (array_key_exists(0, $value)) {
207208
// Numeric keys: single or multi-value field
208-
foreach($value as $val) {
209+
foreach ($value as $val) {
209210
$val = $this->xmlEncode($val);
210211
fwrite($fp, "<value>$val</value>\n");
211212
}

tests/unit/CommandTest.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace tests;
34

45
use PHPUnit\Framework\TestCase;
@@ -21,7 +22,7 @@ public function testCanAddFiles()
2122
$document2 = $this->getDocument2();
2223
$file = $this->getOutFile();
2324

24-
$command = new Command;
25+
$command = new Command();
2526
$this->assertEquals(0, $command->getFileCount());
2627
$this->assertInstanceOf('mikehaertl\pdftk\Command', $command->addFile($document1, 'A'));
2728
$this->assertInstanceOf('mikehaertl\pdftk\Command', $command->addFile($document2, 'B', 'complex\'"password'));
@@ -37,7 +38,7 @@ public function testCanAddOptions()
3738
$document1 = $this->getDocument1();
3839
$file = $this->getOutFile();
3940

40-
$command = new Command;
41+
$command = new Command();
4142
$this->assertInstanceOf('mikehaertl\pdftk\Command', $command->addFile($document1, 'A'));
4243
$this->assertInstanceOf('mikehaertl\pdftk\Command', $command->addOption('encrypt_40bit'));
4344
$this->assertInstanceOf('mikehaertl\pdftk\Command', $command->addOption('allow', 'Printing', false));
@@ -53,7 +54,7 @@ public function testCanSetAndGetOperationAndArgument()
5354
$document1 = $this->getDocument1();
5455
$file = $this->getOutFile();
5556

56-
$command = new Command;
57+
$command = new Command();
5758
$this->assertInstanceOf('mikehaertl\pdftk\Command', $command->addFile($document1, 'A'));
5859
$this->assertInstanceOf('mikehaertl\pdftk\Command', $command->setOperation('cat'));
5960
$this->assertInstanceOf('mikehaertl\pdftk\Command', $command->setOperationArgument('A'));
@@ -70,7 +71,7 @@ public function testCanAddPageRanges()
7071
$document1 = $this->getDocument1();
7172
$file = $this->getOutFile();
7273

73-
$command = new Command;
74+
$command = new Command();
7475
$this->assertInstanceOf('mikehaertl\pdftk\Command', $command->addFile($document1, 'A'));
7576
$this->assertInstanceOf('mikehaertl\pdftk\Command', $command->setOperation('cat'));
7677
$this->assertInstanceOf('mikehaertl\pdftk\Command', $command->addPageRange(1));

tests/unit/DataFieldsTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace tests;
34

45
use PHPUnit\Framework\TestCase;

tests/unit/FdfFileTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace tests;
34

45
use PHPUnit\Framework\TestCase;

tests/unit/InfoFieldsTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace tests;
34

45
use PHPUnit\Framework\TestCase;

0 commit comments

Comments
 (0)