Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LPAL-754/LPAL-823 Upgrade service-admin and service-front to PHP 8.1 (#…
…965) * Add psalm as service-admin dev dependency * Update service-admin psalm config to match other components * First pass of level 4 psalm check * Implement simplified LoggerTrait The MakeLogger LoggerTrait is designed to work with laminas-mvc apps and will not work correctly in service-admin (which is not a laminas-mvc app). Implement a simple alternative logger which can be used within service-admin as a drop-in replacement for MakeLogger. As we are not so concerned about logging trace IDs here, we can resort to logging errors directly and not as JSON. If this is unacceptable, we will have to consider rewriting the MakeLogger code so we can output JSON in non-laminas-mvc apps. The code in this commit improves things, as at the moment I would expect logging to fail completely for service-admin due to missing laminas-mvc dependencies. * Second pass of pass of level 4 psalm check * Comment out currently-unused class Once the issue with slim-jwt-auth is fixed (see tuupola/slim-jwt-auth#217), we can reinstate that library as the JWT solution as follows: * Add tuupola/slim-jwt-auth back into composer.json * Remove tuupola/http-factory and tuupola/callable-handler (these are dependencies of tuupola/slim-jwt-auth and will be installed by that library; we no longer need to reference them directly once slim-jwt-auth is back in place) * Uncomment body of App\Middleware\Session\JwtAuthenticationFactory class * Remove App\Middleware\Session\JwtMiddleware file * Remove App\Middleware\Session\JwtMiddlewareFactory file * Uncomment lines 67-68 and remove lines 69-70 of ConfigProvider.php For more context, see commit 3efaa3b in this repo. * Update to PHP 8.1 in composer config * Set a default form element value of '' if it is null * Upgrade to PHP 8.1 in service-admin docker container * Update to version 14 of opg-lpa-datamodels * psalm scan service-admin with PHP 8.1 * Update composer dependencies * Upgrade front-app docker image to PHP 8.1 * Passing null to DateTime is deprecated When we get the last login time for a user, we set this to null if they have not logged in before. This value is then passed to new DateTime($lastLogin). However, PHP 8.1 is not happy with passing a null to the DateTime constructor and throws a deprecation message. Default this value to 'now' if the user has never logged in before to fix. * Move simplified LoggerTrait into MakeLogger shared directory
- Loading branch information