From 22a1c3b26ab39fcf0eeb67ed5a2e12833cf975d7 Mon Sep 17 00:00:00 2001 From: Aalaap Ghag Date: Sat, 7 Nov 2020 11:32:52 +0530 Subject: [PATCH 1/2] Switch to the new FakerPHP Also bump up `php` and `phpunit` versions. --- composer.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/composer.json b/composer.json index deef7ab..6a269fd 100644 --- a/composer.json +++ b/composer.json @@ -10,11 +10,11 @@ ], "keywords": ["faker", "provider", "youtube"], "require": { - "php": "^5.6 || ^7.0", - "fzaninotto/faker": "^1.7" + "php": "^7.1 || ^8.0", + "fakerphp/faker": "^1.10" }, "require-dev": { - "phpunit/phpunit": "^5.7" + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.4.2" }, "autoload": { "psr-4": { From 3d9f1028b994063f13fd14f2a3c6b6ef08ddeaee Mon Sep 17 00:00:00 2001 From: Aalaap Ghag Date: Sat, 7 Nov 2020 11:56:26 +0530 Subject: [PATCH 2/2] Update README for info on version 2.x --- README.md | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 1d45577..23d1695 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ YouTube Provider for Faker --- -This package will allow [Faker](https://github.com/fzaninotto/Faker) to generate +This package will allow [Faker](https://github.com/FakerPHP/Faker) to generate fake, but technically valid, YouTube URLs in various formats as well as an embed HTML. @@ -11,6 +11,18 @@ is also really low, but not impossible. [![Build Status](https://travis-ci.org/aalaap/faker-youtube.svg?branch=master)](https://travis-ci.org/aalaap/faker-youtube) +## Upgrading to the new Faker? + +Since the [original Faker](https://github.com/fzaninotto/Faker) was [sunsetted](https://marmelab.com/blog/2020/10/21/sunsetting-faker.html), +this package was updated to 2.0 to work with the new Faker, bringing along +updated version requirements, which now apply to this package as well. + +- `php`: ^7.1 || ^8.0 +- `phpunit/phpunit`: ^7.5.20 || ^8.5.8 || ^9.4.2 + +If you are still using the original Faker, you can continue to use versions 1.x +of this package. + ## Install To install, use composer: @@ -22,24 +34,27 @@ composer require aalaap/faker-youtube ## Use ```php +# When installed via composer +require_once 'vendor/autoload.php'; + $faker = \Faker\Factory::create(); $faker->addProvider(new \Faker\Provider\Youtube($faker)); ``` ``` -$faker->youtubeUri() +echo $faker->youtubeUri(); // https://www.youtube.com/watch?v=KyXYWQ-B3zO -$faker->youtubeShortUri() +echo $faker->youtubeShortUri(); // https://youtu.be/watch?v=rsPyiZSzj3g -$faker->youtubeEmbedUri() +echo $faker->youtubeEmbedUri(); // https://www.youtube.com/embed/aUgKvcNS6en -$faker->youtubeEmbedCode() +echo $faker->youtubeEmbedCode(); // -$faker->youtubeRandomUri() +echo $faker->youtubeRandomUri(); // https://youtu.be/watch?v=lctkDb05MKT ```