Skip to content

Commit

Permalink
Update PHPDocs
Browse files Browse the repository at this point in the history
  • Loading branch information
AbdullahKaram-Dev committed Dec 26, 2023
1 parent c357a74 commit 5c576dd
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Services/LaravelSvg.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct(
protected string $lastWord = '',
protected bool $withLogoText = false,
protected string $svgTemplate = '',
protected int $wordsCount = 0
protected int $wordsCount = 0
)
{
$this->settings = config('laravel-svg');
Expand All @@ -38,6 +38,7 @@ public function __construct(
* @param $key
* @return string
*/

protected function getSetting($key): string
{
if (isset($this->settings[$key]) && !empty($this->settings[$key])) {
Expand Down Expand Up @@ -128,13 +129,13 @@ protected function saveSvg(): array
} else {
$svgName = $this->firstWord . '-' . $this->lastWord . '.svg';
}
File::put(public_path($this->getSetting('folder').'/'.$this->getSetting('default_svg_path')).'/'.$svgName, $this->svgTemplate);
File::put(public_path($this->getSetting('folder') . '/' . $this->getSetting('default_svg_path')) . '/' . $svgName, $this->svgTemplate);
return [
'name' => $svgName,
'path' => $this->getSetting('default_svg_path') . '/' . $svgName,
'full_path' => asset($this->getSetting('folder').'/'.$this->getSetting('default_svg_path')).'/'.$svgName,
'full_path' => asset($this->getSetting('folder') . '/' . $this->getSetting('default_svg_path')) . '/' . $svgName,
'mime_type' => self::DEFAULT_SVG_TYPE,
'size' => File::size(public_path($this->getSetting('folder').'/'.$this->getSetting('default_svg_path')).'/'.$svgName),
'size' => File::size(public_path($this->getSetting('folder') . '/' . $this->getSetting('default_svg_path')) . '/' . $svgName),
'disk' => 'public'
];
}
Expand All @@ -145,8 +146,8 @@ protected function saveSvg(): array
*/
protected function checkDisk(): void
{
if (!File::exists(public_path($this->getSetting('folder').'/'.$this->getSetting('default_svg_path')))) {
File::makeDirectory(public_path($this->getSetting('folder').'/'.$this->getSetting('default_svg_path')));
if (!File::exists(public_path($this->getSetting('folder') . '/' . $this->getSetting('default_svg_path')))) {
File::makeDirectory(public_path($this->getSetting('folder') . '/' . $this->getSetting('default_svg_path')));
}
}

Expand Down

0 comments on commit 5c576dd

Please sign in to comment.