![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
php-imports
Advanced tools
JavaScript library for formatting PHP imports.
$ npm i --save php-imports
or
$ yarn add php-imports
This package provides basic cli:
PHP imports formatter
USAGE
$ php-imports [FILE]
OPTIONS
-V, --verbose Print more info
-c, --config=config JSON configuration
-f, --flag=flag Specify configuration key-value pair
-h, --help show CLI help
-p, --project=project [default: .] Project directory or .phpimportsrc file
-v, --version show CLI version
--dry Don't write any changes to files
--init Create .phpimportsrc file
By default, it uses .phpimportsrc file located at current working directory.
It is a json file that contains configuration for this package. You can create this file with $ php-imports --init
.
Also, you can specify these flags with -f
argument:
$ php-imports -f unused.enable=true
It can contain the following options (dot means object nesting):
root
: Base location of sources. Default is .
(current working directory).
include
: List of files to include (glob patterns) relatively to root (default is src/**/*.php
).
exclude
: List of files to exclude (relatively to root, default is node_modules
and vendor
).
order
: Order of import sets and empty lines between them. An array of enums with possible values:
emptyLine
all.all
all.class
all.function
all.const
singleUses.all
singleUses.class
singleUses.function
singleUses.const
groupedUses.all
groupedUses.class
groupedUses.function
groupedUses.const
sort.order
: Order of first-level imports. Possible values: default
(alphabetical) or natural
(first longest, alphabetical).
sort.nestedOrder
: Order of second-level imports. Possible values: default
(alphabetical) or natural
(first longest, alphabetical).
print.emptyLinesAfterImports
: Count of empty lines between last import and the declaration after it.
print.wrap
: If false, then nested groups are never wrapped, if true (which is default), then they are always in separate lines.
You can also set it to number to start wrapping only when line length exceeds that limit.
Alternatively it can be set to object {"all":false,"limit":120}
in order to put as much as possible imports in single line with wrapping still enabled.
psr12.enable
: Enable PSR-12 imports formatting.
psr12.isolateModifiers
: Whether to put different modifiers (without modifier, const and function) to different groups.
psr12.minNestedGroupNestedUsesCount
: Minimum count of nested uses to make a nested group with them.
psr12.minNestedGroupUsesCount
: Mimimum count of uses to make a nested group with them.
psr12.minGroupUsesCount
: Mimimum count of uses of same namespace to make a group with them.
custom.enable
: Enable custom imports formatting.
custom.isolateModifiers
: Whether to put different modifiers (without modifier, const and function) to different groups.
custom.include
: A list of namespaces that should always be grouped. Can be used with wildcards (*) and double wildcards (**).
custom.exclude
: A list of namespaces that should never be grouped.
unused.enable
: Clean up unused imports.
The project is released under the MIT license. Read the license for more information.
FAQs
JavaScript library for formatting PHP imports
The npm package php-imports receives a total of 6 weekly downloads. As such, php-imports popularity was classified as not popular.
We found that php-imports demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.