Skip to content

Commit

Permalink
...
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinDev committed Apr 21, 2022
1 parent 2aa4510 commit a0dd1ac
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 42 deletions.
3 changes: 2 additions & 1 deletion packages/extractor/composer.json
Expand Up @@ -18,7 +18,8 @@
}
],
"require": {
"php": ">=8.0"
"php": ">=8.0",
"neitanod/forceutf8": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down
12 changes: 12 additions & 0 deletions packages/google/src/Helper/Puphpeteer.php
Expand Up @@ -102,6 +102,9 @@ public function __destruct()
$this->close();
}

/**
* @psalm-suppress UndefinedMagicMethod
*/
public function load(string $html, string $from = ''): string
{
if ('' !== $from) {
Expand All @@ -114,6 +117,9 @@ public function load(string $html, string $from = ''): string
return self::$pageContent;
}

/**
* @psalm-suppress UndefinedMagicMethod
*/
public function setCookie(string $name, string $value, string $domain): void
{
$cookie = \Safe\json_decode(\Safe\json_encode([
Expand All @@ -122,6 +128,9 @@ public function setCookie(string $name, string $value, string $domain): void
$this->getBrowserPage()->setCookie($cookie[0]); // @phpstan-ignore-line
}

/**
* @psalm-suppress UndefinedMagicMethod
*/
public function get(string $url): string
{
$this->getBrowserPage()->goto($url, ['waitUntil' => 'domcontentloaded']); // @phpstan-ignore-line
Expand All @@ -134,6 +143,9 @@ public function get(string $url): string
return self::$pageContent;
}

/**
* @psalm-suppress UndefinedMagicMethod
*/
private function manageMetaRefresh(string $base = ''): void
{
if ($this->elementExists('[http-equiv=refresh]')) {
Expand Down
80 changes: 40 additions & 40 deletions packages/text-analyzer/composer.json
@@ -1,43 +1,43 @@
{
"name": "piedweb/text-analyzer",
"type": "library",
"description": "Semantic Analysis : Extract Expressions from a text and order it by density.",
"keywords": [
"Pied Web",
"TextAnalyzer"
],
"homepage": "https://dev.piedweb.com",
"license": "MIT",
"authors": [
{
"name": "Robin D. (ak Pied Web)",
"email": "contact@robin-d.fr",
"homepage": "https://piedweb.com"
}
],
"require": {
"php" : "~7.1|^8.0",
"neitanod/forceutf8": "^2.0.4",
"ropendev/simple_html_dom": "^1.7",
"vimeo/psalm": "^4.4"
},
"require-dev": {
"phpunit/phpunit" : ">=7.0",
"squizlabs/php_codesniffer": "^3.0"
},
"autoload": {
"psr-4": {
"PiedWeb\\TextAnalyzer\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"PiedWeb\\TextAnalyzer\\": "tests"
}
},
"scripts": {
"test": "phpunit",
"check-style": "phpcs src tests",
"fix-style": "phpcbf src tests"
"name": "piedweb/text-analyzer",
"type": "library",
"description": "Semantic Analysis : Extract Expressions from a text and order it by density.",
"keywords": [
"Pied Web",
"TextAnalyzer"
],
"homepage": "https://dev.piedweb.com",
"license": "MIT",
"authors": [
{
"name": "Robin D. (ak Pied Web)",
"email": "contact@robin-d.fr",
"homepage": "https://piedweb.com"
}
],
"require": {
"php": "~7.1|^8.0",
"neitanod/forceutf8": "^2.0",
"ropendev/simple_html_dom": "^1.7",
"vimeo/psalm": "^4.4"
},
"require-dev": {
"phpunit/phpunit": ">=7.0",
"squizlabs/php_codesniffer": "^3.0"
},
"autoload": {
"psr-4": {
"PiedWeb\\TextAnalyzer\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"PiedWeb\\TextAnalyzer\\": "tests"
}
},
"scripts": {
"test": "phpunit",
"check-style": "phpcs src tests",
"fix-style": "phpcbf src tests"
}
}
2 changes: 1 addition & 1 deletion packages/text-analyzer/src/CleanText.php
Expand Up @@ -15,7 +15,7 @@ class CleanText

// '/([^\n\.\!\?]{10,}[\.\!\?…])*/';
/**
* @var string[]&mixed[]
* @var string[]
*/
public const STOP_WORDS = [
// English stop words
Expand Down

0 comments on commit a0dd1ac

Please sign in to comment.