Skip to content

Commit e1c14e4

Browse files
author
Kirill Nesmeyanov
committed
Add reader package stub
0 parents  commit e1c14e4

File tree

17 files changed

+508
-0
lines changed

17 files changed

+508
-0
lines changed

.editorconfig

Lines changed: 13 additions & 0 deletions
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

.gitattributes

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
* text=auto eol=lf
2+
*.pp eol=lf linguist-language=EBNF
3+
*.pp2 eol=lf linguist-language=EBNF
4+
*.phptl eol=lf linguist-language=TypeScript
5+
6+
.editorconfig export-ignore
7+
.php-cs-fixer.php export-ignore
8+
.gitattributes export-ignore
9+
.gitignore export-ignore
10+
11+
phpunit.xml export-ignore
12+
psalm.xml export-ignore
13+
rector.php export-ignore
14+
15+
/.github export-ignore
16+
/example export-ignore
17+
/tests export-ignore

.github/workflows/codestyle.yml

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: codestyle
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
psalm:
9+
name: Code Style
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php: [ '8.2' ]
15+
os: [ ubuntu-latest ]
16+
steps:
17+
- name: Set Git To Use LF
18+
run: |
19+
git config --global core.autocrlf false
20+
git config --global core.eol lf
21+
- name: Checkout
22+
uses: actions/checkout@v3.3.0
23+
- name: Setup PHP ${{ matrix.php }}
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
- name: Validate Composer
28+
run: composer validate
29+
- name: Get Composer Cache Directory
30+
id: composer-cache
31+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
32+
- name: Restore Composer Cache
33+
uses: actions/cache@v1
34+
with:
35+
path: ${{ steps.composer-cache.outputs.dir }}
36+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
37+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
38+
- name: Install Dependencies
39+
uses: nick-invision/retry@v1
40+
with:
41+
timeout_minutes: 5
42+
max_attempts: 5
43+
command: composer update --prefer-dist --no-interaction --no-progress
44+
- name: Check Code Style
45+
run: composer phpcs:check

.github/workflows/security.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: security
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
jobs:
10+
security:
11+
name: Security
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: [ '8.2' ]
17+
os: [ ubuntu-latest ]
18+
steps:
19+
- name: Set Git To Use LF
20+
run: |
21+
git config --global core.autocrlf false
22+
git config --global core.eol lf
23+
- name: Checkout
24+
uses: actions/checkout@v3.3.0
25+
- name: Setup PHP ${{ matrix.php }}
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
- name: Validate Composer
30+
run: composer validate
31+
- name: Get Composer Cache Directory
32+
id: composer-cache
33+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
34+
- name: Restore Composer Cache
35+
uses: actions/cache@v1
36+
with:
37+
path: ${{ steps.composer-cache.outputs.dir }}
38+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
39+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
40+
- name: Install Dependencies
41+
uses: nick-invision/retry@v1
42+
with:
43+
timeout_minutes: 5
44+
max_attempts: 5
45+
command: composer update --prefer-dist --no-interaction --no-progress
46+
- name: Composer Audit
47+
run: composer audit
48+
- name: Security Advisories
49+
run: composer require --dev roave/security-advisories:dev-latest
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
name: static-analysis
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
psalm:
9+
name: Psalm
10+
runs-on: ${{ matrix.os }}
11+
strategy:
12+
fail-fast: false
13+
matrix:
14+
php: [ '8.2' ]
15+
os: [ ubuntu-latest ]
16+
steps:
17+
- name: Set Git To Use LF
18+
run: |
19+
git config --global core.autocrlf false
20+
git config --global core.eol lf
21+
- name: Checkout
22+
uses: actions/checkout@v3.3.0
23+
- name: Setup PHP ${{ matrix.php }}
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: ${{ matrix.php }}
27+
- name: Validate Composer
28+
run: composer validate
29+
- name: Get Composer Cache Directory
30+
id: composer-cache
31+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
32+
- name: Restore Composer Cache
33+
uses: actions/cache@v1
34+
with:
35+
path: ${{ steps.composer-cache.outputs.dir }}
36+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
37+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
38+
- name: Install Dependencies
39+
uses: nick-invision/retry@v1
40+
with:
41+
timeout_minutes: 5
42+
max_attempts: 5
43+
command: composer update --prefer-dist --no-interaction --no-progress
44+
- name: Static Analysis
45+
run: composer linter:check

.github/workflows/tests.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
pull_request:
6+
schedule:
7+
- cron: '0 0 * * *'
8+
9+
jobs:
10+
tests:
11+
name: Tests (${{matrix.php}}, ${{ matrix.os }}, ${{ matrix.stability }})
12+
runs-on: ${{ matrix.os }}
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
php: [ '8.1', '8.2', '8.3' ]
17+
os: [ ubuntu-latest, macos-latest, windows-latest ]
18+
stability: [ prefer-lowest, prefer-stable ]
19+
steps:
20+
- name: Set Git To Use LF
21+
run: |
22+
git config --global core.autocrlf false
23+
git config --global core.eol lf
24+
- name: Checkout
25+
uses: actions/checkout@v3.3.0
26+
- name: Setup PHP ${{ matrix.php }}
27+
uses: shivammathur/setup-php@v2
28+
with:
29+
php-version: ${{ matrix.php }}
30+
tools: pecl
31+
ini-values: "memory_limit=-1"
32+
- name: Validate Composer
33+
run: composer validate
34+
- name: Get Composer Cache Directory
35+
id: composer-cache
36+
run: echo "::set-output name=dir::$(composer config cache-files-dir)"
37+
- name: Restore Composer Cache
38+
uses: actions/cache@v1
39+
with:
40+
path: ${{ steps.composer-cache.outputs.dir }}
41+
key: ${{ runner.os }}-${{ matrix.php }}-composer-${{ hashFiles('**/composer.json') }}
42+
restore-keys: ${{ runner.os }}-${{ matrix.php }}-composer-
43+
- name: Install Dependencies
44+
uses: nick-invision/retry@v1
45+
with:
46+
timeout_minutes: 5
47+
max_attempts: 5
48+
command: composer update --${{ matrix.stability }} --ignore-platform-reqs --prefer-dist --no-interaction --no-progress
49+
- name: Execute Unit Tests
50+
run: composer test:unit
51+
- name: Execute Functional Tests
52+
run: composer test:functional

.gitignore

Lines changed: 14 additions & 0 deletions
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

.php-cs-fixer.php

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<?php
2+
3+
$files = PhpCsFixer\Finder::create()
4+
->in([__DIR__ . '/src']);
5+
6+
return (new PhpCsFixer\Config())
7+
->setRules([
8+
'@PER-CS2.0' => true,
9+
'@PER-CS2.0:risky' => true,
10+
'strict_param' => true,
11+
'array_syntax' => [
12+
'syntax' => 'short',
13+
],
14+
])
15+
->setCacheFile(__DIR__ . '/vendor/.php-cs-fixer.cache')
16+
->setFinder($files);

LICENSE

Lines changed: 21 additions & 0 deletions
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.

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<a href="https://github.com/php-type-language" target="_blank">
2+
<picture>
3+
<img align="center" src="https://github.com/php-type-language/.github/blob/master/assets/dark.png?raw=true">
4+
</picture>
5+
</a>
6+
7+
---
8+
9+
<p align="center">
10+
<a href="https://packagist.org/packages/phptl/reader"><img src="https://poser.pugx.org/phptl/reader/require/php?style=for-the-badge" alt="PHP 8.1+"></a>
11+
<a href="https://packagist.org/packages/phptl/reader"><img src="https://poser.pugx.org/phptl/reader/version?style=for-the-badge" alt="Latest Stable Version"></a>
12+
<a href="https://packagist.org/packages/phptl/reader"><img src="https://poser.pugx.org/phptl/reader/v/unstable?style=for-the-badge" alt="Latest Unstable Version"></a>
13+
<a href="https://raw.githubusercontent.com/php-type-language/reader/blob/master/LICENSE"><img src="https://poser.pugx.org/phptl/reader/license?style=for-the-badge" alt="License MIT"></a>
14+
</p>
15+
<p align="center">
16+
<a href="https://github.com/php-type-language/reader/actions"><img src="https://github.com/php-type-language/reader/workflows/tests/badge.svg"></a>
17+
</p>
18+
19+
The PHP reference implementation for Type Language Reader.
20+
21+
## Installation
22+
23+
Type Language Reader is available as composer repository and can be installed
24+
using the following command in a root of your project:
25+
26+
```sh
27+
$ composer require phptl/reader
28+
```
29+
30+
## Quick Start
31+
32+
TODO

0 commit comments

Comments
 (0)