|
| 1 | +(this file can be removed before merging) |
| 2 | + |
1 | 3 | SourceMapper Implementation Notes |
2 | 4 | ================================= |
3 | 5 |
|
4 | | -Currently the `<directory>` element in `<include>` and `<exclude>` has the |
5 | | -attributes `prefix` and `suffix` and we also have `<file>` which specifies a |
6 | | -single file. |
7 | | - |
8 | | -Our primary goal is to ensure that the source mapper needn't iterate over all |
| 6 | +The primary goal is to ensure that the source mapper needn't iterate over all |
9 | 7 | included files recursively whenever the source map is required (for example |
10 | 8 | when a deprecation is encountered PHPUnit needs to know if the deprecation was |
11 | 9 | issued from source code within the project's responsiblity - i.e. source that |
12 | 10 | is mapped). We can determine if a file is within the included source by |
13 | 11 | converting the glob-patterns in the `<directory>` element to regexes. |
14 | 12 |
|
15 | | -This is more complicated than it could be as the current matching logic |
16 | | -depends on PHP's `glob` function - the implementation of which is not |
17 | | -consistent across platforms and which has a number of rarely-used operators |
18 | | -which while not common, would present a B/C break if they were removed. |
| 13 | +Currently the `<directory>` element in `<include>` and `<exclude>` has the |
| 14 | +attributes `prefix` and `suffix` and we also have `<file>` which specifies a |
| 15 | +single file. |
| 16 | + |
| 17 | +This is more complicated than it could be: |
| 18 | + |
| 19 | +- Current matching/traversal logic depends on PHP's `glob` function - the implementation |
| 20 | + of which is not consistent across platforms and which has a number of |
| 21 | + rarely-used operators which while not common, would present a B/C break if |
| 22 | + they were removed. |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
19 | 27 |
|
20 | 28 | How it works currently |
21 | 29 | ---------------------- |
@@ -44,6 +52,8 @@ The Factory: |
44 | 52 | - create a new PHPUnit `Iterator` passing a recursive iterator iterator |
45 | 53 | directory iterator... (the iterator that iterates over the directories) that |
46 | 54 | **follows symlinks and skips dots**. |
| 55 | +- the iterator also Excludes the excluded `<directory>` elements **but does |
| 56 | + not take into account the prefixes or suffixes**. |
47 | 57 |
|
48 | 58 | The Iterator: |
49 | 59 |
|
|
0 commit comments