From d8819d13d8cce43a3d3a5757b4d63e26ab004c70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Sat, 28 Mar 2020 08:52:33 +0000 Subject: [PATCH 1/9] Require specific repository_dispatch event type - docs-build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Bundyra --- .github/workflows/docs-build.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/docs-build.yml b/.github/workflows/docs-build.yml index 61464824..57378fb3 100644 --- a/.github/workflows/docs-build.yml +++ b/.github/workflows/docs-build.yml @@ -5,6 +5,7 @@ on: branches: - master repository_dispatch: + types: docs-build jobs: build-deploy: From 06371b62e051b1ed8c1c8d1bf7a7215dd5a6f05b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Sat, 28 Mar 2020 08:52:33 +0000 Subject: [PATCH 2/9] Adds .github directory into .gitattributes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Bundyra --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index e2ae92dd..70b009d9 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,5 +1,6 @@ /.coveralls.yml export-ignore /.gitattributes export-ignore +/.github/ export-ignore /.gitignore export-ignore /.travis.yml export-ignore /docs/ export-ignore From f5b0c6f23ff4e53e1cdd50270f667984b29713aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Sun, 29 Mar 2020 12:16:37 +0100 Subject: [PATCH 3/9] Set version constraint for replaced repository in composer.json MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Bundyra --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index eff74bef..0b0f8e9c 100644 --- a/composer.json +++ b/composer.json @@ -71,6 +71,6 @@ "test-coverage": "phpunit --colors=always --coverage-clover clover.xml" }, "replace": { - "zendframework/zend-feed": "self.version" + "zendframework/zend-feed": "^2.12.0" } } From 33a4ea03f776d2a9a4247f3f342365550ca35841 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Sun, 29 Mar 2020 13:36:19 +0100 Subject: [PATCH 4/9] release: 2.12.2 readiness MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds CHANGELOG entry for 2.12.2 release Sets release date Signed-off-by: Michał Bundyra --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e5169f59..4ecd8832 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 2.12.2 - TBD +## 2.12.2 - 2020-03-29 ### Added @@ -22,7 +22,7 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- Nothing. +- Fixed `replace` version constraint in composer.json so repository can be used as replacement of `zendframework/zend-feed:^2.12.0`. ## 2.12.1 - 2020-03-23 From a2827d8239ee4923ada4ed6f11547dec63a34d87 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Sun, 29 Mar 2020 13:37:55 +0100 Subject: [PATCH 5/9] Bumped to next dev version (2.12.3) --- CHANGELOG.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4ecd8832..e65f5919 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,28 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. +## 2.12.3 - TBD + +### Added + +- Nothing. + +### Changed + +- Nothing. + +### Deprecated + +- Nothing. + +### Removed + +- Nothing. + +### Fixed + +- Nothing. + ## 2.12.2 - 2020-03-29 ### Added From cc20f0452e89c57b6c43c2a10ecec05b7cd798d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Wed, 15 Apr 2020 20:23:54 +0100 Subject: [PATCH 6/9] Updates copyright notes MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Bundyra --- COPYRIGHT.md | 3 +-- LICENSE.md | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/COPYRIGHT.md b/COPYRIGHT.md index f6870469..0a8cccc0 100644 --- a/COPYRIGHT.md +++ b/COPYRIGHT.md @@ -1,2 +1 @@ -Copyright (c) 2019-2020, Laminas Foundation. -All rights reserved. (https://getlaminas.org/) +Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC. (https://getlaminas.org/) diff --git a/LICENSE.md b/LICENSE.md index 16fe8690..10b40f14 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -1,5 +1,4 @@ -Copyright (c) 2019-2020, Laminas Foundation -All rights reserved. +Copyright (c) 2020 Laminas Project a Series of LF Projects, LLC. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: From 8fab83c6c3cd10f824180bc8087c2f9d1afcc86a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Tue, 18 Aug 2020 15:07:03 +0200 Subject: [PATCH 7/9] Fixes #20 - itunes:explicit values have changed MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Frank Brückner --- src/Writer/Extension/ITunes/Entry.php | 21 ++++++++-- src/Writer/Extension/ITunes/Feed.php | 21 ++++++++-- test/Writer/Extension/ITunes/EntryTest.php | 48 +++++++++++++++------- test/Writer/Extension/ITunes/FeedTest.php | 48 +++++++++++++++------- 4 files changed, 104 insertions(+), 34 deletions(-) diff --git a/src/Writer/Extension/ITunes/Entry.php b/src/Writer/Extension/ITunes/Entry.php index 30f65c6c..0dbbdf59 100644 --- a/src/Writer/Extension/ITunes/Entry.php +++ b/src/Writer/Extension/ITunes/Entry.php @@ -145,18 +145,33 @@ public function setItunesDuration($value) /** * Set "explicit" flag * + * @see https://help.apple.com/itc/podcasts_connect/#/itcb54353390 + * * @param bool $value * @return $this * @throws Writer\Exception\InvalidArgumentException */ public function setItunesExplicit($value) { - if (! in_array($value, ['yes', 'no', 'clean'])) { + // "yes", "no" and "clean" are valid values for a previous version + if (! is_bool($value) && ! in_array($value, ['yes', 'no', 'clean'])) { throw new Writer\Exception\InvalidArgumentException( - 'invalid parameter: "explicit" may only be one of "yes", "no" or "clean"' + 'invalid parameter: "explicit" must be a boolean value' ); } - $this->data['explicit'] = $value; + + switch ($value) { + case 'yes': + $value = true; + break; + + case 'no': + case 'clean': + $value = false; + break; + } + + $this->data['explicit'] = $value ? 'true' : 'false'; return $this; } diff --git a/src/Writer/Extension/ITunes/Feed.php b/src/Writer/Extension/ITunes/Feed.php index 22650113..5f925f87 100644 --- a/src/Writer/Extension/ITunes/Feed.php +++ b/src/Writer/Extension/ITunes/Feed.php @@ -210,18 +210,33 @@ public function setItunesDuration($value) /** * Set "explicit" flag * + * @see https://help.apple.com/itc/podcasts_connect/#/itcb54353390 + * * @param bool $value * @return $this * @throws Writer\Exception\InvalidArgumentException */ public function setItunesExplicit($value) { - if (! in_array($value, ['yes', 'no', 'clean'])) { + // "yes", "no" and "clean" are valid values for a previous version + if (! is_bool($value) && ! in_array($value, ['yes', 'no', 'clean'])) { throw new Writer\Exception\InvalidArgumentException( - 'invalid parameter: "explicit" may only be one of "yes", "no" or "clean"' + 'invalid parameter: "explicit" must be a boolean value' ); } - $this->data['explicit'] = $value; + + switch ($value) { + case 'yes': + $value = true; + break; + + case 'no': + case 'clean': + $value = false; + break; + } + + $this->data['explicit'] = $value ? 'true' : 'false'; return $this; } diff --git a/test/Writer/Extension/ITunes/EntryTest.php b/test/Writer/Extension/ITunes/EntryTest.php index 8069997c..6474006a 100644 --- a/test/Writer/Extension/ITunes/EntryTest.php +++ b/test/Writer/Extension/ITunes/EntryTest.php @@ -108,25 +108,45 @@ public function testSetDurationThrowsExceptionOnInvalidMinutes() $entry->setItunesDuration('23:234:45'); } - public function testSetExplicitToYes() - { - $entry = new Writer\Entry(); - $entry->setItunesExplicit('yes'); - $this->assertEquals('yes', $entry->getItunesExplicit()); - } - - public function testSetExplicitToNo() + /** + * @dataProvider dataProviderForSetExplicit + * + * @param string|bool $value + * @param string $result + */ + public function testSetExplicit($value, $result) { $entry = new Writer\Entry(); - $entry->setItunesExplicit('no'); - $this->assertEquals('no', $entry->getItunesExplicit()); + $entry->setItunesExplicit($value); + $this->assertEquals($result, $entry->getItunesExplicit()); } - public function testSetExplicitToClean() + public function dataProviderForSetExplicit() { - $entry = new Writer\Entry(); - $entry->setItunesExplicit('clean'); - $this->assertEquals('clean', $entry->getItunesExplicit()); + return [ + // Current behaviour + [ + true, + 'true', + ], + [ + false, + 'false', + ], + // Old behaviour + [ + 'yes', + 'true', + ], + [ + 'no', + 'false', + ], + [ + 'clean', + 'false', + ], + ]; } public function testSetExplicitThrowsExceptionOnUnknownTerm() diff --git a/test/Writer/Extension/ITunes/FeedTest.php b/test/Writer/Extension/ITunes/FeedTest.php index 9c6206a9..2888a7ca 100644 --- a/test/Writer/Extension/ITunes/FeedTest.php +++ b/test/Writer/Extension/ITunes/FeedTest.php @@ -161,25 +161,45 @@ public function testSetDurationThrowsExceptionOnInvalidMinutes() $feed->setItunesDuration('23:234:45'); } - public function testSetExplicitToYes() - { - $feed = new Writer\Feed(); - $feed->setItunesExplicit('yes'); - $this->assertEquals('yes', $feed->getItunesExplicit()); - } - - public function testSetExplicitToNo() + /** + * @dataProvider dataProviderForSetExplicit + * + * @param string|bool $value + * @param string $result + */ + public function testSetExplicit($value, $result) { $feed = new Writer\Feed(); - $feed->setItunesExplicit('no'); - $this->assertEquals('no', $feed->getItunesExplicit()); + $feed->setItunesExplicit($value); + $this->assertEquals($result, $feed->getItunesExplicit()); } - public function testSetExplicitToClean() + public function dataProviderForSetExplicit() { - $feed = new Writer\Feed(); - $feed->setItunesExplicit('clean'); - $this->assertEquals('clean', $feed->getItunesExplicit()); + return [ + // Current behaviour + [ + true, + 'true', + ], + [ + false, + 'false', + ], + // Old behaviour + [ + 'yes', + 'true', + ], + [ + 'no', + 'false', + ], + [ + 'clean', + 'false', + ], + ]; } public function testSetExplicitThrowsExceptionOnUnknownTerm() From 1376a3430de2955e4d1e4ca4fdea872b44c96597 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Frank=20Bru=CC=88ckner?= Date: Tue, 18 Aug 2020 15:36:26 +0200 Subject: [PATCH 8/9] Adds CHANGELOG entry for 2.12.3 release MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Frank Brückner --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e65f5919..92221daf 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,7 @@ All notable changes to this project will be documented in this file, in reverse chronological order by release. -## 2.12.3 - TBD +## 2.12.3 - 2020-08-18 ### Added @@ -22,7 +22,8 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- Nothing. +- [laminas/laminas-feed#20](https://github.com/laminas/laminas-feed/issues/20) provides a fix for the writer extension + of iTunes to support valid values for the `itunes:explicit` element. ## 2.12.2 - 2020-03-29 From c7892191a936a37e62db8cb9defefa454c90dbd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Bundyra?= Date: Tue, 18 Aug 2020 15:44:39 +0200 Subject: [PATCH 9/9] Updates CHANGELOG notes for #21 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Michał Bundyra --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 92221daf..dcf9e460 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,7 +22,7 @@ All notable changes to this project will be documented in this file, in reverse ### Fixed -- [laminas/laminas-feed#20](https://github.com/laminas/laminas-feed/issues/20) provides a fix for the writer extension +- [#21](https://github.com/laminas/laminas-feed/pull/21) fixes the writer extension of iTunes to support valid values for the `itunes:explicit` element. ## 2.12.2 - 2020-03-29