
phpdoc_types_order
¶Sorts PHPDoc types.
sort_algorithm
¶The sorting algorithm to apply.
Allowed values: 'alpha'
and 'none'
Default value: 'alpha'
null_adjustment
¶Forces the position of null
(overrides sort_algorithm
).
Allowed values: 'always_first'
, 'always_last'
and 'none'
Default value: 'always_first'
case_sensitive
¶Whether the sorting should be case sensitive.
Allowed types: bool
Default value: false
Default configuration.
--- Original
+++ New
<?php
/**
- * @param string|null $bar
+ * @param null|string $bar
*/
With configuration: ['null_adjustment' => 'always_last']
.
--- Original
+++ New
<?php
/**
- * @param null|string $bar
+ * @param string|null $bar
*/
With configuration: ['sort_algorithm' => 'alpha']
.
--- Original
+++ New
<?php
/**
- * @param null|string|int|\Foo $bar
+ * @param null|\Foo|int|string $bar
*/
With configuration: ['sort_algorithm' => 'alpha', 'null_adjustment' => 'always_last']
.
--- Original
+++ New
<?php
/**
- * @param null|string|int|\Foo $bar
+ * @param \Foo|int|string|null $bar
*/
With configuration: ['sort_algorithm' => 'alpha', 'null_adjustment' => 'none']
.
--- Original
+++ New
<?php
/**
- * @param null|string|int|\Foo $bar
+ * @param \Foo|int|null|string $bar
*/
With configuration: ['case_sensitive' => true]
.
--- Original
+++ New
<?php
/**
- * @param Aaa|AA $bar
+ * @param AA|Aaa $bar
*/