Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Merge pull request #329 from tighten/v9.38.0-changes
Browse files Browse the repository at this point in the history
v9.38.0 changes
  • Loading branch information
jamisonvalenta authored Jan 13, 2023
2 parents 8998fef + f541575 commit 47b3c26
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/Collect/Support/Enumerable.php
Original file line number Diff line number Diff line change
Expand Up @@ -1168,7 +1168,7 @@ public function count(): int;
* @param (callable(TValue, TKey): mixed)|string|null $countBy
* @return static<array-key, int>
*/
public function countBy($callback = null);
public function countBy($countBy = null);

/**
* Zip the collection together with one or more arrays.
Expand Down
12 changes: 8 additions & 4 deletions tests/files/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@ public static function singular($value)
* @param string|null $language
* @return string
*/
public static function slug($title, $separator = '-', $language = 'en')
public static function slug($title, $separator = '-', $language = 'en', $dictionary = ['@' => 'at'])
{
$title = $language ? static::ascii($title, $language) : $title;

Expand All @@ -1023,10 +1023,14 @@ public static function slug($title, $separator = '-', $language = 'en')

$title = preg_replace('!['.preg_quote($flip).']+!u', $separator, $title);

// Replace @ with the word 'at'
$title = str_replace('@', $separator.'at'.$separator, $title);
// Replace dictionary words
foreach ($dictionary as $key => $value) {
$dictionary[$key] = $separator.$value.$separator;
}

$title = str_replace(array_keys($dictionary), array_values($dictionary), $title);

// Remove all characters that are not the separator, letters, numbers, or whitespace.
// Remove all characters that are not the separator, letters, numbers, or whitespace
$title = preg_replace('![^'.preg_quote($separator).'\pL\pN\s]+!u', '', static::lower($title));

// Replace all separator characters and whitespace by a single separator
Expand Down
2 changes: 1 addition & 1 deletion upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ function getCurrentVersionFromGitHub()
echo Getting current version from $repository...

if [ -z "$requestedVersion" ]; then
collectionVersion=$(git ls-remote $repository --tags v9.35\* | grep tags/ | grep -v {} | cut -d \/ -f 3 | cut -d v -f 2 | grep -v RC | grep -vi beta | sort -t. -k 1,1n -k 2,2n -k 3,3n| tail -1)
collectionVersion=$(git ls-remote $repository --tags v9.38\* | grep tags/ | grep -v {} | cut -d \/ -f 3 | cut -d v -f 2 | grep -v RC | grep -vi beta | sort -t. -k 1,1n -k 2,2n -k 3,3n| tail -1)
else
collectionVersion=$requestedVersion
fi
Expand Down

0 comments on commit 47b3c26

Please sign in to comment.