Skip to content
Permalink

Comparing changes

This is a direct comparison between two commits made in this repository or its related repositories. View the default comparison for this range or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: symfony/string
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v6.4.4
Choose a base ref
..
head repository: symfony/string
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v7.0.4
Choose a head ref
Showing with 10 additions and 16 deletions.
  1. +2 −2 AbstractString.php
  2. +1 −1 LazyString.php
  3. +1 −4 Slugger/AsciiSlugger.php
  4. +1 −4 UnicodeString.php
  5. +5 −5 composer.json
4 changes: 2 additions & 2 deletions AbstractString.php
Original file line number Diff line number Diff line change
@@ -39,8 +39,8 @@ abstract class AbstractString implements \Stringable, \JsonSerializable
public const PREG_SPLIT_DELIM_CAPTURE = \PREG_SPLIT_DELIM_CAPTURE;
public const PREG_SPLIT_OFFSET_CAPTURE = \PREG_SPLIT_OFFSET_CAPTURE;

protected $string = '';
protected $ignoreCase = false;
protected string $string = '';
protected ?bool $ignoreCase = false;

abstract public function __construct(string $string = '');

2 changes: 1 addition & 1 deletion LazyString.php
Original file line number Diff line number Diff line change
@@ -129,7 +129,7 @@ private static function getPrettyName(callable $callback): string
} elseif ($callback instanceof \Closure) {
$r = new \ReflectionFunction($callback);

if (str_contains($r->name, '{closure}') || !$class = \PHP_VERSION_ID >= 80111 ? $r->getClosureCalledClass() : $r->getClosureScopeClass()) {
if (str_contains($r->name, '{closure}') || !$class = $r->getClosureCalledClass()) {
return $r->name;
}

5 changes: 1 addition & 4 deletions Slugger/AsciiSlugger.php
Original file line number Diff line number Diff line change
@@ -74,10 +74,7 @@ public function __construct(?string $defaultLocale = null, array|\Closure|null $
$this->symbolsMap = $symbolsMap ?? $this->symbolsMap;
}

/**
* @return void
*/
public function setLocale(string $locale)
public function setLocale(string $locale): void
{
$this->defaultLocale = $locale;
}
5 changes: 1 addition & 4 deletions UnicodeString.php
Original file line number Diff line number Diff line change
@@ -362,10 +362,7 @@ public function startsWith(string|iterable|AbstractString $prefix): bool
return $prefix === grapheme_extract($this->string, \strlen($prefix), \GRAPHEME_EXTR_MAXBYTES);
}

/**
* @return void
*/
public function __wakeup()
public function __wakeup(): void
{
if (!\is_string($this->string)) {
throw new \BadMethodCallException('Cannot unserialize '.__CLASS__);
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -16,18 +16,18 @@
}
],
"require": {
"php": ">=8.1",
"php": ">=8.2",
"symfony/polyfill-ctype": "~1.8",
"symfony/polyfill-intl-grapheme": "~1.0",
"symfony/polyfill-intl-normalizer": "~1.0",
"symfony/polyfill-mbstring": "~1.0"
},
"require-dev": {
"symfony/error-handler": "^5.4|^6.0|^7.0",
"symfony/intl": "^6.2|^7.0",
"symfony/http-client": "^5.4|^6.0|^7.0",
"symfony/error-handler": "^6.4|^7.0",
"symfony/intl": "^6.4|^7.0",
"symfony/http-client": "^6.4|^7.0",
"symfony/translation-contracts": "^2.5|^3.0",
"symfony/var-exporter": "^5.4|^6.0|^7.0"
"symfony/var-exporter": "^6.4|^7.0"
},
"conflict": {
"symfony/translation-contracts": "<2.5"