Skip to content

Commit

Permalink
Apply StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
janiscw committed Mar 26, 2024
1 parent b029c85 commit 6795c5a
Show file tree
Hide file tree
Showing 8 changed files with 29 additions and 31 deletions.
2 changes: 1 addition & 1 deletion config/pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,5 +77,5 @@
| Define the writer class. It must implement the PdfWriter interface.
|
*/
'writer' => PdflibPdfWriter::class
'writer' => PdflibPdfWriter::class,
];
6 changes: 3 additions & 3 deletions src/Files/FileManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public function templatePath($fileName)
/**
* Return the path of a font.
*
* @param $name
* @param $name
* @param string $type
* @return string
*
Expand Down Expand Up @@ -142,8 +142,8 @@ protected static function absolutePath($disk, $prefix, $fileName = null)
/**
* Get the absolut path for document's different location.
*
* @param $location
* @param $fileName
* @param $location
* @param $fileName
* @return string
*
* @throws DifferentLocationException
Expand Down
8 changes: 4 additions & 4 deletions src/Helpers/MeasureCalculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ class MeasureCalculator
const ptToMm = 0.352777778;

/**
* @param $measure
* @param $unit
* @param $measure
* @param $unit
* @return float
*
* @throws MeasureException
Expand All @@ -22,8 +22,8 @@ public static function calculateToPt($measure, $unit = null)
}

/**
* @param $measure
* @param $unit
* @param $measure
* @param $unit
* @return float
*
* @throws MeasureException
Expand Down
4 changes: 1 addition & 3 deletions src/Pdf.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ public function create(): bool
}

/**
* @param $fileName
*
* @param $fileName
* @return void
*/
private function previewFileName($fileName = null)
Expand All @@ -186,7 +185,6 @@ private function previewFileName($fileName = null)
$extensionPos = strrpos($this->fileName, '.');
$this->fileName = substr($this->fileName, 0, $extensionPos) . '_preview' . substr($this->fileName, $extensionPos);
}

}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/PdflibServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ class PdflibServiceProvider extends ServiceProvider
* Register services.
*
* @return void
*
* @throws Exception
*/
public function register()
Expand All @@ -31,14 +32,13 @@ public function register()
config('pdf.creator', 'Laravel')
);

if($writer instanceof PdfWriter !== true) {
if ($writer instanceof PdfWriter !== true) {
throw new \Exception('Writer must implement PdfWriter interface');
}

return $writer;
});


$this->app->bind('pdf', function () {
return new Pdf(
$this->app->make(PdfWriter::class)
Expand Down
18 changes: 9 additions & 9 deletions src/Writers/PdfWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ interface PdfWriter
/**
* Define the search path for fonts.
*
* @param $searchPath
* @param $searchPath
* @return $this
*/
public function defineFontSearchPath($searchPath);
Expand Down Expand Up @@ -72,7 +72,7 @@ public function loadTemplate($absolutPath, $optlist = null);
/**
* Copy a template page into the current document.
*
* @param $pageNumber
* @param $pageNumber
* @return $this
*/
public function fromTemplatePage($pageNumber);
Expand Down Expand Up @@ -164,7 +164,7 @@ public function writeText($text);
/**
* Write a line of text.
*
* @param $text
* @param $text
* @param string|null $optlist
* @return $this
*/
Expand Down Expand Up @@ -240,8 +240,8 @@ public function drawLine($xFrom, $xTo, $yFrom, $yTo, $lineWidth = 0.3, $unit = n
/**
* Set the writer's position.
*
* @param $x
* @param $y
* @param $x
* @param $y
* @param null $unit
* @return $this
*
Expand All @@ -252,9 +252,9 @@ public function setPosition($x, $y, $unit = null);
/**
* Set X position of the writer.
*
* @param $measure
* @param $measure
* @param string $unit
* @param $ignoreOffset
* @param $ignoreOffset
* @return $this
*
* @throws MeasureException
Expand Down Expand Up @@ -314,7 +314,7 @@ public function getElementSize($infobox, $corner);
/**
* Set X offset for preview.
*
* @param $measure
* @param $measure
* @param string $unit
* @return $this
*
Expand All @@ -325,7 +325,7 @@ public function setXOffset($measure, $unit = null);
/**
* Set Y offset for preview.
*
* @param $measure
* @param $measure
* @param string $unit
* @return $this
*
Expand Down
14 changes: 7 additions & 7 deletions src/Writers/PdflibPdfWriter.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ class PdflibPdfWriter extends PDFlib implements PdfWriter
/**
* Current font size.
*
* @var integer
* @var int
*/
protected $fontSize;

Expand All @@ -109,8 +109,8 @@ class PdflibPdfWriter extends PDFlib implements PdfWriter
/**
* PdflibPdfWriter constructor.
*
* @param $license
* @param $creator
* @param $license
* @param $creator
*/
public function __construct($license, $creator)
{
Expand Down Expand Up @@ -545,7 +545,7 @@ public function getElementSize($element, $dimension = 'width')
*/
public function setXOffset($measure, $unit = null)
{
$measure = MeasureCalculator::calculateToPt($measure, $unit ?: config('pdf.measurement.unit', 'pt'));
$measure = MeasureCalculator::calculateToPt($measure, $unit ?: config('pdf.measurement.unit', 'pt'));
$this->xOffset = $measure;

return $this;
Expand All @@ -556,7 +556,7 @@ public function setXOffset($measure, $unit = null)
*/
public function setYOffset($measure, $unit = null)
{
$measure = MeasureCalculator::calculateToPt($measure, $unit ?: config('pdf.measurement.unit', 'pt'));
$measure = MeasureCalculator::calculateToPt($measure, $unit ?: config('pdf.measurement.unit', 'pt'));
$this->yOffset = $measure;

return $this;
Expand Down Expand Up @@ -585,8 +585,8 @@ public function disableOffset()
/**
* Loads existing or new image.
*
* @param $imagePath
* @param $loadOptions
* @param $imagePath
* @param $loadOptions
* @return int
*
* @throws ImageException
Expand Down
4 changes: 2 additions & 2 deletions tests/Files/PathHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class PathHelper
/**
* Generate an absolute path and removes old file with this path.
*
* @param $fileName
* @param $diskName
* @param $fileName
* @param $diskName
* @param null $path
* @param bool $cleanup
* @return string
Expand Down

0 comments on commit 6795c5a

Please sign in to comment.