| 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: | |
| 28: | |
| 29: | |
| 30: | |
| 31: | |
| 32: | |
| 33: | |
| 34: | |
| 35: | |
| 36: | |
| 37: | |
| 38: | |
| 39: | |
| 40: | |
| 41: | |
| 42: | |
| 43: | |
| 44: | |
| 45: | |
| 46: | |
| 47: | interface Type |
| 48: | { |
| 49: | |
| 50: | |
| 51: | |
| 52: | |
| 53: | |
| 54: | |
| 55: | |
| 56: | |
| 57: | |
| 58: | public function getReferencedClasses(): array; |
| 59: | |
| 60: | |
| 61: | |
| 62: | |
| 63: | |
| 64: | |
| 65: | |
| 66: | public function getObjectClassNames(): array; |
| 67: | |
| 68: | |
| 69: | public function getObjectClassReflections(): array; |
| 70: | |
| 71: | |
| 72: | |
| 73: | |
| 74: | |
| 75: | public function getClassStringObjectType(): Type; |
| 76: | |
| 77: | |
| 78: | |
| 79: | |
| 80: | |
| 81: | public function getObjectTypeOrClassStringObjectType(): Type; |
| 82: | |
| 83: | public function isObject(): TrinaryLogic; |
| 84: | |
| 85: | public function isEnum(): TrinaryLogic; |
| 86: | |
| 87: | |
| 88: | public function getArrays(): array; |
| 89: | |
| 90: | |
| 91: | |
| 92: | |
| 93: | |
| 94: | |
| 95: | public function getConstantArrays(): array; |
| 96: | |
| 97: | |
| 98: | public function getConstantStrings(): array; |
| 99: | |
| 100: | |
| 101: | |
| 102: | |
| 103: | |
| 104: | |
| 105: | public function accepts(Type $type, bool $strictTypes): AcceptsResult; |
| 106: | |
| 107: | |
| 108: | |
| 109: | |
| 110: | |
| 111: | |
| 112: | |
| 113: | public function isSuperTypeOf(Type $type): IsSuperTypeOfResult; |
| 114: | |
| 115: | public function equals(Type $type): bool; |
| 116: | |
| 117: | public function describe(VerbosityLevel $level): string; |
| 118: | |
| 119: | public function canAccessProperties(): TrinaryLogic; |
| 120: | |
| 121: | |
| 122: | public function hasProperty(string $propertyName): TrinaryLogic; |
| 123: | |
| 124: | |
| 125: | public function getProperty(string $propertyName, ClassMemberAccessAnswerer $scope): ExtendedPropertyReflection; |
| 126: | |
| 127: | |
| 128: | public function getUnresolvedPropertyPrototype(string $propertyName, ClassMemberAccessAnswerer $scope): UnresolvedPropertyPrototypeReflection; |
| 129: | |
| 130: | public function hasInstanceProperty(string $propertyName): TrinaryLogic; |
| 131: | |
| 132: | public function getInstanceProperty(string $propertyName, ClassMemberAccessAnswerer $scope): ExtendedPropertyReflection; |
| 133: | |
| 134: | |
| 135: | |
| 136: | |
| 137: | |
| 138: | public function getUnresolvedInstancePropertyPrototype(string $propertyName, ClassMemberAccessAnswerer $scope): UnresolvedPropertyPrototypeReflection; |
| 139: | |
| 140: | public function hasStaticProperty(string $propertyName): TrinaryLogic; |
| 141: | |
| 142: | public function getStaticProperty(string $propertyName, ClassMemberAccessAnswerer $scope): ExtendedPropertyReflection; |
| 143: | |
| 144: | public function getUnresolvedStaticPropertyPrototype(string $propertyName, ClassMemberAccessAnswerer $scope): UnresolvedPropertyPrototypeReflection; |
| 145: | |
| 146: | public function canCallMethods(): TrinaryLogic; |
| 147: | |
| 148: | public function hasMethod(string $methodName): TrinaryLogic; |
| 149: | |
| 150: | public function getMethod(string $methodName, ClassMemberAccessAnswerer $scope): ExtendedMethodReflection; |
| 151: | |
| 152: | |
| 153: | |
| 154: | |
| 155: | |
| 156: | public function getUnresolvedMethodPrototype(string $methodName, ClassMemberAccessAnswerer $scope): UnresolvedMethodPrototypeReflection; |
| 157: | |
| 158: | public function canAccessConstants(): TrinaryLogic; |
| 159: | |
| 160: | public function hasConstant(string $constantName): TrinaryLogic; |
| 161: | |
| 162: | public function getConstant(string $constantName): ClassConstantReflection; |
| 163: | |
| 164: | public function isIterable(): TrinaryLogic; |
| 165: | |
| 166: | public function isIterableAtLeastOnce(): TrinaryLogic; |
| 167: | |
| 168: | |
| 169: | |
| 170: | |
| 171: | public function getArraySize(): Type; |
| 172: | |
| 173: | |
| 174: | |
| 175: | |
| 176: | public function getIterableKeyType(): Type; |
| 177: | |
| 178: | |
| 179: | public function getFirstIterableKeyType(): Type; |
| 180: | |
| 181: | |
| 182: | public function getLastIterableKeyType(): Type; |
| 183: | |
| 184: | public function getIterableValueType(): Type; |
| 185: | |
| 186: | |
| 187: | public function getFirstIterableValueType(): Type; |
| 188: | |
| 189: | |
| 190: | public function getLastIterableValueType(): Type; |
| 191: | |
| 192: | public function isArray(): TrinaryLogic; |
| 193: | |
| 194: | public function isConstantArray(): TrinaryLogic; |
| 195: | |
| 196: | |
| 197: | |
| 198: | |
| 199: | |
| 200: | public function isOversizedArray(): TrinaryLogic; |
| 201: | |
| 202: | |
| 203: | |
| 204: | |
| 205: | public function isList(): TrinaryLogic; |
| 206: | |
| 207: | public function isOffsetAccessible(): TrinaryLogic; |
| 208: | |
| 209: | |
| 210: | |
| 211: | |
| 212: | |
| 213: | public function isOffsetAccessLegal(): TrinaryLogic; |
| 214: | |
| 215: | public function hasOffsetValueType(Type $offsetType): TrinaryLogic; |
| 216: | |
| 217: | public function getOffsetValueType(Type $offsetType): Type; |
| 218: | |
| 219: | |
| 220: | |
| 221: | |
| 222: | |
| 223: | |
| 224: | public function setOffsetValueType(?Type $offsetType, Type $valueType, bool $unionValues = true): Type; |
| 225: | |
| 226: | |
| 227: | |
| 228: | |
| 229: | |
| 230: | public function setExistingOffsetValueType(Type $offsetType, Type $valueType): Type; |
| 231: | |
| 232: | public function unsetOffset(Type $offsetType): Type; |
| 233: | |
| 234: | |
| 235: | public function getKeysArrayFiltered(Type $filterValueType, TrinaryLogic $strict): Type; |
| 236: | |
| 237: | |
| 238: | public function getKeysArray(): Type; |
| 239: | |
| 240: | |
| 241: | public function getValuesArray(): Type; |
| 242: | |
| 243: | |
| 244: | public function chunkArray(Type $lengthType, TrinaryLogic $preserveKeys): Type; |
| 245: | |
| 246: | |
| 247: | public function fillKeysArray(Type $valueType): Type; |
| 248: | |
| 249: | |
| 250: | public function flipArray(): Type; |
| 251: | |
| 252: | |
| 253: | public function intersectKeyArray(Type $otherArraysType): Type; |
| 254: | |
| 255: | |
| 256: | public function popArray(): Type; |
| 257: | |
| 258: | |
| 259: | public function reverseArray(TrinaryLogic $preserveKeys): Type; |
| 260: | |
| 261: | |
| 262: | public function searchArray(Type $needleType, ?TrinaryLogic $strict = null): Type; |
| 263: | |
| 264: | |
| 265: | public function shiftArray(): Type; |
| 266: | |
| 267: | |
| 268: | public function shuffleArray(): Type; |
| 269: | |
| 270: | |
| 271: | public function sliceArray(Type $offsetType, Type $lengthType, TrinaryLogic $preserveKeys): Type; |
| 272: | |
| 273: | |
| 274: | public function spliceArray(Type $offsetType, Type $lengthType, Type $replacementType): Type; |
| 275: | |
| 276: | |
| 277: | public function getEnumCases(): array; |
| 278: | |
| 279: | |
| 280: | |
| 281: | |
| 282: | public function getEnumCaseObject(): ?EnumCaseObjectType; |
| 283: | |
| 284: | |
| 285: | |
| 286: | |
| 287: | |
| 288: | |
| 289: | |
| 290: | |
| 291: | |
| 292: | |
| 293: | |
| 294: | |
| 295: | |
| 296: | |
| 297: | |
| 298: | public function getFiniteTypes(): array; |
| 299: | |
| 300: | |
| 301: | public function exponentiate(Type $exponent): Type; |
| 302: | |
| 303: | public function isCallable(): TrinaryLogic; |
| 304: | |
| 305: | |
| 306: | public function getCallableParametersAcceptors(ClassMemberAccessAnswerer $scope): array; |
| 307: | |
| 308: | public function isCloneable(): TrinaryLogic; |
| 309: | |
| 310: | |
| 311: | public function toBoolean(): BooleanType; |
| 312: | |
| 313: | |
| 314: | public function toNumber(): Type; |
| 315: | |
| 316: | |
| 317: | public function toInteger(): Type; |
| 318: | |
| 319: | |
| 320: | public function toFloat(): Type; |
| 321: | |
| 322: | |
| 323: | public function toString(): Type; |
| 324: | |
| 325: | |
| 326: | public function toArray(): Type; |
| 327: | |
| 328: | |
| 329: | |
| 330: | |
| 331: | |
| 332: | public function toArrayKey(): Type; |
| 333: | |
| 334: | |
| 335: | |
| 336: | |
| 337: | |
| 338: | |
| 339: | |
| 340: | |
| 341: | |
| 342: | |
| 343: | |
| 344: | |
| 345: | |
| 346: | public function toCoercedArgumentType(bool $strictTypes): self; |
| 347: | |
| 348: | public function isSmallerThan(Type $otherType, PhpVersion $phpVersion): TrinaryLogic; |
| 349: | |
| 350: | public function isSmallerThanOrEqual(Type $otherType, PhpVersion $phpVersion): TrinaryLogic; |
| 351: | |
| 352: | |
| 353: | |
| 354: | |
| 355: | |
| 356: | |
| 357: | |
| 358: | public function isConstantValue(): TrinaryLogic; |
| 359: | |
| 360: | |
| 361: | |
| 362: | |
| 363: | |
| 364: | |
| 365: | |
| 366: | public function isConstantScalarValue(): TrinaryLogic; |
| 367: | |
| 368: | |
| 369: | public function getConstantScalarTypes(): array; |
| 370: | |
| 371: | |
| 372: | public function getConstantScalarValues(): array; |
| 373: | |
| 374: | public function isNull(): TrinaryLogic; |
| 375: | |
| 376: | public function isTrue(): TrinaryLogic; |
| 377: | |
| 378: | public function isFalse(): TrinaryLogic; |
| 379: | |
| 380: | public function isBoolean(): TrinaryLogic; |
| 381: | |
| 382: | public function isFloat(): TrinaryLogic; |
| 383: | |
| 384: | public function isInteger(): TrinaryLogic; |
| 385: | |
| 386: | public function isString(): TrinaryLogic; |
| 387: | |
| 388: | public function isNumericString(): TrinaryLogic; |
| 389: | |
| 390: | public function isNonEmptyString(): TrinaryLogic; |
| 391: | |
| 392: | |
| 393: | |
| 394: | |
| 395: | |
| 396: | public function isNonFalsyString(): TrinaryLogic; |
| 397: | |
| 398: | |
| 399: | |
| 400: | |
| 401: | |
| 402: | public function isLiteralString(): TrinaryLogic; |
| 403: | |
| 404: | public function isLowercaseString(): TrinaryLogic; |
| 405: | |
| 406: | public function isUppercaseString(): TrinaryLogic; |
| 407: | |
| 408: | public function isClassString(): TrinaryLogic; |
| 409: | |
| 410: | public function isVoid(): TrinaryLogic; |
| 411: | |
| 412: | public function isScalar(): TrinaryLogic; |
| 413: | |
| 414: | public function looseCompare(Type $type, PhpVersion $phpVersion): BooleanType; |
| 415: | |
| 416: | |
| 417: | |
| 418: | |
| 419: | |
| 420: | public function getSmallerType(PhpVersion $phpVersion): Type; |
| 421: | |
| 422: | public function getSmallerOrEqualType(PhpVersion $phpVersion): Type; |
| 423: | |
| 424: | public function getGreaterType(PhpVersion $phpVersion): Type; |
| 425: | |
| 426: | public function getGreaterOrEqualType(PhpVersion $phpVersion): Type; |
| 427: | |
| 428: | |
| 429: | |
| 430: | |
| 431: | |
| 432: | |
| 433: | |
| 434: | |
| 435: | |
| 436: | |
| 437: | |
| 438: | |
| 439: | |
| 440: | |
| 441: | |
| 442: | |
| 443: | |
| 444: | public function getTemplateType(string $ancestorClassName, string $templateTypeName): Type; |
| 445: | |
| 446: | |
| 447: | |
| 448: | |
| 449: | |
| 450: | |
| 451: | public function inferTemplateTypes(Type $receivedType): TemplateTypeMap; |
| 452: | |
| 453: | |
| 454: | |
| 455: | |
| 456: | |
| 457: | |
| 458: | |
| 459: | |
| 460: | |
| 461: | |
| 462: | |
| 463: | |
| 464: | |
| 465: | |
| 466: | |
| 467: | |
| 468: | |
| 469: | public function getReferencedTemplateTypes(TemplateTypeVariance $positionVariance): array; |
| 470: | |
| 471: | |
| 472: | public function toAbsoluteNumber(): Type; |
| 473: | |
| 474: | |
| 475: | |
| 476: | |
| 477: | |
| 478: | |
| 479: | |
| 480: | |
| 481: | |
| 482: | public function traverse(callable $cb): Type; |
| 483: | |
| 484: | |
| 485: | |
| 486: | |
| 487: | |
| 488: | |
| 489: | |
| 490: | |
| 491: | public function traverseSimultaneously(Type $right, callable $cb): Type; |
| 492: | |
| 493: | public function toPhpDocNode(): TypeNode; |
| 494: | |
| 495: | |
| 496: | public function tryRemove(Type $typeToRemove): ?Type; |
| 497: | |
| 498: | |
| 499: | |
| 500: | |
| 501: | |
| 502: | public function generalize(GeneralizePrecision $precision): Type; |
| 503: | |
| 504: | |
| 505: | |
| 506: | |
| 507: | public function hasTemplateOrLateResolvableType(): bool; |
| 508: | |
| 509: | } |
| 510: | |