Skip to content

Commit a79f986

Browse files
committed
Minor fixes
1 parent e321ea5 commit a79f986

10 files changed

+168
-19
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

.gitattributes

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.gitattributes export-ignore
6+
/.gitignore export-ignore
7+
/.travis.yml export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/.scrutinizer.yml export-ignore
10+
/tests export-ignore
11+
/.editorconfig export-ignore

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
build
12
composer.lock
3+
docs
24
tests/temp
35
vendor
6+
coverage

.styleci.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
preset: laravel
22

3-
linting: true
4-
53
disabled:
64
- single_class_element_per_statement
5+
- self_accessor

.travis.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ php:
55
- 5.6
66
- 7.0
77
- 7.1
8+
- 7.2
89

910
env:
1011
matrix:
@@ -17,3 +18,6 @@ before_script:
1718

1819
script:
1920
- vendor/bin/phpunit
21+
22+
after_script:
23+
- php vendor/bin/ocular code-coverage:upload --format=php-clover coverage.clover

CHANGELOG.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Changelog
2+
3+
All notable changes to `laravel-sri` will be documented in this file
4+
5+
## 1.0.6 - 2018-08-16
6+
7+
- Fix compatibility for Laravel 5.6
8+
- Implement info method on Hasher
9+
10+
## 1.0.5 - 2018-02-09
11+
12+
- Add support for Laravel 5.6
13+
14+
## 1.0.4 - 2017-09-28
15+
16+
- Add support for Laravel 5.5
17+
18+
## 1.0.3 - 2017-01-24
19+
20+
- Add support for Laravel 5.4
21+
22+
## 1.0.2 - 2016-10-26
23+
24+
- Refactor integrity helper
25+
26+
## 1.0.1 - 2016-10-25
27+
28+
- Install orchestra/testbench v3.2
29+
30+
## 1.0.0 - 2016-10-25
31+
32+
- Initial release

CONTRIBUTING.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing
2+
3+
Contributions are **welcome** and will be fully **credited**.
4+
5+
Please read and understand the contribution guide before creating an issue or pull request.
6+
7+
## Etiquette
8+
9+
This project is open source, and as such, the maintainers give their free time to build and maintain the source code
10+
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
11+
extremely unfair for them to suffer abuse or anger for their hard work.
12+
13+
Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
14+
world that developers are civilized and selfless people.
15+
16+
It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
17+
quality to benefit the project. Many developers have different skillsets, strengths, and weaknesses. Respect the maintainer's decision, and do not be upset or abusive if your submission is not used.
18+
19+
## Viability
20+
21+
When requesting or submitting new features, first consider whether it might be useful to others. Open
22+
source projects are used by many developers, who may have entirely different needs to your own. Think about
23+
whether or not your feature is likely to be used by other users of the project.
24+
25+
## Procedure
26+
27+
Before filing an issue:
28+
29+
- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
30+
- Check to make sure your feature suggestion isn't already present within the project.
31+
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
32+
- Check the pull requests tab to ensure that the feature isn't already in progress.
33+
34+
Before submitting a pull request:
35+
36+
- Check the codebase to ensure that your feature doesn't already exist.
37+
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.
38+
39+
## Requirements
40+
41+
If the project maintainer has any additional requirements, you will find them listed here.
42+
43+
- **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)** - The easiest way to apply the conventions is to install [PHP Code Sniffer](https://pear.php.net/package/PHP_CodeSniffer).
44+
45+
- **Add tests!** - Your patch won't be accepted if it doesn't have tests.
46+
47+
- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.
48+
49+
- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.
50+
51+
- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.
52+
53+
- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](https://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.
54+
55+
**Happy coding**!

LICENSE renamed to LICENSE.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
MIT License
1+
The MIT License (MIT)
22

3-
Copyright (c) [2016] [Sébastien Nikolaou]
3+
Copyright (c) Sébastien Nikolaou <info@sebdesign.eu>
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal
@@ -9,13 +9,13 @@ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
99
copies of the Software, and to permit persons to whom the Software is
1010
furnished to do so, subject to the following conditions:
1111

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
1414

1515
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
1616
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
1717
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1818
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1919
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

Lines changed: 33 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ Subresource Integrity (SRI) package for Laravel
55
[![Latest Version on Packagist](https://img.shields.io/packagist/v/sebdesign/laravel-sri.svg)](https://packagist.org/packages/sebdesign/laravel-sri)
66
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md)
77
[![Build Status](https://img.shields.io/travis/sebdesign/laravel-sri/master.svg)](https://travis-ci.org/sebdesign/laravel-sri)
8+
[![StyleCI](https://github.styleci.io/repos/71842300/shield)](https://github.styleci.io/repos/71842300)
89

910
Reference and generate [Subresource Integrity (SRI)](https://www.w3.org/TR/SRI/) hashes from your Laravel Elixir asset pipeline.
1011

@@ -13,7 +14,7 @@ Reference and generate [Subresource Integrity (SRI)](https://www.w3.org/TR/SRI/)
1314
You can install the package via composer:
1415

1516
```bash
16-
$ composer require sebdesign/laravel-sri
17+
composer require sebdesign/laravel-sri
1718
```
1819

1920
Laravel 5.5 uses Package Auto-Discovery, so doesn't require you to manually add the service provider.
@@ -22,7 +23,6 @@ If you don't use auto-discovery or you are using an older version, you must add
2223
```php
2324
// config/app.php
2425
'providers' => [
25-
...
2626
Sebdesign\SRI\SubresourceIntegrityServiceProvider::class,
2727
];
2828
```
@@ -36,11 +36,19 @@ To reference the generated hashes from the `sri.json` in your views, you may use
3636
As a fallback, if the given file is not found in the `sri.json`, **it will generate the appropriate hashes on the fly** for your convenience.
3737

3838
```php
39-
{{-- Use with elixir() function --}}
40-
<link rel="stylesheet" href="{{ elixir('css/app.css') }}" integrity="{{ integrity('css/app.css') }}" crossorigin="anonymous">
41-
42-
{{-- Use with asset() function --}}
43-
<script src="{{ asset('js/app.js') }}" integrity="{{ integrity('js/app.js') }}" crossorigin="anonymous"></script>
39+
// Use with elixir() function
40+
<link
41+
rel="stylesheet"
42+
href="{{ elixir('css/app.css') }}"
43+
integrity="{{ integrity('css/app.css') }}"
44+
crossorigin="anonymous">
45+
46+
// Use with asset() function
47+
<script
48+
src="{{ asset('js/app.js') }}"
49+
integrity="{{ integrity('js/app.js') }}"
50+
crossorigin="anonymous">
51+
</script>
4452
```
4553

4654
If you have set the output folder for the `sri.json` in a different location in your Gulpfile, you can specify its `path` on the `config/sri.php`.
@@ -53,16 +61,31 @@ If you have set the output folder for the `sri.json` in a different location in
5361
You can also override the config options by passing an array as a second argument on the `integrity` helper function:
5462

5563
```php
56-
{{-- Use different hash algorithm --}}
57-
<link rel="stylesheet" href="{{ elixir('css/app.css') }}" integrity="{{ integrity('css/app.css', ['algorithms' => ['sha384']]) }}" crossorigin="anonymous">
64+
// Use different hash algorithm
65+
<link
66+
rel="stylesheet"
67+
href="{{ elixir('css/app.css') }}"
68+
integrity="{{ integrity('css/app.css', ['algorithms' => ['sha384']]) }}"
69+
crossorigin="anonymous">
5870
```
5971

6072
## Testing
6173

6274
``` bash
63-
$ composer test
75+
composer test
6476
```
6577

78+
### Changelog
79+
80+
Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
81+
82+
## Contributing
83+
84+
Please see [CONTRIBUTING](CONTRIBUTING.md) for details.
85+
86+
## Security
87+
If you discover any security related issues, please email info@sebdesign.eu instead of using the issue tracker.
88+
6689
## License
6790

6891
The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

phpunit.xml.dist

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,11 @@
1919
<directory suffix=".php">src/</directory>
2020
</whitelist>
2121
</filter>
22-
</phpunit>
22+
<logging>
23+
<log type="tap" target="build/report.tap"/>
24+
<log type="junit" target="build/report.junit.xml"/>
25+
<log type="coverage-html" target="build/coverage"/>
26+
<log type="coverage-text" target="build/coverage.txt"/>
27+
<log type="coverage-clover" target="build/logs/clover.xml"/>
28+
</logging>
29+
</phpunit>

0 commit comments

Comments
 (0)