Download the PHP package o0h/phpstan-spaghetti without Composer

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

PHPStan Spaghetti

Latest Stable Version Total Downloads License PHPUnit PHPStan Coding Standard

A PHPStan extension that enforces true spaghetti code principles in your PHP projects.

Why?

While most static analysis tools try to improve code quality, PHPStan Spaghetti takes a different approach: it ensures your code stays true to the classic spaghetti code style. No more clean, maintainable code - embrace the chaos!

Installation

Install via Composer:

If you also install phpstan/extension-installer then you're all set!

Manual installation If you don't want to use `phpstan/extension-installer`, include `extension.neon` in your project's PHPStan config:

Configuration

The extension is enabled by default. To disable the rules, add the following to your phpstan.neon:

To explicitly enable (default behavior):

Rules

PHPStan Spaghetti provides 21 rules organized into 5 categories to enforce true spaghetti code principles.

Control Flow

NoLoopsRule

Prohibits all loop constructs (for, while, do-while, foreach). Use goto statements instead.

Violation:

Compliant:

RestrictedIfRule

Enforces strict rules for if statements:

NoSwitchMatchRule

Prohibits switch and match expressions. Use chains of if and goto instead.

NoTryCatchRule

Prohibits try-catch-finally blocks. Handle errors with conditional checks and goto.

NoReturnRule

Prohibits return statements. Use inline code and goto instead.

NoYieldRule

Prohibits yield and yield from expressions. No generators allowed in spaghetti code.

NoThrowRule

Prohibits throw statements. Handle errors with conditional checks and goto.

Functions

NoFunctionDefinitionRule

Prohibits user-defined functions. Use inline code with goto statements instead.

NoCallableArgumentRule

Prohibits using callable types as function arguments (closures, arrow functions, string callables, etc.).

NoCallableArgumentInMethodCallRule

Prohibits using callable types as method call arguments.

NoCallableArgumentInStaticCallRule

Prohibits using callable types as static method call arguments.

Object-Oriented Programming

NoClassLikeDefinitionRule

Prohibits all class-like definitions (classes, interfaces, traits, enums). Spaghetti code should be procedural!

NoObjectInstantiationRule

Prohibits object instantiation with new keyword.

NoObjectAccessRule

Prohibits accessing object properties and methods (->, ::, ?->).

NoInstanceofRule

Prohibits instanceof operator. Spaghetti code shouldn't use objects anyway.

NoTypeCheckFunctionRule

Prohibits type check functions (is_a(), is_subclass_of(), get_class(), get_parent_class()). Spaghetti code shouldn't use objects anyway.

Operators

NoTernaryOperatorRule

Prohibits ternary operators (? :). Use if statements with goto instead.

NoNullCoalesceRule

Prohibits null coalesce operators (??, ??=).

NoSpaceshipOperatorRule

Prohibits spaceship operator (<=>).

Structure

NoNamespaceRule

Prohibits namespace declarations. Use global namespace only.

NoTypeDeclarationRule

Prohibits type declarations for parameters, return values, and properties.

Development

Running Tests

Code Style

Check code style:

Fix code style:

Static Analysis

Run All Checks

Requirements

License

MIT

Disclaimer

This package is intended for educational and entertainment purposes. Please do not actually use these coding practices in production code. Embrace clean code principles, not spaghetti code!


All versions of phpstan-spaghetti with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
phpstan/phpstan Version ^2.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 o0h/phpstan-spaghetti contains the following files

Loading the files please wait ...