Download the PHP package mmoreram/php-formatter without Composer

On this page you can find all versions of the php package mmoreram/php-formatter. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package php-formatter

PHP Formatter

Build Status

This PHP formatter aims to provide you some bulk actions for you PHP projects to ensure their consistency. None of them fixes PSR rules. If you want to fix PSR rules, please check friendsofphp/php-cs-fixer.

Install

Install PHP Formatter in this way:

If it is the first time you globally install a dependency then make sure you include ~/.composer/vendor/bin in $PATH as shown here.

Always keep your PHP Formatter installation up to date:

.phar file

You can also use already last built .phar.

You can copy the .phar file as a global script

Compile

Finally you can also compile your own version of the package. ( You need set phar.readonly = Off in your php.ini ). For the compilation of this package you need the box-project/box2 library.

You can copy the .phar file as a global script

Config

You can place a file named .formatter.yml in the root of your project. In every command execution, this will be the priority of the definitions.

If an option is set in the command, this will be used. Otherwise, if is defined in a found config file, this will be used. Otherwise, default value will be used.

This is the config reference

you can also define where to search the .formatter.yml file using the --config|-c option

Commands

PHP Formatter is a set of commands useful for your PHP projects. They do not consider any kind of Common Coding Standard, like PSR-0 or PSR-1, is more like a useful way of working for developers and reviewers.

Sort all Use Statements

You can sort your Use Statements in different ways. For this command you must provide as an argument the path where to look for the PHP files you want to process.

Group

You can sort your Use statements using as many groups as you want (--group). It means that you can group lines with same root (Symfony\) in a specific order.

Common group is named _main and if is not specified, is placed in the beginning. You can define where to place this group with the --group option

This command will sort the code like this

As you can see, a blank line is placed between groups. If any group is defined, one big group is created with all namespaces.

When using a .formatter.yml you can also specify subgroups by entering an array

This will create a Symfony group placing all Symfony\Component\HttpKernel classes on top.

Finally, the --group-type defines if you want one use literal in every namespace line

This command will sort the code like this

or if you want only one use for all groups.

This command will sort the code like this

Sort

There are two options of sorting. You can sort your namespaces alphabetically (default value)

This command will sort the code like this

or by length (two namespaces with same length will be sorted alphabetically)

This command will sort the code like this

You can also define the direction of the sorting. This can be ascending (default value)

This command will sort the code like this

or descending

This command will sort the code like this

Fix all PHP headers

You can define your PHP header in your .formatter.yml file and this command will check and fix that all PHP files have it properly.

Fix all strict declarations

In your >=7.0 PHP applications you can use simple type declarations in your methods. You can define your application as relaxed as you want by declaring the strict_mode variable in your files. Each php file must be configured itself, so in order to make sure all your files have the definition after the header if exists and before the namespace declaration, you can use this command.

You can have three values here. If you define a boolean, then each file found will have the declaration with the boolean given.

Otherwise, if you define a '~' value then your declaration lines will be removed.

Exclude folders/files

You can exclude folders and files by using the multi-option --exclude as many times as you need. This option works the same way the Symfony component Finder works, so to make sure you properly understand the way this option works, just check the documentation.

In that case, maybe the most used way, you will exclude all vendors from your process.

Dry run

You can use this tool just to test the files will be modified, using option --dry-run

Any command from this library will never have any impact in your code as long as you have defined this option.


All versions of php-formatter with dependencies

PHP Build Version
Package Version
Requires php Version >=7.0
symfony/console Version ^3.2||^4.0
symfony/process Version ^3.2||^4.0
symfony/finder Version ^3.2||^4.0
symfony/filesystem Version ^3.2||^4.0
symfony/yaml Version ^3.2||^4.0
symfony/event-dispatcher Version ^3.2||^4.0
symfony/property-access Version ^3.2||^4.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package mmoreram/php-formatter contains the following files

Loading the files please wait ....