-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Prepare new release
- Loading branch information
Showing
21 changed files
with
455 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
name: Check & fix styling | ||
|
||
on: [ push ] | ||
|
||
jobs: | ||
php-cs-fixer: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ github.head_ref }} | ||
|
||
- name: Run PHP CS Fixer | ||
uses: docker://oskarstark/php-cs-fixer-ga | ||
with: | ||
args: --config=.php-cs-fixer.dist.php --allow-risky=yes | ||
|
||
- name: Commit changes | ||
uses: stefanzweifel/git-auto-commit-action@v4 | ||
with: | ||
commit_message: Fix styling |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Tests | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: true | ||
matrix: | ||
os: [ ubuntu-latest, windows-latest ] | ||
php: [ 7.4, 8.0 ] | ||
stability: [ prefer-lowest, prefer-stable ] | ||
|
||
name: P${{ matrix.php }} - ${{ matrix.stability }} - ${{ 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: Setup problem matchers | ||
run: | | ||
echo "::add-matcher::${{ runner.tool_cache }}/php.json" | ||
echo "::add-matcher::${{ runner.tool_cache }}/phpunit.json" | ||
- name: Install dependencies | ||
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction | ||
|
||
- name: Execute tests | ||
run: vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ coverage | |
docs | ||
phpunit.xml | ||
psalm.xml | ||
testbench.yaml | ||
vendor | ||
.php-cs-fixer.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
<?php | ||
|
||
$finder = Symfony\Component\Finder\Finder::create() | ||
->in([ | ||
__DIR__ . '/src', | ||
__DIR__ . '/tests', | ||
]) | ||
->name('*.php') | ||
->ignoreDotFiles(true) | ||
->ignoreVCS(true); | ||
|
||
return (new PhpCsFixer\Config()) | ||
->setRules([ | ||
'@PSR12' => true, | ||
'array_syntax' => ['syntax' => 'short'], | ||
'ordered_imports' => ['sort_algorithm' => 'alpha'], | ||
'no_unused_imports' => true, | ||
'not_operator_with_successor_space' => false, | ||
'trailing_comma_in_multiline' => true, | ||
'phpdoc_scalar' => true, | ||
'unary_operator_spaces' => true, | ||
'binary_operator_spaces' => true, | ||
'blank_line_before_statement' => [ | ||
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'], | ||
], | ||
'phpdoc_single_line_var_spacing' => true, | ||
'phpdoc_var_without_name' => true, | ||
'class_attributes_separation' => [ | ||
'elements' => [ | ||
'method' => 'one', | ||
], | ||
], | ||
'method_argument_space' => [ | ||
'on_multiline' => 'ensure_fully_multiline', | ||
'keep_multiple_spaces_after_comma' => true, | ||
], | ||
'single_trait_insert_per_statement' => true, | ||
]) | ||
->setFinder($finder); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,55 @@ | ||
{ | ||
"name": "druc/laravel-langscanner", | ||
"description": "Scan missing language translations.", | ||
"keywords": [ | ||
"druc", | ||
"laravel-langscanner" | ||
], | ||
"homepage": "https://github.com/druc/laravel-langscanner", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Constantin Druc", | ||
"email": "druc@pinsmile.com", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"php": "^7.4|^8.0", | ||
"spatie/laravel-package-tools": "^1.4.3", | ||
"illuminate/contracts": "^8.0", | ||
"illuminate/support": "^8.0", | ||
"illuminate/filesystem": "^8.0", | ||
"ext-json": "*" | ||
}, | ||
"require-dev": { | ||
"nunomaduro/collision": "^5.3", | ||
"orchestra/testbench": "^6.15", | ||
"phpunit/phpunit": "^9.3" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Druc\\Langscanner\\": "src" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Druc\\Langscanner\\Tests\\": "tests" | ||
} | ||
}, | ||
"scripts": { | ||
"test": "./vendor/bin/testbench package:test", | ||
"test-coverage": "vendor/bin/phpunit --coverage-html coverage" | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Druc\\Langscanner\\LangscannerServiceProvider" | ||
] | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
"name": "druc/laravel-langscanner", | ||
"description": "Scan missing language translations.", | ||
"keywords": [ | ||
"druc", | ||
"laravel-langscanner" | ||
], | ||
"homepage": "https://github.com/druc/laravel-langscanner", | ||
"license": "MIT", | ||
"authors": [ | ||
{ | ||
"name": "Constantin Druc", | ||
"email": "druc@pinsmile.com", | ||
"role": "Developer" | ||
} | ||
], | ||
"require": { | ||
"php": "^7.4|^8.0", | ||
"spatie/laravel-package-tools": "^1.4.3", | ||
"illuminate/contracts": "^8.0", | ||
"ext-json": "*" | ||
}, | ||
"require-dev": { | ||
"friendsofphp/php-cs-fixer": "^3.3", | ||
"nunomaduro/collision": "^5.3", | ||
"orchestra/testbench": "^6.15", | ||
"phpunit/phpunit": "^9.3" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"Druc\\Langscanner\\": "src" | ||
} | ||
}, | ||
"autoload-dev": { | ||
"psr-4": { | ||
"Druc\\Langscanner\\Tests\\": "tests" | ||
} | ||
}, | ||
"scripts": { | ||
"test": "./vendor/bin/testbench package:test", | ||
"test-coverage": "vendor/bin/phpunit --coverage-html coverage" | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
}, | ||
"extra": { | ||
"laravel": { | ||
"providers": [ | ||
"Druc\\Langscanner\\LangscannerServiceProvider" | ||
] | ||
} | ||
}, | ||
"minimum-stability": "dev", | ||
"prefer-stable": true | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
|
||
namespace Druc\Langscanner; | ||
|
||
use Druc\Langscanner\Contracts\FileTranslations; | ||
|
||
class CachedFileTranslations implements FileTranslations | ||
{ | ||
private FileTranslations $fileTranslations; | ||
|
||
public function __construct(FileTranslations $fileTranslations) | ||
{ | ||
$this->fileTranslations = $fileTranslations; | ||
} | ||
|
||
public function update(array $translations): void | ||
{ | ||
$this->fileTranslations->update($translations); | ||
} | ||
|
||
public function all(): array | ||
{ | ||
$this->fileTranslations->all(); | ||
} | ||
|
||
public function contains(string $key): bool | ||
{ | ||
return $this->fileTranslations->contains($key); | ||
} | ||
|
||
public function language(): string | ||
{ | ||
return $this->fileTranslations->language(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<?php | ||
|
||
namespace Druc\Langscanner\Contracts; | ||
|
||
interface FileTranslations | ||
{ | ||
public function update(array $translations): void; | ||
|
||
public function all(): array; | ||
|
||
public function language(): string; | ||
|
||
public function contains(string $key): bool; | ||
} |
Oops, something went wrong.