Download the PHP package tightenco/tlint without Composer

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

TLint Logo


Latest Version on Packagist

Install (Requires PHP 8.1+)

Note TLint is intended to work with the tools included in Duster. To receive the best coverage we recommend using Duster to install and configure TLint.

Upgrade

Upgrading from 8.x to 9.x

TLint 9 requires PHP >= 8.1.

tformat.json has been dropped in favor of a single tlint.json file.

Now linting the following files and directories:

To continue excluding these files and directories add them to your tlint.json file under excluded.

Upgrading from 7.x to 8.x

A significant number of formatters were added between the 7.x and 8.x releases. If you want to roll these out gradually or disable them altogether, you can use the disabled setting in your tlint.json config.

Upgrading from 6.x to 7.x

TLint focuses on linting and formatting issues other tools are not able to catch. The 7.x release removes lints and formatters covered by tools in Duster. If you need to add these back you can grab them from an earlier version of TLint and follow the Custom Configuration documentation.

What Is It?

This is an opinionated code linter (with growing support for auto-formatting!) for Tighten flavored code conventions for Laravel and PHP.

For example, Laravel has many available ways to pass variables from a controller to a view:

A)

B)

C)

In this case TLint will warn if you are not using the B) method. This example is a sort of "meta layer" of code linting, allowing teams to avoid higher level sticking points of code review / discussions.

Usage

For entire project (you must pass the lint command to use other options)

For individual files and specific directories

You can also lint only diff files by running the following with unstaged git changes

Want the output from a file as JSON? (Primarily used for integration with editor plugins)

Want the output from a file as a checkstyle XML report? (Primarily used with CI tools like reviewdog and cs2pr)

Want to only run a single linter?

Example Output

Formatting

Using the same conventions as above, but using the format command, you can auto-fix some lints:

Linting Configuration

TLint Ships with 2 "preset" styles: Laravel & Tighten. The Laravel preset is intended to match the conventions agreed upon by the Laravel framework contributors, while the Tighten preset is intended to match those agreed upon by Tighten team members.

The default configuration is "tighten" flavored, but you may change this by adding a tlint.json file to your project's root directory with the following schema:

You may further customize the linters used by adding specific lint names to the "disabled" list. You may disable linting for specific directories by adding them to the "excluded" list. You may provide custom paths by adding them to the "paths" lists.

Custom Configuration & Presets

You can also add your own custom preset and linters by providing a fully-qualified class name as the preset. For example, if you created a custom preset class:

Then your config could look like:

This lets you define custom linting/formatting functionality, or modify the existing linters/formatters to your liking.

Editor Integrations

PHPStorm

Sublime

VSCode

Available Linters

Linter Description
ApplyMiddlewareInRoutes Apply middleware in routes (not controllers).
ArrayParametersOverViewWith Prefer view(..., [...]) over view(...)->with(...).
FullyQualifiedFacades Import facades using their full namespace.
MailableMethodsInBuild Mailable values (from and subject etc) should be set in build().
NoDatesPropertyOnModels The $dates property was deprecated in Laravel 8. Use $casts instead.
NoDocBlocksForMigrationUpDown Remove doc blocks from the up and down method in migrations.
NoJsonDirective Use blade {{ $model }} auto escaping for models, and double quotes via json_encode over @json blade directive: <vue-comp :values='@json($var)'> -> <vue-comp :values="{{ $model }}"> OR <vue-comp :values="{!! json_encode($var) !!}">
NoLeadingSlashesOnRoutePaths No leading slashes on route paths.
NoRequestAll No request()->all(). Use request()->only(...) to retrieve specific input values.
NoSpaceAfterBladeDirectives No space between blade template directive names and the opening paren:@section ( -> @section(
OneLineBetweenClassVisibilityChanges Class members of differing visibility must be separated by a blank line
PureRestControllers You should not mix restful and non-restful public methods in a controller
QualifiedNamesOnlyForClassName Fully Qualified Class Names should only be used for accessing class names
RemoveLeadingSlashNamespaces Prefer Namespace\... over \Namespace\....
RequestHelperFunctionWherePossible Use the request(...) helper function directly to access request values wherever possible
RequestValidation Use request()->validate(...) helper function or extract a FormRequest instead of using $this->validate(...) in controllers
SpaceAfterBladeDirectives Put a space between blade control structure names and the opening paren:@if( -> @if (
SpacesAroundBladeRenderContent Spaces around blade rendered content:{{1 + 1}} -> {{ 1 + 1 }}
UseAnonymousMigrations Prefer anonymous class migrations.

General PHP

Laravel

Available Formatters

Notes about formatting

Formatter Description
ArrayParametersOverViewWith Prefer view(..., [...]) over view(...)->with(...).
FullyQualifiedFacades Import facades using their full namespace.
MailableMethodsInBuild Mailable values (from and subject etc) should be set in build().
NoDatesPropertyOnModels Use $casts instead of $dates on Eloquent models.
NoDocBlocksForMigrationUpDown Removes doc blocks from the up and down method in migrations.
NoLeadingSlashesOnRoutePaths No leading slashes on route paths.
NoSpaceAfterBladeDirectives No space between blade template directive names and the opening paren:@section ( -> @section(
OneLineBetweenClassVisibilityChanges Class members of differing visibility must be separated by a blank line
RemoveLeadingSlashNamespaces Prefer Namespace\... over \Namespace\....
RequestHelperFunctionWherePossible Use the request(...) helper function directly to access request values wherever possible
RequestValidation Use request()->validate(...) helper function or extract a FormRequest instead of using $this->validate(...) in controllers
SpaceAfterBladeDirectives Put a space between blade control structure names and the opening paren:@if( -> @if (
SpacesAroundBladeRenderContent Spaces around blade rendered content:{{1 + 1}} -> {{ 1 + 1 }}
UseAnonymousMigrations Prefer anonymous class migrations.

General PHP

Laravel

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

Credits

License

The MIT License (MIT). Please see License File for more information.


All versions of tlint with dependencies

PHP Build Version
Package Version
Requires php Version >=8.1
illuminate/view Version *
nikic/php-parser Version ^5.0
symfony/console Version ^6.1||^7.0
symfony/process Version ^6.1||^7.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 tightenco/tlint contains the following files

Loading the files please wait ....