Merged
Conversation
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
Merge release 4.0.1 into 4.1.x
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Release Notes for 4.1.0
Feature release (minor)
4.1.0
Enhancement
ClassLocatorto find class names for attribute drivers thanks to @GromNaN and @rela589nImprovement