Download the PHP package staempfli/typo3-conventions-checker without Composer

On this page you can find all versions of the php package staempfli/typo3-conventions-checker. 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 typo3-conventions-checker

TYPO3 Conventions Checker

What does it do?

This package lets you automatically test any changed code against the TYPO3 file formatting requirements right before you commit your changes. It also forces you to keep the commit messages tidy, according to the TYPO3 contribution workflow. There are some checks we're leaving out, though, as the commit message structure applies to TYPO3 core contributions and we're not usually committing to the core repository in our projects, eh.

This works via Git hooks, so every time you type 'git commit ...', the configured GrumPHP tasks get fired.

The package itself doesn't do much, honestly. :) It provides some configuration and requires some dependencies to get your code quality and conventions checks set up in no time.

But how does it do it?

Pretty simple. It requires GrumPHP which hits up the PHP Coding Standards Fixer and well as the PHP Mess Detector on each and every commit of yours. Only the files you're trying to commit are getting checked for any coding standards violations or code messes.

Installing

Prerequisites / TYPO3 project setup

This package expects you work with a composer-based TYPO3 setup, having a (probably versioned) composer manifest outside your public html directory called 'web' (though you may of course reconfigure this directory's name). Something along the lines of:

(Alternatively, you can create a custom grumphp.yml file in your git root directory, this will work as well).

Options and Customizing

Default configuration

Per default, this package uses

Override (i.e. 'extend') configuration

For this to work, you need to create your own grumphp.yml in your git root directory according to the GrumPHP configuration. In there, you may reference this package's grumphp configuration and override the settings.

Important notice on inheritance: To my knowledge, it is not possible to recursively inherit task settings, meaning: you override one property/setting of a task (see example below), you need to re-define all tasks and their settings. See the grumphp configuration provided for extensions.

Example 1: Reconfiguring the git commit message restrictions

Let's say you want to limit the git commit message length to 42 characters. Update your grumphp.yml from

to something like

Example 2: Customizing the php-cs-fixer configuration

Like in the first example: reconfigure this via the grumphp configuration. This time though, reference a different (your own) php-cs-fixer configuration:

Initializing extensions

Let's say, you maintain an extension 'mynews' and of course, you want the code of 'mynews' to comply with some coding standards as well. You're working on the main project, where 'mynews' is included as a dependency but you'll probably introduce changes to 'mynews' while working on the main project. But, because 'mynews' is its own git repository, it doesn't get checked by GrumPHP automatically if you just initialized GrumPHP on your main project as described above.

Lucky you! You're just 2 baby steps away from forcing all commits to 'mynews' to get checked by GrumPHP.

  1. Add a reference to a grumphp.yml configuration via composer manifest of the 'mynews' extension or create a custom grumphp.yml in the extension's root directory. Note that this package already provides a dedicated grumphp configuration that respects the extension directory nesting.

Via 'extra' section of the composer manifest of the extension:

Via grumphp.yml in the root directory of the extension:

  1. In your root composer manifest, run the 'initializeExtensions' method via composer scripts. Let's say, after each composer update, eh?


Windows users

There currently is a bug, which leads to wrong paths of the grumphp executable in the git hooks when used inside extensions as described above. You might experience git cli responding with an error that the GrumPHP executable could not be found. The reason for that is the wrong registration in .git/hooks/pre-commit as well as .git/hooks/commit-message.

Solution: In the files mentioned above, the calls to GrumPHP might look something like this:

Notice that the path to the GrumPHP executable is not in enclosed in quotes and will lead to errors. Just enclose "X:\path (...) grumphp" in double quotes and you're all set:


All versions of typo3-conventions-checker with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
phpro/grumphp Version *
friendsofphp/php-cs-fixer Version *
phpmd/phpmd Version *
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 staempfli/typo3-conventions-checker contains the following files

Loading the files please wait ....