diff --git a/examples/OAuthProviderFactory.php b/examples/OAuthProviderFactory.php index 563add16..639c2a15 100644 --- a/examples/OAuthProviderFactory.php +++ b/examples/OAuthProviderFactory.php @@ -43,9 +43,9 @@ public function __construct( protected UriFactoryInterface $uriFactory, protected string $cfgDir = __DIR__.'/../config', string $envFile = '.env', - string $logLevel = null, + string|null $logLevel = null, ){ - ini_set('date.timezone', 'Europe/Amsterdam'); + ini_set('date.timezone', 'UTC'); $this->dotEnv = (new DotEnv($this->cfgDir, $envFile, false))->load(); $this->logger = $this->initLogger($logLevel); diff --git a/examples/provider-example-common.php b/examples/provider-example-common.php index 63b86b17..a695ac7b 100644 --- a/examples/provider-example-common.php +++ b/examples/provider-example-common.php @@ -20,16 +20,16 @@ /** * these vars are supposed to be set before this file is included to ease testing * + * @var string $CFGDIR - the directory where configuration is stored (.env, cacert, tokens) * @var string $ENVFILE - the name of the .env file in case it differs from the default * @var string $ENVVAR - name prefix for the environment variable - * @var string $CFGDIR - the directory where configuration is stored (.env, cacert, tokens) * @var string $LOGLEVEL - log level for the test logger, use 'none' to suppress logging * @var array|null $PARAMS - additional params to pass to getAuthURL() * @var array|null $SCOPES - a set of scopes for the current provider (OAuth2 only) */ +$CFGDIR ??= __DIR__.'/../config'; $ENVFILE ??= '.env'; $ENVVAR ??= ''; -$CFGDIR ??= __DIR__.'/../config'; $LOGLEVEL ??= 'info'; $PARAMS ??= null; $SCOPES ??= null; diff --git a/src/Core/OAuthProvider.php b/src/Core/OAuthProvider.php index 8aa5b5d6..51a5f94f 100644 --- a/src/Core/OAuthProvider.php +++ b/src/Core/OAuthProvider.php @@ -315,7 +315,7 @@ protected function getRequestBody(StreamInterface|array|string $body, RequestInt } - throw new ProviderException('invalid body/content-type'); // @codeCoverageIgnore + throw new ProviderException('invalid body/content-type'); } /** diff --git a/src/OAuthOptionsTrait.php b/src/OAuthOptionsTrait.php index 03a63d0a..598d9ddd 100644 --- a/src/OAuthOptionsTrait.php +++ b/src/OAuthOptionsTrait.php @@ -34,6 +34,8 @@ trait OAuthOptionsTrait{ /** * Whether to start the session when session storage is used * + * Note: this will only start a session if there is no active session present + * * @see \chillerlan\OAuth\Storage\SessionStorage */ protected bool $sessionStart = true;