Skip to content

Commit cd9133b

Browse files
authored
Merge pull request #205 from splitio/dw
PHP 7.1.7
2 parents bc5baa8 + 17a9a92 commit cd9133b

20 files changed

+270
-250
lines changed

CHANGES.txt

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
7.1.7 (May 16, 2023)
2+
- Updated terminology on the SDKs codebase to be more aligned with current standard without causing a breaking change. The core change is the term split for feature flag on things like logs and phpdoc comments.
3+
- Fixed php 8.2 warnings in code.
4+
15
7.1.6 (Feb 14, 2023)
26
- Fixed logging on array conversion.
37

@@ -41,7 +45,7 @@
4145
- Added flag `IPAddressesEnabled` into options to enable/disable sending MachineName and MachineIP when data is posted in headers.
4246

4347
6.2.2 (Sep 18, 2019)
44-
- Fetch multiple splits at once on getTreatments/getTreatmentsWithConfig
48+
- Fetch multiple feature flags at once on getTreatments/getTreatmentsWithConfig
4549
- Removed MatcherClient (DependencyMatcher now uses Evaluator directly)
4650
- Removed shared memory.
4751
- Several code cleanups
@@ -52,7 +56,7 @@
5256

5357
6.2.0 (May 30, 2019)
5458
- Added validation for TrafficType in track calls.
55-
- Added validation when split does not exist on treatments and manager calls.
59+
- Added validation when feature flag does not exist on treatments and manager calls.
5660
- Added multiple factory instantiation check.
5761
- Removed producer modules.
5862
- Added properties to track method.
@@ -94,7 +98,7 @@
9498
- Downgrade logging level for shared memory messages
9599

96100
5.2.3: (Sep 5, 2017)
97-
- Adding hotfix to return empty splits array in SplitManager when redis is empty.
101+
- Adding hotfix to return empty feature flags array in SplitManager when redis is empty.
98102

99103
5.2.2: (Aug 1, 2017)
100104
- Adding hotfix to return CONTROL if redis is down instead of failing.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright © 2022 Split Software, Inc.
1+
Copyright © 2023 Split Software, Inc.
22

33
Licensed under the Apache License, Version 2.0 (the "License");
44
you may not use this file except in compliance with the License.

README.md

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,24 @@
44
[![Latest stable](https://img.shields.io/packagist/v/splitsoftware/split-sdk-php)](https://packagist.org/packages/splitsoftware/split-sdk-php)
55
[![Documentation](https://img.shields.io/badge/php_client-documentation-informational)](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
66

7-
This SDK is designed to work with Split, the platform for controlled rollouts, serving features to your users via the Split feature flag to manage your complete customer experience.
7+
## Overview
8+
This SDK is designed to work with Split, the platform for controlled rollouts, which serves features to your users via feature flags to manage your complete customer experience.
89

910
## Compatibility
1011
This SDK is compatible with PHP 7.3 and above.
1112

1213
## Getting started
1314
Below is a simple example that describes the instantiation and most basic usage of our SDK.
14-
Keep in mind that since PHP does not have the ability to share memory between processes the use of the [split-synchronizer](https://help.split.io/hc/en-us/articles/360019686092-Split-Synchronizer-Proxy) is mandatory for this SDK.
15+
Keep in mind that since PHP does not have the ability to share memory between processes the use of the [split-synchronizer](https://help.split.io/hc/en-us/articles/360019686092-Split-Synchronizer) is mandatory for this SDK.
1516

1617
```php
1718
<?php
1819

1920
$sdkConfig = ['cache' => ['adapter' => 'predis']];
20-
$splitFactory = \SplitIO\Sdk::factory('SDK_API_KEY', $sdkConfig);
21+
$splitFactory = \SplitIO\Sdk::factory('YOUR_SDK_KEY', $sdkConfig);
2122

2223
$splitClient = $splitFactory->client();
23-
$treatment = $splitClient->getTreatment('CUSTOMER_ID','SPLIT_NAME');
24+
$treatment = $splitClient->getTreatment('CUSTOMER_ID','FEATURE_FLAG_NAME');
2425
if ($treatment === 'on') {
2526
// Feature is enabled for this user!
2627
} elseif ($treatment === 'off') {
@@ -30,9 +31,11 @@ if ($treatment === 'on') {
3031
}
3132
```
3233

34+
Please refer to [our official docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK) to learn about all the functionality provided by our SDK and the configuration options available for tailoring it to your current application setup.
35+
3336
## Submitting issues
3437

35-
The Split team monitors all issues submitted to this [issue tracker](https://github.com/splitio/php-client/issues). We encourage you to use this issue tracker to submit any bug reports, feedback, and feature enhancements. We'll do our best to respond in a timely manner.
38+
The Split team monitors all issues submitted to this [issue tracker](https://github.com/splitio/php-client/issues). We encourage you to use this issue tracker to submit any bug reports, feedback, and feature enhancements. We'll do our best to respond in a timely manner.
3639

3740
## Contributing
3841
Please see [Contributors Guide](CONTRIBUTORS-GUIDE.md) to find all you need to submit a Pull Request (PR).
@@ -48,16 +51,21 @@ To learn more about Split, contact hello@split.io, or get started with feature f
4851

4952
Split has built and maintains SDKs for:
5053

54+
* .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
55+
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
56+
* Angular [Github](https://github.com/splitio/angular-sdk-plugin) [Docs](https://help.split.io/hc/en-us/articles/6495326064397-Angular-utilities)
57+
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
58+
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
5159
* Java [Github](https://github.com/splitio/java-client) [Docs](https://help.split.io/hc/en-us/articles/360020405151-Java-SDK)
52-
* Javascript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
60+
* JavaScript [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020448791-JavaScript-SDK)
61+
* JavaScript for Browser [Github](https://github.com/splitio/javascript-browser-client) [Docs](https://help.split.io/hc/en-us/articles/360058730852-Browser-SDK)
5362
* Node [Github](https://github.com/splitio/javascript-client) [Docs](https://help.split.io/hc/en-us/articles/360020564931-Node-js-SDK)
54-
* .NET [Github](https://github.com/splitio/dotnet-client) [Docs](https://help.split.io/hc/en-us/articles/360020240172--NET-SDK)
55-
* Ruby [Github](https://github.com/splitio/ruby-client) [Docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK)
5663
* PHP [Github](https://github.com/splitio/php-client) [Docs](https://help.split.io/hc/en-us/articles/360020350372-PHP-SDK)
5764
* Python [Github](https://github.com/splitio/python-client) [Docs](https://help.split.io/hc/en-us/articles/360020359652-Python-SDK)
58-
* GO [Github](https://github.com/splitio/go-client) [Docs](https://help.split.io/hc/en-us/articles/360020093652-Go-SDK)
59-
* Android [Github](https://github.com/splitio/android-client) [Docs](https://help.split.io/hc/en-us/articles/360020343291-Android-SDK)
60-
* iOS [Github](https://github.com/splitio/ios-client) [Docs](https://help.split.io/hc/en-us/articles/360020401491-iOS-SDK)
65+
* React [Github](https://github.com/splitio/react-client) [Docs](https://help.split.io/hc/en-us/articles/360038825091-React-SDK)
66+
* React Native [Github](https://github.com/splitio/react-native-client) [Docs](https://help.split.io/hc/en-us/articles/4406066357901-React-Native-SDK)
67+
* Redux [Github](https://github.com/splitio/redux-client) [Docs](https://help.split.io/hc/en-us/articles/360038851551-Redux-SDK)
68+
* Ruby [Github](https://github.com/splitio/ruby-client) [Docs](https://help.split.io/hc/en-us/articles/360020673251-Ruby-SDK)
6169

6270
For a comprehensive list of open source projects visit our [Github page](https://github.com/splitio?utf8=%E2%9C%93&query=%20only%3Apublic%20).
6371

src/SplitIO/Component/Cache/SplitCache.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ public function getSplit($splitName)
5959
public function getSplits($splitNames)
6060
{
6161
$cache = Di::getCache();
62-
$cacheItems = $cache->fetchMany(array_map('self::getCacheKeyForSplit', $splitNames));
62+
$cacheItems = $cache->fetchMany(array_map([
63+
self::class, 'getCacheKeyForSplit'
64+
], $splitNames));
6365
$toReturn = array();
6466
foreach ($cacheItems as $key => $value) {
6567
$toReturn[self::getSplitNameFromCacheKey($key)] = $value;
@@ -74,7 +76,7 @@ public function getSplitNames()
7476
{
7577
$cache = Di::getCache();
7678
$splitKeys = $cache->getKeys(self::getCacheKeySearchPattern());
77-
return array_map('self::getSplitNameFromCacheKey', $splitKeys);
79+
return array_map([self::class, 'getSplitNameFromCacheKey'], $splitKeys);
7880
}
7981

8082
/**

src/SplitIO/Grammar/Condition/Matcher/ContainsString.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
class ContainsString extends AbstractMatcher
88
{
9-
protected $ContainsStringMatcherData = null;
9+
private $containsStringMatcherData = null;
1010

1111
public function __construct($data, $negate = false, $attribute = null)
1212
{

src/SplitIO/Grammar/Split.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public function __construct(array $split)
5151
$this->configurations = isset($split['configurations']) && count($split['configurations']) > 0 ?
5252
$split['configurations'] : null;
5353

54-
SplitApp::logger()->info("Constructing Split: ".$this->name);
54+
SplitApp::logger()->info("Constructing Feature Flag: ".$this->name);
5555

5656
if (isset($split['conditions']) && is_array($split['conditions'])) {
5757
$this->conditions = array();

0 commit comments

Comments
 (0)