Skip to content

Merge release 4.1.0 into 5.0.x#435

Merged
greg0ire merged 26 commits into5.0.xfrom
4.1.x-merge-up-into-5.0.x_TA2qrOVB
Aug 22, 2025
Merged

Merge release 4.1.0 into 5.0.x#435
greg0ire merged 26 commits into5.0.xfrom
4.1.x-merge-up-into-5.0.x_TA2qrOVB

Conversation

@github-actions
Copy link
Contributor

@github-actions github-actions bot commented Aug 22, 2025

Release Notes for 4.1.0

Feature release (minor)

4.1.0

  • Total issues resolved: 0
  • Total pull requests resolved: 2
  • Total contributors: 2

Enhancement

Improvement

jawira and others added 26 commits July 13, 2025 22:01
fix: Add parent constructor call in EnumReflectionProperty
Add phpunit ci job for PHP 8.4
Remove Reflection*::setAccessible() calls
`i` flag is removed - it makes search case-insensitive. There's no point in making search case-insensitive for an extension regex (`.php`), since the extension is always lowercase.

`GET_MATCH` is changed into `MATCH` - using `MATCH` is more obvious, since there are **NO implicit modifications** of the result as in the case of `GET_MATCH`, which returns only the "matched" part of the path string instead of the actual `SplFileInfo` item.

`^.+` part of regex is removed - it's no longer necessary, since it had only been required for `GET_MATCH` to return the full path. Now, with `MATCH`, regex only affects results filtering and does not affect the results themselves.
This is necessary, since in #429 we would like to use a different way of "finding files" - using a client-defined iterable. Thus, the only way to do the switch is to split the loops.
…e path names

Before it was only possible to pass an array of paths where to look for. Now, it's possible to explicitly provide fine-grained iterable of only necessary files to the Driver. It's anticipated to use Symfony Finder in the Bundles using this library. This gives much flexibility for client code to configure which files should be included and which should not.
…iterable-files

Feature: iterable source file path names for `ColocatedMappingDriver`
…urce file path names"

This reverts commit a6cb5a1.
A better implementation is incoming, with fixes. This reverts makes the
branch releaseable again, and will make the incoming pull request easier
to review.
Revert "Feature: allow `ColocatedMappingDriver` to accept iterable source file path names
 When checking $includedFiles for an included file,
 the previous `in_array()` approach, executed in a loop,
 is very expensive. Basically, it results in performance
 of O(N * M), where N - number of declared classes,
 M - number of included classes. The current approach
 is O(N), since `isset()` check has constant `O(1)` time.
This change makes it easy for the depending libraries to use iterable of
`SplFileInfo`, adapted to the format of `ColocatedMappingDriver` file paths.
For example, one could provide an instance of Symfony Finder, adapted with
`FilePathNameIterator` without having to reinvent it from scratch.
This change makes it easy for the client code to migrate toward the
newer version. The migration would be as easy as passing
`new FilePathIterator(new DirectoryFilesIterator($paths))` into
the constructor instead of the array of `$paths`.
This commit adds support for `ColocatedMappingDriver` to accept
`iterable` of file paths. Before it was only possible to accept
an array of directory paths. Now, one could provide fine-grained
iterator of only necessary files to the Driver. Bundles should
use Symfony Finder to implement it, since it gives much flexibility
to the client code to configure which files should be included
and which not.

Backward compatibility is achieved with the following approach:
If it's an array, then it should be OK to take a look at `$paths[0]`
and determine if it is a file or a directory. If it's not an array,
we can assume that it's `$filePaths` iterable that's given.
Co-authored-by: Yevhen Sidelnyk <41589422+rela589n@users.noreply.github.com>
Introduce `ClassLocator` to find class names for attribute drivers
@greg0ire greg0ire merged commit 1d58b06 into 5.0.x Aug 22, 2025
10 checks passed
@greg0ire greg0ire deleted the 4.1.x-merge-up-into-5.0.x_TA2qrOVB branch August 22, 2025 06:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants