Skip to content

Commit 792a296

Browse files
committed
Initial commit
0 parents  commit 792a296

File tree

104 files changed

+4106
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

104 files changed

+4106
-0
lines changed

Diff for: .editorconfig

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
insert_final_newline = true
7+
indent_style = space
8+
indent_size = 4
9+
trim_trailing_whitespace = true
10+
11+
[*.yml]
12+
indent_style = space
13+
indent_size = 2

Diff for: .gitattributes

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
/tests export-ignore

Diff for: .github/workflows/main.yml

+126
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,126 @@
1+
name: build
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
security:
7+
name: Security
8+
runs-on: ${{ matrix.os }}
9+
strategy:
10+
fail-fast: false
11+
matrix:
12+
php: [ '8.1' ]
13+
os: [ ubuntu-latest ]
14+
steps:
15+
- name: Set Git To Use LF
16+
run: |
17+
git config --global core.autocrlf false
18+
git config --global core.eol lf
19+
- name: Checkout
20+
uses: actions/checkout@v2
21+
- name: Setup PHP ${{ matrix.php }}
22+
uses: shivammathur/setup-php@v2
23+
with:
24+
php-version: ${{ matrix.php }}
25+
- name: Install Dependencies
26+
uses: nick-invision/retry@v1
27+
with:
28+
timeout_minutes: 5
29+
max_attempts: 5
30+
command: composer update --prefer-dist --no-interaction --no-progress
31+
- name: Security Advisories
32+
run: composer require --dev roave/security-advisories:dev-latest
33+
34+
static-analysis:
35+
name: Psalm
36+
runs-on: ${{ matrix.os }}
37+
strategy:
38+
fail-fast: false
39+
matrix:
40+
php: [ '8.1' ]
41+
os: [ ubuntu-latest ]
42+
43+
steps:
44+
- name: Set Git To Use LF
45+
run: |
46+
git config --global core.autocrlf false
47+
git config --global core.eol lf
48+
49+
- name: Checkout
50+
uses: actions/checkout@v2
51+
52+
- name: Setup PHP ${{ matrix.php }}
53+
uses: shivammathur/setup-php@v2
54+
with:
55+
php-version: ${{ matrix.php }}
56+
tools: composer:v2
57+
58+
- name: Install Dependencies
59+
uses: nick-invision/retry@v1
60+
with:
61+
timeout_minutes: 5
62+
max_attempts: 5
63+
command: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress
64+
65+
- name: Static Analysis
66+
continue-on-error: true
67+
run: vendor/bin/psalm --no-cache
68+
69+
coding-standards:
70+
name: Coding Standards
71+
runs-on: ${{ matrix.os }}
72+
strategy:
73+
fail-fast: false
74+
matrix:
75+
php: [ '8.1' ]
76+
os: [ ubuntu-latest ]
77+
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v2
81+
82+
- name: Setup PHP ${{ matrix.php }}
83+
uses: shivammathur/setup-php@v2
84+
with:
85+
php-version: ${{ matrix.php }}
86+
tools: composer:v2
87+
88+
- name: Install Dependencies
89+
uses: nick-invision/retry@v1
90+
with:
91+
timeout_minutes: 5
92+
max_attempts: 5
93+
command: composer update --ignore-platform-reqs --prefer-dist --no-interaction --no-progress
94+
95+
- name: Check Coding Standards
96+
run: vendor/bin/phpcs --standard=phpcs.xml
97+
98+
test:
99+
name: Build (${{matrix.php}}, ${{ matrix.os }}, ${{ matrix.stability }})
100+
runs-on: ${{ matrix.os }}
101+
strategy:
102+
fail-fast: false
103+
matrix:
104+
php: [ '8.1', '8.2' ]
105+
os: [ ubuntu-latest, macos-latest, windows-latest ]
106+
stability: [ prefer-lowest, prefer-stable ]
107+
108+
steps:
109+
- name: Checkout
110+
uses: actions/checkout@v2
111+
112+
- name: Setup PHP ${{ matrix.php }}
113+
uses: shivammathur/setup-php@v2
114+
with:
115+
php-version: ${{ matrix.php }}
116+
tools: composer:v2
117+
118+
- name: Install Dependencies
119+
uses: nick-invision/retry@v1
120+
with:
121+
timeout_minutes: 5
122+
max_attempts: 5
123+
command: composer update --${{ matrix.stability }} --ignore-platform-reqs --prefer-dist --no-interaction --no-progress
124+
125+
- name: Execute Tests
126+
run: vendor/bin/phpunit

Diff for: .gitignore

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Common
2+
/.env
3+
/*.cache
4+
5+
6+
# IDE
7+
/.idea/
8+
9+
# Composer
10+
/composer.lock
11+
/vendor/
12+
13+
# Testing
14+
test.php

Diff for: .php-cs-fixer.php

+61
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
$config = new PhpCsFixer\Config();
6+
7+
return $config
8+
->setCacheFile(__DIR__ . '/.php-cs-fixer.cache')
9+
->setRiskyAllowed(true)
10+
->setRules([
11+
'@PSR12' => true,
12+
'binary_operator_spaces' => [
13+
'default' => null,
14+
'operators' => [
15+
'|' => 'single_space',
16+
'!==' => 'single_space',
17+
'!=' => 'single_space',
18+
'==' => 'single_space',
19+
'===' => 'single_space',
20+
],
21+
],
22+
'modernize_strpos' => true,
23+
'trailing_comma_in_multiline' => [
24+
'elements' => [
25+
'arrays',
26+
],
27+
],
28+
'declare_strict_types' => true,
29+
'linebreak_after_opening_tag' => true,
30+
'blank_line_after_opening_tag' => true,
31+
'single_quote' => true,
32+
'lowercase_cast' => true,
33+
'short_scalar_cast' => true,
34+
'no_leading_import_slash' => true,
35+
'method_argument_space' => [
36+
'on_multiline' => 'ignore',
37+
],
38+
'declare_equal_normalize' => [
39+
'space' => 'none',
40+
],
41+
'new_with_braces' => true,
42+
'no_blank_lines_after_phpdoc' => true,
43+
'single_blank_line_before_namespace' => true,
44+
'ternary_operator_spaces' => true,
45+
'unary_operator_spaces' => true,
46+
'return_type_declaration' => true,
47+
'concat_space' => [
48+
'spacing' => 'one',
49+
],
50+
'no_useless_else' => true,
51+
'no_useless_return' => true,
52+
'phpdoc_separation' => false,
53+
'yoda_style' => false,
54+
'void_return' => true,
55+
])
56+
->setFinder(
57+
(new PhpCsFixer\Finder())
58+
->in([__DIR__ . '/libs', __DIR__ . '/tests'])
59+
->name('*.php')
60+
)
61+
;

Diff for: LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) Nesmeyanov Kirill
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

Diff for: composer.json

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
{
2+
"name": "hyper/hyper",
3+
"license": "MIT",
4+
"type": "library",
5+
"description": "PHP DataMapper Database Layer",
6+
"homepage": "https://github.com/hyper-php",
7+
"authors": [
8+
{
9+
"name": "Kirill Nesmeyanov",
10+
"email": "[email protected]",
11+
"role": "maintainer"
12+
}
13+
],
14+
"repositories": [
15+
{"type": "path", "url": "libs/hydrator"},
16+
{"type": "path", "url": "libs/pool"},
17+
{"type": "path", "url": "libs/pool-doctrine"},
18+
{"type": "path", "url": "libs/types"},
19+
{"type": "path", "url": "libs/types-dsl"},
20+
{"type": "path", "url": "libs/types-repository"}
21+
],
22+
"require": {
23+
"php": "^8.1",
24+
"hyper/pool": "^1.0",
25+
"hyper/pool-doctrine": "^1.0",
26+
"hyper/types": "^1.0",
27+
"hyper/types-dsl": "^1.0",
28+
"hyper/types-repository": "^1.0",
29+
"hyper/hydrator": "^1.0"
30+
},
31+
"require-dev": {
32+
"doctrine/dbal": "4.0.0-beta1 as 3.5.0",
33+
"doctrine/orm": "^3.0",
34+
"phplrt/phplrt": "^3.2",
35+
"jetbrains/phpstorm-attributes": "^1.0",
36+
"friendsofphp/php-cs-fixer": "^3.8",
37+
"phpunit/phpunit": "^9.5.20",
38+
"symfony/var-dumper": "^5.4|^6.0",
39+
"vimeo/psalm": "^4.22"
40+
},
41+
"extra": {
42+
"branch-alias": {
43+
"dev-master": "1.0.x-dev",
44+
"dev-main": "1.0.x-dev"
45+
}
46+
},
47+
"config": {
48+
"sort-packages": true,
49+
"platform-check": true
50+
},
51+
"scripts": {
52+
"phpcs": "php-cs-fixer fix --config=.php-cs-fixer.php"
53+
},
54+
"minimum-stability": "dev",
55+
"prefer-stable": true
56+
}

Diff for: docker-compose.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
version: "3.8"
2+
3+
services:
4+
postgres:
5+
image: postgres:14.5
6+
container_name: hyper-postgres
7+
volumes:
8+
- ./docker/postgres:/data
9+
- postgres:/var/lib/postgresql/data
10+
environment:
11+
- POSTGRES_DB=postgres
12+
- POSTGRES_USER=user
13+
- POSTGRES_PASSWORD=password
14+
ports:
15+
- "5432:5432"
16+
networks:
17+
- hyper
18+
19+
networks:
20+
hyper:
21+
name: hyper
22+
driver: bridge
23+
24+
volumes:
25+
postgres:

Diff for: libs/hydrator/composer.json

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
{
2+
"name": "hyper/hydrator",
3+
"type": "library",
4+
"license": "MIT",
5+
"require": {
6+
"php": "^8.1",
7+
"php-ds/php-ds": "^1.4",
8+
"hyper/types": "^1.0",
9+
"hyper/types-repository": "^1.0"
10+
},
11+
"autoload": {
12+
"psr-4": {
13+
"Hyper\\Hydrator\\": "src"
14+
}
15+
},
16+
"require-dev": {
17+
"phpunit/phpunit": "^9.5.20",
18+
"vimeo/psalm": "^4.22"
19+
},
20+
"autoload-dev": {
21+
"psr-4": {
22+
"Hyper\\Hydrator\\Tests\\": "tests"
23+
}
24+
},
25+
"extra": {
26+
"branch-alias": {
27+
"dev-master": "1.0.x-dev",
28+
"dev-main": "1.0.x-dev"
29+
}
30+
},
31+
"minimum-stability": "dev",
32+
"prefer-stable": true
33+
}

Diff for: libs/hydrator/phpunit.xml

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd"
4+
colors="true"
5+
backupGlobals="true"
6+
stopOnFailure="false"
7+
processIsolation="false"
8+
backupStaticAttributes="false"
9+
bootstrap="vendor/autoload.php"
10+
convertErrorsToExceptions="true"
11+
convertNoticesToExceptions="true"
12+
convertWarningsToExceptions="true"
13+
>
14+
<coverage>
15+
<include>
16+
<directory suffix=".php">src</directory>
17+
</include>
18+
</coverage>
19+
<testsuites>
20+
<testsuite name="TestSuite">
21+
<directory suffix="TestCase.php">tests</directory>
22+
</testsuite>
23+
</testsuites>
24+
<php>
25+
<ini name="error_reporting" value="-1"/>
26+
<ini name="memory_limit" value="-1"/>
27+
</php>
28+
</phpunit>

0 commit comments

Comments
 (0)