Skip to content

Commit

Permalink
Merge commit '9ba8fde4272c4e149fe56f9fa0f42411942a8c5b'
Browse files Browse the repository at this point in the history
* commit '9ba8fde4272c4e149fe56f9fa0f42411942a8c5b': (31 commits)
  wip
  wip
  wip
  wip
  Update run-tests.yml
  wip
  wip
  Add changelog workflow (automated commit)
  Remove misplaced * (spatie#182)
  Update CHANGELOG.md
  Fixed FeedItem update() use with CarbonImmutable date (spatie#178)
  Update CHANGELOG.md
  Fix config validation (spatie#159)
  wip
  do not fail with default config
  wip
  wip
  Package throws an exception when using with Statamic (spatie#155)
  wip
  use defaults
  ...

# Conflicts:
#	.gitignore
#	src/Feed.php
  • Loading branch information
yipeecaiey committed Sep 11, 2024
2 parents 536309d + 9ba8fde commit 67c87b1
Show file tree
Hide file tree
Showing 51 changed files with 1,177 additions and 432 deletions.
6 changes: 3 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
; This file is for unifying the coding style for different editors and IDEs.
; More information at http://editorconfig.org

root = true

[*]
Expand All @@ -13,3 +10,6 @@ trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
8 changes: 6 additions & 2 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.travis.yml export-ignore
/phpunit.xml.dist export-ignore
/.scrutinizer.yml export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.php_cs.dist export-ignore
/psalm.xml export-ignore
/psalm.xml.dist export-ignore
/testbench.yaml export-ignore
55 changes: 55 additions & 0 deletions .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

Please read and understand the contribution guide before creating an issue or pull request.

## Etiquette

This project is open source, and as such, the maintainers give their free time to build and maintain the source code
held within. They make the code freely available in the hope that it will be of use to other developers. It would be
extremely unfair for them to suffer abuse or anger for their hard work.

Please be considerate towards maintainers when raising issues or presenting pull requests. Let's show the
world that developers are civilized and selfless people.

It's the duty of the maintainer to ensure that all submissions to the project are of sufficient
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.

## Viability

When requesting or submitting new features, first consider whether it might be useful to others. Open
source projects are used by many developers, who may have entirely different needs to your own. Think about
whether or not your feature is likely to be used by other users of the project.

## Procedure

Before filing an issue:

- Attempt to replicate the problem, to ensure that it wasn't a coincidental incident.
- Check to make sure your feature suggestion isn't already present within the project.
- Check the pull requests tab to ensure that the bug doesn't have a fix in progress.
- Check the pull requests tab to ensure that the feature isn't already in progress.

Before submitting a pull request:

- Check the codebase to ensure that your feature doesn't already exist.
- Check the pull requests to ensure that another person hasn't already submitted the feature or fix.

## Requirements

If the project maintainer has any additional requirements, you will find them listed here.

- **[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).

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](https://semver.org/). Randomly breaking public APIs is not an option.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **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.

**Happy coding**!
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
github: spatie
custom: https://spatie.be/open-source/support-us
11 changes: 11 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
blank_issues_enabled: false
contact_links:
- name: Ask a question
url: https://github.com/spatie/laravel-feed/discussions/new?category=q-a
about: Ask the community for help
- name: Request a feature
url: https://github.com/spatie/laravel-feed/discussions/new?category=ideas
about: Share ideas for new features
- name: Report a bug
url: https://github.com/spatie/laravel-feed/issues/new
about: Report a reproducable bug
3 changes: 3 additions & 0 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Security Policy

If you discover any security related issues, please email freek@spatie.be instead of using the issue tracker.
2 changes: 1 addition & 1 deletion .github/workflows/php-cs-fixer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- name: Fix style
uses: docker://oskarstark/php-cs-fixer-ga
with:
args: --config=.php_cs --allow-risky=yes
args: --config=.php_cs.dist.php --allow-risky=yes

- name: Extract branch name
shell: bash
Expand Down
75 changes: 35 additions & 40 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,43 +3,38 @@ name: run-tests
on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
php: [7.4, 8.0]
laravel: [7.*, 8.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 8.*
testbench: 6.*
- laravel: 7.*
testbench: 5.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Setup Problem Matches
run: |
echo "::add-matcher::${{ runner.tool_cache }}/php.json"
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"
- name: Execute tests
run: vendor/bin/phpunit
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1, 8.0]
laravel: [9.*, 8.*]
dependency-version: [prefer-stable]
include:
- laravel: 9.*
testbench: 7.*
- laravel: 8.*
testbench: ^6.23

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
- name: Execute tests
run: vendor/bin/phpunit
28 changes: 28 additions & 0 deletions .github/workflows/update-changelog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: "Update Changelog"

on:
release:
types: [released]

jobs:
update:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2
with:
ref: main

- name: Update Changelog
uses: stefanzweifel/changelog-updater-action@v1
with:
latest-version: ${{ github.event.release.name }}
release-notes: ${{ github.event.release.body }}

- name: Commit updated CHANGELOG
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: main
commit_message: Update CHANGELOG
file_pattern: CHANGELOG.md
10 changes: 10 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
.idea
.php_cs
.php_cs.cache
.phpunit.result.cache
build
composer.lock
coverage
docs
phpunit.xml
psalm.xml
testbench.yaml
vendor
.php-cs-fixer.cache

.php_cs.cache
.idea
13 changes: 5 additions & 8 deletions .php_cs → .php_cs.dist.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->notPath('bootstrap/*')
->notPath('storage/*')
->notPath('storage/*')
->notPath('resources/view/mail/*')
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
Expand All @@ -14,14 +10,14 @@
->ignoreDotFiles(true)
->ignoreVCS(true);

return PhpCsFixer\Config::create()
return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => true,
'array_syntax' => ['syntax' => 'short'],
'ordered_imports' => ['sortAlgorithm' => 'alpha'],
'ordered_imports' => ['sort_algorithm' => 'alpha'],
'no_unused_imports' => true,
'not_operator_with_successor_space' => true,
'trailing_comma_in_multiline_array' => true,
'trailing_comma_in_multiline' => true,
'phpdoc_scalar' => true,
'unary_operator_spaces' => true,
'binary_operator_spaces' => true,
Expand All @@ -33,6 +29,7 @@
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
]
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
48 changes: 48 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,54 @@

All notable changes to `laravel-feed` will be documented in this file

## 4.0.5 - 2021-10-14

- fix FeedItem update() use with CarbonImmutable date (#178)

## 4.0.4 - 2021-05-31

- improve config validation (#159)

## 4.0.3 - 2021-05-31

- do not throw exception for default config

## 4.0.2 - 2021-05-31

- improve service provider

## 4.0.1 - 2021-05-31

- assume atom feed by default

## 4.0.0 - 2021-05-31

- adds support for PHP 8 only.
- drops PHP 7 support.
- uses PHP 8 syntax where possible.
- bumps `PHPUnit` to v9.5.
- adds support for running tests in parallel.
- updates the readme to include the new API & configuration settings.
- adds an `UPGRADING.md` guide to help users manually upgrade package versions.
- adds support for json feeds _(`jsonfeed.org` support)_.
- removes `FeedItem::author`. _Use `FeedItem::authorName` and `FeedItem::authorEmail` instead._
- removes the `feed::feed` view. _Use `feed::atom`, `feed::json`, `feed:rss` or a custom view instead._
- adds support for `FeedItem::image` _(json feeds only)_.
- adds validation of the configuration file.
- adds support for tuple notation in the `items` configuration key.
- adds feed config option `format` to specify the type of feed that is generated _(`rss`, `atom`, or `json`)_.
- adds feed config option `contentType` to force the content type of the feed response.
- adds feed config option `image` which associates an image with the overall feed.
- changes feed config option `type` default value to an empty string _(value is now auto detected by default)_.
- changes feed config option `view` so that it is now required to be an existing view.
- config option `view` no longer defaults to `feed::feed` when it contains an empty value _(now defaults to `feed::atom`)._
- generated rss and atom feeds now pass w3c validation (#152).

This release contains breaking changes:
- `FeedItem::author` has been replaced with `authorName` and `authorEmail` _(optional)_.
- Several new configuration options are required (see above).
- The value of the configuration option `view` must be an existing view _(empty values/non-existent views now throw an Exception)_.

## 3.2.1 - 2021-05-27

- fix breaking change introduced in 3.1.4
Expand Down
32 changes: 0 additions & 32 deletions CONTRIBUTING.md

This file was deleted.

Loading

0 comments on commit 67c87b1

Please sign in to comment.