Download the PHP package cosmira/soda without Composer

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

Soda

Soda checks PHP code for oversized methods, complex conditions, naming problems, and structural issues. It reports what failed and where, with a non-zero exit status when violations are found.

Requires PHP 8.2 or higher.

The first check needs no configuration: Soda uses its standard rules when it finds no soda.php. Vendor directories are excluded automatically.

Configure once, run daily

Create soda.php in your project root. Choose named classes and pass their options:

Exclude generated directories or caches with ->exclude([__DIR__.'/generated']). Configuration exclusions and CLI --exclude values are combined.

Then run:

Only the listed rules run. Remove a rule to disable it. To use the whole standard set, pass RuleCatalog::standard() to with(); import Cosmira\Soda\Config\RuleCatalog. vendor/bin/soda init can generate an expanded, editable configuration equivalent to RuleCatalog::standard(), including its thresholds and readonly-data and boolean-method policies. The standard bundle also includes RepresentationChurn research: its findings appear separately and do not fail the quality gate. Save their evidence with --research-json=build/soda-research.json. Optional rules remain opt-in.

Useful commands

Command Purpose
vendor/bin/soda Check the paths in soda.php
vendor/bin/soda quality src/ tests/ Check explicit paths
vendor/bin/soda --config=tools/soda.php Select a configuration
vendor/bin/soda --report-json=quality.json Save a JSON report for CI
vendor/bin/soda quality src/ --exclude=generated Exclude a directory; repeat for more exclusions
vendor/bin/soda list:rules Inspect available rules and defaults
vendor/bin/soda --help Show check options

Use the same check command in CI. Exit status 0 means no violations; 1 means a failed check or a configuration/input error. Soda complements a formatter and PHPStan or Psalm by checking code structure and maintainability.

Learn more

Rule authors can inspect available facts with vendor/bin/soda list:metrics. Expression syntax is an optional implementation tool inside a rule class.

Development

Clone this repository and run composer install. Inside the Soda repository, use php soda in place of vendor/bin/soda. Run composer test for behavioral tests and composer ci for the full project checks.

Licensed under the MIT License.

Explicit behavior checks

The standard set also reports internal factories that only forward construction arguments (NoTrivialFactories) and compound own-state conditions repeated in three or more methods (NoRepeatedCompoundConditions). These are opinionated structural checks: they do not prove an abstraction is useless or two decisions have the same meaning. See the factory examples and repeated-condition examples.

The standard set also includes NoIdenticalBranches (repeated explicit match results and identical full ternary branches) and NoNestedTernary (a full ternary directly inside another full ternary's result branch). Both have narrow syntax boundaries and no automatic fixes. See the examples.

The standard set also includes NoAssignmentInReturn and NoChainedAssignments: make state changes explicit instead of hiding them in returned expressions or combining multiple writes into one chain. See return assignments and assignment chains.

Owner behavior recommendations

Six standard checks identify copied or scattered concerns, fragmented owner operations, repeated object configuration, and repeated decisions or updates over foreign state. Their diagnostics suggest traits, owner methods, or fluent objects with source evidence. See configuration, examples, and boundaries.

Expressions and local state

The standard set also includes NoUnneededTernary (opposite literal boolean branches) and NoReturnInFinally (returns that can override pending results or exceptions), NoReassignedParameters, MaxConsecutiveLocalAssignments(8) and NoRepeatedStringLiterals(3). All five run by default. Repeated-literal checks exclude literal array keys, parameter checks accept a narrow entry normalization, and return-assignment checks accept direct lazy initialization with ??=, named owner-state returns and concise arrow state callbacks. Each exception has a strict-mode option. See the calibration against Soda and pinned Laravel sources. See Expressions and local state for configuration, examples, scope boundaries and intentional exceptions.

Statement limits

The standard set includes MaxStatementsPerCallable(20): at most 20 executable statements per function, method or closure, counted independently of formatting. Nested callables have separate counts. See statement counting for the precise boundaries and threshold configuration.

Namespace dependency restrictions

ForbiddenDependencies is opt-in because each project defines its own module boundaries. Map source namespace prefixes to target prefixes they must not depend on:

Here App\Domain cannot reference types in App\Infrastructure or App\Http, including their descendant namespaces. The reverse direction remains allowed. The rule checks direct class and trait type references, even without a dependency cycle. Unused imports and dynamic string references are outside this check. See module restrictions for matching semantics and analysis boundaries.

The standard bundle includes NoEmptyFinallyBlocks, MaxCognitiveComplexity(15), MaxEfferentCoupling(15), and NoDependencyCycles().


All versions of soda with dependencies

PHP Build Version
Package Version
Requires php Version >=8.2
illuminate/console Version ^11.0||^12.0||^13.0
illuminate/container Version ^11.0||^12.0||^13.0
illuminate/events Version ^11.0||^12.0||^13.0
illuminate/support Version ^11.0||^12.0||^13.0
laravel/prompts Version ^0.1.15||^0.2.0||^0.3.0
nikic/php-parser Version ^5.0
phplrt/parser Version ^4.0.3
phplrt/source Version ^4.0.3
phpunit/php-file-iterator Version ^5.1
sebastian/complexity Version ^4.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 cosmira/soda contains the following files

Loading the files please wait ...