File tree 4 files changed +17
-4
lines changed 4 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -273,12 +273,15 @@ public function findQualifiedNameFromPath(string $path)
273
273
}
274
274
275
275
if (mb_strpos ($ path , $ namespace ['path ' ]) === 0 ) {
276
- $ className = '\\' . $ namespace ['prefix ' ] . '\\' .
277
- ltrim (str_replace (
276
+ $ className = $ namespace ['prefix ' ] . '\\' .
277
+ ltrim (
278
+ str_replace (
278
279
'/ ' ,
279
280
'\\' ,
280
281
mb_substr ($ path , mb_strlen ($ namespace ['path ' ]))
281
- ), '\\' );
282
+ ),
283
+ '\\'
284
+ );
282
285
283
286
// Remove the file extension (.php)
284
287
$ className = mb_substr ($ className , 0 , -4 );
Original file line number Diff line number Diff line change @@ -278,7 +278,7 @@ public function testListFilesWithoutPath(): void
278
278
public function testFindQNameFromPathSimple (): void
279
279
{
280
280
$ ClassName = $ this ->locator ->findQualifiedNameFromPath (SYSTEMPATH . 'HTTP/Header.php ' );
281
- $ expected = '\\' . Header::class;
281
+ $ expected = Header::class;
282
282
283
283
$ this ->assertSame ($ expected , $ ClassName );
284
284
}
Original file line number Diff line number Diff line change 33
33
- **Logger: ** The :php:func: `log_message() ` function and the logger methods in
34
34
``CodeIgniter\Log\Logger `` now do not return ``bool `` values. The return types
35
35
have been fixed to ``void `` to follow the PSR-3 interface.
36
+ - **Autoloader: ** The prefix ``\ `` in the fully qualified classname returned by
37
+ ``FileLocator::findQualifiedNameFromPath() `` has been removed.
36
38
37
39
Interface Changes
38
40
=================
Original file line number Diff line number Diff line change @@ -72,6 +72,14 @@ reversed.
72
72
Previous: route1 → route2 → filter1 → filter2
73
73
Now: route2 → route1 → filter2 → filter1
74
74
75
+ FileLocator::findQualifiedNameFromPath()
76
+ ========================================
77
+
78
+ In previous versions, ``FileLocator::findQualifiedNameFromPath() `` returns Fully
79
+ Qualified Classnames with a leading ``\ ``. Now the leading ``\ `` has been removed.
80
+
81
+ If you have code that expects a leading ``\ ``, fix it.
82
+
75
83
Removed Deprecated Items
76
84
========================
77
85
You can’t perform that action at this time.
0 commit comments