Back to list

Composer - Package Definition

Lv.5779@mukitaro10 playsDec 31, 2025

Composer package definition with autoloading, dependencies, dev requirements, and scripts.

preview.php
PHP
1{
2 "name": "vendor/my-package",
3 "description": "A PHP library for data validation",
4 "type": "library",
5 "license": "MIT",
6 "authors": [
7 {
8 "name": "Developer Name",
9 "email": "dev@example.com"
10 }
11 ],
12 "require": {
13 "php": "^8.1",
14 "psr/log": "^3.0"
15 },
16 "require-dev": {
17 "phpunit/phpunit": "^10.0",
18 "phpstan/phpstan": "^1.10"
19 },
20 "autoload": {
21 "psr-4": {
22 "Vendor\\MyPackage\\": "src/"
23 }
24 },
25 "autoload-dev": {
26 "psr-4": {
27 "Vendor\\MyPackage\\Tests\\": "tests/"
28 }
29 },
30 "scripts": {
31 "test": "phpunit",
32 "analyse": "phpstan analyse src"
33 },
34 "config": {
35 "sort-packages": true
36 }
37}

Custom problems are not included in rankings