Skip to content

Commit ba5947c

Browse files
authored
(U2C #19) remove deprecated things, clean up tests (#121)
1 parent df8a154 commit ba5947c

File tree

6 files changed

+141
-263
lines changed

6 files changed

+141
-263
lines changed

src/LaunchDarkly/Impl/Events/EventProcessor.php

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,6 @@ public function flush(): bool
7979
private function getEventPublisher(string $sdkKey, array $options): EventPublisher
8080
{
8181
$ep = $options['event_publisher'] ?? null;
82-
if (!$ep && isset($options['event_publisher_class'])) {
83-
$ep = $options['event_publisher_class'];
84-
}
8582
if (!$ep) {
8683
$ep = Curl::eventPublisher();
8784
}

src/LaunchDarkly/Impl/Integrations/ApcFeatureRequesterCache.php

Lines changed: 0 additions & 35 deletions
This file was deleted.

src/LaunchDarkly/LDClient.php

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ class LDClient
6969
* - `feature_requester`: An optional {@see \LaunchDarkly\FeatureRequester} implementation, or a class or factory for one.
7070
* Defaults to {@see \LaunchDarkly\Integrations\Guzzle::featureRequester()}. There are also optional packages providing
7171
* database integrations; see [Storing data](https://docs.launchdarkly.com/sdk/features/storing-data#php).
72-
* - `feature_requester_class`: Deprecated, equivalent to feature_requester.
7372
* - `event_publisher`: An optional {@see \LaunchDarkly\Subsystems\EventPublisher} implementation, or a class or factory for one.
7473
* Defaults to {@see \LaunchDarkly\Integrations\Curl::eventPublisher()}.
75-
* - `event_publisher_class`: Deprecated, equivalent to event_publisher.
7674
* - `all_attributes_private`: If set to true, no user attributes (other than the key) will be sent back to LaunchDarkly.
7775
* Defaults to false.
7876
* - `private_attribute_names`: An optional array of user attribute names to be marked private. Any users sent to LaunchDarkly
@@ -155,8 +153,6 @@ private function getFeatureRequester(string $sdkKey, array $options): FeatureReq
155153
{
156154
if (isset($options['feature_requester']) && $options['feature_requester']) {
157155
$fr = $options['feature_requester'];
158-
} elseif (isset($options['feature_requester_class']) && $options['feature_requester_class']) {
159-
$fr = $options['feature_requester_class'];
160156
} else {
161157
$fr = Guzzle::featureRequester();
162158
}

tests/FlagBuilder.php

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ public function contextTarget(string $contextKind, int $variation, string ...$va
6666
return $this;
6767
}
6868

69+
public function debugEventsUntilDate(?int $debugEventsUntilDate): FlagBuilder
70+
{
71+
$this->_debugEventsUntilDate = $debugEventsUntilDate;
72+
return $this;
73+
}
74+
6975
public function fallthroughRollout(Rollout $rollout): FlagBuilder
7076
{
7177
$this->_fallthrough = new VariationOrRollout(null, $rollout);
@@ -126,9 +132,27 @@ public function target(int $variation, string ...$values): FlagBuilder
126132
return $this;
127133
}
128134

135+
public function trackEvents(bool $trackEvents): FlagBuilder
136+
{
137+
$this->_trackEvents = $trackEvents;
138+
return $this;
139+
}
140+
141+
public function trackEventsFallthrough(bool $trackEventsFallthrough): FlagBuilder
142+
{
143+
$this->_trackEventsFallthrough = $trackEventsFallthrough;
144+
return $this;
145+
}
146+
129147
public function variations(...$variations): FlagBuilder
130148
{
131149
$this->_variations = $variations;
132150
return $this;
133151
}
152+
153+
public function version(int $version): FlagBuilder
154+
{
155+
$this->_version = $version;
156+
return $this;
157+
}
134158
}

0 commit comments

Comments
 (0)