Skip to content

Commit 0eacd84

Browse files
authored
remove deprecated members (#65)
1 parent 511f727 commit 0eacd84

File tree

7 files changed

+1
-131
lines changed

7 files changed

+1
-131
lines changed

src/LaunchDarkly/CurlEventPublisher.php

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

src/LaunchDarkly/EvaluationException.php

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

src/LaunchDarkly/FeatureFlag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ private function checkPrerequisites(LDUser $user, FeatureRequester $featureReque
185185
}
186186
array_push($events, $eventFactory->newEvalEvent($prereqFeatureFlag, $user, $prereqEvalResult, null, $this));
187187
}
188-
} catch (EvaluationException $e) {
188+
} catch (\Exception $e) {
189189
$prereqOk = false;
190190
}
191191
if (!$prereqOk) {

src/LaunchDarkly/GuzzleEventPublisher.php

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

src/LaunchDarkly/GuzzleFeatureRequester.php

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

src/LaunchDarkly/LDClient.php

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -274,21 +274,6 @@ private function variationDetailInternal(string $key, LDUser $user, $default, Ev
274274
}
275275
}
276276

277-
/**
278-
* Deprecated name for variation().
279-
*
280-
* @deprecated Use variation() instead.
281-
* @param string $key The unique key for the feature flag
282-
* @param LDUser $user The end user requesting the flag
283-
* @param bool $default The default value of the flag
284-
* @return mixed
285-
*/
286-
public function toggle(string $key, LDUser $user, bool $default = false)
287-
{
288-
$this->_logger->warning("Deprecated function: toggle() called. Use variation() instead.");
289-
return $this->variation($key, $user, $default);
290-
}
291-
292277
/**
293278
* Returns whether the LaunchDarkly client is in offline mode.
294279
*/
@@ -334,33 +319,6 @@ public function identify(LDUser $user): void
334319
$this->_eventProcessor->enqueue($this->_eventFactoryDefault->newIdentifyEvent($user));
335320
}
336321

337-
/**
338-
* Deprecated alternative to allFlagsState().
339-
*
340-
* This returns an array mapping feature flag keys to their evaluated results for a given user.
341-
*
342-
* If the result of a flag's evaluation would have returned the default variation, it will have a null entry.
343-
* If the client is offline, has not been initialized, or a null user or user with null/empty user key, null will be returned.
344-
* This method will not send analytics events back to LaunchDarkly.
345-
*
346-
* The most common use case for this method is to bootstrap a set of client-side feature flags from a back-end
347-
* service. Current versions of the JavaScript SDK require somewhat different data; for best compatibility,
348-
* use {@link allFlagsState()} instead.
349-
*
350-
* @deprecated Use allFlagsState() instead. Current versions of the client-side SDK will not
351-
* generate analytics events correctly if you pass the result of allFlags().
352-
* @param LDUser $user The end user requesting the feature flags
353-
* @return array|null Mapping of feature flag keys to their evaluated results for $user
354-
*/
355-
public function allFlags(LDUser $user): ?array
356-
{
357-
$state = $this->allFlagsState($user);
358-
if (!$state->isValid()) {
359-
return null;
360-
}
361-
return $state->toValuesMap();
362-
}
363-
364322
/**
365323
* Returns an object that encapsulates the state of all feature flags for a given user.
366324
*

tests/LDClientTest.php

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -336,33 +336,6 @@ public function testVariationWithAnonymousUserSendsEventWithAnonymousContextKind
336336
$this->assertEquals('anonymousUser', $event['contextKind']);
337337
}
338338

339-
public function testAllFlagsReturnsFlagValues()
340-
{
341-
$flagJson = array(
342-
'key' => 'feature',
343-
'version' => 100,
344-
'deleted' => false,
345-
'on' => false,
346-
'targets' => array(),
347-
'prerequisites' => array(),
348-
'rules' => array(),
349-
'offVariation' => 1,
350-
'fallthrough' => array('variation' => 0),
351-
'variations' => array('fall', 'off', 'on'),
352-
'salt' => ''
353-
);
354-
$flag = FeatureFlag::decode($flagJson);
355-
356-
MockFeatureRequester::$flags = array('feature' => $flag);
357-
$client = $this->makeClient();
358-
359-
$builder = new LDUserBuilder(3);
360-
$user = $builder->build();
361-
$values = $client->allFlags($user);
362-
363-
$this->assertEquals(array('feature' => 'off'), $values);
364-
}
365-
366339
public function testAllFlagsStateReturnsState()
367340
{
368341
$flagJson = array(

0 commit comments

Comments
 (0)