Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gammamatrix committed Feb 13, 2024
1 parent 2b131f3 commit edcaeaa
Show file tree
Hide file tree
Showing 106 changed files with 2,296 additions and 2,007 deletions.
19 changes: 15 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,12 @@ on:
push:
branches: [ "develop" ]
pull_request:
branches: [ "develop" ]
types:
- opened
- reopened
- synchronize
- ready_for_review
- review_requested

permissions:
contents: write
Expand All @@ -16,7 +21,7 @@ jobs:
build:

runs-on: ubuntu-latest

if: ${{ github.event_name == 'push' || !github.event.pull_request.draft }}
steps:
- name: Preparing timer
id: timer_start
Expand Down Expand Up @@ -83,7 +88,7 @@ jobs:
}
env:
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Run php-actions/composer@v6
uses: php-actions/composer@v6
with:
Expand All @@ -96,7 +101,7 @@ jobs:
with:
version: "10.1"
php_version: "8.2"
php_extensions: xdebug
php_extensions: intl xdebug
coverage_clover: clover.xml
coverage_text: true
- name: Make code coverage badge
Expand All @@ -112,6 +117,12 @@ jobs:
github_token: ${{ secrets.GITHUB_TOKEN }}
user_name: 'github-actions[bot]'
user_email: 'github-actions[bot]@users.noreply.github.com'
- uses: php-actions/phpstan@v3
with:
level: 9
php_version: "8.2"
path: config/ database/ src/ tests/Unit/ tests/Feature/
args: --verbose --debug
- name: Stopping timer
if: ${{ !cancelled() }}
id: timer_end
Expand Down
8 changes: 4 additions & 4 deletions .php-cs-fixer.dist → .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,10 +213,10 @@

$finder = PhpCsFixer\Finder::create()
->in([
__DIR__ . '/config',
__DIR__ . '/database',
__DIR__ . '/src',
__DIR__ . '/tests/Feature',
__DIR__.'/config',
__DIR__.'/database',
__DIR__.'/src',
__DIR__.'/tests/Feature',
__DIR__ . '/tests/Unit',
])
->name('*.php')
Expand Down
40 changes: 34 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

[![Playground CI Workflow](https://github.com/gammamatrix/playground-matrix/actions/workflows/ci.yml/badge.svg?branch=develop)](https://raw.githubusercontent.com/gammamatrix/playground-matrix/testing/develop/testdox.txt)
[![Test Coverage](https://raw.githubusercontent.com/gammamatrix/playground-matrix/testing/develop/coverage.svg)](tests)
[![PHPStan Level 9](https://img.shields.io/badge/PHPStan-level%209-brightgreen)](.github/workflows/ci.yml#L120)

The Playground Matrix is a package for [Laravel](https://laravel.com/docs/10.x) applications.

Expand All @@ -15,6 +16,12 @@ You can install the package via composer:
composer require gammamatrix/playground-matrix
```

## `artisan:about`

Playground Matrix provides information in the `artisan about` command.

<img src="resources/docs/artisan-about-playground-matrix.png" alt="screenshot of artisan about command with Playground Matrix.">

## Configuration

Migrations are disabled by default. This package may sometimes be installed where another system handles the migrations.
Expand All @@ -23,7 +30,7 @@ See the contents of the published config file: [config/playground-matrix.php](co

You can publish the config file with:
```bash
php artisan vendor:publish --provider="GammaMatrix\Playground\Matrix\ServiceProvider" --tag="playground-config"
php artisan vendor:publish --provider="Playground\Matrix\ServiceProvider" --tag="playground-config"
```

### Environment Variables
Expand Down Expand Up @@ -61,16 +68,29 @@ See the contents of the published config file: [database/migrations](database/mi

You can publish the migrations file with:
```bash
php artisan vendor:publish --provider="GammaMatrix\Playground\Matrix\ServiceProvider" --tag="playground-migrations"
php artisan vendor:publish --provider="Playground\Matrix\ServiceProvider" --tag="playground-migrations"
```

## About
## PHPStan

Playground Matrix provides information in the `artisan about` command.
Tests at level 9 on:
- `config/`
- `database/`
- `src/`
- `tests/Feature/`
- `tests/Unit/`

<img src="resources/docs/artisan-about-playground-matrix.png" alt="screenshot of artisan about command with Playground Matrix.">
```sh
composer analyse
```

## Tests
## Coding Standards

```sh
composer format
```

## Testing

```sh
composer test
Expand All @@ -79,3 +99,11 @@ composer test
## Changelog

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

## Credits

- [Jeremy Postlethwaite](https://github.com/gammamatrix)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
20 changes: 10 additions & 10 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
],
"require": {
"php": "^8.1",
"gammamatrix/playground": "dev-develop|dev-master|^73.0"
"gammamatrix/playground": "dev-develop|dev-master|dev-feature/*|^73.0"
},
"require-dev": {
"gammamatrix/playground-test": "dev-develop|dev-master|^73.0"
"gammamatrix/playground-test": "dev-develop|dev-master|dev-feature/*|^73.0"
},
"suggest": {
"gammamatrix/playground-matrix-resource": "Provides a resource API and optional Blade UI to interact with the models provided in this package."
Expand All @@ -32,14 +32,14 @@
"prefer-stable": true,
"autoload": {
"psr-4": {
"Database\\Factories\\GammaMatrix\\Playground\\Matrix\\Models\\": "database/factories/",
"GammaMatrix\\Playground\\Matrix\\": "src/"
"Database\\Factories\\Playground\\Matrix\\Models\\": "database/factories/",
"Playground\\Matrix\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\Feature\\GammaMatrix\\Playground\\Matrix\\": "tests/Feature/",
"Tests\\Unit\\GammaMatrix\\Playground\\Matrix\\": "tests/Unit/"
"Tests\\Feature\\Playground\\Matrix\\": "tests/Feature/",
"Tests\\Unit\\Playground\\Matrix\\": "tests/Unit/"
}
},
"config": {
Expand All @@ -56,13 +56,13 @@
},
"laravel": {
"providers": [
"GammaMatrix\\Playground\\Matrix\\ServiceProvider"
"Playground\\Matrix\\ServiceProvider"
]
}
},
"scripts": {
"test": "phpunit",
"format": "php-cs-fixer fix --allow-risky=yes",
"analyse": "phpstan analyse"
"test": "vendor/bin/phpunit",
"format": "vendor/bin/php-cs-fixer fix",
"analyse": "vendor/bin/phpstan analyse --verbose --debug --level max"
}
}
19 changes: 10 additions & 9 deletions database/factories/BacklogFactory.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php
/**
* GammaMatrix
* Playground
*/

namespace Database\Factories\GammaMatrix\Playground\Matrix\Models;
namespace Database\Factories\Playground\Matrix\Models;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use Playground\Matrix\Models\Backlog;

/**
* \Database\Factories\GammaMatrix\Playground\Matrix\Models\BacklogFactory
* \Database\Factories\Playground\Matrix\Models\BacklogFactory
*
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\GammaMatrix\Playground\Matrix\Models\Backlog>
* @extends Factory<Backlog>
*/
class BacklogFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
* @var class-string<Backlog>
*/
protected $model = \GammaMatrix\Playground\Matrix\Models\Backlog::class;
protected $model = Backlog::class;

/**
* Define the model's default state.
Expand All @@ -29,9 +29,10 @@ class BacklogFactory extends Factory
*/
public function definition(): array
{
$title = $this->faker->bs;
$title = $this->faker->sentence(3);

return [
'label' => fake()->bs,
'label' => $this->faker->sentence(3),
'title' => $title,
'slug' => Str::slug($title, '-'),
'description' => $this->faker->sentence(3),
Expand Down
19 changes: 10 additions & 9 deletions database/factories/BoardFactory.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php
/**
* GammaMatrix
* Playground
*/

namespace Database\Factories\GammaMatrix\Playground\Matrix\Models;
namespace Database\Factories\Playground\Matrix\Models;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use Playground\Matrix\Models\Board;

/**
* \Database\Factories\GammaMatrix\Playground\Matrix\Models\BoardFactory
* \Database\Factories\Playground\Matrix\Models\BoardFactory
*
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\GammaMatrix\Playground\Matrix\Models\Board>
* @extends Factory<Board>
*/
class BoardFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
* @var class-string<Board>
*/
protected $model = \GammaMatrix\Playground\Matrix\Models\Board::class;
protected $model = Board::class;

/**
* Define the model's default state.
Expand All @@ -29,9 +29,10 @@ class BoardFactory extends Factory
*/
public function definition(): array
{
$title = $this->faker->bs;
$title = $this->faker->sentence(3);

return [
'label' => fake()->bs,
'label' => $this->faker->sentence(3),
'title' => $title,
'slug' => Str::slug($title, '-'),
'description' => $this->faker->sentence(3),
Expand Down
19 changes: 10 additions & 9 deletions database/factories/EpicFactory.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php
/**
* GammaMatrix
* Playground
*/

namespace Database\Factories\GammaMatrix\Playground\Matrix\Models;
namespace Database\Factories\Playground\Matrix\Models;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use Playground\Matrix\Models\Epic;

/**
* \Database\Factories\GammaMatrix\Playground\Matrix\Models\EpicFactory
* \Database\Factories\Playground\Matrix\Models\EpicFactory
*
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\GammaMatrix\Playground\Matrix\Models\Epic>
* @extends Factory<Epic>
*/
class EpicFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
* @var class-string<Epic>
*/
protected $model = \GammaMatrix\Playground\Matrix\Models\Epic::class;
protected $model = Epic::class;

/**
* Define the model's default state.
Expand All @@ -29,9 +29,10 @@ class EpicFactory extends Factory
*/
public function definition(): array
{
$title = $this->faker->bs;
$title = $this->faker->sentence(3);

return [
'label' => fake()->bs,
'label' => $this->faker->sentence(3),
'title' => $title,
'slug' => Str::slug($title, '-'),
'description' => $this->faker->sentence(3),
Expand Down
19 changes: 10 additions & 9 deletions database/factories/FlowFactory.php
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
<?php
/**
* GammaMatrix
* Playground
*/

namespace Database\Factories\GammaMatrix\Playground\Matrix\Models;
namespace Database\Factories\Playground\Matrix\Models;

use Illuminate\Database\Eloquent\Factories\Factory;
use Illuminate\Support\Str;
use Playground\Matrix\Models\Flow;

/**
* \Database\Factories\GammaMatrix\Playground\Matrix\Models\FlowFactory
* \Database\Factories\Playground\Matrix\Models\FlowFactory
*
* @extends \Illuminate\Database\Eloquent\Factories\Factory<\GammaMatrix\Playground\Matrix\Models\Flow>
* @extends Factory<Flow>
*/
class FlowFactory extends Factory
{
/**
* The name of the factory's corresponding model.
*
* @var string
* @var class-string<Flow>
*/
protected $model = \GammaMatrix\Playground\Matrix\Models\Flow::class;
protected $model = Flow::class;

/**
* Define the model's default state.
Expand All @@ -29,9 +29,10 @@ class FlowFactory extends Factory
*/
public function definition(): array
{
$title = $this->faker->bs;
$title = $this->faker->sentence(3);

return [
'label' => fake()->bs,
'label' => $this->faker->sentence(3),
'title' => $title,
'slug' => Str::slug($title, '-'),
'description' => $this->faker->sentence(3),
Expand Down
Loading

0 comments on commit edcaeaa

Please sign in to comment.