Skip to content

Commit 6d8344d

Browse files
authored
Revamp (#74)
* Upgrade libraries and fix tests * [#68] Ignoring non stylesheet link tags * Composer normalize * Tweak tests * Composer normalize * Remove Coversall * Tests * Cleanup * Code style, fix typos, tweak tests
1 parent 9a3b18a commit 6d8344d

24 files changed

+2934
-171
lines changed

.dependabot/config.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
version: 1
2+
update_configs:
3+
- package_manager: "php:composer"
4+
directory: "/"
5+
update_schedule: "daily"

.github/workflows/main.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: CI
2+
on: [push]
3+
jobs:
4+
test:
5+
runs-on: ubuntu-latest
6+
strategy:
7+
fail-fast: false
8+
matrix:
9+
php-versions: ['7.3', '7.4']
10+
steps:
11+
- uses: actions/checkout@v1
12+
- name: Setup PHP
13+
uses: shivammathur/setup-php@v1
14+
with:
15+
php-version: ${{ matrix.php-versions }}
16+
extensions: mbstring, intl, xml
17+
coverage: xdebug
18+
tools: prestissimo
19+
- name: Get composer cache directory
20+
id: composer-cache
21+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
22+
- name: Cache composer dependencies
23+
uses: actions/cache@v1
24+
with:
25+
path: ${{ steps.composer-cache.outputs.dir }}
26+
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
27+
restore-keys: ${{ runner.os }}-composer-
28+
- name: Install Composer dependencies
29+
run: composer install --no-ansi --no-interaction --no-progress --optimize-autoloader
30+
- name: Setup Problem Matchers for PHPUnit
31+
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
32+
- name: Test with phpunit
33+
run: vendor/bin/phpunit --coverage-text
34+
- name: Sensiolabs Security checker
35+
working-directory: ${{env.working-directory}}
36+
run: |
37+
wget https://get.sensiolabs.org/security-checker.phar
38+
php security-checker.phar security:check
39+
composer-normalize:
40+
runs-on: ubuntu-latest
41+
steps:
42+
- uses: actions/checkout@v1
43+
- name: Composer normalize
44+
uses: localheinz/composer-normalize-action@0.5.2

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
vendor/
22
build/
33
composer.phar
4-
composer.lock
54
.DS_Store
5+
.idea/
6+
.phpunit.result.cache

.scrutinizer.yml

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

.travis.yml

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

README.md

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,7 @@
11
Laravel Mail CSS Inliner
22
========================
33

4-
[![Travis Badge](https://secure.travis-ci.org/fedeisas/laravel-mail-css-inliner.png)](http://travis-ci.org/fedeisas/laravel-mail-css-inliner)
5-
[![Coverage Status](https://coveralls.io/repos/fedeisas/laravel-mail-css-inliner/badge.png)](https://coveralls.io/r/fedeisas/laravel-mail-css-inliner)
4+
![](https://github.com/realeflow/sitebuilder/workflows/CI/badge.svg)
65
[![Latest Stable Version](https://poser.pugx.org/fedeisas/laravel-mail-css-inliner/v/stable.png)](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)
76
[![Latest Unstable Version](https://poser.pugx.org/fedeisas/laravel-mail-css-inliner/v/unstable.png)](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)
87
[![Total Downloads](https://poser.pugx.org/fedeisas/laravel-mail-css-inliner/downloads.png)](https://packagist.org/packages/fedeisas/laravel-mail-css-inliner)
@@ -62,21 +61,13 @@ Into this:
6261
```
6362

6463
## Installation
65-
This package needs Laravel 5.x or 6.x.
64+
This package needs Laravel 7.x.
6665

6766
Begin by installing this package through Composer. Require it directly from the Terminal to take the last stable version:
6867
```bash
6968
$ composer require fedeisas/laravel-mail-css-inliner
7069
```
7170

72-
Once this operation completes, you must add the service provider if you are on Laravel 5.4 or older. Open `app/config/app.php`, and add a new item to the providers array.
73-
```php
74-
'providers' => [
75-
// ...
76-
Fedeisas\LaravelMailCssInliner\LaravelMailCssInlinerServiceProvider::class,
77-
],
78-
```
79-
8071
At this point the inliner should be already working with the default options. If you want to fine-tune these options, you can do so by publishing the configuration file:
8172
```bash
8273
$ php artisan vendor:publish --provider='Fedeisas\LaravelMailCssInliner\LaravelMailCssInlinerServiceProvider'
@@ -87,10 +78,7 @@ and changing the settings on the generated `config/css-inliner.php` file.
8778
```bash
8879
$ composer install
8980
$ ./vendor/bin/phpunit
90-
$ ./vendor/bin/phpcs --standard=phpcs.xml ./src/
91-
$ ./vendor/bin/phpcs --standard=phpcs.xml ./tests/;
9281
```
93-
In addition to a full test suite, there is Travis integration.
9482

9583
## Found a bug?
9684
Please, let me know! Send a pull request or a patch. Questions? Ask! I will respond to all filed issues.

composer.json

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,27 @@
11
{
22
"name": "fedeisas/laravel-mail-css-inliner",
33
"description": "Inline the CSS of your HTML emails using Laravel",
4+
"keywords": [
5+
"laravel",
6+
"mailer",
7+
"css"
8+
],
49
"license": "MIT",
5-
"keywords": ["laravel", "mailer", "css"],
610
"authors": [
711
{
812
"name": "Fede Isas",
913
"email": "fedeisas@hotmail.com"
1014
}
1115
],
1216
"require": {
13-
"php": ">=5.4.0",
14-
"illuminate/support": "^7.0",
17+
"php": "^7.2.5",
18+
"ext-dom": "*",
19+
"illuminate/support": "^7.4",
1520
"tijsverkoyen/css-to-inline-styles": "~2.0"
1621
},
17-
"require-dev" : {
18-
"phpunit/phpunit": "~5.7",
19-
"squizlabs/php_codesniffer": "^2.3",
20-
"swiftmailer/swiftmailer": "~5.0"
21-
},
22-
"autoload": {
23-
"psr-4": {
24-
"Fedeisas\\LaravelMailCssInliner\\": "src/"
25-
}
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"
22+
"require-dev": {
23+
"phpunit/phpunit": "^8.5",
24+
"swiftmailer/swiftmailer": "^6.0"
3625
},
3726
"config": {
3827
"sort-packages": true
@@ -43,5 +32,15 @@
4332
"Fedeisas\\LaravelMailCssInliner\\LaravelMailCssInlinerServiceProvider"
4433
]
4534
}
35+
},
36+
"autoload": {
37+
"psr-4": {
38+
"Fedeisas\\LaravelMailCssInliner\\": "src/"
39+
}
40+
},
41+
"autoload-dev": {
42+
"psr-4": {
43+
"Tests\\": "tests/"
44+
}
4645
}
4746
}

0 commit comments

Comments
 (0)