Skip to content

Commit

Permalink
fix bug on url resolver
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Nov 2, 2023
1 parent 79d9b28 commit 7e6a415
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .phpunit.cache/test-results
@@ -1 +1 @@
{"version":1,"defects":{"GoogleSerpTest::testPuphpeteerMobile":8,"GoogleSerpTest::testCurlMobile":8,"GoogleSerpTest::testExtractionPositionZero":8,"GoogleSerpTest::testExtractMaps":7,"GlobalTest::testTextDataExtractor":7,"GoogleSerpTest::testExtractMapsB":8,"GoogleTrendsTest::testTrendsPuppet":7,"GoogleSuggesterTest::testGoogleSuggester":8,"GoogleTrendsTest::testTrendsCurl":8,"PiedWeb\\MethodDocBlockGenerator\\Test\\MethodDocBlockGeneratorTest::testIt":7},"times":{"PiedWeb\\Crawler\\Test\\CrawlerTest::testIt":1.496,"PiedWeb\\Crawler\\Test\\CrawlerTest::testCommand":0.668,"PiedWeb\\Crawler\\Test\\CrawlerTest::testWitchCachId":0.762,"PiedWeb\\Curl\\Test\\HelperTest::testSchemeFromProxy":0.001,"PiedWeb\\Curl\\Test\\HelperTest::testCheckContentType":0,"PiedWeb\\Curl\\Test\\HelperTest::testCheckStatusCode":0,"PiedWeb\\Curl\\Test\\RequestTest::testDownloadIfHtml":0.304,"PiedWeb\\Curl\\Test\\RequestTest::testNotDownload":0.204,"PiedWeb\\Curl\\Test\\RequestTest::testEffectiveUrl":20.478,"PiedWeb\\Curl\\Test\\RequestTest::testCurlError":0.042,"PiedWeb\\Curl\\Test\\RequestTest::test404":0.229,"PiedWeb\\Curl\\Test\\RequestTest::testAllMethods":1.499,"PiedWeb\\Curl\\Test\\RequestTest::testMultipleCheckInHeaders":0.103,"PiedWeb\\Curl\\Test\\RequestTest::testProxy":1.002,"PiedWeb\\Curl\\Test\\RequestTest::testAbortIfTooBig":0.223,"PiedWeb\\Curl\\Test\\RequestTest::testDownloadOnlyFirstBytes":0.233,"PiedWeb\\Curl\\Test\\RequestTest::testResponseFromCache":0.002,"PiedWeb\\Curl\\Test\\StaticWrapperTest::testStaticGet":0.059,"GlobalTest::testEncoding":0.004,"GlobalTest::testCanonical":0.669,"GlobalTest::testTextDataExtractor":0.405,"GlobalTest::testHrefLangExtractor":0.367,"GoogleSerpTest::testPuphpeteerMobile":9.054,"GoogleSerpTest::testCurlMobile":0.873,"GoogleSerpTest::testExtractionPositionZero":0.784,"GoogleSerpTest::testExtractMaps":3.312,"GoogleSuggesterTest::testGoogleSuggester":1.373,"GoogleTrendsTest::testTrendsCurl":2.809,"GoogleTrendsTest::testTrendsPuppet":34.619,"PiedWeb\\TextAnalyzer\\Test\\AnalyzerTest::testMultiAnalyzer":0.009,"PiedWeb\\TextAnalyzer\\Test\\AnalyzerTest::testTextAnalyzer":0.003,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testSimpleSentences":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveExtremityStopWords":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveExtremityStopWords2":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveStopWords":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testStripTags":0.001,"GoogleSerpTest::testRelatedSearches":0.658,"GoogleSerpTest::testExtractMapsB":0.704,"PiedWeb\\MethodDocBlockGenerator\\Test\\MethodDocBlockGeneratorTest::testIt":0.001}}
{"version":1,"defects":{"GoogleSerpTest::testPuphpeteerMobile":8,"GoogleSerpTest::testCurlMobile":8,"GoogleSerpTest::testExtractionPositionZero":8,"GoogleSerpTest::testExtractMaps":8,"GlobalTest::testTextDataExtractor":7,"GoogleSerpTest::testExtractMapsB":8,"GoogleTrendsTest::testTrendsPuppet":7,"GoogleSuggesterTest::testGoogleSuggester":8,"GoogleTrendsTest::testTrendsCurl":8,"PiedWeb\\MethodDocBlockGenerator\\Test\\MethodDocBlockGeneratorTest::testIt":7,"GoogleSerpTest::testRelatedSearches":8},"times":{"PiedWeb\\Crawler\\Test\\CrawlerTest::testIt":1.643,"PiedWeb\\Crawler\\Test\\CrawlerTest::testCommand":0.421,"PiedWeb\\Crawler\\Test\\CrawlerTest::testWitchCachId":0.839,"PiedWeb\\Curl\\Test\\HelperTest::testSchemeFromProxy":0.001,"PiedWeb\\Curl\\Test\\HelperTest::testCheckContentType":0,"PiedWeb\\Curl\\Test\\HelperTest::testCheckStatusCode":0,"PiedWeb\\Curl\\Test\\RequestTest::testDownloadIfHtml":0.267,"PiedWeb\\Curl\\Test\\RequestTest::testNotDownload":0.212,"PiedWeb\\Curl\\Test\\RequestTest::testEffectiveUrl":20.474,"PiedWeb\\Curl\\Test\\RequestTest::testCurlError":0.043,"PiedWeb\\Curl\\Test\\RequestTest::test404":0.201,"PiedWeb\\Curl\\Test\\RequestTest::testAllMethods":1.24,"PiedWeb\\Curl\\Test\\RequestTest::testMultipleCheckInHeaders":0.119,"PiedWeb\\Curl\\Test\\RequestTest::testProxy":1.002,"PiedWeb\\Curl\\Test\\RequestTest::testAbortIfTooBig":0.247,"PiedWeb\\Curl\\Test\\RequestTest::testDownloadOnlyFirstBytes":0.206,"PiedWeb\\Curl\\Test\\RequestTest::testResponseFromCache":0.001,"PiedWeb\\Curl\\Test\\StaticWrapperTest::testStaticGet":0.061,"GlobalTest::testEncoding":0.004,"GlobalTest::testCanonical":0.623,"GlobalTest::testTextDataExtractor":0.388,"GlobalTest::testHrefLangExtractor":0.337,"GoogleSerpTest::testPuphpeteerMobile":0.001,"GoogleSerpTest::testCurlMobile":0.154,"GoogleSerpTest::testExtractionPositionZero":0.176,"GoogleSerpTest::testExtractMaps":0.138,"GoogleSuggesterTest::testGoogleSuggester":1.514,"GoogleTrendsTest::testTrendsCurl":2.699,"GoogleTrendsTest::testTrendsPuppet":34.14,"PiedWeb\\TextAnalyzer\\Test\\AnalyzerTest::testMultiAnalyzer":0.02,"PiedWeb\\TextAnalyzer\\Test\\AnalyzerTest::testTextAnalyzer":0.004,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testSimpleSentences":0.001,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveExtremityStopWords":0.001,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveExtremityStopWords2":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testRemoveStopWords":0,"PiedWeb\\ExpressionHarvester\\Test\\CleanTextTest::testStripTags":0.001,"GoogleSerpTest::testRelatedSearches":0.129,"GoogleSerpTest::testExtractMapsB":0.704,"PiedWeb\\MethodDocBlockGenerator\\Test\\MethodDocBlockGeneratorTest::testIt":0.001}}
5 changes: 0 additions & 5 deletions packages/extractor/src/Link.php
Expand Up @@ -276,11 +276,6 @@ public function setMayFollow(bool $mayFollow): void
$this->mayFollow = $mayFollow;
}

public function setTo(string $to): void
{
$this->to = $to;
}

public function setAnchor(string $anchor): void
{
$this->anchor = $anchor;
Expand Down
4 changes: 1 addition & 3 deletions packages/extractor/src/Url.php
Expand Up @@ -11,7 +11,6 @@
use League\Uri\BaseUri;
use League\Uri\Http;
use League\Uri\UriInfo;
use League\Uri\UriResolver;

final class Url implements \Stringable
{
Expand All @@ -32,8 +31,7 @@ public function __construct(string $url)

public function resolve(string $url): string
{
$resolved = BaseUri::from($this->http)->resolve(trim($url))->getUri();
// $resolved = UriResolver::resolve(Http::createFromString(trim($url)), $this->http);
$resolved = BaseUri::from($this->http)->resolve(Http::new(trim($url)))->getUri();

return $resolved->__toString();
}
Expand Down

0 comments on commit 7e6a415

Please sign in to comment.