Skip to content

Commit

Permalink
Merge pull request #10 from SolumDeSignum/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
Faks authored Oct 18, 2024
2 parents df42521 + fc4bc69 commit 17fa399
Show file tree
Hide file tree
Showing 8 changed files with 124 additions and 6 deletions.
18 changes: 18 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
root = true

[*]
charset = utf-8
end_of_line = lf
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2

[docker-compose.yml]
indent_size = 4
20 changes: 20 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'esnext',
sourceType: 'module',
ecmaFeatures: {
jsx: true,
},
},
settings: {
react: {
version: 'detect',
},
},
extends: ['plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint', 'plugin:prettier/recommended'],
rules: {
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
},
};
16 changes: 16 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Path-based git attributes
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html

# Ignore all test and documentation with "export-ignore".
/.github export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/phpunit.xml.dist export-ignore
/art export-ignore
/docs export-ignore
/tests export-ignore
/.editorconfig export-ignore
/.php_cs.dist.php export-ignore
/phpstan* export-ignore
/CHANGELOG.md export-ignore
/CONTRIBUTING.md export-ignore
13 changes: 13 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
vendor
composer.lock
.idea/
.DS_Store
.phpunit.result.cache
node_modules/
images/
packages/*
build
.idea
.phpunit.cache
.phpunit.result.cache
.php-cs-fixer.cache
2 changes: 2 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
ignoreErrors:
14 changes: 14 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
includes:
- ./vendor/larastan/larastan/extension.neon
- phpstan-baseline.neon

parameters:
level: 9
paths:
- src
- config
tmpDir: build/phpstan
checkOctaneCompatibility: true

ignoreErrors:
- '#Unsafe usage of new static#'
17 changes: 17 additions & 0 deletions phpunit.xml.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
bootstrap="vendor/autoload.php"
colors="true"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
>
<source>
<include>
<directory suffix=".php">src/</directory>
</include>
</source>
<testsuites>
<testsuite name="Test Suite">
<directory>tests</directory>
</testsuite>
</testsuites>
</phpunit>
30 changes: 24 additions & 6 deletions src/ScenariosServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,10 @@

namespace SolumDeSignum\Scenarios;

use Illuminate\Contracts\Support\DeferrableProvider;
use Illuminate\Support\ServiceProvider;

class ScenariosServiceProvider extends ServiceProvider
class ScenariosServiceProvider extends ServiceProvider implements DeferrableProvider
{
/**
* Bootstrap the application events.
Expand All @@ -15,12 +16,9 @@ class ScenariosServiceProvider extends ServiceProvider
*/
public function boot(): void
{
// Publishing is only necessary when using the CLI.
if ($this->app->runningInConsole()) {
$this->publishes([
__DIR__ . '/../config/scenarios.php' => config_path('scenarios.php')
],
'config'
);
$this->bootForConsole();
}
}

Expand All @@ -36,4 +34,24 @@ public function register(): void
'scenarios'
);
}

/**
* Get the services provided by the provider.
*
* @return array
*/
public function provides(): array
{
return parent::provides();
}

protected function bootForConsole(): void
{
// Publishing the configuration file.
$this->publishes([
__DIR__ . '/../config/scenarios.php' => config_path('scenarios.php')
],
'scenarios.config'
);
}
}

0 comments on commit 17fa399

Please sign in to comment.