Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Commit

Permalink
Merge pull request #481 from FriendsOfPHP/deprecation
Browse files Browse the repository at this point in the history
Add some deprecation notice to encourage people to use HttpBrowser instead from the Symfony BrowserKit component
  • Loading branch information
fabpot authored Apr 1, 2023
2 parents f51940f + 84da2bb commit e3f2867
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 27 deletions.
25 changes: 0 additions & 25 deletions .travis.yml

This file was deleted.

11 changes: 11 additions & 0 deletions Goutte/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,22 @@

namespace Goutte;

use Symfony\Component\BrowserKit\CookieJar;
use Symfony\Component\BrowserKit\History;
use Symfony\Component\BrowserKit\HttpBrowser;
use Symfony\Contracts\HttpClient\HttpClientInterface;

/**
* @author Fabien Potencier <[email protected]>
*
* @deprecated Use Symfony\Component\BrowserKit\HttpBrowser directly instead
*/
class Client extends HttpBrowser
{
public function __construct(HttpClientInterface $client = null, History $history = null, CookieJar $cookieJar = null)
{
trigger_deprecation('fabpot/goutte', '4.0', 'The "%s" class is deprecated, use "%s" instead.', __CLASS__, HttpBrowser::class);

parent::__construct($client, $history, $cookieJar);
}
}
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2010-2016 Fabien Potencier
Copyright (c) 2010-present Fabien Potencier

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
7 changes: 7 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ Goutte is a screen scraping and web crawling library for PHP.
Goutte provides a nice API to crawl websites and extract data from the HTML/XML
responses.

**WARNING**: This library is deprecated. As of v4, Goutte became a simple proxy
to the `HttpBrowser class
<https://symfony.com/doc/current/components/browser_kit.html#making-external-http-requests>`_
from the `Symfony BrowserKit <https://symfony.com/browser-kit>`_ component. To
migrate, replace ``Goutte\\Client`` by
``Symfony\\Component\\BrowserKit\\HttpBrowser`` in your code.

Requirements
------------

Expand Down
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@
],
"require": {
"php": ">=7.1.3",
"symfony/deprecation-contracts": "^2.1|^3",
"symfony/browser-kit": "^4.4|^5.0|^6.0",
"symfony/css-selector": "^4.4|^5.0|^6.0",
"symfony/dom-crawler": "^4.4|^5.0|^6.0",
"symfony/http-client": "^4.4|^5.0|^6.0",
"symfony/mime": "^4.4|^5.0|^6.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^5.0|^6.0"
"symfony/phpunit-bridge": "^6.0"
},
"autoload": {
"psr-4": { "Goutte\\": "Goutte" },
Expand Down

0 comments on commit e3f2867

Please sign in to comment.