This PR was merged into the 4.4 branch.
Discussion
----------
Fix: Article
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
This pull request
* [x] fixes usages of the indefinite article `a` where `an` should be used instead
Commits
-------
34b320ba97 Fix: Article
This PR was merged into the 4.4 branch.
Discussion
----------
[Console] Fix PHP 8.1 null error for preg_match flag
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Since PHP 8.1, `null` is no longer accepted as `$flags` in `preg_match`, default integer `0` value should be used instead.
Commits
-------
52f02e529a [Console] Fix PHP 8.1 null error for preg_match flag
This PR was merged into the 5.3-dev branch.
Discussion
----------
Fix package name
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | symfony/symfony-docs#... <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- Never break backward compatibility (see https://symfony.com/bc).
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against branch 5.x.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->
Fix Package name as the Bridge is named `SpotHit` and not `Spothit`.
Commits
-------
5f8c736303 Fix package name
This PR was merged into the 5.3-dev branch.
Discussion
----------
[PasswordHasher] Fix: Use algorithm instead of algo
| Q | A
| ------------- | ---
| Branch? | 5.5
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
This pull request
* [x] renames fields, variables, and parameters using `algos` or `algo` (which appear to be entirely made-up words) to `algorithms` and `algorithm` respectively
Commits
-------
a4dd14b478 Fix: Use algorithm instead of algo
This PR was merged into the 5.3-dev branch.
Discussion
----------
[PasswordHasher] Fix: Run 'php-cs-fixer fix'
| Q | A
| ------------- | ---
| Branch? | 5.5
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | n/a
| License | MIT
| Doc PR | n/a
This pull request
* [x] runs `php-cs-fixer fix` in `src/Symfony/Component/PasswordHasher`
💁♂️ I do not know who or what enforces coding standard issues in this repository, but after opening a few pull requests in this repository, I noticed that `fabbot.io` repeatedly reports coding standard violations that are unrelated to the proposed changes. As an experiment I ran
```
$ php-cs-fixer fix
```
on the entire repository and found a lot of issues. Not sure, would you not prefer to have these fixed?
Since the `PasswordHasher` component was only recently extracted, I assume it is safe to propose to run `php-cs-fixer fix` at least on this newly introduced component.
Commits
-------
2102170e43 Fix: Run 'php-cs-fixer fix'
This PR was submitted for the 5.x branch but it was merged into the 4.4 branch instead.
Discussion
----------
[DependencyInjection] Definition::removeMethodCall should remove all matching calls
It would only remove the first match, leaving the other method call(s) there to exist. This leads to unexpected situations.
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | None
| License | MIT
| Doc PR |
I found out that `Definition::removeMethodCall` only removes the first method call and stops. It should remove all method calls named `$method`.
Commits
-------
944ba23b58 Definition::removeMethodCall should remove all matching calls
This PR was merged into the 5.3-dev branch.
Discussion
----------
[FrameworkBundle] Deprecate session.storage service
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | yes
| Tickets | -
| License | MIT
| Doc PR | TODO
Following the deprecation of `session` service, this PR deprecate other services that contains state: `session.storage`
- `session.storage`
- `session.storage.native`, `session.storage.php_bridge` and `session.storage.mock_file`
- `session.storage.metadata_bag`
Because people can inject / decorate override all these services, providing a migration path like I did with `session` would have been very hard. That's why, I added a new `opt-in` flag:
When people use `framework.session: true` or `framework.session.storage_id` the previous behavior is kept and deprecation are triggered when accessing the services.
But when people use the new `framework.session.storage_factory_id` configuration, the previous services (`session.storage.*`) are deleted (in case people would try to inject the legacy `session.storage*` services and would have expect to manipulate the same objects as the object injected in the session)
Commits
-------
37c591516a Deprecate session.storage
This PR was squashed before being merged into the 5.3-dev branch.
Discussion
----------
[DependencyInjection] Negated (not:) env var processor
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? |no
| New feature? | yes
| Deprecations? | no
| License | MIT
| Doc PR | symfony/symfony-docs#14976
This little PR suggests a `not:` env var processor (in a perfect world, I would name it `!:` but only words are accepted as prefixes 🙃)
Goal is to _negate_ a boolean env variable.
Example usage:
```bash
FOO=yes
BAR=off
```
```yaml
# config/services.yaml
parameters:
not_foo: '%env(not:FOO)%' # false
not_bar: '%env(not:BAR)%' # true
```
I'm thinking of this for this kind of usages:
- `some_prod_related_stuff: '%env(not:APP_DEBUG)%'`
- `enabled: '%env(not:bool:key:disabled:query_string:SOME_DSN)%'`
~~Processor raises an exception when preceding resolved value is not a boolean.~~
This processor allows any truthy/falsy values, like `bool:`.
Thank you,
Ben
Commits
-------
56545fd270 [DependencyInjection] Negated (not:) env var processor
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Security] Extract password hashing from security-core - with proper wording
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | Fixes#39698
| License | MIT
| Doc PR | todo
This PR renames password "encoders" to password _hashers_ (naming widely used, see e.g. django or laravel).
This also takes the opportunity to extract the logic related to password hashing from security-core, moving it to a new password-hasher component.
Nowadays, many modern web apps and APIs don't deal with passwords at all, that's why splitting makes sense as a step towards making security-core not tied to the password concept.
For upgrading, applications will have to use `passwords_hashers` instead of `encoders` in their security configuration, and type-hint against `PasswordHasherInterface` (and related) instead of `PasswordEncoderInterface`.
The proposed API is not much different from the encoder one regarding behavior and signatures, and it is slightly more close to the PHP built-in password hashing API:
```php
namespace Symfony\Component\PasswordHasher;
interface PasswordHasherInterface
{
public function hash(string $plainPassword): string;
public function verify(string $hashedPassword, string $plainPassword): bool;
public function needsRehash(string $hashedPassword): bool;
}
```
Commits
-------
c5c981c559 [Security] Extract password hashing from security-core - using the right naming
This PR was merged into the 4.4 branch.
Discussion
----------
[Finder] mark the LazyIterator class as internal
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | https://github.com/symfony/symfony/pull/40040#discussion_r575127254
| License | MIT
| Doc PR |
Commits
-------
4a2c996b95 mark the LazyIterator class as internal
This PR was squashed before being merged into the 5.2 branch.
Discussion
----------
[HttpFoundation] Fix typo in exception message
| Q | A
| ------------- | ---
| Branch? | 5.2 for bug fixes
| Bug fix? | yes
| New feature? | no <!-- please update src/**/CHANGELOG.md files -->
| Deprecations? | no <!-- please update UPGRADE-*.md and src/**/CHANGELOG.md files -->
| Tickets | - <!-- prefix each issue number with "Fix #", no need to create an issue if none exist, explain below instead -->
| License | MIT
| Doc PR | - <!-- required for new features -->
<!--
Replace this notice by a short README for your feature/bugfix. This will help people
understand your PR and can be used as a start for the documentation.
Additionally (see https://symfony.com/releases):
- Always add tests and ensure they pass.
- Never break backward compatibility (see https://symfony.com/bc).
- Bug fixes must be submitted against the lowest maintained branch where they apply
(lowest branches are regularly merged to upper ones so they get the fixes too.)
- Features and deprecations must be submitted against branch 5.x.
- Changelog entry should follow https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry
-->
Commits
-------
2248af5857 [HttpFoundation] Fix typo in exception message
* 5.2:
add missing return type declaration
Modernize func_get_args() calls to variadic parameters
Use a lazyintertor to close files descriptors when no longer used
* 4.4:
add missing return type declaration
Modernize func_get_args() calls to variadic parameters
Use a lazyintertor to close files descriptors when no longer used
This PR was merged into the 4.4 branch.
Discussion
----------
[Finder] add missing return type declaration
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets |
| License | MIT
| Doc PR |
should make builds green again
Commits
-------
cfce9cbd59 add missing return type declaration
This PR was merged into the 4.4 branch.
Discussion
----------
[Finder] Use a lazyIterator to close files descriptors when no longer used
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | fix#35508
| License | MIT
| Doc PR | -
The `RecursiveDirectoryIterator` class open the file on `__construct`.
Because we Inject an instance of `RecursiveDirectoryIterator` inside the \AppendIterator` class, php opens a lot of file even before iterating on it.
This PR adds a new `LazyIterator` class that instantiate the decorated class only when something starts iterating on it.
When the iteration is over, it unset the variable to close let the decorated class clean things (ie. close the files)
Commits
-------
7117e1a798 Use a lazyintertor to close files descriptors when no longer used
This PR was merged into the 4.4 branch.
Discussion
----------
Modernize func_get_args() calls to variadic parameters
| Q | A
| ------------- | ---
| Branch? | 4.4
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | N/A
| License | MIT
| Doc PR | N/A
While reviewing #40143, I stumbled across the `Filesystem::box()` method and I felt like we could make the code look a little less PHP5-ish.
Commits
-------
5b536131f7 Modernize func_get_args() calls to variadic parameters
This PR was merged into the 5.3-dev branch.
Discussion
----------
[HttpFoundation] Fix consistency in sessions not found exceptions
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | yes
| New feature? | no
| Deprecations? | no
| Tickets | Fix#40112
| License | MIT
| Doc PR | -
Make `Request::getSession` thrown a `SessionNotFoundException` and make `SessionNotFoundException` extends `\BadMethodCallException` for backward compatibility and
Commits
-------
7fcb76d367 Fix consistency in sessions not found exceptions
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Filesystem] Remove dirs atomically if possible
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | no
| Deprecations? | no
| Tickets | Fix#27578
| License | MIT
| Doc PR | no need to
Commits
-------
17bccca9c6 [Filesystem] remove dirs atomically if possible
This PR was merged into the 5.3-dev branch.
Discussion
----------
[Uid] Add UidFactory to create Ulid and Uuid from timestamps and randomness/nodes
| Q | A
| ------------- | ---
| Branch? | 5.x
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Tickets | -
| License | MIT
| Doc PR | -
Ref https://github.com/symfony/symfony/pull/36097
When you migrate an existing resource identifier to an uid, you might want to choose the timestamp so that it is coherent with the creation date of the existing resource. (eg: I have a row in a table with id=1, created_at=2018-12-11 19:00:00, I would like to use that timestamp to create the resource Ulid).
I guess it can also be useful to choose the randomness of the Ulid or the node of the Uuid.
From what I understood, v3 and v5 don't need those features, this is why there are not in the factory.
See https://github.com/symfony/symfony/pull/39507#pullrequestreview-584904889 for more details.
Commits
-------
88a99ddbdf [Uid] Add UuidFactory to create Ulid and Uuid from timestamps, namespaces and nodes