-
Notifications
You must be signed in to change notification settings - Fork 11
Description
Problem
I think that by default the variable $_environment in Configuration.php should be set to "production", not null.
I feel like if someone specifically wants no SSL, then he can use Trolley\Configuration::environment("localhost"); and if you're doing development on the library, then you can use development , but by default SSL should be enabled and the https://api.trolley.com API_SERVER should be used, like set in production 😃
Do you agree ?
Fix proposed
You could set private $_environment = "production"
OR
You could modify the code to allow a null $_environment everywhere in it
Ex: I noticed an issue in the sslOn() function that throws an error when the string is empty because the 1st param of substr() function (Configuration.php line 473 ) cannot be null :
substr(): Passing null to parameter #1 ($string) of type string is deprecated
in vendor\/trolley\/core\/lib\/Trolley\/Configuration.php
OR
(not really a fix but it would have saved me half an hour)
You could document that users have to use Trolley\Configuration::environment("production"); in the readme
Or maybe you have another idea, or there's a reason for that specific setup due to concerns I haven't already met...
Thank you !