Skip to content

Commit 674e3a7

Browse files
authored
Merge pull request #1 from typesetsh/feature/upgrade-typeset
chore: add package auto-discovery, update readme, code style
2 parents 6d63570 + 4723428 commit 674e3a7

File tree

10 files changed

+43
-46
lines changed

10 files changed

+43
-46
lines changed

.php_cs.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
$finder = PhpCsFixer\Finder::create()
4+
->in(__DIR__ . '/config')
45
->in(__DIR__ . '/src')
56
;
67

README.md

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,28 +12,13 @@ in your laravel project. Typeset.sh is a printcss layout and rendering engine wr
1212

1313
Make sure you have access to a valid composer token from typeset.sh.
1414

15-
Add typeset.sh packages repository to composer.
15+
Add typeset.sh package repository to composer and install the package via composer:
1616

1717
composer config repositories.typesetsh composer https://packages.typeset.sh
1818
composer require typesetsh/laravel-wrapper
1919

20+
The package will be automatically discovered in your application thanks to [package auto-discovery](https://laravel.com/docs/8.x/packages#package-discovery).
2021

21-
Then add the following line to register provider in `config/app.php`
22-
```php
23-
'providers' => [
24-
25-
// ...
26-
27-
App\Providers\AppServiceProvider::class,
28-
App\Providers\AuthServiceProvider::class,
29-
App\Providers\EventServiceProvider::class,
30-
App\Providers\RouteServiceProvider::class,
31-
[+] Typesetsh\LaravelWrapper\ServiceProvider::class,
32-
33-
],
34-
```
35-
36-
3722
## Usage
3823

3924
The wrapper works similar to the view. Technically it wraps the view and uses its html output

composer.json

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
{
88
"name": "Jacob Siefer",
99
"email": "[email protected]"
10+
},
11+
{
12+
"name": "Rouven Alexander Rieker",
13+
"email": "[email protected]"
1014
}
1115
],
1216
"minimum-stability": "stable",
@@ -15,21 +19,25 @@
1519
"typesetsh/typesetsh": "^0.14"
1620
},
1721
"require-dev": {
18-
"friendsofphp/php-cs-fixer": "^2.17@dev",
19-
"phan/phan": "dev-master"
22+
"friendsofphp/php-cs-fixer": "^2.16"
2023
},
2124
"autoload": {
2225
"psr-4": {
2326
"Typesetsh\\LaravelWrapper\\": "src/"
2427
},
25-
"files": ["src/helper.php"]
28+
"files": [
29+
"src/helper.php"
30+
]
2631
},
27-
"autoload-dev": {
28-
"psr-4": {
29-
"Typesetsh\\LaravelWrapper\\": "tests/unit/"
32+
"extra": {
33+
"laravel": {
34+
"providers": [
35+
"Typesetsh\\LaravelWrapper\\TypesetServiceProvider"
36+
]
3037
}
3138
},
32-
"repositories": [{
39+
"repositories": [
40+
{
3341
"type": "composer",
3442
"url": "https://packages.typeset.sh"
3543
}

config/typesetsh.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@
1212
|
1313
*/
1414

15-
'allowed_directories' => [public_path()],
15+
'allowed_directories' => [
16+
public_path(),
17+
],
1618

1719
/*
1820
|--------------------------------------------------------------------------

src/Facades/Pdf.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<?php
22
/**
3-
* @copyright Copyright (c) 2020 Jacob Siefer
4-
*
5-
* @see LICENSE
3+
* Copyright (c) 2020 Jacob Siefer
4+
* See LICENSE bundled with this package for license details.
65
*/
76

7+
declare(strict_types=1);
8+
89
namespace Typesetsh\LaravelWrapper\Facades;
910

10-
use Typesetsh\LaravelWrapper\PdfView;
11+
use Typesetsh\LaravelWrapper\Pdf\View;
1112

1213
/**
13-
* @method static PdfView make($view, array $data = [], array $mergeData = [])
14+
* @method static View make($view, array $data = [], array $mergeData = [])
1415
*/
1516
class Pdf extends \Illuminate\Support\Facades\Facade
1617
{

src/Pdf/Factory.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
/**
3-
* @copyright Copyright (c) 2020 Jacob Siefer
4-
*
5-
* @see LICENSE
3+
* Copyright (c) 2020 Jacob Siefer
4+
* See LICENSE bundled with this package for license details.
65
*/
6+
77
declare(strict_types=1);
88

99
namespace Typesetsh\LaravelWrapper\Pdf;

src/Pdf/View.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
<?php
22
/**
3-
* @copyright Copyright (c) 2020 Jacob Siefer
4-
*
5-
* @see LICENSE
3+
* Copyright (c) 2020 Jacob Siefer
4+
* See LICENSE bundled with this package for license details.
65
*/
6+
77
declare(strict_types=1);
88

99
namespace Typesetsh\LaravelWrapper\Pdf;
1010

1111
use Illuminate\Contracts\Support\Renderable;
1212
use Illuminate\Contracts\Support\Responsable;
1313
use Illuminate\Contracts\View\View as HtmlView;
14+
use Illuminate\Http\Request;
1415
use Symfony\Component\HttpFoundation\StreamedResponse;
1516
use Typesetsh\LaravelWrapper\Typesetsh;
1617

@@ -54,7 +55,7 @@ public function render(): string
5455
/**
5556
* Create an HTTP response that represents the object.
5657
*
57-
* @param \Illuminate\Http\Request $request
58+
* @param Request $request
5859
*/
5960
public function toResponse($request): StreamedResponse
6061
{

src/ServiceProvider.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
/**
3-
* @copyright Copyright (c) 2020 Jacob Siefer
4-
*
5-
* @see LICENSE
3+
* Copyright (c) 2020 Jacob Siefer
4+
* See LICENSE bundled with this package for license details.
65
*/
6+
77
declare(strict_types=1);
88

99
namespace Typesetsh\LaravelWrapper;

src/Typesetsh.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22
/**
3-
* @copyright Copyright (c) 2020 Jacob Siefer
4-
*
5-
* @see LICENSE
3+
* Copyright (c) 2020 Jacob Siefer
4+
* See LICENSE bundled with this package for license details.
65
*/
6+
77
declare(strict_types=1);
88

99
namespace Typesetsh\LaravelWrapper;

src/helper.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
<?php
22
/**
3-
* @copyright Copyright (c) 2020 Jacob Siefer
4-
*
5-
* @see LICENSE
3+
* Copyright (c) 2020 Jacob Siefer
4+
* See LICENSE bundled with this package for license details.
65
*/
76

87
namespace typesetsh;

0 commit comments

Comments
 (0)