Skip to content

Commit ef83b36

Browse files
authored
Merge pull request #6 from SolumDeSignum/dev
Dev
2 parents c103c8b + f5d22d8 commit ef83b36

File tree

8 files changed

+120
-23
lines changed

8 files changed

+120
-23
lines changed

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
17+
[docker-compose.yml]
18+
indent_size = 4

.eslintrc.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
module.exports = {
2+
parser: '@typescript-eslint/parser',
3+
parserOptions: {
4+
ecmaVersion: 'esnext',
5+
sourceType: 'module',
6+
ecmaFeatures: {
7+
jsx: true,
8+
},
9+
},
10+
settings: {
11+
react: {
12+
version: 'detect',
13+
},
14+
},
15+
extends: ['plugin:@typescript-eslint/recommended', 'prettier/@typescript-eslint', 'plugin:prettier/recommended'],
16+
rules: {
17+
// Place to specify ESLint rules. Can be used to overwrite rules specified from the extended configs
18+
// e.g. "@typescript-eslint/explicit-function-return-type": "off",
19+
},
20+
};

.gitattributes

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Path-based git attributes
2+
# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html
3+
4+
# Ignore all test and documentation with "export-ignore".
5+
/.github export-ignore
6+
/.gitattributes export-ignore
7+
/.gitignore export-ignore
8+
/phpunit.xml.dist export-ignore
9+
/art export-ignore
10+
/docs export-ignore
11+
/tests export-ignore
12+
/.editorconfig export-ignore
13+
/.php_cs.dist.php export-ignore
14+
/phpstan* export-ignore
15+
/CHANGELOG.md export-ignore
16+
/CONTRIBUTING.md export-ignore

.gitignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
vendor
2+
composer.lock
3+
.idea/
4+
.DS_Store
5+
.phpunit.result.cache
6+
node_modules/
7+
images/
8+
packages/*
9+
build
10+
.idea
11+
.phpunit.cache
12+
.phpunit.result.cache
13+
.php-cs-fixer.cache

phpstan-baseline.neon

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
parameters:
2+
ignoreErrors:

phpstan.neon.dist

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
includes:
2+
- ./vendor/larastan/larastan/extension.neon
3+
- phpstan-baseline.neon
4+
5+
parameters:
6+
level: 9
7+
paths:
8+
- src
9+
- config
10+
tmpDir: build/phpstan
11+
checkOctaneCompatibility: true
12+
13+
ignoreErrors:
14+
- '#Unsafe usage of new static#'

phpunit.xml.dist

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3+
bootstrap="vendor/autoload.php"
4+
colors="true"
5+
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.4/phpunit.xsd"
6+
>
7+
<source>
8+
<include>
9+
<directory suffix=".php">src/</directory>
10+
</include>
11+
</source>
12+
<testsuites>
13+
<testsuite name="Test Suite">
14+
<directory>tests</directory>
15+
</testsuite>
16+
</testsuites>
17+
</phpunit>

src/PackageTranslatorLoaderServiceProvider.php

Lines changed: 20 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44

55
namespace SolumDeSignum\PackageTranslatorLoader;
66

7+
use Illuminate\Contracts\Support\DeferrableProvider;
78
use Illuminate\Support\ServiceProvider;
89

9-
class PackageTranslatorLoaderServiceProvider extends ServiceProvider
10+
class PackageTranslatorLoaderServiceProvider extends ServiceProvider implements DeferrableProvider
1011
{
1112
/**
1213
* Perform post-registration booting of services.
@@ -21,22 +22,6 @@ public function boot(): void
2122
}
2223
}
2324

24-
/**
25-
* Console-specific booting.
26-
*
27-
* @return void
28-
*/
29-
protected function bootForConsole(): void
30-
{
31-
// Publishing the configuration file.
32-
$this->publishes(
33-
[
34-
__DIR__ . '/../config/package-translator-loader.php' => config_path('package-translator-loader.php'),
35-
],
36-
'package-translator-loader'
37-
);
38-
}
39-
4025
/**
4126
* Register any package services.
4227
*
@@ -50,12 +35,9 @@ public function register(): void
5035
);
5136

5237
// Register the service the package provides.
53-
$this->app->singleton(
54-
'package-translator-loader',
55-
function ($app) {
56-
return new PackageTranslatorLoader($app);
57-
}
58-
);
38+
$this->app->singleton('package-translator-loader', function ($app) {
39+
return new PackageTranslatorLoader($app);
40+
});
5941
}
6042

6143
/**
@@ -67,4 +49,19 @@ public function provides(): array
6749
{
6850
return ['package-translator-loader'];
6951
}
52+
53+
/**
54+
* Console-specific booting.
55+
*
56+
* @return void
57+
*/
58+
protected function bootForConsole(): void
59+
{
60+
// Publishing the configuration file.
61+
$this->publishes([
62+
__DIR__ . '/../config/package-translator-loader.php' => config_path('package-translator-loader.php'),
63+
],
64+
'package-translator-loader.config'
65+
);
66+
}
7067
}

0 commit comments

Comments
 (0)