Skip to content

Commit

Permalink
Fixing pint coding standard
Browse files Browse the repository at this point in the history
  • Loading branch information
tentacode authored and spekulatius committed Apr 9, 2024
1 parent 2bade14 commit 0db799a
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 29 deletions.
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

0 comments on commit 0db799a

Please sign in to comment.