Skip to content

Commit 5e828b9

Browse files
committed
Modernizing Package
1 parent 183c9d1 commit 5e828b9

11 files changed

+96
-65
lines changed

.editorconfig

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
; This file is for unifying the coding style for different editors and IDEs.
2+
; More information at http://editorconfig.org
3+
4+
root = true
5+
6+
[*]
7+
charset = utf-8
8+
indent_size = 4
9+
indent_style = space
10+
end_of_line = lf
11+
insert_final_newline = true
12+
trim_trailing_whitespace = true
13+
14+
[*.md]
15+
trim_trailing_whitespace = false

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
/vendor
2-
/build
1+
vendor/
2+
build/
33
composer.phar
44
composer.lock
55
.DS_Store

.scrutinizer.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
filter:
2+
excluded_paths: [tests/*]
3+
4+
checks:
5+
php:
6+
remove_extra_empty_lines: true
7+
remove_php_closing_tag: true
8+
remove_trailing_whitespace: true
9+
fix_use_statements:
10+
remove_unused: true
11+
preserve_multiple: false
12+
preserve_blanklines: true
13+
order_alphabetically: true
14+
fix_php_opening_tag: true
15+
fix_linefeed: true
16+
fix_line_ending: true
17+
fix_identation_4spaces: true
18+
fix_doc_comments: true
19+
20+
tools:
21+
external_code_coverage:
22+
timeout: 600
23+
runs: 3

.styleci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
preset: psr2

composer.json

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,26 @@
1515
"tijsverkoyen/css-to-inline-styles": "~2.0"
1616
},
1717
"require-dev" : {
18-
"jakub-onderka/php-parallel-lint": "0.8.*",
19-
"jakub-onderka/php-console-highlighter": "0.3.*",
20-
"phpmd/phpmd": "~1.5",
21-
"phpunit/phpunit": "~4.0",
22-
"satooshi/php-coveralls": "~0.7@dev",
23-
"squizlabs/php_codesniffer": "~1.5",
18+
"phpunit/phpunit": "~5.7",
19+
"squizlabs/php_codesniffer": "^2.3",
2420
"swiftmailer/swiftmailer": "~5.0"
2521
},
2622
"autoload": {
2723
"psr-4": {
2824
"Fedeisas\\LaravelMailCssInliner\\": "src/"
2925
}
26+
},
27+
"autoload-dev": {
28+
"psr-4": {
29+
"Tests\\": "tests/"
30+
}
31+
},
32+
"scripts": {
33+
"test": "phpunit",
34+
"check-style": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests",
35+
"fix-style": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests"
36+
},
37+
"config": {
38+
"sort-packages": true
3039
}
3140
}

phpcs.xml

Lines changed: 0 additions & 15 deletions
This file was deleted.

phpmd.xml

Lines changed: 0 additions & 27 deletions
This file was deleted.

phpunit.xml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,11 @@
2323
<directory suffix=".php">./src</directory>
2424
</whitelist>
2525
</filter>
26+
<logging>
27+
<log type="tap" target="build/report.tap"/>
28+
<log type="junit" target="build/report.junit.xml"/>
29+
<log type="coverage-html" target="build/coverage" charset="UTF-8" yui="true" highlight="true"/>
30+
<log type="coverage-text" target="build/coverage.txt"/>
31+
<log type="coverage-clover" target="build/logs/clover.xml"/>
32+
</logging>
2633
</phpunit>

src/CssInlinerPlugin.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ public function loadOptions($options)
7474

7575
/**
7676
* Find CSS stylesheet links and load them
77-
*
78-
* Loads the body of the message and passes
77+
*
78+
* Loads the body of the message and passes
7979
* any link stylesheets to $this->css
8080
* Removes any link elements
81-
*
81+
*
8282
* @return string $message The message
8383
*/
8484
public function loadCssFilesFromLinks($message)

src/LaravelMailCssInlinerServiceProvider.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
use Illuminate\Support\ServiceProvider;
44
use Swift_Mailer;
5+
use Fedeisas\LaravelMailCssInliner\CssInlinerPlugin;
56

67
class LaravelMailCssInlinerServiceProvider extends ServiceProvider
78
{
@@ -13,7 +14,7 @@ class LaravelMailCssInlinerServiceProvider extends ServiceProvider
1314
public function boot()
1415
{
1516
$this->publishes([
16-
__DIR__.'/../config/css-inliner.php' => config_path('css-inliner.php'),
17+
__DIR__ . '/../config/css-inliner.php' => config_path('css-inliner.php'),
1718
], 'config');
1819
}
1920

@@ -24,14 +25,14 @@ public function boot()
2425
*/
2526
public function register()
2627
{
27-
$this->mergeConfigFrom(__DIR__.'/../config/css-inliner.php', 'css-inliner');
28+
$this->mergeConfigFrom(__DIR__ . '/../config/css-inliner.php', 'css-inliner');
2829

29-
$this->app->singleton('Fedeisas\LaravelMailCssInliner\CssInlinerPlugin', function ($app) {
30+
$this->app->singleton(CssInlinerPlugin::class, function ($app) {
3031
return new CssInlinerPlugin($app['config']->get('css-inliner'));
3132
});
3233

3334
$this->app->extend('swift.mailer', function (Swift_Mailer $swiftMailer, $app) {
34-
$inlinerPlugin = $app->make('Fedeisas\LaravelMailCssInliner\CssInlinerPlugin');
35+
$inlinerPlugin = $app->make(CssInlinerPlugin::class);
3536
$swiftMailer->registerPlugin($inlinerPlugin);
3637
return $swiftMailer;
3738
});

0 commit comments

Comments
 (0)