Download the PHP package roave/you-are-using-it-wrong without Composer

On this page you can find all versions of the php package roave/you-are-using-it-wrong. 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 you-are-using-it-wrong

roave/you-are-using-it-wrong

Mutation testing badge Type Coverage Packagist

This package enforces type checks during composer installation in downstream consumers of your package. This only applies to usages of classes, properties, methods and functions declared within packages that directly depend on roave/you-are-using-it-wrong.

Issues that the static analyser finds that do not relate to these namespaces will not be reported.

roave/you-are-using-it-wrong comes with a zero-configuration out-of-the-box setup.

By default, it hooks into composer install and composer update, preventing a successful command execution if there are type errors in usages of protected namespaces.

The usage of this plugin is highly endorsed for authors of new PHP libraries who appreciate the advantages of static types.

This project is built with the hope that libraries with larger user-bases will raise awareness of type safety (or current lack thereof) in the PHP ecosystem.

As annoying as it might sound, it is not uncommon for library maintainers to respond to support questions caused by lack of type checks in downstream projects. In addition to that, relying more on static types over runtime checks, it is possible to reduce code size and maintenance burden by strengthening the API boundaries of a library.

Installation

This package is designed to be installed as a dependency of PHP libraries.

In your library, add it to your composer.json:

No further changes are needed for this tool to start operating as per its design, if your declared types are already reflecting your library requirements.

Please also note that this should not be used in "require-dev", but specifically in "require" in order for the type checks to be applied to downstream consumers of your code.

Examples

You can experiment with the following example by running cd examples && ./run-example.sh.

Given you are the author of my/awesome-library, which has following composer.json:

Given following my/awesome-library/src/MyHelloWorld.php:

Given following downstream a/project/composer.json project that depends on your my/awesome-library:

And following a/project/src/MyExample.php:

Then composer install in said project will fail:

Workarounds

This package is designed to be quite invasive from a type-check perspective, but it will bail out of any checks if a psalm configuration is detected in the root of the installation/project. If that is the case, the tool assumes that the author of the project is already responsible for ensuring type-safety within their own domain, and therefore bails out without performing further checks.

As mentioned above, the design of the tool circles around raising awareness of static type usage in the PHP ecosystem, and therefore it will only give up if it is sure that library consumers are already taking care of the matter on their own.

Professional Support

If you need help with setting up this library in your project, you can contact us at [email protected] for consulting/support.


All versions of you-are-using-it-wrong with dependencies

PHP Build Version
Package Version
Requires php Version ~8.1.0 || ~8.2.0 || ~8.3.0
ext-json Version *
composer-plugin-api Version ^2.1.0
ocramius/package-versions Version ^2.8.0
vimeo/psalm Version ^5.19.1
psalm/plugin-phpunit Version ^0.18.4
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 roave/you-are-using-it-wrong contains the following files

Loading the files please wait ....