@@ -63,11 +63,11 @@ public static function reset()
63
63
/**
64
64
* Registers file.
65
65
*
66
- * @param string $file
67
- *
68
- * @return void
66
+ * @deprecated this method is deprecated and will be removed in doctrine/annotations 2.0
67
+ * autoloading should be deferred to the globally registered autoloader by then. For now,
68
+ * use @example AnnotationRegistry::registerLoader('class_exists')
69
69
*/
70
- public static function registerFile ($ file )
70
+ public static function registerFile (string $ file ) : void
71
71
{
72
72
require_once $ file ;
73
73
}
@@ -80,9 +80,11 @@ public static function registerFile($file)
80
80
* @param string $namespace
81
81
* @param string|array|null $dirs
82
82
*
83
- * @return void
83
+ * @deprecated this method is deprecated and will be removed in doctrine/annotations 2.0
84
+ * autoloading should be deferred to the globally registered autoloader by then. For now,
85
+ * use @example AnnotationRegistry::registerLoader('class_exists')
84
86
*/
85
- public static function registerAutoloadNamespace ($ namespace , $ dirs = null )
87
+ public static function registerAutoloadNamespace (string $ namespace , $ dirs = null ) : void
86
88
{
87
89
self ::$ autoloadNamespaces [$ namespace ] = $ dirs ;
88
90
}
@@ -92,11 +94,13 @@ public static function registerAutoloadNamespace($namespace, $dirs = null)
92
94
*
93
95
* Loading of this namespaces will be done with a PSR-0 namespace loading algorithm.
94
96
*
95
- * @param array $namespaces
97
+ * @param string[][]|string[]|null[] $namespaces indexed by namespace name
96
98
*
97
- * @return void
99
+ * @deprecated this method is deprecated and will be removed in doctrine/annotations 2.0
100
+ * autoloading should be deferred to the globally registered autoloader by then. For now,
101
+ * use @example AnnotationRegistry::registerLoader('class_exists')
98
102
*/
99
- public static function registerAutoloadNamespaces (array $ namespaces )
103
+ public static function registerAutoloadNamespaces (array $ namespaces ) : void
100
104
{
101
105
self ::$ autoloadNamespaces = \array_merge (self ::$ autoloadNamespaces , $ namespaces );
102
106
}
@@ -107,17 +111,11 @@ public static function registerAutoloadNamespaces(array $namespaces)
107
111
* NOTE: These class loaders HAVE to be silent when a class was not found!
108
112
* IMPORTANT: Loaders have to return true if they loaded a class that could contain the searched annotation class.
109
113
*
110
- * @param callable $callable
111
- *
112
- * @return void
113
- *
114
- * @throws \InvalidArgumentException
115
- *
116
114
* @deprecated this method is deprecated and will be removed in doctrine/annotations 2.0
117
115
* autoloading should be deferred to the globally registered autoloader by then. For now,
118
116
* use @example AnnotationRegistry::registerLoader('class_exists')
119
117
*/
120
- public static function registerLoader (callable $ callable )
118
+ public static function registerLoader (callable $ callable ) : void
121
119
{
122
120
// Reset our static cache now that we have a new loader to work with
123
121
self ::$ failedToAutoload = [];
@@ -140,6 +138,7 @@ public static function loadAnnotationClass(string $class) : bool
140
138
foreach (self ::$ autoloadNamespaces AS $ namespace => $ dirs ) {
141
139
if (\strpos ($ class , $ namespace ) === 0 ) {
142
140
$ file = \str_replace ('\\' , \DIRECTORY_SEPARATOR , $ class ) . '.php ' ;
141
+
143
142
if ($ dirs === null ) {
144
143
if ($ path = stream_resolve_include_path ($ file )) {
145
144
require $ path ;
0 commit comments