-
Notifications
You must be signed in to change notification settings - Fork 0
/
composer.json
108 lines (107 loc) · 3.31 KB
/
composer.json
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
{
"name": "tomrf/seminorm",
"description": "pdo sql query builder and executor",
"keywords": [ "sql", "orm", "query builder", "pdo", "mysql", "sqlite" ],
"homepage": "http://github.com/tomrf/seminorm",
"type": "library",
"license": "MIT",
"authors": [
{
"name": "Tom Rune Flo",
"email": "[email protected]",
"homepage": "http://github.com/tomrf/"
}
],
"autoload": {
"psr-4": {
"Tomrf\\Seminorm\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tomrf\\Seminorm\\Test\\": "tests/"
}
},
"minimum-stability": "stable",
"require": {
"php": "^8.0",
"psr/log": "^3.0"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
"phpstan/phpstan": "^1.8",
"friendsofphp/php-cs-fixer": "^3.8",
"roave/security-advisories": "dev-latest",
"phpmd/phpmd": "^2.12",
"tomrf/readme-gen": "*"
},
"extra": {
"intro": [
"PHP SQL query builder and executor, using PDO."
],
"example": [
"$db = new \\Tomrf\\Seminorm\\Seminorm(",
" new PdoConnection(",
" PdoConnection::dsn(",
" 'mysql',",
" 'my_database',",
" 'localhost',",
" ),",
" 'username',",
" 'password',",
" [] // array of PDO options, ATTR_PERSISTENT, ATTR_ERRMODE etc..",
" ),",
" new Factory(QueryBuilder::class),",
" new Factory(PdoQueryExecutor::class),",
" null, // optional row class, defaults to array",
" null, // optional data value class, defaults to string",
");",
"",
"$rows = $db->execute(",
" 'SELECT * FROM `my_table` WHERE id = :id',",
" [ 'id' => 1 ]",
")->findMany();",
"",
"$rowId = $db->execute(",
" $db->query()->insertInto(",
" 'my_table', ",
" [ 'name' => 'My Name', 'email' => '[email protected]' ]",
" )",
")->getLastInsertId();",
"",
"..."
]
},
"scripts": {
"phpunit": [
"phpunit -c .phpunit.dist.xml --colors=auto --coverage-text --stderr"
],
"cs-fixer": [
"php-cs-fixer fix --allow-risky=yes --diff --verbose src/"
],
"phpstan": [
"phpstan analyze --level max src/"
],
"phpmd": [
"phpmd src/ ansi .phpmd-ruleset.xml"
],
"test": [
"@phpunit",
"@phpmd",
"@phpstan"
],
"coverage": [
"@putenv XDEBUG_MODE=coverage",
"@phpunit --coverage-xml .phpunit.cache/code-coverage/xml",
"ls -al .phpunit.cache/code-coverage/xml"
],
"coverage-html": [
"@putenv XDEBUG_MODE=coverage",
"@phpunit --coverage-html .phpunit.cache/code-coverage/html",
"php -S localhost:0 -t .phpunit.cache/code-coverage/html"
],
"clean": [
"rm -rf vendor/ .phpunit.cache .php-cs-fixer.cache"
]
}
}