Skip to content

QA - Use Laravel Pint #17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autoload.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?php

defined('APP_PATH') || define('APP_PATH', realpath(__DIR__ ));
defined('APP_PATH') || define('APP_PATH', realpath(__DIR__));
defined('CONTENT_PATH') || define('CONTENT_PATH', realpath(__DIR__ . '/examples/content'));
require_once 'vendor/autoload.php';
6 changes: 3 additions & 3 deletions dev/DevFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@

namespace EvoSys21\PdfLib\Dev;

use EvoSys21\PdfLib\Multicell;
use EvoSys21\PdfLib\Table;
use EvoSys21\PdfLib\Examples\Fpdf\PdfFactory as FpdfFactory;
use EvoSys21\PdfLib\Examples\Fpdf\PdfSettings as FpdfSettings;
use EvoSys21\PdfLib\Examples\Tcpdf\PdfFactory as TcpdfFactory;
use EvoSys21\PdfLib\Examples\Tcpdf\PdfSettings as TcpdfSettings;
use EvoSys21\PdfLib\Examples\Tfpdf\PdfFactory as TfpdfFactory;
use EvoSys21\PdfLib\Examples\Tfpdf\PdfSettings as TfpdfSettings;
use EvoSys21\PdfLib\Multicell;
use EvoSys21\PdfLib\Table;

class DevFactory
{
Expand All @@ -24,6 +24,7 @@ public function __construct(protected ?string $context = null)
protected function getGlobalContext()
{
global $pdfContext;

return empty($pdfContext) ? 'fpdf' : $pdfContext;
}

Expand All @@ -47,7 +48,6 @@ protected function getSettings()

public function multicell(): Multicell
{

$factory = self::getFactory();
$settings = self::getSettings();

Expand Down
15 changes: 7 additions & 8 deletions dev/dev-example-multicell.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* Pdf Advanced Multicell - Example
*/

require_once __DIR__ . '/../autoload.php';

use EvoSys21\PdfLib\Fpdf\Pdf;
Expand Down Expand Up @@ -42,7 +41,7 @@
$multicell->setStyle('h4', 11, null, null, null, 'h');
$multicell->setStyle('super', 8, null, [255, 102, 153]);

$s = <<<HEREDOC
$s = <<<'HEREDOC'
This line is a simple text with no formatting(text-formatting from the pdf settings)
<p>The following is <s y='-1'>Subscript</s> and <s y='1'>Superscript</s></p>

Expand All @@ -55,7 +54,7 @@

$pdf->ln(10);

$s = <<<HEREDOC
$s = <<<'HEREDOC'
<title>Typography:</title>

<h1>Heading 1</h1>
Expand All @@ -68,9 +67,9 @@

$pdf->ln(10);

$multicell->multiCell(0, 10, "<title>Table of Content:</title>");
$multicell->multiCell(0, 10, '<title>Table of Content:</title>');

$s = <<<HEREDOC
$s = <<<'HEREDOC'
<p width='10'> </p><p> - Paragraph 1</p>
<p width='10'> </p><p> - Paragraph 2</p>
<p width='20'> </p><p> - Paragraph 2.1</p>
Expand All @@ -80,17 +79,17 @@
$multicell->multiCell(0, 5, $s);

$pdf->ln(10);
$multicell->multiCell(0, 10, "<title>Tag width and alignment:</title>");
$multicell->multiCell(0, 10, '<title>Tag width and alignment:</title>');

$s = <<<HEREDOC
$s = <<<'HEREDOC'
<p width="100" align="left"> Align Left </p>
<p width="100" align="center"> Align Center </p>
<p width="100" align="right"> Align Right </p>
HEREDOC;
$multicell->multiCell(100, 5, $s, 1, '', 1);

$pdf->AddPage();
$multicell->multiCell(0, 10, "<title>No wrap:</title> text will not break on normal separators");
$multicell->multiCell(0, 10, '<title>No wrap:</title> text will not break on normal separators');

$s = "The price is <b nowrap='1'>USD 5.344,23</b>";
foreach ([40, 45, 50] as $width) {
Expand Down
5 changes: 2 additions & 3 deletions dev/dev-multicell-shrinking.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
/**
* Pdf Advanced Multicell - Example
*/

$factory = new DevFactory();

// Create the Advanced Multicell Object and inject the PDF object
$multicell = $factory->multicell();
$pdf = $multicell->getPdfObject();

$txt = <<<EOL
$txt = <<<'EOL'
This <b>TCPDF addon</b> allows creation of an <b>Advanced Multicell</b> which uses as input a <b>TAG based formatted string</b> instead of a simple string. The use of tags allows to change the font, the style (<b>bold</b>, <i>italic</i>, <u>underline</u>), the size, and the color of characters and many other features.

<h3>Features:</h3>
Expand Down Expand Up @@ -50,7 +49,7 @@
//
//$pdf->AddPage();

$txt = <<<EOL
$txt = <<<'EOL'
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
EOL;

Expand Down
4 changes: 1 addition & 3 deletions dev/dev-multicell-shrinking3.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* Pdf Advanced Multicell - Example
*/

$factory = new DevFactory();

// Create the Advanced Multicell Object and inject the PDF object
Expand All @@ -12,13 +11,12 @@

$txt = file_get_contents(CONTENT_PATH . '/multicell.txt');


$multicell->maxHeight(100)->shrinkToFit();
$multicell->multiCell(0, 5, $txt, 1, 'J', 1, 3, 3, 3, 3);

//$multicell->maxLines(3)->shrinkToFit();

$txt = <<<EOL
$txt = <<<'EOL'
This <b>TCPDF addon</b> allows creation of an <b>Advanced Multicell</b> which uses as input a <b>TAG based formatted string</b> instead of a simple string. The use of tags allows to change the font, the style (<b>bold</b>, <i>italic</i>, <u>underline</u>), the size, and the color of characters and many other features.
EOL;

Expand Down
2 changes: 1 addition & 1 deletion dev/dev-multicell-shrinking4.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

//$multicell->maxLines(3)->shrinkToFit();

$txt = <<<EOL
$txt = <<<'EOL'
This <b>TCPDF addon</b> allows creation of an <b>Advanced Multicell</b> which uses as input a <b>TAG based formatted string</b> instead of a simple string. The use of tags allows to change the font, the style (<b>bold</b>, <i>italic</i>, <u>underline</u>), the size, and the color of characters and many other features.

<h3>Features:</h3>
Expand Down
2 changes: 0 additions & 2 deletions dev/dev-multicell-style-inheritance.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* Pdf Advanced Multicell - Example
*/

require_once __DIR__ . '/../autoload.php';

use EvoSys21\PdfLib\Fpdf\Pdf;
Expand All @@ -24,7 +23,6 @@
// add a page
$pdf->AddPage();


// Create the Advanced Multicell Object and inject the PDF object
$multicell = new Multicell($pdf);

Expand Down
2 changes: 0 additions & 2 deletions dev/dev-multicell-style-inheritance1.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* Pdf Advanced Multicell - Example
*/

require_once __DIR__ . '/../autoload.php';

use EvoSys21\PdfLib\Fpdf\Pdf;
Expand All @@ -24,7 +23,6 @@
// add a page
$pdf->AddPage();


// Create the Advanced Multicell Object and inject the PDF object
$multicell = new Multicell($pdf);

Expand Down
2 changes: 1 addition & 1 deletion dev/dev-multicell-style.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
$multicell = $factory->multicell();
$pdf = $multicell->getPdfObject();

$txt = <<<EOL
$txt = <<<'EOL'
<code>
<span style="color: #0000BB; font-size: 12px">&lt;?php<br /></span>
<span style="color: #FF8000">/**<br />&nbsp;*&nbsp;Pdf&nbsp;Advanced&nbsp;Multicell&nbsp;-&nbsp;Example<br /></span>
Expand Down
2 changes: 1 addition & 1 deletion dev/dev-multicell-style1.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
$multicell = $factory->multicell();
$pdf = $multicell->getPdfObject();

$txt = <<<EOL
$txt = <<<'EOL'
<code>
<span style="color: #0000BB; font-size: 12px">&lt;?php<br /></span>
<span style="color: #FF8000">/**<br />&nbsp;*&nbsp;Pdf&nbsp;Advanced&nbsp;Multicell&nbsp;-&nbsp;Example<br /></span>
Expand Down
5 changes: 1 addition & 4 deletions dev/example-multicell-dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* Pdf Advanced Multicell - Example
*/

require_once __DIR__ . '/../autoload.php';

use EvoSys21\PdfLib\Fpdf\Pdf;
Expand All @@ -24,7 +23,6 @@
// add a page
$pdf->AddPage();


// Create the Advanced Multicell Object and inject the PDF object
$multicell = new Multicell($pdf);

Expand Down Expand Up @@ -67,7 +65,7 @@
//$pdf->ln(10);

$s = "The price is <b nowrap='1'>USD 5.344,23</b>";
$s1 = "The price is <b>USD 5.344,23</b>";
$s1 = 'The price is <b>USD 5.344,23</b>';
foreach ([40, 45, 50] as $width) {
$multicell->multiCell($width, 5, $s, 0, 'L');
$multicell->multiCell($width, 5, $s1, 0, 'L');
Expand All @@ -91,6 +89,5 @@
//<p width='50'>xxx</p><font> - Paragraph 2</font>";
//$multicell->multiCell(0, 5, $s);


// output the pdf
$pdf->Output();
16 changes: 7 additions & 9 deletions dev/example-table-dev.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* Pdf Advanced Table - Example
*/

require_once __DIR__ . '/../autoload.php';

use EvoSys21\PdfLib\Fpdf\Pdf;
Expand Down Expand Up @@ -52,7 +51,7 @@
'I am cell 2',
[
'TEXT' => 'I am cell 3',
'TEXT_ALIGN' => 'R'
'TEXT_ALIGN' => 'R',
],
];

Expand All @@ -64,7 +63,7 @@
'I am cell 2',
[
'TEXT' => 'I am cell 3',
'TEXT_ALIGN' => 'R'
'TEXT_ALIGN' => 'R',
],
];

Expand All @@ -74,7 +73,7 @@
$row = [
new Image($pdf, CONTENT_PATH . '/images/blog.jpg', 10),
"<p><b>Images</b> are supported\n<bi></bi></p>",
new Image($pdf, CONTENT_PATH . '/images/telescope.jpg', 35, 35)
new Image($pdf, CONTENT_PATH . '/images/telescope.jpg', 35, 35),
];

//add the row to the table
Expand All @@ -88,7 +87,7 @@
'FILE' => CONTENT_PATH . '/images/telescope.jpg',
'WIDTH' => 35,
'HEIGHT' => 35,
]
],
];

//add the data row
Expand All @@ -98,8 +97,8 @@
'TEXT' => 'some text',
'PADDING_TOP' => 0,
'PADDING_BOTTOM' => 0,
'LINE_SIZE' => 42.3
],[
'LINE_SIZE' => 42.3,
], [
'PADDING_TOP' => 0,
'PADDING_BOTTOM' => 0,
'TEXT' => '<h1>Second Column</h1>',
Expand All @@ -110,12 +109,11 @@
$row = [[
'TEXT' => 'some text',
'PADDING_TOP' => 0,
'LINE_SIZE' => 20
'LINE_SIZE' => 20,
]];
//add the data row
$table->addRow($row);


$table->close();

$pdf->output();
5 changes: 2 additions & 3 deletions dev/example-table-dev1.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* Pdf Advanced Table - Example
*/

require_once __DIR__ . '/../autoload.php';

use EvoSys21\PdfLib\Fpdf\Pdf;
Expand Down Expand Up @@ -51,7 +50,7 @@
'I am cell 2',
[
'TEXT' => 'I am cell 3',
'TEXT_ALIGN' => 'R'
'TEXT_ALIGN' => 'R',
],
];

Expand All @@ -69,7 +68,7 @@

//$table->addPageBreak();

$row = [[ 'TEXT' => "Cell\nCell\nCell\nCell\nCell\nCell\nCell\nCell\nCell\nCell\n", 'HEIGHT' => 60, 'PADDING_TOP' => 20]];
$row = [['TEXT' => "Cell\nCell\nCell\nCell\nCell\nCell\nCell\nCell\nCell\nCell\n", 'HEIGHT' => 60, 'PADDING_TOP' => 20]];

$table->addRow($row);

Expand Down
1 change: 0 additions & 1 deletion dev/samples/sample-test-code.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
/**
* Pdf Advanced Multicell - Example
*/

require_once __DIR__ . '/../autoload.php';

//get the PDF object
Expand Down
10 changes: 5 additions & 5 deletions dev/table/disable-page-break.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

use EvoSys21\PdfLib\Table;

if (!isset($splitMode)) {
if (! isset($splitMode)) {
$splitMode = true;
}

Expand Down Expand Up @@ -33,7 +33,7 @@

//Table Header
for ($i = 0; $i < $columns; $i++) {
$header[$i]['TEXT'] = "Header #" . ($i + 1);
$header[$i]['TEXT'] = 'Header #' . ($i + 1);
}

$header1 = $header;
Expand All @@ -47,10 +47,10 @@
$table->addHeader($header);
$table->addHeader($header1);

$sDefaultText = "Lorem ipsum;, dolor sit amet";
$sDefaultText = 'Lorem ipsum;, dolor sit amet';
$sDefaultText2 = "<p>Some Line</p>\n<b>Some text</b>";
$sDefaultLongText = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.";
$sDefaultLongText2 = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur";
$sDefaultLongText = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.';
$sDefaultLongText2 = 'Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur';

$aDefaultRow = [];
for ($i = 0; $i < $columns; $i++) {
Expand Down
Loading
Loading