diff --git a/composer.json b/composer.json index 4ef61becb..74751f289 100644 --- a/composer.json +++ b/composer.json @@ -28,7 +28,7 @@ "kevinrob/guzzle-cache-middleware": "^8.0", "phpunit/php-code-coverage": "^9", "phpunit/phpunit": "^9", - "vimeo/psalm": "^6.13.1" + "vimeo/psalm": "^7.0.4" }, "suggest": { "guzzlehttp/guzzle": "(^6.3 | ^7 | ^8) Required when using GuzzleEventPublisher or the default FeatureRequester", diff --git a/psalm-baseline.xml b/psalm-baseline.xml index f91a02f3f..6f61d3c79 100644 --- a/psalm-baseline.xml +++ b/psalm-baseline.xml @@ -1,24 +1,9 @@ - - - - - - + - - - - - - - - - - _errorKind]]> _prerequisiteKey]]> @@ -27,33 +12,15 @@ - - - - - - - - - getDebugEventsUntilDate()]]> getDebugEventsUntilDate()]]> - - - - - - - - - @@ -62,18 +29,6 @@ - - - - - - - - - - - - @@ -166,17 +121,14 @@ - - - + + + - - - @@ -206,14 +158,8 @@ - - - - - - @@ -231,12 +177,8 @@ - - - - @@ -258,9 +200,6 @@ - - - @@ -298,12 +237,9 @@ - - - - - - + + + @@ -330,9 +266,6 @@ - - - @@ -341,6 +274,10 @@ + + + + @@ -393,118 +330,27 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _send_events]]> - - - - - - - @@ -514,13 +360,6 @@ - - - - - - - _error]]> @@ -532,118 +371,13 @@ - - - - - - - - - - - - _kind]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - _singleComponent]]> - - - - - - - - - - - - - - - - - - - diff --git a/src/LaunchDarkly/BigSegmentsEvaluationStatus.php b/src/LaunchDarkly/BigSegmentsEvaluationStatus.php index 44275e13b..5801b2019 100644 --- a/src/LaunchDarkly/BigSegmentsEvaluationStatus.php +++ b/src/LaunchDarkly/BigSegmentsEvaluationStatus.php @@ -7,6 +7,8 @@ /** * A status enum which represents the result of a Big Segment query involved in * a flag evaluation. + * + * @psalm-api */ enum BigSegmentsEvaluationStatus: string { diff --git a/src/LaunchDarkly/EvaluationDetail.php b/src/LaunchDarkly/EvaluationDetail.php index c8223ad85..b074d8ee0 100644 --- a/src/LaunchDarkly/EvaluationDetail.php +++ b/src/LaunchDarkly/EvaluationDetail.php @@ -8,6 +8,8 @@ * An object that combines the result of a flag evaluation with an explanation of how it was calculated. * * This is returned by {@see \LaunchDarkly\LDClient::variationDetail()}. + * + * @psalm-api */ class EvaluationDetail { diff --git a/src/LaunchDarkly/EvaluationReason.php b/src/LaunchDarkly/EvaluationReason.php index 0a1623b5c..1942ade28 100644 --- a/src/LaunchDarkly/EvaluationReason.php +++ b/src/LaunchDarkly/EvaluationReason.php @@ -8,6 +8,8 @@ * Describes the reason that a flag evaluation produced a particular value. * * This is part of the {@see \LaunchDarkly\EvaluationDetail} object returned by {@see \LaunchDarkly\LDClient::variationDetail()}. + * + * @psalm-api */ class EvaluationReason implements \JsonSerializable { diff --git a/src/LaunchDarkly/FeatureFlagsState.php b/src/LaunchDarkly/FeatureFlagsState.php index 63d62c17a..e9eff4502 100644 --- a/src/LaunchDarkly/FeatureFlagsState.php +++ b/src/LaunchDarkly/FeatureFlagsState.php @@ -14,6 +14,8 @@ * Serializing this object to JSON using json_encode(), or the jsonSerialize() method, will produce the * appropriate data structure for bootstrapping the LaunchDarkly JavaScript client. See the SDK * reference guide on ["Bootstrapping"](https://docs.launchdarkly.com/sdk/features/bootstrapping#javascript). + * + * @psalm-api */ class FeatureFlagsState implements \JsonSerializable { diff --git a/src/LaunchDarkly/Hooks/EvaluationSeriesContext.php b/src/LaunchDarkly/Hooks/EvaluationSeriesContext.php index 701554136..4095de4d7 100644 --- a/src/LaunchDarkly/Hooks/EvaluationSeriesContext.php +++ b/src/LaunchDarkly/Hooks/EvaluationSeriesContext.php @@ -15,6 +15,8 @@ * flag data from LaunchDarkly at least once, so the first variation call's * `beforeEvaluation` typically sees `null` while its `afterEvaluation` sees the * captured value. See {@see \LaunchDarkly\Hooks\EvaluationSeriesContext::$environmentId}. + * + * @psalm-api */ final class EvaluationSeriesContext { diff --git a/src/LaunchDarkly/Hooks/Hook.php b/src/LaunchDarkly/Hooks/Hook.php index d71d781e1..89d96e2d8 100644 --- a/src/LaunchDarkly/Hooks/Hook.php +++ b/src/LaunchDarkly/Hooks/Hook.php @@ -14,6 +14,8 @@ * without breaking existing implementations. * * Only `getMetadata` is abstract; subclasses override just the stages they need. + * + * @psalm-api */ abstract class Hook { diff --git a/src/LaunchDarkly/Hooks/Metadata.php b/src/LaunchDarkly/Hooks/Metadata.php index 8359ac2fc..b391646d3 100644 --- a/src/LaunchDarkly/Hooks/Metadata.php +++ b/src/LaunchDarkly/Hooks/Metadata.php @@ -6,6 +6,8 @@ /** * Metadata about a hook implementation. + * + * @psalm-api */ final class Metadata { diff --git a/src/LaunchDarkly/Hooks/TrackSeriesContext.php b/src/LaunchDarkly/Hooks/TrackSeriesContext.php index c0711139d..663a37ad4 100644 --- a/src/LaunchDarkly/Hooks/TrackSeriesContext.php +++ b/src/LaunchDarkly/Hooks/TrackSeriesContext.php @@ -8,6 +8,8 @@ /** * Contextual information provided to the afterTrack stage of the track series. + * + * @psalm-api */ final class TrackSeriesContext { diff --git a/src/LaunchDarkly/Impl/Integrations/FeatureRequesterBase.php b/src/LaunchDarkly/Impl/Integrations/FeatureRequesterBase.php index dfc5c6749..e7fcb44ea 100644 --- a/src/LaunchDarkly/Impl/Integrations/FeatureRequesterBase.php +++ b/src/LaunchDarkly/Impl/Integrations/FeatureRequesterBase.php @@ -14,6 +14,7 @@ /** * @ignore * @internal + * @psalm-api */ class FeatureRequesterBase implements FeatureRequester { diff --git a/src/LaunchDarkly/Integrations/Curl.php b/src/LaunchDarkly/Integrations/Curl.php index d2784715b..2eb6b0bd9 100644 --- a/src/LaunchDarkly/Integrations/Curl.php +++ b/src/LaunchDarkly/Integrations/Curl.php @@ -7,6 +7,8 @@ /** * Integration with the curl HTTP client. * @since 3.5.0 + * + * @psalm-api */ class Curl { diff --git a/src/LaunchDarkly/Integrations/Files.php b/src/LaunchDarkly/Integrations/Files.php index 7a6ac4cb6..4592c8864 100644 --- a/src/LaunchDarkly/Integrations/Files.php +++ b/src/LaunchDarkly/Integrations/Files.php @@ -7,6 +7,8 @@ /** * Integration with filesystem data. * @since 3.5.0 + * + * @psalm-api */ class Files { diff --git a/src/LaunchDarkly/Integrations/Guzzle.php b/src/LaunchDarkly/Integrations/Guzzle.php index 0f8f229c2..7e011d610 100644 --- a/src/LaunchDarkly/Integrations/Guzzle.php +++ b/src/LaunchDarkly/Integrations/Guzzle.php @@ -7,6 +7,8 @@ /** * Integration with the Guzzle HTTP client. * @since 3.5.0 + * + * @psalm-api */ class Guzzle { diff --git a/src/LaunchDarkly/Integrations/TestData.php b/src/LaunchDarkly/Integrations/TestData.php index b8229754d..5ea1ee05c 100644 --- a/src/LaunchDarkly/Integrations/TestData.php +++ b/src/LaunchDarkly/Integrations/TestData.php @@ -9,6 +9,9 @@ use LaunchDarkly\Integrations\TestData\FlagBuilder; use LaunchDarkly\Subsystems\FeatureRequester; +/** + * @psalm-api + */ class TestData implements FeatureRequester { protected array $_flagBuilders; diff --git a/src/LaunchDarkly/Integrations/TestData/FlagBuilder.php b/src/LaunchDarkly/Integrations/TestData/FlagBuilder.php index 63ada503b..86a95bca2 100644 --- a/src/LaunchDarkly/Integrations/TestData/FlagBuilder.php +++ b/src/LaunchDarkly/Integrations/TestData/FlagBuilder.php @@ -15,6 +15,8 @@ * * @see \LaunchDarkly\Integrations\TestData::flag() * @see \LaunchDarkly\Integrations\TestData::update() + * + * @psalm-api */ class FlagBuilder { diff --git a/src/LaunchDarkly/Integrations/TestData/FlagRuleBuilder.php b/src/LaunchDarkly/Integrations/TestData/FlagRuleBuilder.php index 32a486247..f19c743d5 100644 --- a/src/LaunchDarkly/Integrations/TestData/FlagRuleBuilder.php +++ b/src/LaunchDarkly/Integrations/TestData/FlagRuleBuilder.php @@ -21,6 +21,8 @@ * `thenReturn(int)` to finish defining the rule. * * @see \LaunchDarkly\Integrations\TestData\FlagBuilder + * + * @psalm-api */ class FlagRuleBuilder { diff --git a/src/LaunchDarkly/Integrations/TestData/MigrationSettingsBuilder.php b/src/LaunchDarkly/Integrations/TestData/MigrationSettingsBuilder.php index f8a7329c8..fa5c76f79 100644 --- a/src/LaunchDarkly/Integrations/TestData/MigrationSettingsBuilder.php +++ b/src/LaunchDarkly/Integrations/TestData/MigrationSettingsBuilder.php @@ -4,6 +4,9 @@ namespace LaunchDarkly\Integrations\TestData; +/** + * @psalm-api + */ class MigrationSettingsBuilder { protected ?int $checkRatio = null; diff --git a/src/LaunchDarkly/LDClient.php b/src/LaunchDarkly/LDClient.php index ed8addf45..a06e429db 100644 --- a/src/LaunchDarkly/LDClient.php +++ b/src/LaunchDarkly/LDClient.php @@ -34,6 +34,8 @@ /** * A client for the LaunchDarkly API. + * + * @psalm-api */ class LDClient { diff --git a/src/LaunchDarkly/LDContext.php b/src/LaunchDarkly/LDContext.php index b7203a0b5..0dbfa6db1 100644 --- a/src/LaunchDarkly/LDContext.php +++ b/src/LaunchDarkly/LDContext.php @@ -19,6 +19,8 @@ * * An LDContext can be in an error state if it was built with invalid attributes. See * {@see \LaunchDarkly\LDContext::isValid()} and {@see \LaunchDarkly\LDContext::getError()}. + * + * @psalm-api */ class LDContext implements \JsonSerializable { diff --git a/src/LaunchDarkly/LDContextBuilder.php b/src/LaunchDarkly/LDContextBuilder.php index 2def85a13..5f6ce1b34 100644 --- a/src/LaunchDarkly/LDContextBuilder.php +++ b/src/LaunchDarkly/LDContextBuilder.php @@ -26,6 +26,8 @@ * ``` * * @see \LaunchDarkly\LDContext + * + * @psalm-api */ class LDContextBuilder { diff --git a/src/LaunchDarkly/LDContextMultiBuilder.php b/src/LaunchDarkly/LDContextMultiBuilder.php index 51ceb0903..fd235d8ff 100644 --- a/src/LaunchDarkly/LDContextMultiBuilder.php +++ b/src/LaunchDarkly/LDContextMultiBuilder.php @@ -24,6 +24,8 @@ * ``` * * @see \LaunchDarkly\LDContext + * + * @psalm-api */ class LDContextMultiBuilder { diff --git a/src/LaunchDarkly/Migrations/ExecutionOrder.php b/src/LaunchDarkly/Migrations/ExecutionOrder.php index ec7e661d1..bfb139a65 100644 --- a/src/LaunchDarkly/Migrations/ExecutionOrder.php +++ b/src/LaunchDarkly/Migrations/ExecutionOrder.php @@ -8,6 +8,8 @@ * Depending on the migration stage, reads may operate against both old and new * origins. In this situation, the execution order can be defined to specify * how these individual reads are coordinated. + * + * @psalm-api */ enum ExecutionOrder: string { diff --git a/src/LaunchDarkly/Migrations/MigrationConfig.php b/src/LaunchDarkly/Migrations/MigrationConfig.php index 045557101..8ae63ea41 100644 --- a/src/LaunchDarkly/Migrations/MigrationConfig.php +++ b/src/LaunchDarkly/Migrations/MigrationConfig.php @@ -12,6 +12,8 @@ * customer defined read or write operations on old or new origins of * information. For read operations, an optional comparison function also be * defined. + * + * @psalm-api */ class MigrationConfig { diff --git a/src/LaunchDarkly/Migrations/Migrator.php b/src/LaunchDarkly/Migrations/Migrator.php index 086496367..bec85bc03 100644 --- a/src/LaunchDarkly/Migrations/Migrator.php +++ b/src/LaunchDarkly/Migrations/Migrator.php @@ -14,6 +14,8 @@ * * This class is not intended to be instanced directly, but instead should be constructed * using the {@see MigratorBuilder}. + * + * @psalm-api */ class Migrator { diff --git a/src/LaunchDarkly/Migrations/MigratorBuilder.php b/src/LaunchDarkly/Migrations/MigratorBuilder.php index 887899aea..29ca48f30 100644 --- a/src/LaunchDarkly/Migrations/MigratorBuilder.php +++ b/src/LaunchDarkly/Migrations/MigratorBuilder.php @@ -12,6 +12,8 @@ * The migration builder is used to configure and construct an instance of a * {@see Migrator}. This migrator can be used to perform LaunchDarkly assisted * technology migrations through the use of migration-based feature flags. + * + * @psalm-api */ class MigratorBuilder { diff --git a/src/LaunchDarkly/Migrations/OpTracker.php b/src/LaunchDarkly/Migrations/OpTracker.php index 6eb2a22dd..8f6d2a135 100644 --- a/src/LaunchDarkly/Migrations/OpTracker.php +++ b/src/LaunchDarkly/Migrations/OpTracker.php @@ -20,6 +20,8 @@ * The OpTracker is not expected to be instantiated directly. Consumers should * instead call {@see \LaunchDarkly\LDClient:migration_variation()} and use the * returned tracker instance. + * + * @psalm-api */ class OpTracker { diff --git a/src/LaunchDarkly/Migrations/Operation.php b/src/LaunchDarkly/Migrations/Operation.php index 518f4a28e..c10878ccb 100644 --- a/src/LaunchDarkly/Migrations/Operation.php +++ b/src/LaunchDarkly/Migrations/Operation.php @@ -7,6 +7,8 @@ /** * The operation enum is used to record the type of migration operation that * occurred. + * + * @psalm-api */ enum Operation: string { diff --git a/src/LaunchDarkly/Migrations/OperationResult.php b/src/LaunchDarkly/Migrations/OperationResult.php index b43286cf4..506883a4c 100644 --- a/src/LaunchDarkly/Migrations/OperationResult.php +++ b/src/LaunchDarkly/Migrations/OperationResult.php @@ -9,6 +9,8 @@ /** * The OperationResult pairs an origin with a result. + * + * @psalm-api */ class OperationResult { diff --git a/src/LaunchDarkly/Migrations/Origin.php b/src/LaunchDarkly/Migrations/Origin.php index 781475f9a..97afcfa7d 100644 --- a/src/LaunchDarkly/Migrations/Origin.php +++ b/src/LaunchDarkly/Migrations/Origin.php @@ -7,6 +7,8 @@ /** * The origin enum is used to denote which source of data should be affected * by a particular operation. + * + * @psalm-api */ enum Origin: string { diff --git a/src/LaunchDarkly/Migrations/Stage.php b/src/LaunchDarkly/Migrations/Stage.php index cef9d028d..77a74db62 100644 --- a/src/LaunchDarkly/Migrations/Stage.php +++ b/src/LaunchDarkly/Migrations/Stage.php @@ -9,6 +9,8 @@ * part of, progressing through the following order. * * OFF -> DUALWRITE -> SHADOW -> LIVE -> RAMPDOWN -> COMPLETE + * + * @psalm-api */ enum Stage: string { diff --git a/src/LaunchDarkly/Migrations/WriteResult.php b/src/LaunchDarkly/Migrations/WriteResult.php index 12283731f..31fe7c7be 100644 --- a/src/LaunchDarkly/Migrations/WriteResult.php +++ b/src/LaunchDarkly/Migrations/WriteResult.php @@ -6,6 +6,8 @@ /** * The WriteResult pairs an origin with a result. + * + * @psalm-api */ class WriteResult { diff --git a/src/LaunchDarkly/Subsystems/BigSegmentStatusListener.php b/src/LaunchDarkly/Subsystems/BigSegmentStatusListener.php index 4eae7a8c2..f39af8e6f 100644 --- a/src/LaunchDarkly/Subsystems/BigSegmentStatusListener.php +++ b/src/LaunchDarkly/Subsystems/BigSegmentStatusListener.php @@ -8,6 +8,8 @@ /** * Interface for a listener that will be notified when the status of the Big Segment store changes. + * + * @psalm-api */ interface BigSegmentStatusListener { diff --git a/src/LaunchDarkly/Subsystems/BigSegmentStatusProvider.php b/src/LaunchDarkly/Subsystems/BigSegmentStatusProvider.php index f701c0088..4f6439f5d 100644 --- a/src/LaunchDarkly/Subsystems/BigSegmentStatusProvider.php +++ b/src/LaunchDarkly/Subsystems/BigSegmentStatusProvider.php @@ -36,6 +36,8 @@ * determined to have changed. This included during evaluation or when the * status is checked directly. Listeners are encouraged to be as fast as * possible. + * + * @psalm-api */ interface BigSegmentStatusProvider { diff --git a/src/LaunchDarkly/Subsystems/BigSegmentsStore.php b/src/LaunchDarkly/Subsystems/BigSegmentsStore.php index 76d47306f..69f07a0ba 100644 --- a/src/LaunchDarkly/Subsystems/BigSegmentsStore.php +++ b/src/LaunchDarkly/Subsystems/BigSegmentsStore.php @@ -8,6 +8,8 @@ /** * Interface for a store that provides access to Big Segments data. + * + * @psalm-api */ interface BigSegmentsStore { diff --git a/src/LaunchDarkly/Subsystems/EventPublisher.php b/src/LaunchDarkly/Subsystems/EventPublisher.php index 6062a9bf6..419c544c1 100644 --- a/src/LaunchDarkly/Subsystems/EventPublisher.php +++ b/src/LaunchDarkly/Subsystems/EventPublisher.php @@ -11,6 +11,8 @@ * * - {@see \LaunchDarkly\Integrations\Curl::eventPublisher()} (the default) * - {@see \LaunchDarkly\Integrations\Guzzle::eventPublisher()} + * + * @psalm-api */ interface EventPublisher { diff --git a/src/LaunchDarkly/Subsystems/FeatureRequester.php b/src/LaunchDarkly/Subsystems/FeatureRequester.php index e67126797..aa396b2bf 100644 --- a/src/LaunchDarkly/Subsystems/FeatureRequester.php +++ b/src/LaunchDarkly/Subsystems/FeatureRequester.php @@ -17,6 +17,8 @@ * - Database integrations provided in separate packages. See: https://docs.launchdarkly.com/sdk/features/storing-data#php * - A mechanism for reading data from the filesystem: {@see \LaunchDarkly\Integrations\Files} * - A mechanism for injecting test data: {@see \LaunchDarkly\Integrations\TestData} + * + * @psalm-api */ interface FeatureRequester { diff --git a/src/LaunchDarkly/Types/ApplicationInfo.php b/src/LaunchDarkly/Types/ApplicationInfo.php index 6ae77e3b8..1c1209643 100644 --- a/src/LaunchDarkly/Types/ApplicationInfo.php +++ b/src/LaunchDarkly/Types/ApplicationInfo.php @@ -15,6 +15,8 @@ * - Cannot be empty * - Cannot exceed 64 characters in length * - Can only contain a-z, A-Z, 0-9, period (.), dash (-), and underscore (_). + * + * @psalm-api */ final class ApplicationInfo { diff --git a/src/LaunchDarkly/Types/AttributeReference.php b/src/LaunchDarkly/Types/AttributeReference.php index 953b7dd53..b7c35d542 100644 --- a/src/LaunchDarkly/Types/AttributeReference.php +++ b/src/LaunchDarkly/Types/AttributeReference.php @@ -21,6 +21,8 @@ * or "~" in a path component are escaped as "~1" or "~0" respectively. This syntax * deliberately resembles JSON Pointer, but no JSON Pointer behaviors other than those * mentioned here are supported. + * + * @psalm-api */ class AttributeReference { diff --git a/src/LaunchDarkly/Types/BigSegmentsConfig.php b/src/LaunchDarkly/Types/BigSegmentsConfig.php index 10b15d8db..58ce5d9b2 100644 --- a/src/LaunchDarkly/Types/BigSegmentsConfig.php +++ b/src/LaunchDarkly/Types/BigSegmentsConfig.php @@ -18,6 +18,8 @@ * BigSegmentsConfig that at a minimum specifies what database integration to * use, and then pass the `BigSegmentsConfig` object as the `big_segments` * parameter when creating a {@see LaunchDarkly\LDClient}. + * + * @psalm-api */ class BigSegmentsConfig { diff --git a/src/LaunchDarkly/Types/BigSegmentsStoreMetadata.php b/src/LaunchDarkly/Types/BigSegmentsStoreMetadata.php index 9eff5a9a5..ac65eb325 100644 --- a/src/LaunchDarkly/Types/BigSegmentsStoreMetadata.php +++ b/src/LaunchDarkly/Types/BigSegmentsStoreMetadata.php @@ -6,6 +6,8 @@ /** * Metadata about the state of a big segments store. + * + * @psalm-api */ class BigSegmentsStoreMetadata { diff --git a/src/LaunchDarkly/Types/BigSegmentsStoreStatus.php b/src/LaunchDarkly/Types/BigSegmentsStoreStatus.php index 9b3b91836..2a11eac0a 100644 --- a/src/LaunchDarkly/Types/BigSegmentsStoreStatus.php +++ b/src/LaunchDarkly/Types/BigSegmentsStoreStatus.php @@ -9,6 +9,8 @@ * * Big Segments are a specific type of segments. For more information, read the LaunchDarkly * documentation: https://docs.launchdarkly.com/home/users/big-segments + * + * @psalm-api */ class BigSegmentsStoreStatus { diff --git a/src/LaunchDarkly/Types/Result.php b/src/LaunchDarkly/Types/Result.php index 3c9d1e647..b075d7f45 100644 --- a/src/LaunchDarkly/Types/Result.php +++ b/src/LaunchDarkly/Types/Result.php @@ -16,6 +16,8 @@ * * If the operation fails, the Result will contain an error describing the * value. An optional exception may also be provided. + * + * @psalm-api */ final class Result {