Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@nicolas-grekas
Copy link
Member

Q A
Branch? 8.0
Bug fix? no
New feature? no
Deprecations? no
Issues -
License MIT

@OskarStark
Copy link
Contributor

Wow 🤩

throw new \LogicException(\sprintf('Resetting a non-lazy manager service is not supported. Declare the "%s" service as lazy.', $name));
}

return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't the if ($manager instanceof LazyObjectInterface) { above also dead code ? Or is there still a case where we use a LazyObjectInterface of var-exporter instead of a native lazy object on PHP 8.4+ ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LazyObjectInterface is not deprecated, it's still used for lazy decorators, which is the remaining feature on the topic.

$prevCacheDir = false;
}
}
$SYMFONY_PHPUNIT_REMOVE = $getEnvVar('SYMFONY_PHPUNIT_REMOVE', 'phpspec/prophecy'.($PHPUNIT_VERSION < 6.0 ? ' symfony/yaml' : ''));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we really dropping support for older PHPUnit versions ? There is a difference between the default version and the supported versions.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

older phpunit versions don't support PHP 8, but we bumped the bridge to PHP >= 8.1 (to keep using it when testing Symfony 6.4)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll need a proper cleanup to remove all code related to using older PHPUnit versions then. For instance, there is no need to remove the prophecy dependency in PHPUnit 9.6 anymore (as it is not installed by default anymore).
And we probably need a check on $PHPUNIT_VERSION to fail properly if the env variable specifies an unsupported PHPUnit version.

}

return static::createFromFormat('U.u', \sprintf('%.6F', $timestamp));
return parent::createFromTimestamp($timestamp);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we drop the method override entirely now that we don't need to polyfill it ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the decoration remains for the static return type, which is more accurate than the native one

}
/**
* @internal
* @deprecated since Symfony 7.3
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

adding a @deprecated since Symfony 7.3 annotation that was not there before is suspicious to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added as a reminder this should removed while removing the deprecated traits
the annotation was not needed because @internal

Copy link
Member Author

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comments addressed @stof, thanks for the review!

throw new \LogicException(\sprintf('Resetting a non-lazy manager service is not supported. Declare the "%s" service as lazy.', $name));
}

return;
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LazyObjectInterface is not deprecated, it's still used for lazy decorators, which is the remaining feature on the topic.

$prevCacheDir = false;
}
}
$SYMFONY_PHPUNIT_REMOVE = $getEnvVar('SYMFONY_PHPUNIT_REMOVE', 'phpspec/prophecy'.($PHPUNIT_VERSION < 6.0 ? ' symfony/yaml' : ''));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

older phpunit versions don't support PHP 8, but we bumped the bridge to PHP >= 8.1 (to keep using it when testing Symfony 6.4)

}

return static::createFromFormat('U.u', \sprintf('%.6F', $timestamp));
return parent::createFromTimestamp($timestamp);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the decoration remains for the static return type, which is more accurate than the native one

}
/**
* @internal
* @deprecated since Symfony 7.3
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added as a reminder this should removed while removing the deprecated traits
the annotation was not needed because @internal

@nicolas-grekas nicolas-grekas force-pushed the deadcode branch 2 times, most recently from 321cf79 to 38e079e Compare June 4, 2025 10:36
nicolas-grekas added a commit that referenced this pull request Jun 4, 2025
…ekas)

This PR was merged into the 8.0 branch.

Discussion
----------

Remove deadcode after the bump to PHP >= 8.4

| Q             | A
| ------------- | ---
| Branch?       | 8.0
| Bug fix?      | no
| New feature?  | no
| Deprecations? | no
| Issues        | -
| License       | MIT

Commits
-------

38e079e Remove deadcode after the bump to PHP >= 8.4
@nicolas-grekas nicolas-grekas merged commit d8b20d5 into symfony:8.0 Jun 4, 2025
7 of 9 checks passed
@nicolas-grekas nicolas-grekas deleted the deadcode branch June 4, 2025 10:39
nicolas-grekas added a commit that referenced this pull request Nov 6, 2025
This PR was merged into the 8.0 branch.

Discussion
----------

[Clock] Removes redundant timezone check

| Q | A
|---|---
| Branch? | 8.0
| Bug fix? | no
| New feature? | no
| BC breaks? | no
| Deprecations? | no
| Issues | n/a
| License | MIT

This PR removes unused code in `MockClock::withTimeZone()`.

This change cleans up the legacy branching logic, similar to the cleanup performed in other components (See #60666 on [this line](https://github.com/symfony/symfony/pull/60666/files#diff-4f259654aa1664031ca46e2710b790a0d01b5f5e0e92455a21eca48241988773L31))

Commits
-------

b158a98 [Clock] Removes redundant timezone check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants