1: | <?php declare(strict_types = 1); |
2: | |
3: | namespace PHPStan\Type; |
4: | |
5: | use PHPStan\Php\PhpVersion; |
6: | use PHPStan\PhpDocParser\Ast\Type\TypeNode; |
7: | use PHPStan\Reflection\Callables\CallableParametersAcceptor; |
8: | use PHPStan\Reflection\ClassConstantReflection; |
9: | use PHPStan\Reflection\ClassMemberAccessAnswerer; |
10: | use PHPStan\Reflection\ClassReflection; |
11: | use PHPStan\Reflection\ExtendedMethodReflection; |
12: | use PHPStan\Reflection\ExtendedPropertyReflection; |
13: | use PHPStan\Reflection\Type\UnresolvedMethodPrototypeReflection; |
14: | use PHPStan\Reflection\Type\UnresolvedPropertyPrototypeReflection; |
15: | use PHPStan\TrinaryLogic; |
16: | use PHPStan\Type\Constant\ConstantArrayType; |
17: | use PHPStan\Type\Constant\ConstantStringType; |
18: | use PHPStan\Type\Enum\EnumCaseObjectType; |
19: | use PHPStan\Type\Generic\TemplateTypeMap; |
20: | use PHPStan\Type\Generic\TemplateTypeReference; |
21: | use PHPStan\Type\Generic\TemplateTypeVariance; |
22: | |
23: | |
24: | |
25: | |
26: | |
27: | interface Type |
28: | { |
29: | |
30: | |
31: | |
32: | |
33: | public function getReferencedClasses(): array; |
34: | |
35: | |
36: | public function getObjectClassNames(): array; |
37: | |
38: | |
39: | |
40: | |
41: | public function getObjectClassReflections(): array; |
42: | |
43: | |
44: | |
45: | |
46: | public function getClassStringObjectType(): Type; |
47: | |
48: | |
49: | |
50: | |
51: | |
52: | public function getObjectTypeOrClassStringObjectType(): Type; |
53: | |
54: | public function isObject(): TrinaryLogic; |
55: | |
56: | public function isEnum(): TrinaryLogic; |
57: | |
58: | |
59: | public function getArrays(): array; |
60: | |
61: | |
62: | public function getConstantArrays(): array; |
63: | |
64: | |
65: | public function getConstantStrings(): array; |
66: | |
67: | public function accepts(Type $type, bool $strictTypes): AcceptsResult; |
68: | |
69: | public function isSuperTypeOf(Type $type): IsSuperTypeOfResult; |
70: | |
71: | public function equals(Type $type): bool; |
72: | |
73: | public function describe(VerbosityLevel $level): string; |
74: | |
75: | public function canAccessProperties(): TrinaryLogic; |
76: | |
77: | public function hasProperty(string $propertyName): TrinaryLogic; |
78: | |
79: | public function getProperty(string $propertyName, ClassMemberAccessAnswerer $scope): ExtendedPropertyReflection; |
80: | |
81: | public function getUnresolvedPropertyPrototype(string $propertyName, ClassMemberAccessAnswerer $scope): UnresolvedPropertyPrototypeReflection; |
82: | |
83: | public function canCallMethods(): TrinaryLogic; |
84: | |
85: | public function hasMethod(string $methodName): TrinaryLogic; |
86: | |
87: | public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope): ExtendedMethodReflection; |
88: | |
89: | public function getUnresolvedMethodPrototype(string $methodName, ClassMemberAccessAnswerer $scope): UnresolvedMethodPrototypeReflection; |
90: | |
91: | public function canAccessConstants(): TrinaryLogic; |
92: | |
93: | public function hasConstant(string $constantName): TrinaryLogic; |
94: | |
95: | public function getConstant(string $constantName): ClassConstantReflection; |
96: | |
97: | public function isIterable(): TrinaryLogic; |
98: | |
99: | public function isIterableAtLeastOnce(): TrinaryLogic; |
100: | |
101: | public function getArraySize(): Type; |
102: | |
103: | public function getIterableKeyType(): Type; |
104: | |
105: | public function getFirstIterableKeyType(): Type; |
106: | |
107: | public function getLastIterableKeyType(): Type; |
108: | |
109: | public function getIterableValueType(): Type; |
110: | |
111: | public function getFirstIterableValueType(): Type; |
112: | |
113: | public function getLastIterableValueType(): Type; |
114: | |
115: | public function isArray(): TrinaryLogic; |
116: | |
117: | public function isConstantArray(): TrinaryLogic; |
118: | |
119: | public function isOversizedArray(): TrinaryLogic; |
120: | |
121: | public function isList(): TrinaryLogic; |
122: | |
123: | public function isOffsetAccessible(): TrinaryLogic; |
124: | |
125: | public function isOffsetAccessLegal(): TrinaryLogic; |
126: | |
127: | public function hasOffsetValueType(Type $offsetType): TrinaryLogic; |
128: | |
129: | public function getOffsetValueType(Type $offsetType): Type; |
130: | |
131: | public function setOffsetValueType(?Type $offsetType, Type $valueType, bool $unionValues = true): Type; |
132: | |
133: | public function setExistingOffsetValueType(Type $offsetType, Type $valueType): Type; |
134: | |
135: | public function unsetOffset(Type $offsetType): Type; |
136: | |
137: | public function getKeysArray(): Type; |
138: | |
139: | public function getValuesArray(): Type; |
140: | |
141: | public function chunkArray(Type $lengthType, TrinaryLogic $preserveKeys): Type; |
142: | |
143: | public function fillKeysArray(Type $valueType): Type; |
144: | |
145: | public function flipArray(): Type; |
146: | |
147: | public function intersectKeyArray(Type $otherArraysType): Type; |
148: | |
149: | public function popArray(): Type; |
150: | |
151: | public function reverseArray(TrinaryLogic $preserveKeys): Type; |
152: | |
153: | public function searchArray(Type $needleType): Type; |
154: | |
155: | public function shiftArray(): Type; |
156: | |
157: | public function shuffleArray(): Type; |
158: | |
159: | public function sliceArray(Type $offsetType, Type $lengthType, TrinaryLogic $preserveKeys): Type; |
160: | |
161: | |
162: | |
163: | |
164: | public function getEnumCases(): array; |
165: | |
166: | |
167: | |
168: | |
169: | |
170: | |
171: | |
172: | |
173: | |
174: | |
175: | |
176: | |
177: | |
178: | |
179: | |
180: | public function getFiniteTypes(): array; |
181: | |
182: | public function exponentiate(Type $exponent): Type; |
183: | |
184: | public function isCallable(): TrinaryLogic; |
185: | |
186: | |
187: | |
188: | |
189: | public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array; |
190: | |
191: | public function isCloneable(): TrinaryLogic; |
192: | |
193: | public function toBoolean(): BooleanType; |
194: | |
195: | public function toNumber(): Type; |
196: | |
197: | public function toInteger(): Type; |
198: | |
199: | public function toFloat(): Type; |
200: | |
201: | public function toString(): Type; |
202: | |
203: | public function toArray(): Type; |
204: | |
205: | public function toArrayKey(): Type; |
206: | |
207: | public function isSmallerThan(Type $otherType, PhpVersion $phpVersion): TrinaryLogic; |
208: | |
209: | public function isSmallerThanOrEqual(Type $otherType, PhpVersion $phpVersion): TrinaryLogic; |
210: | |
211: | |
212: | |
213: | |
214: | public function isConstantValue(): TrinaryLogic; |
215: | |
216: | |
217: | |
218: | |
219: | public function isConstantScalarValue(): TrinaryLogic; |
220: | |
221: | |
222: | |
223: | |
224: | public function getConstantScalarTypes(): array; |
225: | |
226: | |
227: | |
228: | |
229: | public function getConstantScalarValues(): array; |
230: | |
231: | public function isNull(): TrinaryLogic; |
232: | |
233: | public function isTrue(): TrinaryLogic; |
234: | |
235: | public function isFalse(): TrinaryLogic; |
236: | |
237: | public function isBoolean(): TrinaryLogic; |
238: | |
239: | public function isFloat(): TrinaryLogic; |
240: | |
241: | public function isInteger(): TrinaryLogic; |
242: | |
243: | public function isString(): TrinaryLogic; |
244: | |
245: | public function isNumericString(): TrinaryLogic; |
246: | |
247: | public function isNonEmptyString(): TrinaryLogic; |
248: | |
249: | public function isNonFalsyString(): TrinaryLogic; |
250: | |
251: | public function isLiteralString(): TrinaryLogic; |
252: | |
253: | public function isLowercaseString(): TrinaryLogic; |
254: | |
255: | public function isUppercaseString(): TrinaryLogic; |
256: | |
257: | public function isClassString(): TrinaryLogic; |
258: | |
259: | public function isVoid(): TrinaryLogic; |
260: | |
261: | public function isScalar(): TrinaryLogic; |
262: | |
263: | public function looseCompare(Type $type, PhpVersion $phpVersion): BooleanType; |
264: | |
265: | public function getSmallerType(PhpVersion $phpVersion): Type; |
266: | |
267: | public function getSmallerOrEqualType(PhpVersion $phpVersion): Type; |
268: | |
269: | public function getGreaterType(PhpVersion $phpVersion): Type; |
270: | |
271: | public function getGreaterOrEqualType(PhpVersion $phpVersion): Type; |
272: | |
273: | |
274: | |
275: | |
276: | |
277: | |
278: | |
279: | |
280: | |
281: | |
282: | |
283: | |
284: | |
285: | |
286: | |
287: | |
288: | |
289: | public function getTemplateType(string $ancestorClassName, string $templateTypeName): Type; |
290: | |
291: | |
292: | |
293: | |
294: | |
295: | |
296: | |
297: | public function inferTemplateTypes(Type $receivedType): TemplateTypeMap; |
298: | |
299: | |
300: | |
301: | |
302: | |
303: | |
304: | |
305: | |
306: | |
307: | |
308: | |
309: | |
310: | |
311: | |
312: | |
313: | |
314: | |
315: | public function getReferencedTemplateTypes(TemplateTypeVariance $positionVariance): array; |
316: | |
317: | public function toAbsoluteNumber(): Type; |
318: | |
319: | |
320: | |
321: | |
322: | |
323: | |
324: | |
325: | |
326: | |
327: | public function traverse(callable $cb): Type; |
328: | |
329: | |
330: | |
331: | |
332: | |
333: | |
334: | public function traverseSimultaneously(Type $right, callable $cb): Type; |
335: | |
336: | public function toPhpDocNode(): TypeNode; |
337: | |
338: | |
339: | |
340: | |
341: | |
342: | |
343: | public function tryRemove(Type $typeToRemove): ?Type; |
344: | |
345: | public function generalize(GeneralizePrecision $precision): Type; |
346: | |
347: | } |
348: | |