Download the PHP package worksome/coding-style without Composer

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

Worksome Coding Style

Latest Stable Version Total Downloads Latest Unstable Version License

This repository contains the coding style followed by Worksome.

It includes configuration for ECS, PHPStan, and Rector.

Setup

Install this Composer package:

Run the generate command for generating the config files:

Add the following section to your composer.json file:

Usage

To use it, simply run one of the scripts added to composer.

ECS Rules

The Worksome code style extends the PSR-12 base rule set.

Excluded / Skipped Rules

Additional / Customised Rules

Note: Customised rules have a ⚙️ icon.

PhpCsFixer

PHP CodeSniffer

Slevomat Coding Standard

Symplify Coding Standard

Worksome

Custom PHPStan rules

The Worksome code style includes the following custom PHPStan rules.

Generic

Rules that are applied to all projects.

DeclareStrictTypes

Identifier: worksome.declareStrictTypes

This rule is used to ensure that all PHP files include with the declare(strict_types=1) statement.

DisallowPHPUnit

Identifier: worksome.disallowPhpunit

This rule prevents PHPUnit tests in favour of Pest PHP. It will allow abstract TestCase classes.

NamespaceBasedSuffix

Identifier: worksome.namespaceBasedSuffix

Sets up configuration for suffixing the following namespaces

This makes sures events, listeners, policies and jobs has the same suffix.

Laravel

Rules that are only applied in a Laravel context.

DisallowEnvironmentCheckRule

Identifier: worksome.laravel.disallowEnvironmentCheck

This rule will prevent checking the application environment, instead preferring that a driver based approach is used.

DisallowPartialRouteFacadeResource

Identifier: worksome.laravel.disallowPartialRouteResource

This rule disallows the usage of the Route::resource method when combined with only or except. Instead, partial route resources should be split into multiple routes.

DisallowPartialRouteVariableResourceRule

Identifier: worksome.laravel.disallowPartialRouteResource

Similar to DisallowPartialRouteVariableResourceRule, but prevents partial resource usage when used in a route group.

EnforceKebabCaseArtisanCommandsRule

Identifier: worksome.laravel.kebabCaseArtisanCommands

This rule will enforce the use of kebab-case for Artisan commands.

RequireWithoutTimestampsRule

Identifier: worksome.laravel.requireWithoutTimestamps

This rule enforces that all update, insert, save, saveQuietly, delete, restore, method calls within Laravel migration files are properly enclosed in a withoutTimestamps() context.

Custom PHP_CodeSniffer sniffs

The Worksome code style includes various custom PHP_CodeSniffer sniffs where auto-fixers via PHP CS Fixer are not possible.

Generic

Pascal-casing enum cases

This ensures that all enum cases use pascal-casing (e.g. Case::PascalCase).

Laravel

All custom sniffs specific to Laravel.

Config filename kebab case

Checks if all config files are written in kebab case.

Disallow compact usage

Makes sure that compact() isn't used in code.

Disallow env usage

Makes sure that you don't use env helper in your code, except for config files.

Disallow HasFactory usage

Ensures that the HasFactory trait is not used on models, this ensures that the factory class is called directly.

Event listener suffix

Enforces event listeners to end with a specific suffix, this suffix is defaulted to Listener.

parameters defaults
suffix Listener

Disallow blade outside the resources directory

Makes sure no .blade.php files exist outside of Laravel's resources directory.

parameters defaults
resourcesDirectory {YOUR_PROJECT}/resources

Exception suffix

This ensures that all Exception classes should have a suffix of Exception.

PhpDoc

All custom sniffs which are not specific to Laravel.

Property dollar sign

Makes sure that you always have a dollar sign in your properties defined in phpdoc.

Param tags with no type or comment

This removes all @param tags which has not specified a type or comment.

This is mainly because PHPStan requires this before it sees the property as valid.

Disallow TODO comments

This ensures that all to-do comments are blocked from use. Jira should be used instead.

Space in generics

This ensures that generics types in PHPDoc comments contain a single space after the comma.

Custom Rector rules

The Worksome code style includes custom Rector rules for automatically refactoring code.

Generic

Disallowed Attributes

This ensures that specified PHP attributes are automatically removed when they are not allowed.

Credits


All versions of coding-style with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
composer-plugin-api Version ^2.0
canvural/larastan-strict-rules Version ^2.1.10
jetbrains/phpstorm-attributes Version ^1.0
larastan/larastan Version ^2.9.7
phpstan/phpstan Version ^1.11
phpstan/phpstan-mockery Version ^1.1.2
rector/rector Version ^1.0
slevomat/coding-standard Version ^8.14.1
spaze/phpstan-disallowed-calls Version ^2.16
symplify/easy-coding-standard Version ^12.1.10
thecodingmachine/safe Version ^2.5
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 worksome/coding-style contains the following files

Loading the files please wait ....