Skip to content

Commit

Permalink
GlobalNamespaceImportFixer - Introduction
Browse files Browse the repository at this point in the history
  • Loading branch information
gharlan authored and SpacePossum committed Oct 11, 2019
1 parent 68c932a commit 41fe1f4
Show file tree
Hide file tree
Showing 12 changed files with 2,084 additions and 0 deletions.
13 changes: 13 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,19 @@ Choose from the list of available rules:
- ``annotations`` (``array``): list of annotations to remove, e.g. ``["author"]``;
defaults to ``[]``

* **global_namespace_import**

Imports or fully qualifies global classes/functions/constants.

Configuration options:

- ``import_classes`` (``false``, ``null``, ``true``): whether to import, not import or
ignore global classes; defaults to ``true``
- ``import_constants`` (``false``, ``null``, ``true``): whether to import, not import or
ignore global constants; defaults to ``null``
- ``import_functions`` (``false``, ``null``, ``true``): whether to import, not import or
ignore global functions; defaults to ``null``

* **hash_to_slash_comment**

Single line comments should use double slashes ``//`` and not hash ``#``.
Expand Down
9 changes: 9 additions & 0 deletions src/Fixer/ConstantNotation/NativeConstantInvocationFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,15 @@ public function getDefinition()
);
}

/**
* {@inheritdoc}
*/
public function getPriority()
{
// must be run before GlobalNamespaceImportFixer
return 10;
}

/**
* {@inheritdoc}
*/
Expand Down
9 changes: 9 additions & 0 deletions src/Fixer/FunctionNotation/NativeFunctionInvocationFixer.php
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,15 @@ function baz($options)
);
}

/**
* {@inheritdoc}
*/
public function getPriority()
{
// must be run before GlobalNamespaceImportFixer
return 10;
}

/**
* {@inheritdoc}
*/
Expand Down

0 comments on commit 41fe1f4

Please sign in to comment.