Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusjp committed Oct 27, 2023
0 parents commit b2da6e9
Show file tree
Hide file tree
Showing 30 changed files with 1,111 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: run-tests

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ ubuntu-latest ]
php: [ 8.3, 8.2, 8.1 ]
laravel: [ 9.*, 10.* ]
stability: [ prefer-stable ]
include:
- laravel: 10.*
testbench: 8.*
- laravel: 9.*
testbench: 7.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{ matrix.php }}
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick, fileinfo
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction
env:
COMPOSER_AUTH: ${{ secrets.COMPOSER_AUTH }}

- name: Execute tests
run: vendor/bin/phpunit
11 changes: 11 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
composer.lock

/vendor/
/node_modules/

.env

/var/cache/
.phpunit.result.cache
/coverage/
/reports/
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Changelog
All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.1.0] 2023-10-27
### Created
- Initial setup of this library
74 changes: 74 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@

# Contributor Covenant Code of Conduct

## Our Pledge

In the interest of fostering an open and welcoming environment, we as
contributors and maintainers pledge to make participation in our project and
our community a harassment-free experience for everyone, regardless of age, body
size, disability, ethnicity, sex characteristics, gender identity and expression,
level of experience, education, socio-economic status, nationality, personal
appearance, race, religion, or sexual identity and orientation.

## Our Standards

Examples of behavior that contributes to creating a positive environment
include:

* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members

Examples of unacceptable behavior by participants include:

* The use of sexualized language or imagery and unwelcome sexual attention or
advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic
address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a
professional setting

## Our Responsibilities

Project maintainers are responsible for clarifying the standards of acceptable
behavior and are expected to take appropriate and fair corrective action in
response to any instances of unacceptable behavior.

Project maintainers have the right and responsibility to remove, edit, or
reject comments, commits, code, wiki edits, issues, and other contributions
that are not aligned to this Code of Conduct, or to ban temporarily or
permanently any contributor for other behaviors that they deem inappropriate,
threatening, offensive, or harmful.

## Scope

This Code of Conduct applies within all project spaces, and it also applies when
an individual is representing the project or its community in public spaces.
Examples of representing a project or community include using an official
project e-mail address, posting via an official social media account, or acting
as an appointed representative at an online or offline event. Representation of
a project may be further defined and clarified by project maintainers.

## Enforcement

Instances of abusive, harassing, or otherwise unacceptable behavior may be
reported by contacting the project team at [email protected]. All
complaints will be reviewed and investigated and will result in a response that
is deemed necessary and appropriate to the circumstances. The project team is
obligated to maintain confidentiality with regard to the reporter of an incident.
Further details of specific enforcement policies may be posted separately.

Project maintainers who do not follow or enforce the Code of Conduct in good
faith may face temporary or permanent repercussions as determined by other
members of the project's leadership.

## Attribution

This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html

[homepage]: https://www.contributor-covenant.org
9 changes: 9 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Thank you for showing interest in contributing to this project.

**Please submit your pull request against the `main` branch only**

Please ensure that before you do that you ran `composer checkup` from the project root after you've made any changes.

We're trying to ensure there is **100%** coverage, including Integration tests for the Repositories, so please ensure any new and or updated tests cover all of your changes.

Happy contributing!
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) 2023 CoderG33k

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.
67 changes: 67 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
A Laravel typed config generator
========================================
[![Latest Version](http://img.shields.io/packagist/v/MJTheOne/typed-config-generator.svg?style=flat-square)](https://github.com/MJTheOne/typed-config-generator/releases)
![Build](https://github.com/MJTheOne/typed-config-generator/actions/workflows/run-tests.yml/badge.svg?event=push)
[![codecov](https://codecov.io/gh/MJTheOne/typed-config-generator/branch/main/graph/badge.svg?token=BRH4XEU1VK)](https://codecov.io/gh/MJTheOne/typed-config-generator)

Are you a PHPStan lovin' strict programmer?! Say no more! This package will generate typed config classes for you based on your config files.

We all struggle with the `mixed` return type of the `config()` helper function. This package will stop your struggle and leave all your (unnecessary?) type checks behind you!

Installation
============
Make sure Composer is installed globally, as explained in the
[installation chapter](https://getcomposer.org/doc/00-intro.md)
of the Composer documentation.

### Step 1: Download the module
Open a command console, enter your project directory and execute:

```console
$ composer require coderg33k/typed-config-generator
```

### Step 2: Enable the module
*@todo: Autodiscover the ServiceProvider*

Then, enable the library by adding the service provider to the list of registered providers
in the `config/app.php` file of your project:

```php
// config/app.php

'providers' => [
// ...
CoderG33k\TypedConfigServiceProvider::class,
// ...
];
```

Testing
-------
This bundle uses [PHPUnit](https://phpunit.de) for unit and integration tests.

It can be run standalone by `composer phpunit` or within the complete checkup by `composer checkup`

### Checkup
The above-mentioned checkup runs multiple analyses of the bundle's code. This includes [Squizlab's Codesniffer](https://github.com/squizlabs/PHP_CodeSniffer), [PHPStan](https://phpstan.org) and a [coverage check](https://github.com/richardregeer/phpunit-coverage-check).

Continuous Integration
----------------------
[GitHub actions](https://github.com/features/actions) are used for continuous integration. Check out the [configuration file](https://github.com/coddin-web/idp-openid-connect-bundle/blob/main/.github/workflows/ci.yml) if you'd like to know more.

Changelog
---------
See the [project changelog](https://github.com/coddin-web/idp-openid-connect-bundle/blob/main/CHANGELOG.md)

Contributing
------------
Contributions are always welcome. Please see [CONTRIBUTING.md](https://github.com/coddin-web/idp-openid-connect-bundle/blob/main/CONTRIBUTING.md) and [CODE_OF_CONDUCT.md](https://github.com/coddin-web/idp-openid-connect-bundle/blob/main/CODE_OF_CONDUCT.md) for details.

License
-------
The MIT License (MIT). Please see [License File](https://github.com/coddin-web/idp-openid-connect-bundle/blob/main/LICENSE) for more information.

Credits
-------
This code is principally developed and maintained by [Marius Posthumus](https://github.com/MJTheOne)
6 changes: 6 additions & 0 deletions assets/laravel.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"package": "laravel/framework",
"config_file": "auth"
}
]
6 changes: 6 additions & 0 deletions assets/spatie.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[
{
"package": "spatie/laravel-data",
"config_file": "data"
}
]
42 changes: 42 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"name": "coderg33k/typed-config-generator",
"description": "Typed Classes for your Laravel configs!",
"type": "library",
"require": {
"php": "^8.1",
"illuminate/support": "^9.0|^10.0"
},
"require-dev": {
"dg/bypass-finals": "^1.5",
"nunomaduro/larastan": "^2.6",
"orchestra/testbench": "^7.0|^8.0",
"phpstan/phpstan": "^1.10",
"phpstan/phpstan-deprecation-rules": "^1.1",
"phpstan/phpstan-phpunit": "^1.3",
"phpstan/phpstan-strict-rules": "^1.5",
"phpunit/phpunit": "^9.0|^10.4",
"rregeer/phpunit-coverage-check": "^0.3.1",
"slevomat/coding-standard": "^8.14",
"squizlabs/php_codesniffer": "^3.7",
"thecodingmachine/phpstan-strict-rules": "^1.0"
},
"license": "MIT",
"autoload": {
"psr-4": {
"Coderg33k\\TypedConfigGenerator\\": "src/"
}
},
"authors": [
{
"name": "Marius",
"homepage": "https://github.com/MJTheOne"
}
],
"minimum-stability": "stable",
"config": {
"sort-packages": true,
"allow-plugins": {
"dealerdirect/phpcodesniffer-composer-installer": true
}
}
}
Loading

0 comments on commit b2da6e9

Please sign in to comment.