You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* unit test for union type with null
* Nullable union test
* Nullable union bug fix
* Fix test for old php version
* Targeting PHP minimum version 8.0
* Targeting PHP minimum version 8.0
* Targeting PHP minimum version 8.0
* Run cs fix
* Expanding php 8.0 features usage
* Expanding php 8.0 features usage
* Expanding php 8.0 features usage
* Datetime class name bug fix
* Failing tests fixed
* Bad params with stdClass test removed. It's already throws an error in php 8.0
* Improving code with php 8.0 features
* Improving code with php 8.0 features
* Improving code with php 8.0 features
* Improving code with php 8.0 features
* Improving code with php 8.0 features
* Improving code with php 8.0 features
* Expanding php 8.0 features
* drop test for php <=7.4
* remove some php 7.4 polyfill
* Version 6.1 docs. Drop all examples for php <8.0.
* Failed tests fix
* Improving code with php 8 features
* Improving code with php 8 features
* Improving code with php 8 features
* Improving code with php 8 features
* Improving code with php 8 features
* Improving code with php 8 features
* Improving code with php 8 features
* Remove php 7.4 from CI tests
* Improving code with php 8 features
* Improving code with php 8 features
* Replacing array_merge with built-in spread syntax for lists due to big performance difference.
* Removed types: Container does not match CI server psr extension classes
* Failing CI test fix
* Failing CI test fix
* Fix types for fields descriptors. That caused misunderstanding in methods purpose...
* Failing CI test fix.
* Failing CI test fix.
* Failing CI test fix. Just remove throws tag
* Failing CI test fix. Just remove throws tag
Co-authored-by: madness <ss@gmail.com>
Copy file name to clipboardExpand all lines: src/AnnotationReader.php
+61-72Lines changed: 61 additions & 72 deletions
Original file line number
Diff line number
Diff line change
@@ -40,57 +40,39 @@
40
40
usefunctionin_array;
41
41
usefunctionis_a;
42
42
usefunctionreset;
43
-
usefunctionstrpos;
43
+
usefunctionstr_contains;
44
+
usefunctionstr_starts_with;
44
45
usefunctionstrrpos;
45
46
usefunctionsubstr;
46
47
47
48
useconstPHP_MAJOR_VERSION;
48
49
49
50
class AnnotationReader
50
51
{
51
-
/** @var Reader */
52
-
private$reader;
53
-
54
52
// In this mode, no exceptions will be thrown for incorrect annotations (unless the name of the annotation we are looking for is part of the docblock)
55
53
publicconstLAX_MODE = 'LAX_MODE';
56
54
// In this mode, exceptions will be thrown for any incorrect annotations.
57
55
publicconstSTRICT_MODE = 'STRICT_MODE';
58
56
59
-
/**
60
-
* Classes in those namespaces MUST have valid annotations (otherwise, an error is thrown).
61
-
*
62
-
* @var string[]
63
-
*/
64
-
private$strictNamespaces;
65
-
66
-
/**
67
-
* If true, no exceptions will be thrown for incorrect annotations in code coming from the "vendor/" directory.
68
-
*
69
-
* @var string
70
-
*/
71
-
private$mode;
72
57
73
58
/** @var array<string, (object|null)> */
74
-
private$methodAnnotationCache = [];
59
+
privatearray$methodAnnotationCache = [];
75
60
76
61
/** @var array<string, array<object>> */
77
-
private$methodAnnotationsCache = [];
62
+
privatearray$methodAnnotationsCache = [];
78
63
79
64
/** @var array<string, array<object>> */
80
-
private$propertyAnnotationsCache = [];
65
+
privatearray$propertyAnnotationsCache = [];
81
66
82
67
/**
83
-
* @param string $mode One of self::LAX_MODE or self::STRICT_MODE
84
-
* @param string[] $strictNamespaces
68
+
* @param string $mode One of self::LAX_MODE or self::STRICT_MODE. If true, no exceptions will be thrown for incorrect annotations in code coming from the "vendor/" directory.
69
+
* @param string[] $strictNamespaces Classes in those namespaces MUST have valid annotations (otherwise, an error is thrown).
0 commit comments