Skip to content

Commit 67706c5

Browse files
authored
PHP 8-only Support, New Features (v4) (spatie#153)
* add 'content-type' config option to allow customization of the content-type for the feed response * add jsonfeed.org support * add test for jsonfeed.org support, update test snapshots * sync config/misc files with spatie/package-skeleton-laravel where possible * drop php 7 support; add support for parallel testing; bump phpunit version to 9.5 * update php-cs-fixer config * update readme * escape quotes for content/summary fields * add support for feed images * add configuration option for specifying the feed type (atom, rss. or json) * add owner feed object prop, timestamp() method for generating correct timestamps based on the feed format * ensure that generated rss, atom and json feeds can pass w3c validation * add helper class for determining content types for feeds; use helper class to determine response content type * add `image` attribute to FeedItem (json feeds only); remove `Feed::author` attribute and add `Feed::authorName` and `Feed::authorEmail` attributes; add test for response content type; update tests/snapshots * update readme, wip * use hasViewComposer() instead of separate methods for registering the view composer; code cleanup * remove unused import * add configuration file validation * wip * add config validator tests; update test snapshots * support tuple syntax for items configuration key * wip * update readme, description of items key in config * make config validation and tests more robust * wip * rename `jsonfeed` view to `json` * use PHP 8 syntax where possible * remove feed::feed view * default to feed::atom view instead of feed::feed * add support for caching feed items * rename kebab-case config keys to camelCase * wip * use php 8 syntax, code cleanup * add version upgrade guide * validate cacheTtl config option * revert item cache commits * fix feed item resolver and tests * update docs on how to correctly pass arguments to the `items` method * use PHPUnit 9.5.4; bump laravel-package-tools version to v1.9 * update changelog * remove parallel testing, use PHPUnit 9.4 to avoid issues with v9.5
1 parent f0d15c8 commit 67706c5

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

49 files changed

+1081
-365
lines changed

.editorconfig

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
; This file is for unifying the coding style for different editors and IDEs.
2-
; More information at http://editorconfig.org
3-
41
root = true
52

63
[*]
@@ -13,3 +10,6 @@ trim_trailing_whitespace = true
1310

1411
[*.md]
1512
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2

.gitattributes

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,13 @@
22
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
33

44
# Ignore all test and documentation with "export-ignore".
5+
/.github export-ignore
56
/.gitattributes export-ignore
67
/.gitignore export-ignore
7-
/.travis.yml export-ignore
88
/phpunit.xml.dist export-ignore
9-
/.scrutinizer.yml export-ignore
109
/tests export-ignore
10+
/.editorconfig export-ignore
11+
/.php_cs.dist export-ignore
12+
/psalm.xml export-ignore
13+
/psalm.xml.dist export-ignore
14+
/testbench.yaml export-ignore

.github/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**!

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
github: spatie
2+
custom: https://spatie.be/open-source/support-us

.github/ISSUE_TEMPLATE/config.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
blank_issues_enabled: false
2+
contact_links:
3+
- name: Ask a question
4+
url: https://github.com/spatie/laravel-feed/discussions/new?category=q-a
5+
about: Ask the community for help
6+
- name: Request a feature
7+
url: https://github.com/spatie/laravel-feed/discussions/new?category=ideas
8+
about: Share ideas for new features
9+
- name: Report a bug
10+
url: https://github.com/spatie/laravel-feed/issues/new
11+
about: Report a reproducable bug

.github/SECURITY.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Security Policy
2+
3+
If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker.

.github/workflows/php-cs-fixer.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
- name: Fix style
1414
uses: docker://oskarstark/php-cs-fixer-ga
1515
with:
16-
args: --config=.php_cs --allow-risky=yes
16+
args: --config=.php_cs.dist --allow-risky=yes
1717

1818
- name: Extract branch name
1919
shell: bash

.github/workflows/run-tests.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99
fail-fast: false
1010
matrix:
1111
os: [ubuntu-latest]
12-
php: [7.4, 8.0]
12+
php: [8.0]
1313
laravel: [7.*, 8.*]
1414
dependency-version: [prefer-lowest, prefer-stable]
1515
include:

.gitignore

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1+
.idea
2+
.php_cs
3+
.php_cs.cache
4+
.phpunit.result.cache
15
build
26
composer.lock
7+
coverage
38
docs
9+
phpunit.xml
10+
psalm.xml
11+
testbench.yaml
412
vendor
5-
.php_cs.cache

.php_cs renamed to .php_cs.dist

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
$finder = Symfony\Component\Finder\Finder::create()
44
->notPath('bootstrap/*')
55
->notPath('storage/*')
6-
->notPath('storage/*')
76
->notPath('resources/view/mail/*')
87
->in([
98
__DIR__ . '/src',
@@ -30,9 +29,15 @@ return PhpCsFixer\Config::create()
3029
],
3130
'phpdoc_single_line_var_spacing' => true,
3231
'phpdoc_var_without_name' => true,
32+
'class_attributes_separation' => [
33+
'elements' => [
34+
'method',
35+
],
36+
],
3337
'method_argument_space' => [
3438
'on_multiline' => 'ensure_fully_multiline',
3539
'keep_multiple_spaces_after_comma' => true,
36-
]
40+
],
41+
'single_trait_insert_per_statement' => true,
3742
])
3843
->setFinder($finder);

0 commit comments

Comments
 (0)