Problem/Motivation
5) web/modules/orig/firebase_php/src/Form/FirebasePhpConfigurationForm.php:19
---------- begin diff ----------
@@ Line 19 @@
*/
final class FirebasePhpConfigurationForm extends ConfigFormBase {
- const FORM_ID = 'firebase_php.settings';
+ const string FORM_ID = 'firebase_php.settings';
public function __construct(
ConfigFactoryInterface $config_factory,
@@ Line 34 @@
*/
#[\Override]
public static function create(ContainerInterface $container): static {
- return new static(
+ return new self(
$container->get('config.factory'),
$container->get('config.typed'),
$container->get('file_system'),
----------- end diff -----------
Applied rules:
* NewStaticToNewSelfRector
* AddTypeToConstRector
6) web/modules/orig/firebase_php/src/Service/FirebasePhpMessagingApi.php:369
---------- begin diff ----------
@@ Line 369 @@
if (isset($payload['data']) && is_array($payload['data'])) {
$summary['data_keys'] = array_values(array_filter(
array_keys($payload['data']),
- static fn(mixed $key): bool => is_string($key),
+ is_string(...),
));
}
----------- end diff -----------
Applied rules:
* ArrowFunctionDelegatingCallToFirstClassCallableRector
7) web/modules/orig/firebase_php/tests/src/Unit/Service/FirebasePhpMessagingApiTest.php:48
---------- begin diff ----------
@@ Line 48 @@
?ImmutableConfig $config = NULL,
?LoggerInterface $logger = NULL,
): FirebasePhpMessagingApi {
- $api = (new \ReflectionClass(FirebasePhpMessagingApi::class))
+ $api = new \ReflectionClass(FirebasePhpMessagingApi::class)
->newInstanceWithoutConstructor();
// $messaging is a public property declared on the parent service.
$api->messaging = $messaging;
@@ Line 135 @@
*/
private function invalidMessageWithCode(int $code): InvalidMessage {
$exception = new InvalidMessage('bad message');
- (new \ReflectionProperty($exception, 'errors'))
+ new \ReflectionProperty($exception, 'errors')
->setValue($exception, ['error' => ['code' => $code]]);
return $exception;
}
----------- end diff -----------
Applied rules:
* NewMethodCallWithoutParenthesesRector
Comments
Comment #4
ptmkenny commented