Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix formatting for typed field and const alignment #7190 #7423

Conversation

junichi11
Copy link
Member

Example:

class GH7190 {

       private const ?string C1   = '';
    public const ?string CCCC2 = '';
    const ?string CCCC3 = '';

       private ?Test $t2;
      private ?Test $t3       = null;
    private readonly Test1&Test2 $t4;
         private array|(Test2&Test3) $test5 = [];
}

Before:

class GH7190 {

    private const ?string C1    = '';
    public const ?string CCCC2 = '';
    const ?string CCCC3 = '';

    private ?Test $t2;
    private ?Test $t3    = null;
    private readonly Test1&Test2 $t4;
    private array|(Test2&Test3) $test5 = [];
}

After:

class GH7190 {

    private const ?string C1   = '';
    public const ?string CCCC2 = '';
    const ?string CCCC3        = '';

    private ?Test $t2;
    private ?Test $t3                  = null;
    private readonly Test1&Test2 $t4;
    private array|(Test2&Test3) $test5 = [];
}

@junichi11 junichi11 added the PHP [ci] enable extra PHP tests (php/php.editor) label May 31, 2024
@junichi11 junichi11 added this to the NB23 milestone May 31, 2024
@junichi11 junichi11 linked an issue May 31, 2024 that may be closed by this pull request
@junichi11 junichi11 requested a review from tmysik June 2, 2024 22:49
- apache#7190
- Add a field type name length
- Fix const name length
- Add unit tests

Example:

```php
class GH7190 {

       private const ?string C1   = '';
    public const ?string CCCC2 = '';
    const ?string CCCC3 = '';

       private ?Test $t2;
      private ?Test $t3       = null;
    private readonly Test1&Test2 $t4;
         private array|(Test2&Test3) $test5 = [];
}
```

Before:

```php
class GH7190 {

    private const ?string C1    = '';
    public const ?string CCCC2 = '';
    const ?string CCCC3 = '';

    private ?Test $t2;
    private ?Test $t3    = null;
    private readonly Test1&Test2 $t4;
    private array|(Test2&Test3) $test5 = [];
}
```

After:

```php
class GH7190 {

    private const ?string C1   = '';
    public const ?string CCCC2 = '';
    const ?string CCCC3        = '';

    private ?Test $t2;
    private ?Test $t3                  = null;
    private readonly Test1&Test2 $t4;
    private array|(Test2&Test3) $test5 = [];
}
```
@junichi11 junichi11 force-pushed the php-gh-7190-formatting-for-typed-fields-alignment branch from cce07cb to f586da1 Compare June 5, 2024 02:50
@junichi11 junichi11 merged commit 66d637f into apache:master Jun 5, 2024
33 checks passed
@junichi11 junichi11 deleted the php-gh-7190-formatting-for-typed-fields-alignment branch June 5, 2024 09:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PHP [ci] enable extra PHP tests (php/php.editor)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Formatting problems in class properties defaults declaration in PHP
2 participants