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
4 changes: 2 additions & 2 deletions src/Optimizely/DecisionService/DecisionService.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@ class DecisionService
* DecisionService constructor.
*
* @param LoggerInterface $logger
* @param UserProfileServiceInterface $userProfileService
* @param ?UserProfileServiceInterface $userProfileService
*/
public function __construct(LoggerInterface $logger, UserProfileServiceInterface $userProfileService = null)
public function __construct(LoggerInterface $logger, ?UserProfileServiceInterface $userProfileService = null)
Comment thread
Tamara-Barum marked this conversation as resolved.
{
$this->_logger = $logger;
$this->_bucketer = new Bucketer($logger);
Expand Down
2 changes: 1 addition & 1 deletion src/Optimizely/Event/Dispatcher/DefaultEventDispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class DefaultEventDispatcher implements EventDispatcherInterface
*/
private $httpClient;

public function __construct(HttpClient $httpClient = null)
public function __construct(?HttpClient $httpClient = null)
{
$this->httpClient = $httpClient ?: new HttpClient();
}
Expand Down
24 changes: 12 additions & 12 deletions src/Optimizely/Optimizely.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,24 +119,24 @@ class Optimizely
* Optimizely constructor for managing Feature Experimentation PHP projects.
*
* @param $datafile string JSON string representing the project.
* @param $eventDispatcher EventDispatcherInterface
* @param $logger LoggerInterface
* @param $errorHandler ErrorHandlerInterface
* @param $eventDispatcher ?EventDispatcherInterface
* @param $logger ?LoggerInterface
* @param $errorHandler ?ErrorHandlerInterface
* @param $skipJsonValidation boolean representing whether JSON schema validation needs to be performed.
* @param $userProfileService UserProfileServiceInterface
* @param $configManager ProjectConfigManagerInterface provides ProjectConfig through getConfig method.
* @param $notificationCenter NotificationCenter
* @param $userProfileService ?UserProfileServiceInterface
* @param $configManager ?ProjectConfigManagerInterface provides ProjectConfig through getConfig method.
* @param $notificationCenter ?NotificationCenter
* @param $sdkKey string uniquely identifying the datafile corresponding to project and environment combination. Must provide at least one of datafile or sdkKey.
*/
public function __construct(
$datafile,
EventDispatcherInterface $eventDispatcher = null,
LoggerInterface $logger = null,
ErrorHandlerInterface $errorHandler = null,
?EventDispatcherInterface $eventDispatcher = null,
?LoggerInterface $logger = null,
?ErrorHandlerInterface $errorHandler = null,
Comment thread
Tamara-Barum marked this conversation as resolved.
$skipJsonValidation = false,
UserProfileServiceInterface $userProfileService = null,
ProjectConfigManagerInterface $configManager = null,
NotificationCenter $notificationCenter = null,
?UserProfileServiceInterface $userProfileService = null,
?ProjectConfigManagerInterface $configManager = null,
?NotificationCenter $notificationCenter = null,
Comment thread
Tamara-Barum marked this conversation as resolved.
$sdkKey = null,
array $defaultDecideOptions = []
) {
Comment thread
Tamara-Barum marked this conversation as resolved.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class OptimizelyConfigService

private ProjectConfigInterface $projectConfig;

public function __construct(ProjectConfigInterface $projectConfig, LoggerInterface $logger = null)
public function __construct(ProjectConfigInterface $projectConfig, ?LoggerInterface $logger = null)
{
$this->experiments = $projectConfig->getAllExperiments();
$this->featureFlags = $projectConfig->getFeatureFlags();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ public function __construct(
$fetchOnInit = true,
$datafile = null,
$skipJsonValidation = false,
LoggerInterface $logger = null,
ErrorHandlerInterface $errorHandler = null,
NotificationCenter $notificationCenter = null,
?LoggerInterface $logger = null,
?ErrorHandlerInterface $errorHandler = null,
?NotificationCenter $notificationCenter = null,
$datafileAccessToken = null
) {
$this->_skipJsonValidation = $skipJsonValidation;
Expand Down
2 changes: 1 addition & 1 deletion src/Optimizely/Utils/Validator.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class Validator
*
* @return boolean Representing whether schema is valid or not.
*/
public static function validateJsonSchema($datafile, LoggerInterface $logger = null)
public static function validateJsonSchema($datafile, ?LoggerInterface $logger = null)
{
$data = json_decode($datafile);

Expand Down
2 changes: 1 addition & 1 deletion src/Optimizely/Utils/VariableTypeUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

class VariableTypeUtils
{
public static function castStringToType($value, $variableType, LoggerInterface $logger = null)
public static function castStringToType($value, $variableType, ?LoggerInterface $logger = null)
{
if ($variableType == FeatureVariable::STRING_TYPE) {
return $value;
Expand Down
Loading