PHP keyword uppercase/lowercase conversion

Hi,

I found the checkbox 'Convert Keywords to lower case' in Settings > Code Style > PHP > Code Conversion.

But I would like to specify which keywords should be converted and which should not.

Example:

<?php

class Baz {
    public float $prop;

  PUBLIC STATIC function foo(bool $one = NULL, int $two = 0, string $three = "String"): int {...}

I would like to set the keywords before word 'function' to be uppercase ('PUBLIC STATIC function'), but the keywords when declaring a variable should stay lowercase ('public float $prop'). Is this possible to set up?

I know I can do it manually, but it would be nice to just hit Alt+Shift+L.

 

Thanks.

1

Unfortunately, there is no option to specify what exact keywords should be capitalized or vice versa. The only solution that quickly comes to my mind is to use macro like:

- Open Find (ctrl+f);
- Type what you need to change (like "public function")
- Hit "Select all occurrences"
- Invoke "Toggle case" option

It is not elegant at all but should do the trick (macro can be assigned to specific key combo).

0

请先登录再写评论。