Download the PHP package ocreaper/naming-convention-analyzer without Composer

On this page you can find all versions of the php package ocreaper/naming-convention-analyzer. 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 naming-convention-analyzer

ocReaper naming convention analyzer

Latest version Downloads

ocReaper naming convention analyzer for PHP_CodeSniffer provides sniffs that ensure proper variable and function naming.

The ensured convention is identical to kettanaito/naming-cheatsheet.

The project uses tbrianjones/Inflect.php to handle pluralization.

Table of contents

  1. Sniffs included in this standard
  2. Installation
  3. How to run the sniffs
    • Choose which sniffs to run
    • Using all sniffs from the standard
  4. Fixing errors automatically
  5. Suppressing sniffs locally
  6. Contributing

Sniffs included in this standard

🔧 = Automatic errors fixing

NamingConventionAnalyzer.Functions.ActionPrefix

Ensures that a function must start with a verb. In case the function starts with a prefix: the second word will be used in check.

NamingConventionAnalyzer.Functions.BoolPrefix

Ensures that functions that returns boolean value must start with:

NamingConventionAnalyzer.Functions.ContextDuplication

Ensures that a function does not duplicate the name of the class it belongs to.

NamingConventionAnalyzer.Variables.ContextDuplication

Ensures that a variable does not duplicate the name of the function it belongs to.

NamingConventionAnalyzer.Variables.SingularPlural

Ensures that the name of those variables that are containing non-associative arrays are in plural.

Squiz.NamingConventions.ValidFunctionName.NotCamelCaps

Ensures that function names are in camel case.

Squiz.NamingConventions.ValidVariableName.NotCamelCaps

Ensures that variable names are in camel case.

Squiz.NamingConventions.ValidVariableName.MemberNotCamelCaps

Ensures that class member names are in camel case.

Squiz.NamingConventions.ValidVariableName.StringNotCamelCaps

Ensures that variable names inside a doublequoted string are in camel case.

Installation

The recommended way to install ocReaper naming convention analyzer is through Composer.

How to run the sniffs

You can choose one of two ways to run only selected sniffs from the standard on your codebase:

Choose which sniffs to run

The recommended way is to write your own ruleset.xml by referencing only the selected sniffs. This is a sample ruleset.xml:

Then run the phpcs executable the usual way:

Exclude sniffs you don't want to run

You can also mention ocReaper naming convention analyzer in your project's ruleset.xml and exclude only some sniffs:

However it is not a recommended way to use ocReaper naming convention analyzer, because your build can break when moving between minor versions of the standard (which can happen if you use ^ or ~ version constraint in composer.json). I regularly add new sniffs even in minor versions meaning your code won't most likely comply with new minor versions of the package.

Fixing errors automatically

Sniffs in this standard marked by the 🔧 symbol support automatic fixing of coding standard violations. To fix your code automatically, run phpcbf instead of phpcs:

Always remember to back up your code before performing automatic fixes and check the results with your own eyes as the automatic fixer can sometimes produce unwanted results.

Contributing

To make this repository work on your machine, clone it and run these two commands in the root directory of the repository:


All versions of naming-convention-analyzer with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1
dealerdirect/phpcodesniffer-composer-installer Version ^0.6.2 || ^0.7
squizlabs/php_codesniffer Version ^3.5.6
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 ocreaper/naming-convention-analyzer contains the following files

Loading the files please wait ...