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

Commit

Permalink
Merge pull request #295 from tighten/v9.7.0-changes
Browse files Browse the repository at this point in the history
v9.7.0 changes
  • Loading branch information
jamisonvalenta authored Apr 15, 2022
2 parents 54cc5f0 + f287abe commit cc4964d
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Collect/Support/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -701,7 +701,7 @@ public function last(callable $callback = null, $default = null)
/**
* Get the values of a given key.
*
* @param string|array<array-key, string> $value
* @param string|int|array<array-key, string> $value
* @param string|null $key
* @return static<int, mixed>
*/
Expand Down
11 changes: 11 additions & 0 deletions tests/files/Support/Str.php
Original file line number Diff line number Diff line change
Expand Up @@ -881,6 +881,17 @@ public static function snake($value, $delimiter = '_')
return static::$snakeCache[$key][$delimiter] = $value;
}

/**
* Remove all "extra" blank space from the given string.
*
* @param string $value
* @return string
*/
public static function squish($value)
{
return preg_replace('/\s+/', ' ', trim($value));
}

/**
* Determine if a given string starts with a given substring.
*
Expand Down
10 changes: 10 additions & 0 deletions tests/files/Support/Stringable.php
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,16 @@ public function scan($format)
return collect(sscanf($this->value, $format));
}

/**
* Remove all "extra" blank space from the given string.
*
* @return static
*/
public function squish()
{
return new static(Str::squish($this->value));
}

/**
* Begin a string with a single instance of a given value.
*
Expand Down
2 changes: 1 addition & 1 deletion upgrade.sh
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ function getCurrentVersionFromGitHub()
echo Getting current version from $repository...

if [ -z "$requestedVersion" ]; then
collectionVersion=$(git ls-remote $repository --tags v9\* | 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.7\* | 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 cc4964d

Please sign in to comment.