Skip to content

Commit

Permalink
Revamp (#74)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
fedeisas committed Apr 5, 2020
1 parent 9a3b18a commit 6d8344d
Show file tree
Hide file tree
Showing 24 changed files with 2,934 additions and 171 deletions.
5 changes: 5 additions & 0 deletions .dependabot/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
version: 1
update_configs:
- package_manager: "php:composer"
directory: "/"
update_schedule: "daily"
44 changes: 44 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: CI
on: [push]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
php-versions: ['7.3', '7.4']
steps:
- uses: actions/checkout@v1
- name: Setup PHP
uses: shivammathur/setup-php@v1
with:
php-version: ${{ matrix.php-versions }}
extensions: mbstring, intl, xml
coverage: xdebug
tools: prestissimo
- name: Get composer cache directory
id: composer-cache
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
- name: Cache composer dependencies
uses: actions/cache@v1
with:
path: ${{ steps.composer-cache.outputs.dir }}
key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: ${{ runner.os }}-composer-
- name: Install Composer dependencies
run: composer install --no-ansi --no-interaction --no-progress --optimize-autoloader
- name: Setup Problem Matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Test with phpunit
run: vendor/bin/phpunit --coverage-text
- name: Sensiolabs Security checker
working-directory: ${{env.working-directory}}
run: |
wget https://get.sensiolabs.org/security-checker.phar
php security-checker.phar security:check
composer-normalize:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Composer normalize
uses: localheinz/[email protected]
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
vendor/
build/
composer.phar
composer.lock
.DS_Store
.idea/
.phpunit.result.cache
23 changes: 0 additions & 23 deletions .scrutinizer.yml

This file was deleted.

26 changes: 0 additions & 26 deletions .travis.yml

This file was deleted.

16 changes: 2 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
Laravel Mail CSS Inliner
========================

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

## Installation
This package needs Laravel 5.x or 6.x.
This package needs Laravel 7.x.

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

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.
```php
'providers' => [
// ...
Fedeisas\LaravelMailCssInliner\LaravelMailCssInlinerServiceProvider::class,
],
```

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:
```bash
$ php artisan vendor:publish --provider='Fedeisas\LaravelMailCssInliner\LaravelMailCssInlinerServiceProvider'
Expand All @@ -87,10 +78,7 @@ and changing the settings on the generated `config/css-inliner.php` file.
```bash
$ composer install
$ ./vendor/bin/phpunit
$ ./vendor/bin/phpcs --standard=phpcs.xml ./src/
$ ./vendor/bin/phpcs --standard=phpcs.xml ./tests/;
```
In addition to a full test suite, there is Travis integration.

## Found a bug?
Please, let me know! Send a pull request or a patch. Questions? Ask! I will respond to all filed issues.
Expand Down
43 changes: 21 additions & 22 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
{
"name": "fedeisas/laravel-mail-css-inliner",
"description": "Inline the CSS of your HTML emails using Laravel",
"keywords": [
"laravel",
"mailer",
"css"
],
"license": "MIT",
"keywords": ["laravel", "mailer", "css"],
"authors": [
{
"name": "Fede Isas",
"email": "[email protected]"
}
],
"require": {
"php": ">=5.4.0",
"illuminate/support": "^7.0",
"php": "^7.2.5",
"ext-dom": "*",
"illuminate/support": "^7.4",
"tijsverkoyen/css-to-inline-styles": "~2.0"
},
"require-dev" : {
"phpunit/phpunit": "~5.7",
"squizlabs/php_codesniffer": "^2.3",
"swiftmailer/swiftmailer": "~5.0"
},
"autoload": {
"psr-4": {
"Fedeisas\\LaravelMailCssInliner\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"test": "phpunit",
"check-style": "phpcs -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests",
"fix-style": "phpcbf -p --standard=PSR2 --runtime-set ignore_errors_on_exit 1 --runtime-set ignore_warnings_on_exit 1 src tests"
"require-dev": {
"phpunit/phpunit": "^8.5",
"swiftmailer/swiftmailer": "^6.0"
},
"config": {
"sort-packages": true
Expand All @@ -43,5 +32,15 @@
"Fedeisas\\LaravelMailCssInliner\\LaravelMailCssInlinerServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Fedeisas\\LaravelMailCssInliner\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
}
}
Loading

0 comments on commit 6d8344d

Please sign in to comment.