Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrading Symfony dependencies to allow ^7.0 #204

Merged
merged 3 commits into from
Apr 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@
"require": {
"php": "^8.1",
"ext-intl": "*",
"symfony/dom-crawler": "^5.4 || ^6.0",
"symfony/dom-crawler": "^5.4 || ^6.0 || ^7.0",
"donatello-za/rake-php-plus": "^1.0.15",
"league/uri": "^7.0",
"symfony/browser-kit": "^6.0",
"symfony/http-client": "^6.0",
"symfony/css-selector": "^6.0"
"symfony/browser-kit": "^6.0 || ^7.0",
"symfony/http-client": "^6.0 || ^7.0",
"symfony/css-selector": "^6.0 || ^7.0"
},
"require-dev": {
"symfony/thanks": "^1.0.0",
"phpunit/phpunit": "^8.0.0|^9.0.0",
"illuminate/collections": "^8.0.0|^9.0.0",
"laravel/pint": "^1.0",
"phpstan/phpstan": "^1.0",
"rector/rector": "^0.18",
"rector/rector": "^0.19",
"symfony/var-dumper": "^6.0"
},
"autoload": {
Expand Down
4 changes: 2 additions & 2 deletions src/UsesContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ protected function prepContent(): array
* @see https://phpscraper.de/examples/extract-keywords.html
* @see https://github.com/spekulatius/phpscraper-keyword-scraping-example
*
* @param string $locale (default: 'en_US')
* @param string $locale (default: 'en_US')
*/
public function contentKeywords($locale = 'en_US'): array
{
Expand All @@ -408,7 +408,7 @@ public function contentKeywords($locale = 'en_US'): array
* @see https://phpscraper.de/examples/extract-keywords.html
* @see https://github.com/spekulatius/phpscraper-keyword-scraping-example
*
* @param string $locale (default: 'en_US')
* @param string $locale (default: 'en_US')
*/
public function contentKeywordsWithScores($locale = 'en_US'): array
{
Expand Down
8 changes: 4 additions & 4 deletions src/UsesFeeds.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public function sitemapUrl(): string
*
* @return array $sitemap
*/
public function sitemapRaw(string $url = null): array
public function sitemapRaw(?string $url = null): array
{
return $this->parseXml($this->fetchAsset($url ?? $this->sitemapUrl()));
}
Expand All @@ -31,7 +31,7 @@ public function sitemapRaw(string $url = null): array
*
* @return array<FeedEntry> $sitemap
*/
public function sitemap(string $url = null): array
public function sitemap(?string $url = null): array
{
return array_map(
// Create the generic DTO for each
Expand Down Expand Up @@ -59,7 +59,7 @@ public function searchIndexUrl(): string
*
* @return array $searchIndex
*/
public function searchIndexRaw(string $url = null): array
public function searchIndexRaw(?string $url = null): array
{
return $this->parseJson($this->fetchAsset($url ?? $this->searchIndexUrl()));
}
Expand All @@ -69,7 +69,7 @@ public function searchIndexRaw(string $url = null): array
*
* @return array<FeedEntry> $searchIndex
*/
public function searchIndex(string $url = null): array
public function searchIndex(?string $url = null): array
{
return array_map(
// Create the generic DTO for each
Expand Down
44 changes: 22 additions & 22 deletions src/UsesFileParsers.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ trait UsesFileParsers
*/
public function csvDecodeRaw(
string $csvString,
string $separator = null,
string $enclosure = null,
string $escape = null
?string $separator = null,
?string $enclosure = null,
?string $escape = null
): array {
try {
$csv = array_map(
Expand All @@ -39,9 +39,9 @@ public function csvDecodeRaw(
*/
public function csvDecode(
string $csvString,
string $separator = null,
string $enclosure = null,
string $escape = null
?string $separator = null,
?string $enclosure = null,
?string $escape = null
): array {
try {
$csv = $this->csvDecodeRaw($csvString, $separator, $enclosure, $escape);
Expand All @@ -68,9 +68,9 @@ public function csvDecode(
*/
public function csvDecodeWithHeaderRaw(
string $csvString,
string $separator = null,
string $enclosure = null,
string $escape = null
?string $separator = null,
?string $enclosure = null,
?string $escape = null
): array {
try {
$csv = $this->csvDecodeRaw($csvString, $separator, $enclosure, $escape);
Expand Down Expand Up @@ -99,9 +99,9 @@ function (&$row, $key, $header): void {
*/
public function csvDecodeWithHeader(
string $csvString,
string $separator = null,
string $enclosure = null,
string $escape = null
?string $separator = null,
?string $enclosure = null,
?string $escape = null
): array {
try {
$csv = $this->csvDecodeWithHeaderRaw($csvString, $separator, $enclosure, $escape);
Expand Down Expand Up @@ -143,10 +143,10 @@ public function castType(string $entry): int|float|string
* @return array $data
*/
public function parseCsv(
string $csvStringOrUrl = null,
string $separator = null,
string $enclosure = null,
string $escape = null
?string $csvStringOrUrl = null,
?string $separator = null,
?string $enclosure = null,
?string $escape = null
): array {
// Check if we got either a current page or at least a URL string to process
if ($csvStringOrUrl === null && $this->currentPage === null) {
Expand Down Expand Up @@ -195,10 +195,10 @@ public function parseCsv(
* @return array $data
*/
public function parseCsvWithHeader(
string $csvStringOrUrl = null,
string $separator = null,
string $enclosure = null,
string $escape = null
?string $csvStringOrUrl = null,
?string $separator = null,
?string $enclosure = null,
?string $escape = null
): array {
// Check if we got either a current page or at least a URL string to process
if ($csvStringOrUrl === null && $this->currentPage === null) {
Expand Down Expand Up @@ -246,7 +246,7 @@ public function parseCsvWithHeader(
*
* @return array $data
*/
public function parseJson(string $jsonStringOrUrl = null): array
public function parseJson(?string $jsonStringOrUrl = null): array
{
// Check if we got either a current page or at least a URL string to process
if ($jsonStringOrUrl === null && $this->currentPage === null) {
Expand Down Expand Up @@ -294,7 +294,7 @@ public function parseJson(string $jsonStringOrUrl = null): array
*
* @return array $data
*/
public function parseXml(string $xmlStringOrUrl = null): array
public function parseXml(?string $xmlStringOrUrl = null): array
{
// Check if we got either a current page or at least a URL string to process
if ($xmlStringOrUrl === null && $this->currentPage === null) {
Expand Down
2 changes: 1 addition & 1 deletion src/UsesUrls.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public function currentBaseHost(): string
*
* @return ?string $absoluteUrl
*/
public function makeUrlAbsolute(string $url = null, string $baseUrl = null): ?string
public function makeUrlAbsolute(?string $url = null, ?string $baseUrl = null): ?string
{
// Allow to pass null through
if ($url === null || $this->currentPage === null) {
Expand Down