Type object
File match composer.json
Schema URL https://catalog.lintel.tools/schemas/schemastore/composer-json/latest.json
Source https://getcomposer.org/schema.json

Validate with Lintel

npx @lintel/lintel check
Type: object

Properties

name string

Package name, including 'vendor-name/' prefix.

pattern=^[a-z0-9]([_.-]?[a-z0-9]+)*/[a-z0-9](([_.]|-{1,2})?[a-z0-9]+)*$
description string

Short package description.

license string | array

License name. Or an array of license names.

type string

Package type, either 'library' for common packages, 'composer-plugin' for plugins, 'metapackage' for empty packages, or a custom type ([a-z0-9-]+) defined by whatever project this package applies to.

pattern=^[a-z0-9-]+$
abandoned boolean | string

Indicates whether this package has been abandoned, it can be boolean or a package name/URL pointing to a recommended alternative. Defaults to false.

version string

Package version, see https://getcomposer.org/doc/04-schema.md#version for more info on valid schemes.

pattern=^[vV]?\d+(?:[.-]\d+){0,3}[._-]?(?:(?:[sS][tT][aA][bB][lL][eE]|[bB][eE][tT][aA]|[bB]|[rR][cC]|[aA][lL][pP][hH][aA]|[aA]|[pP][aA][tT][cC][hH]|[pP][lL]|[pP])(?:(?:[.-]?\d+)*)?)?(?:[.-]?[dD][eE][vV]|\.x-dev)?(?:\+.*)?$|^dev-.*$
default-branch boolean

Internal use only, do not specify this in composer.json. Indicates whether this version is the default branch of the linked VCS repository. Defaults to false.

non-feature-branches array

A set of string or regex patterns for non-numeric branch names that will not be handled as feature branches.

keywords string[]
readme string

Relative path to the readme document.

time string

Package release date, in 'YYYY-MM-DD', 'YYYY-MM-DD HH:MM:SS' or 'YYYY-MM-DDTHH:MM:SSZ' format.

authors object[]

List of authors that contributed to the package. This is typically the main maintainers, not the full list.

homepage string

Homepage URL for the project.

format=uri
support object
10 nested properties
email string

Email address for support.

format=email
issues string

URL to the issue tracker.

format=uri
forum string

URL to the forum.

format=uri
wiki string

URL to the wiki.

format=uri
irc string

IRC channel for support, as irc://server/channel.

format=uri
chat string

URL to the support chat.

format=uri
source string

URL to browse or download the sources.

format=uri
docs string

URL to the documentation.

format=uri
rss string

URL to the RSS feed.

format=uri
security string

URL to the vulnerability disclosure policy (VDP).

format=uri
funding object[]

A list of options to fund the development and maintenance of the package.

source object
4 nested properties
type string required
url string required
reference string required
mirrors array
dist object
5 nested properties
type string required
url string required
reference string
shasum string
mirrors array
_comment array | string

A key to store comments in

require Record<string, string>

This is an object of package name (keys) and version constraints (values) that are required to run this package.

require-dev Record<string, string>

This is an object of package name (keys) and version constraints (values) that this package requires for developing it (testing tools and such).

replace Record<string, string>

This is an object of package name (keys) and version constraints (values) that can be replaced by this package.

conflict Record<string, string>

This is an object of package name (keys) and version constraints (values) that conflict with this package.

provide Record<string, string>

This is an object of package name (keys) and version constraints (values) that this package provides in addition to this package's name.

suggest Record<string, string>

This is an object of package name (keys) and descriptions (values) that this package suggests work well with it (this will be suggested to the user during installation).

repositories Record<string, anonymous-repository | boolean>

A set of additional repositories where packages can be found.

minimum-stability string

The minimum stability the packages must have to be install-able. Possible values are: dev, alpha, beta, RC, stable.

Values: "dev" "alpha" "beta" "rc" "RC" "stable"
prefer-stable boolean

If set to true, stable packages will be preferred to dev packages when possible, even if the minimum-stability allows unstable packages.

autoload object

Description of how the package can be autoloaded.

5 nested properties
psr-0 Record<string, string | array>

This is an object of namespaces (keys) and the directories they can be found in (values, can be arrays of paths) by the autoloader.

psr-4 Record<string, string | array>

This is an object of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.

classmap array

This is an array of paths that contain classes to be included in the class-map generation process.

files array

This is an array of files that are always required on every request.

exclude-from-classmap array

This is an array of patterns to exclude from autoload classmap generation. (e.g. "exclude-from-classmap": ["/test/", "/tests/", "/Tests/"]

autoload-dev object

Description of additional autoload rules for development purpose (eg. a test suite).

4 nested properties
psr-0 Record<string, string | array>

This is an object of namespaces (keys) and the directories they can be found into (values, can be arrays of paths) by the autoloader.

psr-4 Record<string, string | array>

This is an object of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.

classmap array

This is an array of paths that contain classes to be included in the class-map generation process.

files array

This is an array of files that are always required on every request.

target-dir string

DEPRECATED: Forces the package to be installed into the given subdirectory path. This is used for autoloading PSR-0 packages that do not contain their full path. Use forward slashes for cross-platform compatibility.

include-path array

DEPRECATED: A list of directories which should get added to PHP's include path. This is only present to support legacy projects, and all new code should preferably use autoloading.

bin string | array

A set of files, or a single file, that should be treated as binaries and symlinked into bin-dir (from config).

archive object

Options for creating package archives for distribution.

2 nested properties
name string

A base name for archive.

exclude array

A list of patterns for paths to exclude or include if prefixed with an exclamation mark.

php-ext object

Settings for PHP extension packages.

All of: variant
9 nested properties
extension-name string

If specified, this will be used as the name of the extension, where needed by tooling. If this is not specified, the extension name will be derived from the Composer package name (e.g. vendor/name would become ext-name). The extension name may be specified with or without the ext- prefix, and tools that use this must normalise this appropriately.

priority integer

This is used to add a prefix to the INI file, e.g. 90-xdebug.ini which affects the loading order. The priority is a number in the range 10-99 inclusive, with 10 being the highest priority (i.e. will be processed first), and 99 being the lowest priority (i.e. will be processed last). There are two digits so that the files sort correctly on any platform, whether the sorting is natural or not.

Default: 80
min=10max=99
support-zts boolean

Does this package support Zend Thread Safety

Default: true
support-nts boolean

Does this package support non-Thread Safe mode

Default: true
build-path string | null

If specified, this is the subdirectory that will be used to build the extension instead of the root of the project.

Default: null
download-url-method string | string[]
os-families string[]

An array of OS families to mark as compatible with the extension. Specifying this property will mean this package is not installable with PIE on any OS family not listed here. Must not be specified alongside os-families-exclude.

minItems=1
os-families-exclude string[]

An array of OS families to mark as incompatible with the extension. Specifying this property will mean this package is installable on any OS family except those listed here. Must not be specified alongside os-families.

minItems=1
configure-options object[]

These configure options make up the flags that can be passed to ./configure when installing the extension.

config object

Composer options.

59 nested properties
platform Record<string, string | boolean>

This is an object of package name (keys) and version (values) that will be used to mock the platform packages on this machine, the version can be set to false to make it appear like the package is not present.

allow-plugins Record<string, boolean>

This is an object of {"pattern": true|false} with packages which are allowed to be loaded as plugins, or true to allow all, false to allow none. Defaults to {} which prompts when an unknown plugin is added.

process-timeout integer

The timeout in seconds for process executions, defaults to 300 (5mins).

use-include-path boolean

If true, the Composer autoloader will also look for classes in the PHP include path.

use-parent-dir string | boolean

When running Composer in a directory where there is no composer.json, if there is one present in a directory above Composer will by default ask you whether you want to use that directory's composer.json instead. One of: true (always use parent if needed), false (never ask or use it) or "prompt" (ask every time), defaults to prompt.

preferred-install Record<string, string>

The install method Composer will prefer to use, defaults to auto and can be any of source, dist, auto, or an object of {"pattern": "preference"}.

audit object

Security audit and version blocking configuration options

8 nested properties
ignore object | string[]
abandoned enum

Whether abandoned packages should be ignored, reported as problems or cause an audit failure. Applies only to audit reports, not to version blocking.

Values: "ignore" "report" "fail"
filtered enum

Whether filtered packages should be ignored, reported as problems or cause an audit failure. Applies only to audit reports, not to version blocking.

Values: "ignore" "report" "fail"
ignore-severity object | string[]
ignore-unreachable boolean

Whether repositories that are unreachable or return a non-200 status code should be ignored or not. Applies only to the composer audit command, does not affect audit report summaries in other commands or version blocking.

block-insecure boolean

Whether insecure versions should be blocked during a composer update/require command or not.

Default: true
block-abandoned boolean

Whether abandoned packages should be blocked during a composer update/require command or not. Applies only if blocking of insecure versions is enabled.

Default: false
ignore-abandoned object | string[]
filter boolean | object

Filter list configuration options. Set to true to enable with defaults, to false to fully disable, or configure with an object.

3 nested properties
ignore-unreachable boolean

Whether filter list sources that are unreachable or return a non-200 status code should be ignored.

Default: false
unfiltered-packages string | object | object[]

Packages to exempt from filtering. Each item can be a package name string, a {"vendor/package": "constraint"} object, or a detailed object with package, constraint, reason, and apply fields.

sources Record<string, object>

Additional sources to fetch filter list data from.

notify-on-install boolean

Composer allows repositories to define a notification URL, so that they get notified whenever a package from that repository is installed. This option allows you to disable that behaviour, defaults to true.

source-fallback boolean

If true (default), Composer will fall back to a different installation source (e.g., from dist to source or vice versa) when a download fails. Set to false to disable this behavior.

github-protocols string[]

A list of protocols to use for github.com clones, in priority order, defaults to ["https", "ssh", "git"].

github-oauth Record<string, string>

An object of domain name => github API oauth tokens, typically {"github.com":""}.

gitlab-oauth Record<string, string | object>

An object of domain name => gitlab API oauth tokens, typically {"gitlab.com":{"expires-at":"", "refresh-token":"", "token":""}}.

gitlab-token Record<string, string | object>

An object of domain name => gitlab private tokens, typically {"gitlab.com":""}, or an object with username and token keys.

gitlab-protocol enum

A protocol to force use of when creating a repository URL for the source value of the package metadata. One of git or http. By default, Composer will generate a git URL for private repositories and http one for public repos.

Values: "git" "http" "https"
bearer Record<string, string>

An object of domain name => bearer authentication token, for example {"example.com":""}.

custom-headers Record<string, string[]>

Custom HTTP headers for specific domains.

forgejo-token Record<string, object>

An object of domain name => forgejo username/access token, typically {"codeberg.org":{"username": "", "token": ""}}.

disable-tls boolean

Defaults to false. If set to true all HTTPS URLs will be tried with HTTP instead and no network level encryption is performed. Enabling this is a security risk and is NOT recommended. The better way is to enable the php_openssl extension in php.ini.

secure-http boolean

Defaults to true. If set to true only HTTPS URLs are allowed to be downloaded via Composer. If you really absolutely need HTTP access to something then you can disable it, but using "Let's Encrypt" to get a free SSL certificate is generally a better alternative.

secure-svn-domains string[]

A list of domains which should be trusted/marked as using a secure Subversion/SVN transport. By default svn:// protocol is seen as insecure and will throw. This is a better/safer alternative to disabling secure-http altogether.

cafile string

A way to set the path to the openssl CA file. In PHP 5.6+ you should rather set this via openssl.cafile in php.ini, although PHP 5.6+ should be able to detect your system CA file automatically.

capath string

If cafile is not specified or if the certificate is not found there, the directory pointed to by capath is searched for a suitable certificate. capath must be a correctly hashed certificate directory.

http-basic Record<string, object>

An object of domain name => {"username": "...", "password": "..."}.

client-certificate Record<string, object>

An object of domain name => {"local_cert": "...", "local_pk"?: "...", "passphrase"?: "..."} to provide client certificate.

store-auths string | boolean

What to do after prompting for authentication, one of: true (store), false (do not store) or "prompt" (ask every time), defaults to prompt.

vendor-dir string

The location where all packages are installed, defaults to "vendor".

bin-dir string

The location where all binaries are linked, defaults to "vendor/bin".

data-dir string

The location where old phar files are stored, defaults to "$home" except on XDG Base Directory compliant unixes.

cache-dir string

The location where all caches are located, defaults to "~/.composer/cache" on *nix and "%LOCALAPPDATA%\Composer" on windows.

cache-files-dir string

The location where files (zip downloads) are cached, defaults to "{$cache-dir}/files".

cache-repo-dir string

The location where repo (git/hg repo clones) are cached, defaults to "{$cache-dir}/repo".

cache-vcs-dir string

The location where vcs infos (git clones, github api calls, etc. when reading vcs repos) are cached, defaults to "{$cache-dir}/vcs".

cache-ttl integer

The default cache time-to-live, defaults to 15552000 (6 months).

cache-files-ttl integer

The cache time-to-live for files, defaults to the value of cache-ttl.

cache-files-maxsize string | integer

The cache max size for the files cache, defaults to "300MiB".

cache-read-only boolean

Whether to use the Composer cache in read-only mode.

bin-compat enum

The compatibility of the binaries, defaults to "auto" (automatically guessed), can be "full" (compatible with both Windows and Unix-based systems) and "proxy" (only bash-style proxy).

Values: "auto" "full" "proxy" "symlink"
discard-changes string | boolean

The default style of handling dirty updates, defaults to false and can be any of true, false or "stash".

autoloader-suffix string

Optional string to be used as a suffix for the generated Composer autoloader. When null a random one will be generated.

optimize-autoloader boolean

Always optimize when dumping the autoloader.

prepend-autoloader boolean

If false, the composer autoloader will not be prepended to existing autoloaders, defaults to true.

classmap-authoritative boolean

If true, the composer autoloader will not scan the filesystem for classes that are not found in the class map, defaults to false.

apcu-autoloader boolean

If true, the Composer autoloader will check for APCu and use it to cache found/not-found classes when the extension is enabled, defaults to false.

github-domains string[]

A list of domains to use in github mode. This is used for GitHub Enterprise setups, defaults to ["github.com"].

github-expose-hostname boolean

Defaults to true. If set to false, the OAuth tokens created to access the github API will have a date instead of the machine hostname.

gitlab-domains string[]

A list of domains to use in gitlab mode. This is used for custom GitLab setups, defaults to ["gitlab.com"].

forgejo-domains string[]

A list of domains to use in forgejo mode. This is used for custom Forgejo setups, defaults to ["codeberg.org"].

bitbucket-oauth Record<string, object>

An object of domain name => {"consumer-key": "...", "consumer-secret": "..."}.

use-github-api boolean

Defaults to true. If set to false, globally disables the use of the GitHub API for all GitHub repositories and clones the repository as it would for any other repository.

archive-format string

The default archiving format when not provided on cli, defaults to "tar".

archive-dir string

The default archive path when not provided on cli, defaults to ".".

htaccess-protect boolean

Defaults to true. If set to false, Composer will not create .htaccess files in the composer home, cache, and data directories.

sort-packages boolean

Defaults to false. If set to true, Composer will sort packages when adding/updating a new dependency.

lock boolean

Defaults to true. If set to false, Composer will not create a composer.lock file.

platform-check boolean | string

Defaults to "php-only" which checks only the PHP version. Setting to true will also check the presence of required PHP extensions. If set to false, Composer will not create and require a platform_check.php file as part of the autoloader bootstrap.

Values: "php-only" true false
bump-after-update string | boolean

Defaults to false and can be any of true, false, "dev" or "no-dev". If set to true, Composer will run the bump command after running the update command. If set to "dev" or "no-dev" then only the corresponding dependencies will be bumped.

Values: "dev" "no-dev" true false
allow-missing-requirements boolean

Defaults to false. If set to true, Composer will allow install when lock file is not up to date with the latest changes in composer.json.

update-with-minimal-changes boolean

Defaults to false. If set to true, Composer will only perform absolutely necessary changes to transitive dependencies during update.

extra object | array

Arbitrary extra data that can be used by plugins, for example, package of type composer-plugin may have a 'class' key defining an installer class name.

scripts object

Script listeners that will be executed before/after some events.

16 nested properties
pre-install-cmd array | string

Occurs before the install command is executed, contains one or more Class::method callables or shell commands.

post-install-cmd array | string

Occurs after the install command is executed, contains one or more Class::method callables or shell commands.

pre-update-cmd array | string

Occurs before the update command is executed, contains one or more Class::method callables or shell commands.

post-update-cmd array | string

Occurs after the update command is executed, contains one or more Class::method callables or shell commands.

pre-status-cmd array | string

Occurs before the status command is executed, contains one or more Class::method callables or shell commands.

post-status-cmd array | string

Occurs after the status command is executed, contains one or more Class::method callables or shell commands.

pre-package-install array | string

Occurs before a package is installed, contains one or more Class::method callables or shell commands.

post-package-install array | string

Occurs after a package is installed, contains one or more Class::method callables or shell commands.

pre-package-update array | string

Occurs before a package is updated, contains one or more Class::method callables or shell commands.

post-package-update array | string

Occurs after a package is updated, contains one or more Class::method callables or shell commands.

pre-package-uninstall array | string

Occurs before a package has been uninstalled, contains one or more Class::method callables or shell commands.

post-package-uninstall array | string

Occurs after a package has been uninstalled, contains one or more Class::method callables or shell commands.

pre-autoload-dump array | string

Occurs before the autoloader is dumped, contains one or more Class::method callables or shell commands.

post-autoload-dump array | string

Occurs after the autoloader is dumped, contains one or more Class::method callables or shell commands.

post-root-package-install array | string

Occurs after the root-package is installed, contains one or more Class::method callables or shell commands.

post-create-project-cmd array | string

Occurs after the create-project command is executed, contains one or more Class::method callables or shell commands.

scripts-descriptions Record<string, string>

Descriptions for custom commands, shown in console help.

scripts-aliases Record<string, array>

Aliases for custom commands.

Definitions

authors object[]

List of authors that contributed to the package. This is typically the main maintainers, not the full list.

autoload object

Description of how the package can be autoloaded.

psr-0 Record<string, string | array>

This is an object of namespaces (keys) and the directories they can be found in (values, can be arrays of paths) by the autoloader.

psr-4 Record<string, string | array>

This is an object of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.

classmap array

This is an array of paths that contain classes to be included in the class-map generation process.

files array

This is an array of files that are always required on every request.

exclude-from-classmap array

This is an array of patterns to exclude from autoload classmap generation. (e.g. "exclude-from-classmap": ["/test/", "/tests/", "/Tests/"]

repository object
anonymous-repository
composer-repository object
type string required
Values: "composer"
url string required
name string
canonical boolean
only string[]
exclude string[]
options object
allow_ssl_downgrade boolean
force-lazy-providers boolean
filter boolean | object

Filter list configuration for this repository. Set to false to disable filter lists from this repository entirely, or configure with an object.

2 nested properties
lists string | object[]

Filter lists to use from this repository. Use 'defaults' to include all default lists advertised by the repository, prefix a name with '!' to exclude it, or provide objects for detailed configuration.

Default:
[
  "defaults"
]
unfiltered-packages string | object | object[]

Packages to exempt from filtering. Each item can be a package name string, a {"vendor/package": "constraint"} object, or a detailed object with package, constraint, reason, and apply fields.

vcs-repository object
type string required
Values: "vcs" "github" "git" "gitlab" "bitbucket" "git-bitbucket" "hg" "fossil" "perforce" "svn" "forgejo"
url string required
name string
canonical boolean
only string[]
exclude string[]
no-api boolean
secure-http boolean
svn-cache-credentials boolean
trunk-path string | boolean
branches-path string | boolean
tags-path string | boolean
package-path string
depot string
branch string
unique_perforce_client_name string
p4user string
p4password string
path-repository object
type string required
Values: "path"
url string required
name string
canonical boolean
only string[]
exclude string[]
options object
4 nested properties
reference string
Values: "none" "config" "auto"
symlink boolean | null
relative boolean
versions Record<string, string>
artifact-repository object
type string required
Values: "artifact"
url string required
name string
canonical boolean
only string[]
exclude string[]
pear-repository object
type string required
Values: "pear"
url string required
name string
canonical boolean
only string[]
exclude string[]
vendor-alias string
package-repository object
type string required
Values: "package"
package inline-package | inline-package[] required
name string
canonical boolean
only string[]
exclude string[]
inline-package object
name string required

Package name, including 'vendor-name/' prefix.

version string required
type string
target-dir string

DEPRECATED: Forces the package to be installed into the given subdirectory path. This is used for autoloading PSR-0 packages that do not contain their full path. Use forward slashes for cross-platform compatibility.

description string
keywords string[]
homepage string
format=uri
time string
license string | array
authors object[]

List of authors that contributed to the package. This is typically the main maintainers, not the full list.

require Record<string, string>
replace Record<string, string>
conflict Record<string, string>
provide Record<string, string>
require-dev Record<string, string>
suggest Record<string, string>
extra object | array
autoload object

Description of how the package can be autoloaded.

5 nested properties
psr-0 Record<string, string | array>

This is an object of namespaces (keys) and the directories they can be found in (values, can be arrays of paths) by the autoloader.

psr-4 Record<string, string | array>

This is an object of namespaces (keys) and the PSR-4 directories they can map to (values, can be arrays of paths) by the autoloader.

classmap array

This is an array of paths that contain classes to be included in the class-map generation process.

files array

This is an array of files that are always required on every request.

exclude-from-classmap array

This is an array of patterns to exclude from autoload classmap generation. (e.g. "exclude-from-classmap": ["/test/", "/tests/", "/Tests/"]

archive object
1 nested properties
exclude array
bin string | array

A set of files, or a single file, that should be treated as binaries and symlinked into bin-dir (from config).

include-path array

DEPRECATED: A list of directories which should get added to PHP's include path. This is only present to support legacy projects, and all new code should preferably use autoloading.

source object
4 nested properties
type string required
url string required
reference string required
mirrors array
dist object
5 nested properties
type string required
url string required
reference string
shasum string
mirrors array
source object
type string required
url string required
reference string required
mirrors array
dist object
type string required
url string required
reference string
shasum string
mirrors array
unfiltered-packages string | object | object[]

Packages to exempt from filtering. Each item can be a package name string, a {"vendor/package": "constraint"} object, or a detailed object with package, constraint, reason, and apply fields.