Download the PHP package tivins/php-solid without Composer

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

php-solid - SOLID principles checker

A PHP tool that checks SOLID principles in your codebase. It detects Liskov Substitution Principle (LSP) and Interface Segregation Principle (ISP) violations.

CI


Principles covered


LSP — What it checks

A subclass or implementation must not weaken the contract of its parent or interface. The checker verifies:

Violations are reported as:

  1. Docblock violations — @throws in the implementation that are not in the contract.
  2. Code violations — actual throw statements (detected via AST) for exception types not allowed by the contract.

LSP example

LSP features


ISP — What it checks

Clients should not be forced to depend on methods they do not use. The checker detects:

ISP example

ISP features


Requirements

Installation

Usage

You can run the checker in two ways: by passing a directory, or by using a configuration file.

Scan a directory

Pass a directory path as the first argument. The path is relative to the current working directory. The checker builds a config with that directory and recursively finds all PHP classes to check:

The classes (and their contracts — interfaces, parent classes) must be loadable. If a vendor/autoload.php is found in or near the target directory, it is included automatically.

Configuration file

Use --config <file> to load a PHP file that returns a Tivins\Solid\Config instance. The config defines which directories and files to scan, optional exclusions, and optional ISP threshold.

Config file: Copy the bundled example to your project and adapt paths:

Example (e.g. copy config-example.php to config.php):

Paths are resolved relative to the current working directory when you run the checker (e.g. when you run vendor/bin/php-solid --config config.php from your project root, addDirectory('src') refers to ./src).

Without a directory and without --config, the script prints usage and exits:

Run unit tests

The example classes in examples/liskov-violation-example.php and examples/isp-violation-example.php are used by PHPUnit tests:

Output streams (stdout / stderr)

So you can capture only the result in a file and keep logs separate.

Options

Option Description
<directory> Directory to scan. Required when not using --config.
--config <file> Path to a PHP file that returns a Tivins\Solid\Config instance. When present, <directory> is not required.
--lsp Run only LSP checks (skip ISP).
--isp Run only ISP checks (skip LSP).
--isp-threshold <n> Fat interface method threshold (default: 5).
--quiet Suppress progress and summary on stderr. Only the result (stdout) is produced — useful for CI or when piping.
--json Machine-readable output: write only the JSON report to stdout; no [PASS]/[FAIL] lines.

When neither --lsp nor --isp is specified, both principles are checked.

Pipes and redirections

Goal Command
Save JSON report to a file vendor/bin/php-solid src/ --json > report.json
Save human result, hide progress vendor/bin/php-solid src/ --quiet > result.txt
Save progress/summary to a log vendor/bin/php-solid src/ 2> progress.log (result stays on terminal)
JSON only, no progress (e.g. CI) vendor/bin/php-solid src/ --json --quiet 2>/dev/null
Result to file, progress to another file vendor/bin/php-solid src/ --json > report.json 2> progress.log
Use a config file vendor/bin/php-solid --config config.php

To pipe the JSON into another tool (e.g. jq), use --json --quiet so only JSON goes to stdout:

The JSON report is an object with two keys:

Example output

Limitations

LSP

ISP

General

License

MIT.


All versions of php-solid with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
nikic/php-parser Version ^5.0
ext-ctype 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 tivins/php-solid contains the following files

Loading the files please wait ...