Download the PHP package crmplease/coder without Composer

On this page you can find all versions of the php package crmplease/coder. 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 coder

Coder

Coder is library for code-generation, e.g. add property to class, parameter to method, value to array and etc. Library is based on Rector.

Installation

This library should be installed as a dependency using Composer:

Get started

The facade class of this library is Coder, you need to just create it and call methods, example:

API

In all methods value can be:

In all methods key can be:

In all methods path is a path in array, if path not found, then it will be added. Path is array, so if we use path ['level1', 'level2'], then empty array became:

Use empty path if you want to change root level in array.

Parts of the path can be same as key:

If you need to pass code, which will be added as is, then you can use Code class:

If you need to pass some constant, the you can use Constant class :

Add to file return array by order

If value 'newValue' already exists in array, then nothing changed.

Example:

Became:

Add to method return array by order

If value 'newValue' already exists in array, then nothing changed.

Example:

Became:

Add to property array by order

If value 'newValue' already exists in array, then nothing changed.

Example:

Became:

Add to file return array by key

If key 'newKey' already exists in array, then value for this key will be changed to 'newValue'.

Example:

Became:

Add to method return array by key

If key 'newKey' already exists in array, then value for this key will be changed to 'newValue'.

Example:

Became:

Add to property array by key

If key 'newKey' already exists in array, then value for this key will be changed to 'newValue'.

Example:

Became:

Add property to class

If property exists, then property will be updated.

Example:

Became:

Add parameter to method:

If parameter exists, then type will be checked. If it's different, then RectorException will be thrown. If it's equal, then default value will be changed.

Example:

Became:

Add code to the end of method

In simple cases code duplicates is checked (when you try to add one line code).

Example:

Became:

Add method to class

If method exists, then signature and Phpdoc will be updated.

Example:

Became:

Add Phpdoc param to method

If Phpdoc for parameter already exists, then it will be removed and added again.

Example:

Became

Add Phpdoc property to class

If Phpdoc for property already exists, then it will be updated.

Example:

Became

You can add several properties:

Add Phpdoc method to class

If Phpdoc for method already exists, then it will be updated.

Example:

Became

You can add several methods:

Add trait to class

If trait is already used, then nothing will be changed.

Example:

Became:

Remove trait from class

If trait isn't used, then nothing will be changed.

Example:

Became:

Change class parent

If parent doesn't exists, then it will be added.

Example:

Became:

More complex example

More complex example with constants and code:

If value 'newValue' already exists in array, then nothing changed.

Example:

Became:

Config

You can provide config object when create coder:

Disable progress bar

By default rector shows progress bar when change files. You can disable it:

Auto import classes

By default auto import classes is disabled by config/rector.php. You can change default value or use mapping/callback for enable/disable auto import classes:

Path to rector config path

Rector config file for coder is config/rector.php or add new one:

For more information about rector configuration see rector documentation.

Internals

If you want to auto import classes, then change parameters.auto_import_names to true in config/rector.php.

You can run Rector using command line interface:

But command line interface doesn't allow to pass parameters to rectors. You can pass parameters using setters in config file config/rector.php config. For example:

AddToFileReturnArrayByOrderRector

Config for AddToFileReturnArrayByOrderRector:

AddToReturnArrayByOrderRector

Config for AddToReturnArrayByOrderRector:

AddToPropertyArrayByOrderRector

Config for AddToPropertyArrayByOrderRector:

AddToFileReturnArrayByKeyRector

Config for AddToFileReturnArrayByKeyRector:

AddToReturnArrayByKeyRector

Config for AddToReturnArrayByKeyRector:

AddToPropertyArrayByKeyRector

Config for AddToPropertyArrayByKeyRector:

AddPropertyToClassRector

Config for AddPropertyToClassRector:

AddParameterToMethodRector

Config for AddParameterToMethodRector:

AddCodeToMethodRector

Config for AddCodeToMethodRector:

AddMethodToClassRector

Config for AddMethodToClassRector:

AddTraitToClassRector

Config for AddTraitToClassRector:

RemoveTraitFromClassRector

Config for RemoveTraitFromClassRector:

AddPhpdocParamToMethodRector

Config for AddPhpdocParamToMethodRector:

AddPhpdocPropertyToClassRector

Config for AddPhpdocPropertyToClassRector:

AddPhpdocMethodToClassRector

Config for AddPhpdocMethodToClassRector:

ChangeClassParentRector

Config for ChangeClassParentRector:


All versions of coder with dependencies

PHP Build Version
Package Version
Requires rector/rector Version ^0.9.28
nikic/php-parser Version ^4.10
phpstan/phpdoc-parser Version ^0.4.10
symfony/dependency-injection Version ^5.2
symplify/set-config-resolver Version ^9.1
symplify/smart-file-system Version ^9.1
symplify/package-builder Version ^9.1
symfony/console Version ^5.2
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 crmplease/coder contains the following files

Loading the files please wait ....