Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Engine/Engine.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static function getEnvironmentFeatureState(
public static function getIdentityFeatureStates(
EnvironmentModel $environment,
IdentityModel $identity,
array $overrideTraits = null
?array $overrideTraits = null
): array {
$featureStates = self::_getIdentityFeatureStatesDict(
$environment,
Expand Down Expand Up @@ -96,7 +96,7 @@ public static function getIdentityFeatureState(
EnvironmentModel $environment,
IdentityModel $identity,
string $featureName,
array $overrideTraits = null
?array $overrideTraits = null
): FeatureStateModel {
$featureStates = self::_getIdentityFeatureStatesDict(
$environment,
Expand Down Expand Up @@ -128,7 +128,7 @@ public static function getIdentityFeatureState(
private static function _getIdentityFeatureStatesDict(
EnvironmentModel $environment,
IdentityModel $identity,
array $overrideTraits = null
?array $overrideTraits = null
): array {
$featureStates = [];
foreach ($environment->getFeatureStates() as $fs) {
Expand Down
4 changes: 2 additions & 2 deletions src/Engine/Segments/SegmentEvaluator.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class SegmentEvaluator
public static function getIdentitySegments(
EnvironmentModel $environment,
IdentityModel $identity,
array $overrideTraits = null
?array $overrideTraits = null
): array {
return array_filter(
$environment->getProject()->getSegments()->getArrayCopy(),
Expand All @@ -42,7 +42,7 @@ public static function getIdentitySegments(
public static function evaluateIdentityInSegment(
IdentityModel $identity,
SegmentModel $segment,
array $overrideTraits = null
?array $overrideTraits = null
): bool {
$rulesCount = count($segment->getRules());
$identityId = ($identity->getDjangoId() != null) ? $identity->getDjangoId() : $identity->compositeKey();
Expand Down
14 changes: 7 additions & 7 deletions src/Flagsmith.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,15 @@ class Flagsmith
* @throws ValueError
*/
public function __construct(
string $apiKey = null,
string $host = null,
object $customHeaders = null,
int $environmentTtl = null,
Retry $retries = null,
?string $apiKey = null,
?string $host = null,
?object $customHeaders = null,
?int $environmentTtl = null,
?Retry $retries = null,
bool $enableAnalytics = false,
\Closure $defaultFlagHandler = null,
?\Closure $defaultFlagHandler = null,
bool $offlineMode = false,
IOfflineHandler $offlineHandler = null
?IOfflineHandler $offlineHandler = null
) {
if ($offlineMode and is_null($offlineHandler)) {
throw new ValueError('offlineHandler must be provided to use offline mode.');
Expand Down
6 changes: 3 additions & 3 deletions src/Utils/AnalyticsProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public function __construct(
string $environmentKey,
string $baseApiUrl,
int $timeout = 5,
ClientInterface $client = null,
RequestFactoryInterface $requestFactory = null,
StreamFactoryInterface $streamFactory = null
?ClientInterface $client = null,
?RequestFactoryInterface $requestFactory = null,
?StreamFactoryInterface $streamFactory = null
) {
$this->analytics_endpoint = rtrim($baseApiUrl, '/') . self::ANALYTICS_ENDPOINT;
$this->environment_key = $environmentKey;
Expand Down