diff --git a/config/2am-qrcode.php b/config/2am-qrcode.php index fff4837..51d15c5 100644 --- a/config/2am-qrcode.php +++ b/config/2am-qrcode.php @@ -1,3 +1,4 @@ + 16, 'align' => \Da\QrCode\Enums\Label::ALIGN_CENTER, ] -]; \ No newline at end of file +]; diff --git a/routes/laravel.route.php b/routes/laravel.route.php index e3c0ee8..4c68c58 100644 --- a/routes/laravel.route.php +++ b/routes/laravel.route.php @@ -1,7 +1,8 @@ + name('da-qrcode.')->group(function() { +Route::prefix('da-qrcode')->name('da-qrcode.')->group(function () { Route::get('/build', LaravelResourceController::class)->name('build'); -}); \ No newline at end of file +}); diff --git a/src/Component/QrCodeBladeComponent.php b/src/Component/QrCodeBladeComponent.php index 0fbefc5..a00af2f 100644 --- a/src/Component/QrCodeBladeComponent.php +++ b/src/Component/QrCodeBladeComponent.php @@ -1,4 +1,6 @@ + content = $content; $this->format = $format; $this->foreground = $foreground; @@ -164,4 +174,4 @@ public function render() { return view('2am-qrcode::components.qrcode'); } -} \ No newline at end of file +} diff --git a/src/Contracts/ColorsInterface.php b/src/Contracts/ColorsInterface.php index 9a44979..ada98f4 100644 --- a/src/Contracts/ColorsInterface.php +++ b/src/Contracts/ColorsInterface.php @@ -75,4 +75,4 @@ public function buildFillColor(); * @return void */ public function forceUniformRgbColors(): void; -} \ No newline at end of file +} diff --git a/src/Contracts/PathStyleInterface.php b/src/Contracts/PathStyleInterface.php index c91dab3..ed6c99a 100644 --- a/src/Contracts/PathStyleInterface.php +++ b/src/Contracts/PathStyleInterface.php @@ -42,4 +42,4 @@ public function buildModule(); * @return EyeInterface */ public function buildEye(); -} \ No newline at end of file +} diff --git a/src/Controllers/LaravelResourceController.php b/src/Controllers/LaravelResourceController.php index 719139d..3430e15 100644 --- a/src/Controllers/LaravelResourceController.php +++ b/src/Controllers/LaravelResourceController.php @@ -49,4 +49,4 @@ public function __invoke(Request $request) 'Content-Type' => $qrCode->getContentType(), ]); } -} \ No newline at end of file +} diff --git a/src/Enums/Format.php b/src/Enums/Format.php index e381815..e01b875 100644 --- a/src/Enums/Format.php +++ b/src/Enums/Format.php @@ -33,4 +33,4 @@ final class Format extends Enum const VCard = VCardFormat::class; const Wifi = WifiFormat::class; const Youtube = YoutubeFormat::class; -} \ No newline at end of file +} diff --git a/src/Enums/Gradient.php b/src/Enums/Gradient.php index eb72dce..c8889b1 100644 --- a/src/Enums/Gradient.php +++ b/src/Enums/Gradient.php @@ -11,4 +11,4 @@ class Gradient extends Enum public const GRADIENT_RADIAL = 'radial'; public const GRADIENT_DIAGONAL = 'diagonal'; public const GRADIENT_INVERSE_DIAGONAL = 'diagonal_inverse'; -} \ No newline at end of file +} diff --git a/src/Enums/Label.php b/src/Enums/Label.php index 9e0c738..24f488f 100644 --- a/src/Enums/Label.php +++ b/src/Enums/Label.php @@ -9,4 +9,4 @@ final class Label extends Enum const ALIGN_LEFT = 'left'; const ALIGN_RIGHT = 'right'; const ALIGN_CENTER = 'center'; -} \ No newline at end of file +} diff --git a/src/Enums/Path.php b/src/Enums/Path.php index d4f8608..07ae6e3 100644 --- a/src/Enums/Path.php +++ b/src/Enums/Path.php @@ -9,4 +9,4 @@ class Path extends Enum const DOTS = 'dots'; const SQUARE = 'square'; const ROUNDED = 'rounded'; -} \ No newline at end of file +} diff --git a/src/Factory/LaravelQrCodeFactory.php b/src/Factory/LaravelQrCodeFactory.php index 25127c5..d25830f 100644 --- a/src/Factory/LaravelQrCodeFactory.php +++ b/src/Factory/LaravelQrCodeFactory.php @@ -47,8 +47,7 @@ public static function make( ?string $fontPath = null, ?int $fontSize = null, ?string $alignment = null - ): QrCodeInterface - { + ): QrCodeInterface { $qrCode = self::buildQrCode($content, $format); self::applyForeground($qrCode, $foreground); @@ -245,4 +244,4 @@ protected static function validate($content, ?string $format): void throw new Exception('Invalid format. It should be instance of Enum or null, ' . gettype($format) . ' given'); } } -} \ No newline at end of file +} diff --git a/src/Providers/QrCodeServiceProvider.php b/src/Providers/QrCodeServiceProvider.php index b28064d..b3a2a1a 100644 --- a/src/Providers/QrCodeServiceProvider.php +++ b/src/Providers/QrCodeServiceProvider.php @@ -1,4 +1,5 @@ loadViewsFrom(__DIR__ . '/../../resources/views', '2am-qrcode'); - - /** Load package routes */ +/** Load package routes */ $this->loadRoutesFrom(__DIR__ . '/../../routes/laravel.route.php'); - - /** publishes package config */ +/** publishes package config */ $this->publishes([ __DIR__ . '/../../config/2am-qrcode.php' => config_path('2am-qrcode.php'), ], '2am-qrcode-config'); - $this->publishes([ __DIR__ . '/../../resources/views' => resource_path('views/vendor/2am-qrcode'), ], '2am-qrcode-views'); - - /** merges config file with user's published version */ +/** merges config file with user's published version */ $this->mergeConfigFrom(__DIR__ . '/../../config/2am-qrcode.php', '2am-qrcode'); - - /** Declares package's components */ +/** Declares package's components */ Blade::component('qrcode', QrCodeBladeComponent::class, config('2am-qrcode.prefix')); } -} \ No newline at end of file +} diff --git a/src/StyleManager.php b/src/StyleManager.php index 88c27fd..8132e73 100644 --- a/src/StyleManager.php +++ b/src/StyleManager.php @@ -190,7 +190,8 @@ public function getGradientTye() case GradientEnum::GRADIENT_RADIAL: { return GradientType::RADIAL(); } - default: return GradientType::VERTICAL(); + default: + return GradientType::VERTICAL(); } } @@ -244,8 +245,7 @@ public function buildFillColor() $this->getGradientTye(), ) ); - } - else { + } else { return Fill::uniformColor( $this->getBackgroundColor(), $this->getForegroundColor() @@ -259,9 +259,12 @@ public function buildFillColor() public function buildModule() { switch ($this->getPathStyle()) { - case PathStyleInterface::DOTS: return new DotsModule($this->getIntensity()); - case PathStyleInterface::ROUNDED: return new RoundnessModule($this->getIntensity()); - default: return SquareModule::instance(); + case PathStyleInterface::DOTS: + return new DotsModule($this->getIntensity()); + case PathStyleInterface::ROUNDED: + return new RoundnessModule($this->getIntensity()); + default: + return SquareModule::instance(); } } @@ -272,4 +275,4 @@ public function buildEye() { return new ModuleEye($this->buildModule()); } -} \ No newline at end of file +} diff --git a/src/Writer/EpsWriter.php b/src/Writer/EpsWriter.php index 89d1308..7c94b79 100644 --- a/src/Writer/EpsWriter.php +++ b/src/Writer/EpsWriter.php @@ -32,7 +32,8 @@ public function __construct() */ public function writeString(QrCodeInterface $qrCode): string { - $renderer = $this->buildRenderer($qrCode);; + $renderer = $this->buildRenderer($qrCode); + ; $writer = new Writer($renderer);