Download the PHP package topotru/psalm-conditional-final without Composer

On this page you can find all versions of the php package topotru/psalm-conditional-final. 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 psalm-conditional-final

Conditional Final for Psalm

Smart final/abstract class enforcement with attributes-based exclusions for Psalm.

Latest Stable Version License

Enforce final or abstract on your PHP classes without breaking your Doctrine Entities or other proxy-reliant classes.

This plugin replaces dumb token-based linters (like PHPCS) with smart, attributes-aware architectural control on top of the Psalm static analysis engine.

The Problem

Standard linters (e.g., SlevomatCodingStandard.Classes.RequireAbstractOrFinal) force you to make every class final. However, Doctrine Entities (or MappedSuperclasses) must not be final because Doctrine needs to extend them to generate lazy-loading proxy classes at runtime.

If you accidentally make an Entity final, it usually works fine in dev environment but crashes with a Fatal Error on production. To avoid this, you are forced to litter your codebase with ugly comments:

The Solution

Conditional Final reverses the logic:

  1. Every class must be final or abstract by default.
  2. If a class has a forbidden attribute (like #[ORM\Entity]), it must not be final (protects your production).
  3. Completely config-driven. No more inline ignore comments!
  4. Zero-dependency core (does not require doctrine/orm to be installed).

Installation

Enable the plugin in your psalm.xml:

Configuration

By default, the plugin requires all classes to be final or abstract and has an empty exclusion list.

Integration with Doctrine ORM

To enable the built-in preset for Doctrine (#[Entity] and #[MappedSuperclass]), simply add the <useDoctrinePreset /> tag inside the plugin configuration in your psalm.xml:

Custom Configurations

You can add any custom proxy or framework attributes (like API Platform or custom annotations) to the exclusion list manually inside the forbiddenFinalAttributes section:

Errors Handled

License

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


All versions of psalm-conditional-final with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-simplexml Version *
vimeo/psalm Version ^5.15 || ^6.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 topotru/psalm-conditional-final contains the following files

Loading the files please wait ...