Skip to content

Commit

Permalink
Init
Browse files Browse the repository at this point in the history
  • Loading branch information
spajxo committed Feb 17, 2023
0 parents commit ebd410d
Show file tree
Hide file tree
Showing 26 changed files with 1,432 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.editorconfig export-ignore
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/CHANGELOG.md export-ignore
/UPGRADING-1.0.md export-ignore
/CONTRIBUTING.md export-ignore
/LICENSE export-ignore
/phpcs.xml export-ignore
/phpunit.xml export-ignore
/phpstan.neon export-ignore
/tests export-ignore
/examples export-ignore
/docs export-ignore
38 changes: 38 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the prob
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
43 changes: 43 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<!--- Provide a general summary of your changes in the Title above -->

## Description

Describe your changes in detail.

## Motivation and context

Why is this change required? What problem does it solve?

If it fixes an open issue, please link to the issue here (if you write `fixes #num`
or `closes #num`, the issue will be automatically closed when the pull is accepted.)

## How has this been tested?

Please describe in detail how you tested your changes.

Include details of your testing environment, and the tests you ran to
see how your change affects other areas of the code, etc.

## Screenshots (if appropriate)

## Types of changes

What types of changes does your code introduce? Put an `x` in all the boxes that apply:
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)

## Checklist:

Go over all the following points, and put an `x` in all the boxes that apply.

Please, please, please, don't send your pull request until all of the boxes are ticked. Once your pull request is created, it will trigger a build on our [continuous integration](http://www.phptherightway.com/#continuous-integration) server to make sure your [tests and code style pass](https://help.github.com/articles/about-required-status-checks/).

- [ ] I have read the **[CONTRIBUTING](CONTRIBUTING.md)** document.
- [ ] My pull request addresses exactly one patch/feature.
- [ ] I have created a branch for this patch/feature.
- [ ] Each individual commit in the pull request is meaningful.
- [ ] I have added tests to cover my changes.
- [ ] If my change requires a change to the documentation, I have updated it accordingly.

If you're unsure about any of these, don't hesitate to ask. We're here to help!
12 changes: 12 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
- package-ecosystem: composer
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10
54 changes: 54 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
name: CI

on:
- pull_request
- push

jobs:
ci:
runs-on: ubuntu-latest

strategy:
fail-fast: true
matrix:
php: [8.1, 8.2]
dependency-version: [prefer-lowest, prefer-stable]

name: PHP ${{ matrix.php }} (${{ matrix.dependency-version }})

steps:

- name: Checkout
uses: actions/checkout@v3

- name: Cache dependencies
uses: actions/cache@v3
with:
path: ~/.composer/cache/files
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: mbstring, zip
tools: cs2pr
coverage: pcov

- name: Composer Dependencies
run: composer update --${{ matrix.dependency-version }} --no-interaction --prefer-dist

- name: CodeSniffer
run: vendor/bin/phpcs --report=checkstyle | cs2pr

- name: PHPStan
run: vendor/bin/phpstan analyse --error-format=checkstyle | cs2pr

- name: PHPUnit
run: vendor/bin/phpunit --coverage-text --coverage-clover=coverage.xml

- name: Setup problem matchers for PHPUnit
run: echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json"

- name: Codecov
uses: codecov/[email protected]
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
###> IDE ###
/.idea

# Composer
/vendor
/build

# Build
/composer.lock
.phpunit.result.cache
.phpcs.cache
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# Changelog

All notable changes will be documented in this file.

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## [0.1.0]
First release 🚀
33 changes: 33 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Contributing

Contributions are **welcome** and will be fully **credited**.

We accept contributions via Pull Requests on [Github](https://github.com/digitalcz/streams).


## Pull Requests

- **[PSR-12 Coding Standard](https://www.php-fig.org/psr/psr-12/)** - Check the code style with ``$ composer cs`` and fix it with ``$ composer csfix``.

- **Add tests!** - Your patch won't be accepted if it doesn't have tests.

- **Document any change in behaviour** - Make sure the `README.md` and any other relevant documentation are kept up-to-date.

- **Consider our release cycle** - We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.

- **Create feature branches** - Don't ask us to pull from your master branch.

- **One pull request per feature** - If you want to do more than one thing, send multiple pull requests.

- **Send coherent history** - Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please [squash them](http://www.git-scm.com/book/en/v2/Git-Tools-Rewriting-History#Changing-Multiple-Commit-Messages) before submitting.


## Running Tests

``` bash
$ composer csfix # fix codestyle
$ composer checks # run all checks
```


**Happy coding**!
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2020 DigitalCz

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
60 changes: 60 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Streams

[![Latest Stable Version](http://poser.pugx.org/digitalcz/streams/v)](https://packagist.org/packages/digitalcz/streams)
[![Total Downloads](http://poser.pugx.org/digitalcz/streams/downloads)](https://packagist.org/packages/digitalcz/streams)
[![Latest Unstable Version](http://poser.pugx.org/digitalcz/streams/v/unstable)](https://packagist.org/packages/digitalcz/streams)
[![License](http://poser.pugx.org/digitalcz/streams/license)](https://packagist.org/packages/digitalcz/streams)
[![PHP Version Require](http://poser.pugx.org/digitalcz/streams/require/php)](https://packagist.org/packages/digitalcz/streams)
[![CI](https://github.com/digitalcz/streams/workflows/CI/badge.svg)](https://github.com/digitalcz/streams/actions)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/digitalcz/streams/badges/quality-score.png?b=0.x)](https://scrutinizer-ci.com/g/digitalcz/streams/?branch=0.x)
[![codecov](https://codecov.io/gh/digitalcz/streams/branch/0.x/graph/badge.svg?token=QzZ5iMNkg3)](https://codecov.io/gh/digitalcz/streams)

Opinionated abstraction around PHP streams loosely implementing PSR-7 StreamInterface

## Install

Via [Composer](https://getcomposer.org/)

```bash
$ composer require digitalcz/streams
```

## Usage

See [examples](examples) for more

## Change log

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

## Testing

``` bash
$ composer csfix # fix codestyle
$ composer checks # run all checks

# or separately
$ composer tests # run phpunit
$ composer phpstan # run phpstan
$ composer cs # run codesniffer
```

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Security

If you discover any security related issues, please email [email protected] instead of using the issue tracker.

## Credits

- [Digital Solutions s.r.o.][link-author]
- [All Contributors][link-contributors]

## License

The MIT License (MIT). Please see [License File](LICENSE) for more information.

[link-author]: https://github.com/digitalcz
[link-contributors]: ../../contributors
66 changes: 66 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
"name": "digitalcz/streams",
"type": "library",
"description": "Opinionated abstraction around PHP streams loosely implementing PSR-7 StreamInterface",
"keywords": [
"streams",
"file"
],
"homepage": "https://github.com/digitalcz/streams",
"license": "MIT",
"authors": [
{
"name": "Digital Solutions s.r.o.",
"email": "[email protected]",
"homepage": "https://digital.cz",
"role": "Developer"
},
{
"name": "Pavel Stejskal",
"email": "[email protected]",
"homepage": "https://github.com/spajxo",
"role": "Developer"
}
],
"require": {
"php": "^8.1",
"psr/http-message": "^1.0.1"
},
"require-dev": {
"digitalcz/coding-standard": "^0.0.1",
"phpstan/extension-installer": "^1.2.0",
"phpstan/phpstan": "^1.9.0",
"phpstan/phpstan-phpunit": "^1.3.0",
"phpstan/phpstan-strict-rules": "^1.4.4",
"phpunit/phpunit": "^10.0.7",
"symfony/var-dumper": "^v6.2.0"
},
"autoload": {
"psr-4": {
"DigitalCz\\Streams\\": "src"
}
},
"autoload-dev": {
"psr-4": {
"DigitalCz\\Streams\\": "tests"
}
},
"scripts": {
"tests": "phpunit",
"phpstan": "phpstan analyse",
"cs": "phpcs -p",
"csfix": "phpcbf -p",
"checks": [
"@cs",
"@phpstan",
"@tests"
]
},
"config": {
"sort-packages": true,
"allow-plugins": {
"phpstan/extension-installer": true,
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading

0 comments on commit ebd410d

Please sign in to comment.