diff --git a/README.md b/README.md index 92d2cf6..96532ce 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # Link Preview -[![Build Status](https://travis-ci.org/dusterio/link-preview.svg)](https://travis-ci.org/dusterio/link-preview) -[![Code Climate](https://codeclimate.com/github/dusterio/link-preview/badges/gpa.svg)](https://codeclimate.com/github/dusterio/link-preview/badges) -[![Test Coverage](https://codeclimate.com/github/dusterio/link-preview/badges/coverage.svg)](https://codeclimate.com/github/dusterio/link-preview/badges) -[![Total Downloads](https://poser.pugx.org/dusterio/link-preview/d/total.svg)](https://packagist.org/packages/dusterio/link-preview) -[![Latest Stable Version](https://poser.pugx.org/dusterio/link-preview/v/stable.svg)](https://packagist.org/packages/dusterio/link-preview) -[![Latest Unstable Version](https://poser.pugx.org/dusterio/link-preview/v/unstable.svg)](https://packagist.org/packages/dusterio/link-preview) -[![License](https://poser.pugx.org/dusterio/link-preview/license.svg)](https://packagist.org/packages/dusterio/link-preview) +[![Build Status](https://travis-ci.org/propay/link-preview.svg)](https://travis-ci.org/propay/link-preview) +[![Code Climate](https://codeclimate.com/github/propay/link-preview/badges/gpa.svg)](https://codeclimate.com/github/propay/link-preview/badges) +[![Test Coverage](https://codeclimate.com/github/propay/link-preview/badges/coverage.svg)](https://codeclimate.com/github/propay/link-preview/badges) +[![Total Downloads](https://poser.pugx.org/propay/link-preview/d/total.svg)](https://packagist.org/packages/propay/link-preview) +[![Latest Stable Version](https://poser.pugx.org/propay/link-preview/v/stable.svg)](https://packagist.org/packages/propay/link-preview) +[![Latest Unstable Version](https://poser.pugx.org/propay/link-preview/v/unstable.svg)](https://packagist.org/packages/propay/link-preview) +[![License](https://poser.pugx.org/propay/link-preview/license.svg)](https://packagist.org/packages/propay/link-preview) A PHP class that consumes an HTTP(S) link and returns an array of preview information. Think of Facebook sharing - whenever you paste a link, it goes to specified page and fetches some details. @@ -25,7 +25,7 @@ Includes integrations with: Laravel 5 To install simply run: ``` -composer require dusterio/link-preview +composer require propay/link-preview ``` Or add it to `composer.json` manually: @@ -33,7 +33,7 @@ Or add it to `composer.json` manually: ```json { "require": { - "dusterio/link-preview": "~1.2" + "propay/link-preview": "~1.2" } } ``` @@ -41,7 +41,7 @@ Or add it to `composer.json` manually: ## Direct usage ```php -use Dusterio\LinkPreview\Client; +use Propay\LinkPreview\Client; $previewClient = new Client('https://www.boogiecall.com/en/Melbourne'); @@ -87,7 +87,7 @@ $previewClient->getParser('general')->getReader()->config(['allow_redirects' => // If there is a network error (DNS, connect, etc), we throw ConnectionErrorException try { $previews = $previewClient->getPreviews(); -} catch (\Dusterio\LinkPreview\Exceptions\ConnectionErrorException $e) { +} catch (\Propay\LinkPreview\Exceptions\ConnectionErrorException $e) { echo "Oh no!"; } ``` @@ -95,7 +95,7 @@ try { ### YouTube example ```php -use Dusterio\LinkPreview\Client; +use Propay\LinkPreview\Client; $previewClient = new LinkPreview('https://www.youtube.com/watch?v=v1uKhwN6FtA'); @@ -123,12 +123,12 @@ array(2) { 'providers' => [ '...', - 'Dusterio\LinkPreview\Integrations\LaravelServiceProvider', + 'Propay\LinkPreview\Integrations\LaravelServiceProvider', ]; 'aliases' => [ '...', - 'Preview' => 'Dusterio\LinkPreview\Integrations\LaravelFacade', + 'Preview' => 'Propay\LinkPreview\Integrations\LaravelFacade', ]; // Set target url diff --git a/build/logs/clover.xml b/build/logs/clover.xml index a8e3fae..e2e4a51 100644 --- a/build/logs/clover.xml +++ b/build/logs/clover.xml @@ -1,9 +1,9 @@ - + - + @@ -57,49 +57,49 @@ - + - + - + - + - + - + - + - + - + - + @@ -134,15 +134,15 @@ - + - + - + @@ -160,7 +160,7 @@ - + @@ -209,7 +209,7 @@ - + @@ -230,9 +230,9 @@ - + - + @@ -256,9 +256,9 @@ - + - + @@ -272,7 +272,7 @@ - + diff --git a/composer.json b/composer.json index 3c1524e..54af1c5 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,9 @@ { - "name": "dusterio/link-preview", + "name": "propay/link-preview", "type": "library", "description": "Link preview generation for PHP with Laravel support", "keywords": ["php","url","scraping","laravel","preview"], - "homepage": "http://github.com/dusterio/link-preview", + "homepage": "http://github.com/propay/link-preview", "license": "MIT", "authors": [ { @@ -14,7 +14,7 @@ ], "require": { "php": ">=5.5.0", - "illuminate/support": "5.*|6.*|7.*|8.*|9.*", + "illuminate/support": "5.*|6.*|7.*|8.*|9.*|10.*|11.*", "guzzlehttp/guzzle": "^6.1|^7.1", "symfony/dom-crawler": "^3.0|^4.0|^5.0|^6.0", "symfony/css-selector": "^3.0|^4.0|^5.0|^6.0" @@ -25,13 +25,13 @@ }, "autoload": { "psr-4": { - "Dusterio\\LinkPreview\\": "src/" + "Propay\\LinkPreview\\": "src/" } }, "extra":{ "laravel": { "providers": [ - "Dusterio\\LinkPreview\\Integrations\\LaravelServiceProvider" + "Propay\\LinkPreview\\Integrations\\LaravelServiceProvider" ] } } diff --git a/src/Client.php b/src/Client.php index f472542..bc2de2d 100644 --- a/src/Client.php +++ b/src/Client.php @@ -1,14 +1,14 @@ getUrl(), FILTER_VALIDATE_URL) === false; } @@ -101,7 +101,7 @@ public function canParseLink(LinkInterface $link) /** * @inheritdoc */ - public function parseLink(LinkInterface $link) + public function parseLink(LinkInterface $link): static { $link = $this->readLink($link); diff --git a/src/Parsers/VimeoParser.php b/src/Parsers/VimeoParser.php index 07092da..daf3ecc 100644 --- a/src/Parsers/VimeoParser.php +++ b/src/Parsers/VimeoParser.php @@ -1,13 +1,13 @@ getUrl())); } @@ -48,7 +48,7 @@ public function canParseLink(LinkInterface $link) /** * @inheritdoc */ - public function parseLink(LinkInterface $link) + public function parseLink(LinkInterface $link): static { preg_match(static::PATTERN, $link->getUrl(), $matches); @@ -60,4 +60,4 @@ public function parseLink(LinkInterface $link) return $this; } -} \ No newline at end of file +} diff --git a/src/Parsers/YouTubeParser.php b/src/Parsers/YouTubeParser.php index 4a9017e..aec77fa 100644 --- a/src/Parsers/YouTubeParser.php +++ b/src/Parsers/YouTubeParser.php @@ -1,13 +1,13 @@ getUrl())); } @@ -48,7 +48,7 @@ public function canParseLink(LinkInterface $link) /** * @inheritdoc */ - public function parseLink(LinkInterface $link) + public function parseLink(LinkInterface $link): static { preg_match(static::PATTERN, $link->getUrl(), $matches); @@ -60,4 +60,4 @@ public function parseLink(LinkInterface $link) return $this; } -} \ No newline at end of file +} diff --git a/src/Readers/HttpReader.php b/src/Readers/HttpReader.php index a41f28f..218e6f5 100644 --- a/src/Readers/HttpReader.php +++ b/src/Readers/HttpReader.php @@ -1,9 +1,9 @@ $this->jar, 'connect_timeout' => 5, 'headers' => [ - 'User-Agent' => 'dusterio/link-preview v1.2' + 'User-Agent' => 'propay/link-preview v1.2' ] ]; } diff --git a/src/Traits/HasExportableFields.php b/src/Traits/HasExportableFields.php index a1d3312..2d817df 100644 --- a/src/Traits/HasExportableFields.php +++ b/src/Traits/HasExportableFields.php @@ -1,6 +1,6 @@ getMock('Dusterio\LinkPreview\Parsers\HtmlParser', null); - $youtubeParserMock = $this->getMock('Dusterio\LinkPreview\Parsers\YouTubeParser', null); + $generalParserMock = $this->getMock('Propay\LinkPreview\Parsers\HtmlParser', null); + $youtubeParserMock = $this->getMock('Propay\LinkPreview\Parsers\YouTubeParser', null); $linkPreview = new Client('http://www.google.com'); @@ -45,10 +45,10 @@ public function can_add_extra_parsers() */ public function can_parse_an_html_page() { - $linkMock = $this->getMock('Dusterio\LinkPreview\Models\Link', null, ['http://www.google.com']); + $linkMock = $this->getMock('Propay\LinkPreview\Models\Link', null, ['http://www.google.com']); - $generalParserMock = $this->getMock('Dusterio\LinkPreview\Parsers\HtmlParser'); - $previewMock = $this->getMock('Dusterio\LinkPreview\Models\HtmlPreview'); + $generalParserMock = $this->getMock('Propay\LinkPreview\Parsers\HtmlParser'); + $previewMock = $this->getMock('Propay\LinkPreview\Models\HtmlPreview'); $generalParserMock->expects(self::once()) ->method('canParseLink') @@ -100,6 +100,6 @@ public function can_parse_a_youtube_link() { $linkPreview = new Client('https://www.youtube.com/watch?v=ycGfvA1vkR8'); $parsedLink = $linkPreview->getPreview('youtube'); - self::assertInstanceOf('Dusterio\LinkPreview\Models\VideoPreview', $parsedLink); + self::assertInstanceOf('Propay\LinkPreview\Models\VideoPreview', $parsedLink); } } diff --git a/tests/LinkPreview/Tests/Parser/GeneralParserTest.php b/tests/LinkPreview/Tests/Parser/GeneralParserTest.php index 151d2b7..de3e60d 100644 --- a/tests/LinkPreview/Tests/Parser/GeneralParserTest.php +++ b/tests/LinkPreview/Tests/Parser/GeneralParserTest.php @@ -1,21 +1,21 @@ getMock('Dusterio\LinkPreview\Models\Link', null, [$url]); + $linkMock = $this->getMock('Propay\LinkPreview\Models\Link', null, [$url]); $parser = new HtmlParser(); diff --git a/tests/LinkPreview/Tests/Reader/GeneralReaderTest.php b/tests/LinkPreview/Tests/Reader/GeneralReaderTest.php index 43f9a06..bd31355 100644 --- a/tests/LinkPreview/Tests/Reader/GeneralReaderTest.php +++ b/tests/LinkPreview/Tests/Reader/GeneralReaderTest.php @@ -1,8 +1,8 @@ method('request') ->will(self::returnValue($responseMock)); - $linkMock = $this->getMock('Dusterio\LinkPreview\Models\Link', null, ['http://www.google.com']); + $linkMock = $this->getMock('Propay\LinkPreview\Models\Link', null, ['http://www.google.com']); $reader = new HttpReader(); $reader->setClient($clientMock);