Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also 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/var-dumper
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.4.25
Choose a base ref
...
head repository: symfony/var-dumper
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v6.0.0
Choose a head ref

Commits on May 19, 2021

  1. Copy the full SHA
    5e2fdb4 View commit details
  2. Merge branch '5.4' into 6.0

    * 5.4:
      Allow Symfony 6
    derrabus committed May 19, 2021
    Copy the full SHA
    ce779c1 View commit details

Commits on May 20, 2021

  1. Copy the full SHA
    cd446da View commit details

Commits on May 21, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      [Ldap] Avoid calling the deprecated getUsername()
      Report the correct package in the deprecation message
      Wrapping exception js in Sfjs check and also loading base_js Sfjs if needed
      Fix PHP 8.1 deprecations
      Add missing deprecation entry
      [VarDumper] Don't pass null to parse_url()
      Invalid copy-paste fix
    derrabus committed May 21, 2021
    Copy the full SHA
    d1423f2 View commit details

Commits on May 23, 2021

  1. Remove constraint for PHP < 8

    jderusse authored and nicolas-grekas committed May 23, 2021
    Copy the full SHA
    188589e View commit details
  2. minor #41295 Remove constraint for PHP < 8 (jderusse)

    This PR was squashed before being merged into the 6.0 branch.
    
    Discussion
    ----------
    
    Remove constraint for PHP < 8
    
    | Q             | A
    | ------------- | ---
    | Branch?       | 6.0
    | Bug fix?      | no
    | New feature?  | no
    | Deprecations? | no
    | Tickets       | -
    | License       | MIT
    | Doc PR        | -
    
    Remove code check against PHP_VERSION < 8 (except for PHPUnit Bridge)
    
    Commits
    -------
    
    a8c74ae3fb Remove constraint for PHP < 8
    nicolas-grekas committed May 23, 2021
    Copy the full SHA
    84bee9a View commit details

Commits on May 26, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      Fix CS in README files
      Fix markdown
      [HttpKernel] Fixes tests for PHP7.4+
      fix test
      [HttpKernel] Throw when HttpKernel is created and the env is empty
      [FrameworkBundle] Deprecate the `AdapterInterface` autowiring alias, use `CacheItemPoolInterface` instead
      [Filesystem] fix readlink for Windows
    nicolas-grekas committed May 26, 2021
    Copy the full SHA
    a04fd46 View commit details

Commits on May 27, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      [VarDumper] fix tests
      [Intl] fix bad merge
      Remove notice about reverted behavior
      [PhpUnitBridge] fix PHP version check
      keep container.service_subscriber tag on the decorated definition
    nicolas-grekas committed May 27, 2021
    Copy the full SHA
    9015c21 View commit details

Commits on May 28, 2021

  1. Copy the full SHA
    94f5045 View commit details
  2. Copy the full SHA
    1da9722 View commit details

Commits on Jun 2, 2021

  1. Copy the full SHA
    39e88e5 View commit details

Commits on Jun 6, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      Fix incompatible implicit float-to-int conversions
      [Translation] Don't pass null to strtoupper()
      cs fix
      [String] Fix implicit float-to-int casts
      [Asset] Don't pass null to strpos()
      [Messenger] Fix broken mock
      [DependencyInjection] Don't pass null to trim()
      Add return types to JsonSerializable implementations
      Fix Serializable deprecations triggered by token mocks
      Add missing security translations
      [FrameworkBundle] Deprecate the public `profiler` service to private
    derrabus committed Jun 6, 2021
    Copy the full SHA
    a1ad821 View commit details

Commits on Jun 12, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      [Console] Fix using #[AsCommand] without DI
      [DependencyInjection] fix parsing classes for attributes
      [HttpClient] fix compat with cURL <= 7.37
      [Console] fix managing signals when commands are lazy loaded
      Remove Debug component from patch-types.php
      [Uid] Realign inspect commands labels
      [Runtime] fix overriding --env|-e with single-command apps
      [VarDumper] Add casters for Symfony UUIDs and ULIDs
      [Serializer] Fix call to expectExceptionMessage()
      [Config] fix tracking attributes in ReflectionClassResource
      [Process] Fix incorrect parameter type
      [HttpFoundation] Handle tentative return types
    nicolas-grekas committed Jun 12, 2021
    Copy the full SHA
    54454cd View commit details

Commits on Jun 24, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4: (29 commits)
      [DI] fix fixture
      [ErrorHandler] fix handling buffered SilencedErrorContext
      [HttpClient] fix Psr18Client when allow_url_fopen=0
      [DependencyInjection] Add support of PHP enumerations
      [Cache] handle prefixed redis connections when clearing pools
      [Cache] fix eventual consistency when using RedisTagAwareAdapter with a cluster
      [Uid] Prevent double validation in Uuid::fromString() with base32 values
      [Uid] Fix fromString() with low base58 values
      [Notifier] Add options to Microsoft Teams notifier
      [Notifier] Add Telnyx notifier bridge
      [Validator][Translation] Add ExpressionLanguageSyntax en and fr
      [HttpKernel] [HttpCache] Keep s-maxage=0 from ESI sub-responses
      Avoid broken action URL in text notification mail
      [FrameworkBundle] Add commented base64 version of secrets' keys
      [WebProfilerBundle] Improved the light/dark theme switching
      Fix references to CheckRememberMeConditionsListener
      [DependencyInjection] accept service locator definitions with no class
      [Cache] Disable locking on Windows by default
      [HttpClient] Add default base_uri to MockHttpClient
      [DependencyInjection] Fix binding "iterable $foo" when using the PHP-DSL
      ...
    nicolas-grekas committed Jun 24, 2021
    Copy the full SHA
    7511f22 View commit details

Commits on Jun 29, 2021

  1. Add union types

    nicolas-grekas committed Jun 29, 2021
    Copy the full SHA
    e8000c2 View commit details
  2. Add more types

    nicolas-grekas committed Jun 29, 2021
    Copy the full SHA
    e48d7de View commit details

Commits on Jun 30, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      [Filesystem] Workaround cannot dumpFile into "protected" folders on Windows
      Handle concurency in Csrf DoctrineTokenProvider
      Missing translations for Chinese (zh_CN) #41814
      [VarDumper] improve support for AmpHttpClient
      update Italian translation
      Fix SessionTokenStorage reuse with Request
      added missing Arabic translations
    fabpot committed Jun 30, 2021
    Copy the full SHA
    86ff6d6 View commit details
  2. Merge branch '5.4' into 6.0

    * 5.4:
      Fix tests
      CS fix
      CS fix
      CS fix
      CS fixes
      Bump Symfony version to 5.3.4
      Update VERSION for 5.3.3
      Update CHANGELOG for 5.3.3
      Bump Symfony version to 5.2.12
      Update VERSION for 5.2.11
      Update CHANGELOG for 5.2.11
      Bump Symfony version to 4.4.27
      Update VERSION for 4.4.26
      Update CONTRIBUTORS for 4.4.26
      Update CHANGELOG for 4.4.26
    nicolas-grekas committed Jun 30, 2021
    Copy the full SHA
    d8b5baa View commit details

Commits on Jul 5, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      cs fix
      [DependencyInjection][Console] tighten types
      [Lock] fix derivating semaphore from key
      [Serializer] Add support of PHP backed enumerations
      [Notifier] Fix TransportTestCase
      Move ServiceSessionFactory in FrameorkBundle
      [Security\Core] Fix wrong deprecation message in UserPasswordValidator
      VarDumper: add ability to style doubles and integers independently
    nicolas-grekas committed Jul 5, 2021
    Copy the full SHA
    9162577 View commit details

Commits on Jul 15, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      [ErrorHandler] fix parsing `@return array<foo>` annotations
      [HttpFoundation] Fix return types of SessionHandler::gc()
      [Cache] Support decorated Dbal drivers in PdoAdapter
      [VarDumper] Support for intersection types
      Throw error if maximum block limit is reached for slack message options
    nicolas-grekas committed Jul 15, 2021
    Copy the full SHA
    57f39a6 View commit details

Commits on Jul 18, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      Simplify some code with null coalesce operator
      Don't use deprecated TestLogger class
    derrabus committed Jul 18, 2021
    Copy the full SHA
    5bd6c5d View commit details

Commits on Jul 21, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      Leverage str_contains/str_starts_with
      Leverage str_ends_with
    nicolas-grekas committed Jul 21, 2021
    Copy the full SHA
    fd7b567 View commit details

Commits on Jul 23, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      [Cache] Add missing return type
      [5.2] Add missing `@return` annotations
      [4.4] Add missing `@return` annotations
      Handle lock with long key
      #42227 update phpdoc to recommend createIndex over ensureIndex
    nicolas-grekas committed Jul 23, 2021
    Copy the full SHA
    1eb7ad5 View commit details

Commits on Jul 29, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      Remove polyfills from Yaml and Dotenv
      HtmlDumper - setDumpHeader accepts null
    fabpot committed Jul 29, 2021
    Copy the full SHA
    f2ed715 View commit details

Commits on Aug 4, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      Fix return types for PHP 8.1
    derrabus committed Aug 4, 2021
    Copy the full SHA
    dda9748 View commit details

Commits on Aug 5, 2021

  1. Merge branch '5.4' into 6.0

    Tobion committed Aug 5, 2021
    Copy the full SHA
    d6067a7 View commit details

Commits on Aug 10, 2021

  1. Remove ReturnTypeWillChange

    Signed-off-by: Alexander M. Turek <me@derrabus.de>
    derrabus committed Aug 10, 2021
    Copy the full SHA
    51a9d9a View commit details

Commits on Aug 13, 2021

  1. Copy the full SHA
    862552b View commit details

Commits on Aug 16, 2021

  1. Run php-cs-fixer

    nicolas-grekas committed Aug 16, 2021
    Copy the full SHA
    454ef00 View commit details

Commits on Aug 17, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      [Serializer] cs fix
      Cleanup more `@return` annotations
      [Form] Fix phpdoc on FormBuilderInterface
    nicolas-grekas committed Aug 17, 2021
    Copy the full SHA
    a282e51 View commit details

Commits on Aug 24, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      Add some missing return types to internal/final classes
    nicolas-grekas committed Aug 24, 2021
    Copy the full SHA
    1e4416d View commit details

Commits on Sep 8, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      [VarDumper] Backport type fixes
      [Ldap] Backport refactorings
      [DependencyInjection] Optimize PHP preloading
      Introduced new method for getting bundles config path
    nicolas-grekas committed Sep 8, 2021
    Copy the full SHA
    a270702 View commit details
  2. [VarDumper] Fix return type

    Signed-off-by: Alexander M. Turek <me@derrabus.de>
    derrabus committed Sep 8, 2021
    Copy the full SHA
    4889743 View commit details
  3. Copy the full SHA
    8eea4e8 View commit details

Commits on Sep 24, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      [VarDumper] fix dumping typed references from properties
      [VarDumper] minor optim on PHP 8.1
      Update README.md
      [Messenger] [Redis] Allow authentication with user and password
      [Cache] Throw ValueError in debug mode when serialization fails
      [FrameworkBundle] Avoid secrets:decrypt-to-local command to fail
      fix missing classes
      Mattermost Notifier option to post in an other channel
      [Messenger] Add WorkerMetadata to Worker class
    nicolas-grekas committed Sep 24, 2021
    Copy the full SHA
    b198693 View commit details

Commits on Sep 30, 2021

  1. Copy the full SHA
    936e773 View commit details

Commits on Oct 5, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      fix SQLSRV throws for method_exists()
      [HttpKernel] Add basic support for language negotiation
      [Messenger] Add a middleware to log when transaction has been left open
      [HttpClient] Add method to set response factory in mock client
      Move array_merge calls out of loops to improve performance
      Remove references to DBALException
      [VarDumper] Fix handling of "new" in initializers on PHP 8.1
    derrabus committed Oct 5, 2021
    Copy the full SHA
    d314f23 View commit details

Commits on Oct 6, 2021

  1. Copy the full SHA
    365809e View commit details

Commits on Oct 11, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      [Security][WIP] Add authenticators info to the profiler
      [Translation] Use symfony default locale when pulling translations from providers
      added missing translations for Bosnian (bs)
      Add the missing greek translations for security core and validator component
      [HttpKernel] Fix return types in `EventDataCollector`
      Do not call substr_count() if ip is null to avoid deprecation warning in PHP 8.1
      [Security][Validator] Add missing translations for Slovenian (sl)
      [Messenger] Add worker metadata inside logs
      [Messenger] Log when worker should stop and when `SIGTERM` is received
      cs fix
      [Security][Validator] Add missing translations for Finnish (fi)
      [VarDumper] returns a 500 when dd() is executed
      chore(VarDumper): declare that dd() never returns
      [MonologBridge] Deprecate the Swiftmailer handler
      [Cache] Commit items implicitly only when deferred keys are requested
      [MonologBridge] Deprecates ResetLoggersWorkerSubscriber
      Fix "can not" spelling
      [HttpClient] fix missing kernel.reset tag on TraceableHttpClient services
      [Form] Fix ChoiceType Extension to effectively set and use the translator
      Added new CssColor constraint
    chalasr committed Oct 11, 2021
    Copy the full SHA
    6e01f85 View commit details

Commits on Oct 19, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4: (35 commits)
      fix: Improve FR validators translation
      [Notifier] Add push channel to notifier
      Fix CS
      [Lock] Split PdoStore into DoctrineDbalStore
      [Cache] Split PdoAdapter into DoctrineDbalAdapter
      Add swedish translation for issue #43458
      [HttpClient] fix collecting debug info on destruction of CurlResponse
      Fix CS
      added missing thai translations
      Add missing translations for Chinese (zh_TW)
      [DependencyInjection] fix "url" env var processor
      update translation
      [Serializer] symfony#36594 attributes cache breaks normalization
      Remove untranslated translation for Afrikaans
      [Validator] Add missing validator polish translation
      [Security,Validator] Added missing Latvian translations #41053
      Add the missing translations for Indonesian (id)
      [Validator] Add missing Lithuanian translation
      [Validator] Add missing Czech translation
      replace "ispravna" with "važeća" in translating "valid HTML/CSS"
      ...
    derrabus committed Oct 19, 2021
    Copy the full SHA
    c3a2032 View commit details

Commits on Oct 25, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4: (46 commits)
      move username/password fix to non-deprecated Connection class
      cs fix
      [VarDumper] Fix dumping twig templates found in exceptions
      do not replace definition arguments that have not been configured
      fix Console tests on Windows
      [Validator] Add translations for CIDR constraint
      [Dotenv] Fix testLoadEnv() to start from a fresh context
      [Console] Add completion to server:dump command
      bug #42194 [RateLimiter] fix: sliding window policy to use microtime
      [Validator] Update validators.sr_Cyrl.xlf
      [Validator] Update validators.sr_Latn.xlf
      Add suggestions for the option 'format' of lints commands: twig, yaml and xliff
      [VarDumper] Add support for Fiber
      uzb translation
      Update validators.uz.xlf
      Fix logging of impersonator introduced in 5.3
      [Console] Add show proxified command class in completion debug
      skip command completion tests with older Symfony Console versions
      [Uid] Allow use autocompletion
      [Console] Add completion to messenger:setup-transports command
      ...
    nicolas-grekas committed Oct 25, 2021
    Copy the full SHA
    1b303bd View commit details

Commits on Oct 26, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4: (26 commits)
      [Dotenv] Fix testBootEnv() to start from a fresh context
      fix tests
      relax expected exception message for forward-compatibility with 5.4
      fix expected exception messages after changes made in Definition class
      [DependencyInjection] show class name on DI errors
      skip command completion tests with older Symfony Console versions
      Use GitHub issue form templates
      Fix CS
      add ResponseIsUnprocessable
      Add missing translations for Persian (fa)
      skip command completion tests with older Symfony Console versions
      prevent issues with timezones and DST by using only UNIX timestamps
      Add the missing translations for Bahasa Indonesia (id)
      [Finder] Fix .gitignore infinite loop
      Update README.md
      fix messenger DI dependency for registerAttributeForAutoconfiguration
      [Messenger] Autoconfigurable attributes
      Fix deprecations on PHP 8.2
      [Dotenv] Fix testLoadEnv() .env.dist isolation
      Since 5.0, throws \UnexpectedValueException has been removed.
      ...
    nicolas-grekas committed Oct 26, 2021
    Copy the full SHA
    1817d62 View commit details

Commits on Nov 4, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4: (27 commits)
      feat: add completion for DebugAutowiring search argument
      [Routing] Add support for aliasing routes
      [DependencyInjection] only allow `ReflectionNamedType` for `ServiceSubscriberTrait`
      Fix CS
      [Console] Open CompleteCommand for custom outputs
      [Intl] Update the ICU data to 70.1
      [Messenger] Add completion for failed messages commands.
      Fix tests
      Fixing missing full_stack variable that's needed by toolbar.html.twig
      [PropertyInfo] Bump phpstan/phpdoc-parser
      [Security] Backport type fixes
      [VarExporter] escape unicode chars involved in directionality
      [Framework] Add completion to debug:container
      [Messenger] Add completion to command messenger:consume
      [Intl] Update the ICU data to 70.1
      Fix more generic types
      Default access_decision_manager.strategy option with merge.
      Fix typos
      Update validators.ca.xlf
      Add missing Validator translations for Estonian
      ...
    
    Signed-off-by: Alexander M. Turek <me@derrabus.de>
    derrabus committed Nov 4, 2021
    Copy the full SHA
    dbc533e View commit details

Commits on Nov 12, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      Fix tests on PHP 8.1
      [Cache] Fix memory leak
      [Config] Add missing use statement in generated config builder classes
      [DependencyInjection] fix inlining when non-shared services are involved
      [FrameworkBundle] fix deprecation message
      [DoctrineBridge] add support for the JSON type
      [PHPUnitBridge] Fix Uncaught ValueError
      [HttpClient] Implement ResetInterface for all http clients
      [HttpKernel] allow ignoring kernel.reset methods that don't exist
      [FrameworkBundle] fix registering late resettable services
      [Validator] Missing translations for Greek (el)
      translate for japanese 101,102,103
      Use symfony-*-bridge instead of symfony-bridge for component bridges
      Fix Loco Provider
      [HttpClient] Curl http client has to reinit curl multi handle on reset
      [SecurityBundle] Fix compat with symfony/security-core:^6 (ter)
      [Validator] Add Swedish translation for issue #43737
    nicolas-grekas committed Nov 12, 2021
    Copy the full SHA
    b507e79 View commit details

Commits on Nov 29, 2021

  1. Merge branch '5.4' into 6.0

    * 5.4:
      [Security] Do not overwrite already stored tokens for REMOTE_USER authentication
      [Validator] Fix validation for single level domains
      [Notifier] add Vonage bridge to replace the Nexmo one
      Fix redundant type casts
      Increased the reserved memory from 10k to 32k
      Complete event name & dispatcher in EventDispatcherDebugCommand
      [DoctrineBridge] Add DbalLoggerTest to group legacy
      Leverage DBAL's getNativeConnection() method
      [FrameworkBundle] Fix property-info phpstan extractor discovery
      Fix idempotency of LocoProvider write method
    nicolas-grekas committed Nov 29, 2021
    Copy the full SHA
    18d9a17 View commit details
Showing with 162 additions and 388 deletions.
  1. +1 −1 Caster/ArgsStub.php
  2. +2 −2 Caster/ClassStub.php
  3. +2 −5 Caster/ConstStub.php
  4. +1 −1 Caster/CutStub.php
  5. +1 −1 Caster/DsPairStub.php
  6. +4 −4 Caster/ExceptionCaster.php
  7. +3 −3 Caster/LinkStub.php
  8. +2 −2 Caster/MemcachedCaster.php
  9. +1 −1 Caster/RdKafkaCaster.php
  10. +1 −4 Caster/RedisCaster.php
  11. +4 −6 Caster/ReflectionCaster.php
  12. +1 −4 Caster/ResourceCaster.php
  13. +14 −25 Caster/SplCaster.php
  14. +9 −21 Cloner/AbstractCloner.php
  15. +1 −5 Cloner/ClonerInterface.php
  16. +24 −70 Cloner/Data.php
  17. +10 −13 Cloner/DumperInterface.php
  18. +1 −1 Cloner/Stub.php
  19. +12 −37 Cloner/VarCloner.php
  20. +2 −2 Command/Descriptor/CliDescriptor.php
  21. +2 −2 Command/Descriptor/HtmlDescriptor.php
  22. +4 −6 Command/ServerDumpCommand.php
  23. +5 −7 Dumper/AbstractDumper.php
  24. +10 −19 Dumper/CliDumper.php
  25. +0 −3 Dumper/ContextProvider/ContextProviderInterface.php
  26. +2 −2 Dumper/ContextProvider/RequestContextProvider.php
  27. +4 −4 Dumper/ContextProvider/SourceContextProvider.php
  28. +2 −2 Dumper/ContextualizedDumper.php
  29. +6 −6 Dumper/HtmlDumper.php
  30. +2 −2 Dumper/ServerDumper.php
  31. +2 −2 Resources/functions/dump.php
  32. +2 −2 Server/Connection.php
  33. +2 −2 Server/DumpServer.php
  34. +5 −5 Test/VarDumperTestTrait.php
  35. +0 −63 Tests/Caster/ReflectionCasterTest.php
  36. +0 −6 Tests/Caster/SplCasterTest.php
  37. +0 −3 Tests/Cloner/VarClonerTest.php
  38. +0 −22 Tests/Dumper/CliDumperTest.php
  39. +2 −5 VarDumper.php
  40. +6 −7 composer.json
  41. +10 −10 phpunit.xml.dist
2 changes: 1 addition & 1 deletion Caster/ArgsStub.php
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
*/
class ArgsStub extends EnumStub
{
private static $parameters = [];
private static array $parameters = [];

public function __construct(array $args, string $function, ?string $class)
{
4 changes: 2 additions & 2 deletions Caster/ClassStub.php
Original file line number Diff line number Diff line change
@@ -24,7 +24,7 @@ class ClassStub extends ConstStub
* @param string $identifier A PHP identifier, e.g. a class, method, interface, etc. name
* @param callable $callable The callable targeted by the identifier when it is ambiguous or not a real PHP identifier
*/
public function __construct(string $identifier, $callable = null)
public function __construct(string $identifier, callable|array|string $callable = null)
{
$this->value = $identifier;

@@ -87,7 +87,7 @@ public function __construct(string $identifier, $callable = null)
}
}

public static function wrapCallable($callable)
public static function wrapCallable(mixed $callable)
{
if (\is_object($callable) || !\is_callable($callable)) {
return $callable;
7 changes: 2 additions & 5 deletions Caster/ConstStub.php
Original file line number Diff line number Diff line change
@@ -20,16 +20,13 @@
*/
class ConstStub extends Stub
{
public function __construct(string $name, $value = null)
public function __construct(string $name, string|int|float $value = null)
{
$this->class = $name;
$this->value = 1 < \func_num_args() ? $value : $name;
}

/**
* @return string
*/
public function __toString()
public function __toString(): string
{
return (string) $this->value;
}
2 changes: 1 addition & 1 deletion Caster/CutStub.php
Original file line number Diff line number Diff line change
@@ -20,7 +20,7 @@
*/
class CutStub extends Stub
{
public function __construct($value)
public function __construct(mixed $value)
{
$this->value = $value;

2 changes: 1 addition & 1 deletion Caster/DsPairStub.php
Original file line number Diff line number Diff line change
@@ -18,7 +18,7 @@
*/
class DsPairStub extends Stub
{
public function __construct($key, $value)
public function __construct(string|int $key, mixed $value)
{
$this->value = [
Caster::PREFIX_VIRTUAL.'key' => $key,
8 changes: 4 additions & 4 deletions Caster/ExceptionCaster.php
Original file line number Diff line number Diff line change
@@ -24,9 +24,9 @@
*/
class ExceptionCaster
{
public static $srcContext = 1;
public static $traceArgs = true;
public static $errorTypes = [
public static int $srcContext = 1;
public static bool $traceArgs = true;
public static array $errorTypes = [
\E_DEPRECATED => 'E_DEPRECATED',
\E_USER_DEPRECATED => 'E_USER_DEPRECATED',
\E_RECOVERABLE_ERROR => 'E_RECOVERABLE_ERROR',
@@ -44,7 +44,7 @@ class ExceptionCaster
\E_STRICT => 'E_STRICT',
];

private static $framesCache = [];
private static array $framesCache = [];

public static function castError(\Error $e, array $a, Stub $stub, bool $isNested, int $filter = 0)
{
6 changes: 3 additions & 3 deletions Caster/LinkStub.php
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@ class LinkStub extends ConstStub
{
public $inVendor = false;

private static $vendorRoots;
private static $composerRoots;
private static array $vendorRoots;
private static array $composerRoots = [];

public function __construct(string $label, int $line = 0, string $href = null)
{
@@ -65,7 +65,7 @@ public function __construct(string $label, int $line = 0, string $href = null)

private function getComposerRoot(string $file, bool &$inVendor)
{
if (null === self::$vendorRoots) {
if (!isset(self::$vendorRoots)) {
self::$vendorRoots = [];

foreach (get_declared_classes() as $class) {
4 changes: 2 additions & 2 deletions Caster/MemcachedCaster.php
Original file line number Diff line number Diff line change
@@ -20,8 +20,8 @@
*/
class MemcachedCaster
{
private static $optionConstants;
private static $defaultOptions;
private static array $optionConstants;
private static array $defaultOptions;

public static function castMemcached(\Memcached $c, array $a, Stub $stub, bool $isNested)
{
2 changes: 1 addition & 1 deletion Caster/RdKafkaCaster.php
Original file line number Diff line number Diff line change
@@ -166,7 +166,7 @@ public static function castBrokerMetadata(BrokerMetadata $c, array $a, Stub $stu
return $a;
}

private static function extractMetadata($c)
private static function extractMetadata(KafkaConsumer|\RdKafka $c)
{
$prefix = Caster::PREFIX_VIRTUAL;

5 changes: 1 addition & 4 deletions Caster/RedisCaster.php
Original file line number Diff line number Diff line change
@@ -102,10 +102,7 @@ public static function castRedisCluster(\RedisCluster $c, array $a, Stub $stub,
return $a;
}

/**
* @param \Redis|\RedisArray|\RedisCluster $redis
*/
private static function getRedisOptions($redis, array $options = []): EnumStub
private static function getRedisOptions(\Redis|\RedisArray|\RedisCluster $redis, array $options = []): EnumStub
{
$serializer = $redis->getOption(\Redis::OPT_SERIALIZER);
if (\is_array($serializer)) {
10 changes: 4 additions & 6 deletions Caster/ReflectionCaster.php
Original file line number Diff line number Diff line change
@@ -96,7 +96,7 @@ public static function castType(\ReflectionType $c, array $a, Stub $stub, bool $
{
$prefix = Caster::PREFIX_VIRTUAL;

if ($c instanceof \ReflectionNamedType || \PHP_VERSION_ID < 80000) {
if ($c instanceof \ReflectionNamedType) {
$a += [
$prefix.'name' => $c instanceof \ReflectionNamedType ? $c->getName() : (string) $c,
$prefix.'allowsNull' => $c->allowsNull(),
@@ -419,7 +419,7 @@ private static function addExtra(array &$a, \Reflector $c)
private static function addMap(array &$a, object $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL)
{
foreach ($map as $k => $m) {
if (\PHP_VERSION_ID >= 80000 && 'isDisabled' === $k) {
if ('isDisabled' === $k) {
continue;
}

@@ -431,10 +431,8 @@ private static function addMap(array &$a, object $c, array $map, string $prefix

private static function addAttributes(array &$a, \Reflector $c, string $prefix = Caster::PREFIX_VIRTUAL): void
{
if (\PHP_VERSION_ID >= 80000) {
foreach ($c->getAttributes() as $n) {
$a[$prefix.'attributes'][] = $n;
}
foreach ($c->getAttributes() as $n) {
$a[$prefix.'attributes'][] = $n;
}
}
}
5 changes: 1 addition & 4 deletions Caster/ResourceCaster.php
Original file line number Diff line number Diff line change
@@ -22,10 +22,7 @@
*/
class ResourceCaster
{
/**
* @param \CurlHandle|resource $h
*/
public static function castCurl($h, array $a, Stub $stub, bool $isNested): array
public static function castCurl(\CurlHandle $h, array $a, Stub $stub, bool $isNested): array
{
return curl_getinfo($h);
}
39 changes: 14 additions & 25 deletions Caster/SplCaster.php
Original file line number Diff line number Diff line change
@@ -94,32 +94,24 @@ public static function castFileInfo(\SplFileInfo $c, array $a, Stub $stub, bool
unset($a["\0SplFileInfo\0fileName"]);
unset($a["\0SplFileInfo\0pathName"]);

if (\PHP_VERSION_ID < 80000) {
if (false === $c->getPathname()) {
$a[$prefix.''] = 'The parent constructor was not called: the object is in an invalid state';

return $a;
try {
$c->isReadable();
} catch (\RuntimeException $e) {
if ('Object not initialized' !== $e->getMessage()) {
throw $e;
}
} else {
try {
$c->isReadable();
} catch (\RuntimeException $e) {
if ('Object not initialized' !== $e->getMessage()) {
throw $e;
}

$a[$prefix.''] = 'The parent constructor was not called: the object is in an invalid state';
$a[$prefix.''] = 'The parent constructor was not called: the object is in an invalid state';

return $a;
} catch (\Error $e) {
if ('Object not initialized' !== $e->getMessage()) {
throw $e;
}
return $a;
} catch (\Error $e) {
if ('Object not initialized' !== $e->getMessage()) {
throw $e;
}

$a[$prefix.''] = 'The parent constructor was not called: the object is in an invalid state';
$a[$prefix.''] = 'The parent constructor was not called: the object is in an invalid state';

return $a;
}
return $a;
}

foreach ($map as $key => $accessor) {
@@ -219,7 +211,7 @@ public static function castWeakReference(\WeakReference $c, array $a, Stub $stub
return $a;
}

private static function castSplArray($c, array $a, Stub $stub, bool $isNested): array
private static function castSplArray(\ArrayObject|\ArrayIterator $c, array $a, Stub $stub, bool $isNested): array
{
$prefix = Caster::PREFIX_VIRTUAL;
$flags = $c->getFlags();
@@ -229,9 +221,6 @@ private static function castSplArray($c, array $a, Stub $stub, bool $isNested):
$a = Caster::castObject($c, \get_class($c), method_exists($c, '__debugInfo'), $stub->class);
$c->setFlags($flags);
}
if (\PHP_VERSION_ID < 70400) {
$a[$prefix.'storage'] = $c->getArrayCopy();
}
$a += [
$prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST),
$prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS),
30 changes: 9 additions & 21 deletions Cloner/AbstractCloner.php
Original file line number Diff line number Diff line change
@@ -154,7 +154,6 @@ abstract class AbstractCloner implements ClonerInterface
'Symfony\Component\VarDumper\Caster\DsPairStub' => ['Symfony\Component\VarDumper\Caster\DsCaster', 'castPairStub'],

'CurlHandle' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'],
':curl' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castCurl'],

':dba' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'],
':dba persistent' => ['Symfony\Component\VarDumper\Caster\ResourceCaster', 'castDba'],
@@ -199,15 +198,15 @@ abstract class AbstractCloner implements ClonerInterface
/**
* @var array<string, list<callable>>
*/
private $casters = [];
private array $casters = [];

/**
* @var callable|null
*/
private $prevErrorHandler;

private $classInfo = [];
private $filter = 0;
private array $classInfo = [];
private int $filter = 0;

/**
* @param callable[]|null $casters A map of casters
@@ -267,12 +266,9 @@ public function setMinDepth(int $minDepth)
/**
* Clones a PHP variable.
*
* @param mixed $var Any PHP variable
* @param int $filter A bit field of Caster::EXCLUDE_* constants
*
* @return Data
* @param int $filter A bit field of Caster::EXCLUDE_* constants
*/
public function cloneVar($var, int $filter = 0)
public function cloneVar(mixed $var, int $filter = 0): Data
{
$this->prevErrorHandler = set_error_handler(function ($type, $msg, $file, $line, $context = []) {
if (\E_RECOVERABLE_ERROR === $type || \E_USER_ERROR === $type) {
@@ -304,26 +300,20 @@ public function cloneVar($var, int $filter = 0)

/**
* Effectively clones the PHP variable.
*
* @param mixed $var Any PHP variable
*
* @return array
*/
abstract protected function doClone($var);
abstract protected function doClone(mixed $var): array;

/**
* Casts an object to an array representation.
*
* @param bool $isNested True if the object is nested in the dumped structure
*
* @return array
*/
protected function castObject(Stub $stub, bool $isNested)
protected function castObject(Stub $stub, bool $isNested): array
{
$obj = $stub->value;
$class = $stub->class;

if (\PHP_VERSION_ID < 80000 ? "\0" === ($class[15] ?? null) : str_contains($class, "@anonymous\0")) {
if (str_contains($class, "@anonymous\0")) {
$stub->class = get_debug_type($obj);
}
if (isset($this->classInfo[$class])) {
@@ -374,10 +364,8 @@ protected function castObject(Stub $stub, bool $isNested)
* Casts a resource to an array representation.
*
* @param bool $isNested True if the object is nested in the dumped structure
*
* @return array
*/
protected function castResource(Stub $stub, bool $isNested)
protected function castResource(Stub $stub, bool $isNested): array
{
$a = [];
$res = $stub->value;
6 changes: 1 addition & 5 deletions Cloner/ClonerInterface.php
Original file line number Diff line number Diff line change
@@ -18,10 +18,6 @@ interface ClonerInterface
{
/**
* Clones a PHP variable.
*
* @param mixed $var Any PHP variable
*
* @return Data
*/
public function cloneVar($var);
public function cloneVar(mixed $var): Data;
}
Loading