Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jan 30, 2020. It is now read-only.

Commit5248e9f

Browse files
committed
Merging develop to master in preparation for 2.11.0 release.
2 parentsf31376b +8bc7b60 commit5248e9f

File tree

11 files changed

+128
-46
lines changed

11 files changed

+128
-46
lines changed

‎.travis.yml‎

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
sudo:false
2-
31
language:php
42

53
cache:
@@ -54,6 +52,15 @@ matrix:
5452
-php:7.2
5553
env:
5654
-DEPS=latest
55+
-php:7.3
56+
env:
57+
-DEPS=lowest
58+
-php:7.3
59+
env:
60+
-DEPS=locked
61+
-php:7.3
62+
env:
63+
-DEPS=latest
5764

5865
before_install:
5966
-if [[ $TEST_COVERAGE != 'true' ]]; then phpenv config-rm xdebug.ini || return 0 ; fi

‎CHANGELOG.md‎

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,27 @@
22

33
All notable changes to this project will be documented in this file, in reverse chronological order by release.
44

5-
##2.10.4 -TBD
5+
##2.11.0 -2019-01-29
66

77
###Added
88

9-
- Nothing.
9+
-[#94](https://github.com/zendframework/zend-feed/pull/94) adds support for PHP 7.3.
10+
11+
-[#91](https://github.com/zendframework/zend-feed/pull/91) adds explicit requirements for both ext-dom and ext-libxml to the package.
1012

1113
###Changed
1214

13-
- Nothing.
15+
-[#93](https://github.com/zendframework/zend-feed/pull/93)`Writer\Feed`,`Writer\Entry` and`Writer\Deleted` all now accept
16+
`DateTimeImmutable` instances as an arguments to methods that previously only
17+
accepted`DateTime` or Unix Timestamps, such as`Writer\Feed::setDateModified()`.
1418

1519
###Deprecated
1620

1721
- Nothing.
1822

1923
###Removed
2024

21-
-Nothing.
25+
-[#94](https://github.com/zendframework/zend-feed/pull/94) removes support for zend-stdlib v2 releases.
2226

2327
###Fixed
2428

‎composer.json‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,10 @@
1717
},
1818
"require": {
1919
"php":"^5.6 || ^7.0",
20+
"ext-dom":"*",
21+
"ext-libxml":"*",
2022
"zendframework/zend-escaper":"^2.5.2",
21-
"zendframework/zend-stdlib":"^2.7.7 || ^3.1"
23+
"zendframework/zend-stdlib":"^3.2.1"
2224
},
2325
"require-dev": {
2426
"phpunit/phpunit":"^5.7.23 || ^6.4.3",
@@ -53,8 +55,8 @@
5355
},
5456
"extra": {
5557
"branch-alias": {
56-
"dev-master":"2.10.x-dev",
57-
"dev-develop":"2.11.x-dev"
58+
"dev-master":"2.11.x-dev",
59+
"dev-develop":"2.12.x-dev"
5860
}
5961
},
6062
"scripts": {

‎composer.lock‎

Lines changed: 17 additions & 14 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎docs/book/writer.md‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -213,9 +213,9 @@ Method | Description
213213
`setFeedLink()` | Set a URI to an XML feed, whether it is to the feed being generated, or an alternate URI pointing to the same feed but in a different format. At a minimum, it is recommended to include a link to the feed being generated so it has an identifiable final URI allowing a client to track its location changes without necessitating constant redirects. The parameters are the feed URI and type (one of "atom", "rss", or "rdf").
214214
`addAuthors()` | Sets the data for authors. The parameter is an array of array,s where each sub-array may contain the keys "name", "email", and "uri". The "uri" value is only applicable for Atom feeds, since RSS contains no facility to show it. For RSS 2.0, rendering will create two elements: an author element containing the email reference with the name in brackets, and a Dublin Core creator element only containing the name.
215215
`addAuthor()` | Sets the data for a single author following the same array format as described above for a single sub-array.
216-
`setDateCreated()` | Sets the date on which this feed was created. Generally only applicable to Atom, where it represents the date the resource described by an Atom 1.0 document was created. The expected parameter may be a UNIX timestamp ora`DateTime`object.
217-
`setDateModified()` | Sets the date on which this feed was last modified. The expected parameter may be a UNIX timestamp ora`DateTime`object.
218-
`setLastBuildDate()` | Sets the date on which this feed was last build. The expected parameter may be a UNIX timestamp ora`DateTime`object. This will only be rendered for RSS 2.0 feeds, and is automatically rendered as the current date by default when not explicitly set.
216+
`setDateCreated()` | Sets the date on which this feed was created. Generally only applicable to Atom, where it represents the date the resource described by an Atom 1.0 document was created. The expected parameter may be a UNIX timestamp oran object implementing`DateTimeInterface` such as`DateTime`or`DateTimeImmutable`.
217+
`setDateModified()` | Sets the date on which this feed was last modified. The expected parameter may be a UNIX timestamp oran object implementing`DateTimeInterface` such as`DateTime`or`DateTimeImmutable`.
218+
`setLastBuildDate()` | Sets the date on which this feed was last build. The expected parameter may be a UNIX timestamp oran object implementing`DateTimeInterface` such as`DateTime`or`DateTimeImmutable`. This will only be rendered for RSS 2.0 feeds, and is automatically rendered as the current date by default when not explicitly set.
219219
`setLanguage()` | Sets the language of the feed. This will be omitted unless set.
220220
`setGenerator()` | Allows the setting of a generator. The parameter should be an array containing the keys "name", "version", and "uri". If omitted a default generator will be added referencing`Zend\Feed\Writer`, the current zend-version version, and the Framework's URI.
221221
`setCopyright()` | Sets a copyright notice associated with the feed.
@@ -257,8 +257,8 @@ Method | Description
257257
`setLink()` | Set a URI to the HTML website containing the same or similar information as this entry (i.e. if the feed is from a blog, it should provide the blog article's URI where the HTML version of the entry can be read).
258258
`addAuthors()` | Sets the data for authors. The parameter is an array of array,s where each sub-array may contain the keys "name", "email", and "uri". The "uri" value is only applicable for Atom feeds, since RSS contains no facility to show it. For RSS 2.0, rendering will create two elements: an author element containing the email reference with the name in brackets, and a Dublin Core creator element only containing the name.
259259
`addAuthor()` | Sets the data for a single author following the same format as described above for a single sub-array.
260-
`setDateCreated()` | Sets the date on which this entry was created. Generally only applicable to Atom where it represents the date the resource described by an Atom 1.0 document was created. The expected parameter may be a UNIX timestamp ora`DateTime`object. If omitted, the date used will be the current date and time.
261-
`setDateModified()` | Sets the date on which this entry was last modified. The expected parameter may be a UNIX timestamp ora`DateTime`object. If omitted, the date used will be the current date and time.
260+
`setDateCreated()` | Sets the date on which this entry was created. Generally only applicable to Atom where it represents the date the resource described by an Atom 1.0 document was created. The expected parameter may be a UNIX timestamp oran object implementing`DateTimeInterface` such as`DateTime`or`DateTimeImmutable`. If omitted, the date used will be the current date and time.
261+
`setDateModified()` | Sets the date on which this entry was last modified. The expected parameter may be a UNIX timestamp oran object implementing`DateTimeInterface` such as`DateTime`or`DateTimeImmutable`. If omitted, the date used will be the current date and time.
262262
`setCopyright()` | Sets a copyright notice associated with the entry.
263263
`addCategories()` | Accepts an array of categories for rendering, where each element is itself an array whose possible keys include "term", "label", and "scheme". The "term" is a typically a category name suitable for inclusion in a URI. The "label" may be a human readable category name supporting special characters (it is encoded during rendering) and is a required key. The "scheme" (called the domain in RSS) is optional but must be a valid URI.
264264
`addCategory()` | Sets the data for a single category following the same format as described above for a single sub-array.

‎src/Writer/AbstractFeed.php‎

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespaceZend\Feed\Writer;
1111

1212
useDateTime;
13+
useDateTimeInterface;
1314
useZend\Feed\Uri;
1415
useZend\Validator;
1516

@@ -128,17 +129,19 @@ public function setCopyright($copyright)
128129
/**
129130
* Set the feed creation date
130131
*
131-
* @param null|int|DateTime
132+
* @param null|int|DateTimeInterface
132133
* @throws Exception\InvalidArgumentException
133134
* @return AbstractFeed
134135
*/
135136
publicfunctionsetDateCreated($date =null)
136137
{
137138
if ($date ===null) {
138139
$date =newDateTime();
139-
}elseif (is_int($date)) {
140+
}
141+
if (is_int($date)) {
140142
$date =newDateTime('@' .$date);
141-
}elseif (!$dateinstanceof DateTime) {
143+
}
144+
if (!$dateinstanceof DateTimeInterface) {
142145
thrownewException\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp'
143146
.' passed as parameter');
144147
}
@@ -150,17 +153,19 @@ public function setDateCreated($date = null)
150153
/**
151154
* Set the feed modification date
152155
*
153-
* @param null|int|DateTime
156+
* @param null|int|DateTimeInterface
154157
* @throws Exception\InvalidArgumentException
155158
* @return AbstractFeed
156159
*/
157160
publicfunctionsetDateModified($date =null)
158161
{
159162
if ($date ===null) {
160163
$date =newDateTime();
161-
}elseif (is_int($date)) {
164+
}
165+
if (is_int($date)) {
162166
$date =newDateTime('@' .$date);
163-
}elseif (!$dateinstanceof DateTime) {
167+
}
168+
if (!$dateinstanceof DateTimeInterface) {
164169
thrownewException\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp'
165170
.' passed as parameter');
166171
}
@@ -172,17 +177,19 @@ public function setDateModified($date = null)
172177
/**
173178
* Set the feed last-build date. Ignored for Atom 1.0.
174179
*
175-
* @param null|int|DateTime
180+
* @param null|int|DateTimeInterface
176181
* @throws Exception\InvalidArgumentException
177182
* @return AbstractFeed
178183
*/
179184
publicfunctionsetLastBuildDate($date =null)
180185
{
181186
if ($date ===null) {
182187
$date =newDateTime();
183-
}elseif (is_int($date)) {
188+
}
189+
if (is_int($date)) {
184190
$date =newDateTime('@' .$date);
185-
}elseif (!$dateinstanceof DateTime) {
191+
}
192+
if (!$dateinstanceof DateTimeInterface) {
186193
thrownewException\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp'
187194
.' passed as parameter');
188195
}

‎src/Writer/Deleted.php‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespaceZend\Feed\Writer;
1111

1212
useDateTime;
13+
useDateTimeInterface;
1314
useZend\Feed\Uri;
1415

1516
/**
@@ -132,17 +133,19 @@ public function getReference()
132133
/**
133134
* Set when
134135
*
135-
* @param null|string|DateTime $date
136+
* @param null|int|DateTimeInterface $date
136137
* @throws Exception\InvalidArgumentException
137138
* @return Deleted
138139
*/
139140
publicfunctionsetWhen($date =null)
140141
{
141142
if ($date ===null) {
142143
$date =newDateTime();
143-
}elseif (is_int($date)) {
144+
}
145+
if (is_int($date)) {
144146
$date =newDateTime('@' .$date);
145-
}elseif (!$dateinstanceof DateTime) {
147+
}
148+
if (!$dateinstanceof DateTimeInterface) {
146149
thrownewException\InvalidArgumentException('Invalid DateTime object or UNIX Timestamp'
147150
.' passed as parameter');
148151
}

‎src/Writer/Entry.php‎

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespaceZend\Feed\Writer;
1111

1212
useDateTime;
13+
useDateTimeInterface;
1314
useZend\Feed\Uri;
1415

1516
/**
@@ -178,17 +179,19 @@ public function setContent($content)
178179
/**
179180
* Set the feed creation date
180181
*
181-
* @param null|int|DateTime $date
182+
* @param null|int|DateTimeInterface $date
182183
* @throws Exception\InvalidArgumentException
183184
* @return Entry
184185
*/
185186
publicfunctionsetDateCreated($date =null)
186187
{
187188
if ($date ===null) {
188189
$date =newDateTime();
189-
}elseif (is_int($date)) {
190+
}
191+
if (is_int($date)) {
190192
$date =newDateTime('@' .$date);
191-
}elseif (!$dateinstanceof DateTime) {
193+
}
194+
if (!$dateinstanceof DateTimeInterface) {
192195
thrownewException\InvalidArgumentException(
193196
'Invalid DateTime object or UNIX Timestamp passed as parameter'
194197
);
@@ -201,17 +204,19 @@ public function setDateCreated($date = null)
201204
/**
202205
* Set the feed modification date
203206
*
204-
* @param null|int|DateTime $date
207+
* @param null|int|DateTimeInterface $date
205208
* @throws Exception\InvalidArgumentException
206209
* @return Entry
207210
*/
208211
publicfunctionsetDateModified($date =null)
209212
{
210213
if ($date ===null) {
211214
$date =newDateTime();
212-
}elseif (is_int($date)) {
215+
}
216+
if (is_int($date)) {
213217
$date =newDateTime('@' .$date);
214-
}elseif (!$dateinstanceof DateTime) {
218+
}
219+
if (!$dateinstanceof DateTimeInterface) {
215220
thrownewException\InvalidArgumentException(
216221
'Invalid DateTime object or UNIX Timestamp passed as parameter'
217222
);

‎test/Writer/DeletedTest.php‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
namespaceZendTest\Feed\Writer;
1111

1212
useDateTime;
13+
useDateTimeImmutable;
1314
usePHPUnit\Framework\TestCase;
1415
useZend\Feed\Writer;
1516
useZend\Feed\Writer\Exception\InvalidArgumentException;
@@ -89,6 +90,14 @@ public function testSetWhenUsesDateTimeObject()
8990
$this->assertEquals($myDate,$entry->getWhen());
9091
}
9192

93+
publicfunctiontestSetWhenUsesDateTimeImmutableObject()
94+
{
95+
$myDate =newDateTimeImmutable('@' .1234567890);
96+
$entry =newWriter\Deleted;
97+
$entry->setWhen($myDate);
98+
$this->assertEquals($myDate,$entry->getWhen());
99+
}
100+
92101
publicfunctiontestSetWhenThrowsExceptionOnInvalidParameter()
93102
{
94103
$entry =newWriter\Deleted;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp