Skip to content

Commit 6c61742

Browse files
authored
Merge pull request #1 from oss-tools/feature/adding-support-for-laravel-6-7-and-8
2 parents 27cdaa7 + 6aed985 commit 6c61742

29 files changed

+409
-281
lines changed

.github/workflows/php-cs-fixer.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Check & fix styling
2+
3+
on: [push]
4+
5+
jobs:
6+
php-cs-fixer:
7+
runs-on: ubuntu-latest
8+
9+
steps:
10+
- name: Checkout code
11+
uses: actions/checkout@v2
12+
with:
13+
ref: ${{ github.head_ref }}
14+
15+
- name: Run PHP CS Fixer
16+
uses: docker://oskarstark/php-cs-fixer-ga
17+
with:
18+
args: --config=.php_cs.dist.php --allow-risky=yes
19+
20+
- name: Commit changes
21+
uses: stefanzweifel/git-auto-commit-action@v4
22+
with:
23+
commit_message: Fix styling

.github/workflows/run-tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: run-tests
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
test:
7+
runs-on: ${{ matrix.os }}
8+
strategy:
9+
fail-fast: true
10+
matrix:
11+
os: [ubuntu-latest]
12+
php: [8.0]
13+
laravel: [8.*]
14+
dependency-version: [prefer-lowest, prefer-stable]
15+
include:
16+
- laravel: 8.*
17+
testbench: 6.*
18+
19+
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ matrix.os }}
20+
21+
steps:
22+
- name: Checkout code
23+
uses: actions/checkout@v2
24+
25+
- name: Setup PHP
26+
uses: shivammathur/setup-php@v2
27+
with:
28+
php-version: ${{ matrix.php }}
29+
extensions: dom, curl, libxml, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, bcmath, soap, intl, gd, exif, iconv, imagick
30+
coverage: none
31+
32+
- name: Install dependencies
33+
run: |
34+
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
35+
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
36+
37+
- name: Execute tests
38+
run: vendor/bin/phpunit
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: "Update Changelog"
2+
3+
on:
4+
release:
5+
types: [released]
6+
7+
jobs:
8+
update:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout code
13+
uses: actions/checkout@v2
14+
with:
15+
ref: master
16+
17+
- name: Update Changelog
18+
uses: stefanzweifel/changelog-updater-action@v1
19+
with:
20+
latest-version: ${{ github.event.release.name }}
21+
release-notes: ${{ github.event.release.body }}
22+
23+
- name: Commit updated CHANGELOG
24+
uses: stefanzweifel/git-auto-commit-action@v4
25+
with:
26+
branch: master
27+
commit_message: Update CHANGELOG
28+
file_pattern: CHANGELOG.md
29+

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
11
/vendor
22
composer.phar
33
composer.lock
4+
5+
.idea/
6+
7+
.phpunit.result.cache

.php-cs-fixer.cache

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
{"php":"8.1.0","version":"3.4.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"constant_case":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline","keep_multiple_spaces_after_comma":true},"no_break_comment":true,"no_closing_tag":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":{"elements":["method","property"]},"encoding":true,"full_opening_tag":true,"array_syntax":{"syntax":"short"},"ordered_imports":{"sort_algorithm":"alpha"},"no_unused_imports":true,"not_operator_with_successor_space":true,"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"}},"single_trait_insert_per_statement":true},"hashes":{"src\/Manager.php":930501081,"src\/LangmanServiceProvider.php":1257576232,"src\/Commands\/RenameCommand.php":2095920507,"src\/Commands\/FindCommand.php":3665218596,"src\/Commands\/ShowCommand.php":3914980388,"src\/Commands\/TransCommand.php":713645047,"src\/Commands\/SyncCommand.php":1106646668,"src\/Commands\/MissingCommand.php":2976620931,"src\/Commands\/RemoveCommand.php":240620579,"tests\/RenameCommandTest.php":2028456726,"tests\/TestCase.php":521851569,"tests\/MissingCommandTest.php":779460724,"tests\/ShowCommandTest.php":1292372205,"tests\/Kernel.php":2894615529,"tests\/FindCommandTest.php":1614708984,"tests\/ManagerTest.php":1494369161,"tests\/TransCommandTest.php":817487670,"tests\/SyncCommandTest.php":3249143934,"tests\/RemoveCommandTest.php":2984639489}}

.php_cs.dist.php

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?php
2+
3+
$finder = Symfony\Component\Finder\Finder::create()
4+
->in([
5+
__DIR__ . '/src',
6+
__DIR__ . '/tests',
7+
])
8+
->name('*.php')
9+
->notName('*.blade.php')
10+
->ignoreDotFiles(true)
11+
->ignoreVCS(true);
12+
13+
return (new PhpCsFixer\Config())
14+
->setRules([
15+
'@PSR2' => true,
16+
'array_syntax' => ['syntax' => 'short'],
17+
'ordered_imports' => ['sort_algorithm' => 'alpha'],
18+
'no_unused_imports' => true,
19+
'not_operator_with_successor_space' => true,
20+
'trailing_comma_in_multiline' => true,
21+
'phpdoc_scalar' => true,
22+
'unary_operator_spaces' => true,
23+
'binary_operator_spaces' => true,
24+
'blank_line_before_statement' => [
25+
'statements' => ['break', 'continue', 'declare', 'return', 'throw', 'try'],
26+
],
27+
'phpdoc_single_line_var_spacing' => true,
28+
'phpdoc_var_without_name' => true,
29+
'class_attributes_separation' => [
30+
'elements' => [
31+
'method' => 'one',
32+
],
33+
],
34+
'method_argument_space' => [
35+
'on_multiline' => 'ensure_fully_multiline',
36+
'keep_multiple_spaces_after_comma' => true,
37+
],
38+
'single_trait_insert_per_statement' => true,
39+
])
40+
->setFinder($finder);

.travis.yml

Lines changed: 0 additions & 11 deletions
This file was deleted.

README.md

Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,37 @@
1-
<h1 align="center">Laravel Langman</h1>
1+
# Laravel Langman
22

3-
<p align="center">
3+
[![Latest Version](https://img.shields.io/github/release/oss-tools/laravel-langman.svg?style=flat-square)](https://github.com/oss-tools/laravel-langman/releases)
4+
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
5+
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/oss-tools/laravel-langman/run-tests?label=tests)
6+
![Check & fix styling](https://github.com/oss-tools/laravel-langman/workflows/Check%20&%20fix%20styling/badge.svg)
7+
[![Total Downloads](https://img.shields.io/packagist/dt/oss-tools/laravel-langman.svg?style=flat-square)](https://packagist.org/packages/oss-tools/laravel-langman)
8+
9+
### What is Langman?
410
Langman is a language files manager in your artisan console, it helps you search, update, add, and remove
511
translation lines with ease. Taking care of a multilingual interface is not a headache anymore.
6-
<br>
7-
<br>
8-
9-
<img src="http://s16.postimg.org/mghfe2v3p/ezgif_com_optimize.gif" alt="Laravel Langman">
10-
<br>
11-
<a href="https://travis-ci.org/themsaid/laravel-langman"><img src="https://travis-ci.org/themsaid/laravel-langman.svg?branch=master" alt="Build Status"></a>
12-
<a href="https://styleci.io/repos/55088784"><img src="https://styleci.io/repos/55088784/shield?style=flat" alt="StyleCI"></a>
13-
<a href="https://packagist.org/packages/themsaid/laravel-langman"><img src="https://poser.pugx.org/themsaid/laravel-langman/v/stable.svg" alt="Latest Stable Version"></a>
14-
<a href="https://packagist.org/packages/themsaid/laravel-langman"><img src="https://poser.pugx.org/themsaid/laravel-langman/d/total.svg" alt="Total Downloads"></a>
15-
<a href="https://packagist.org/packages/themsaid/laravel-langman"><img src="https://poser.pugx.org/themsaid/laravel-langman/license.svg" alt="License"></a>
1612

17-
</p>
13+
## Note
14+
This package is a detached fork of [themsaid/laravel-langman](https://github.com/themsaid/laravel-langman)
1815

1916
## Installation
2017

2118
Begin by installing the package through Composer. Run the following command in your terminal:
2219

2320
```
24-
$ composer require themsaid/laravel-langman
21+
$ composer require oss-tools/laravel-langman
2522
```
2623

2724
Once done, add the following line in your providers array of `config/app.php`:
2825

2926
```php
30-
Themsaid\Langman\LangmanServiceProvider::class
27+
OSSTools\Langman\LangmanServiceProvider::class
3128
```
3229

3330
This package has a single configuration option that points to the `resources/lang` directory, if only you need to change
3431
the path then publish the config file:
3532

3633
```
37-
php artisan vendor:publish --provider="Themsaid\Langman\LangmanServiceProvider"
34+
php artisan vendor:publish --provider="OSSTools\Langman\LangmanServiceProvider"
3835
```
3936

4037
## Usage
@@ -163,3 +160,8 @@ This will rename `users.name` to be `users.full_name`, the console will output a
163160

164161
If you want a web interface to manage your language files instead, I recommend [Laravel 5 Translation Manager](https://github.com/barryvdh/laravel-translation-manager)
165162
by [Barry vd. Heuvel](https://github.com/barryvdh).
163+
164+
## Testing
165+
```
166+
composer test
167+
```

composer.json

Lines changed: 16 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,25 @@
11
{
2-
"name": "themsaid/laravel-langman",
2+
"name": "oss-tools/laravel-langman",
33
"description": "Manage language files with ease.",
44
"keywords": ["laravel", "localization", "multilingual"],
5-
"homepage": "https://github.com/themsaid/laravel-langman",
5+
"homepage": "https://github.com/oss-tools/laravel-langman",
66
"license": "MIT",
7-
"authors": [
8-
{
9-
"name": "Mohamed Said",
10-
"email": "theMohamedSaid@gmail.com",
11-
"homepage": "https://themsaid.github.io"
12-
}
13-
],
147
"require": {
15-
"php": "^5.5.9 || ^7.0",
16-
"illuminate/support": "~5.1",
17-
"illuminate/console": "~5.1",
18-
"illuminate/filesystem": "~5.1"
8+
"php": "^7.4|^8.0",
9+
"illuminate/database": "^6.0 || ^7.0 || ^8.0",
10+
"illuminate/support": "^6.0 || ^7.0 || ^8.0",
11+
"illuminate/console": "^6.0 || ^7.0 || ^8.0",
12+
"illuminate/filesystem": "^6.0 || ^7.0 || ^8.0"
1913
},
2014
"require-dev": {
21-
"phpunit/phpunit" : "^4.8 || ^5.0",
22-
"orchestra/testbench": "~3.0",
23-
"orchestra/database": "~3.0",
24-
"mockery/mockery": "~0.9.4"
15+
"orchestra/testbench": "^6.0",
16+
"phpunit/phpunit": "^9.3",
17+
"orchestra/database": "^6.0",
18+
"mockery/mockery": "^1.4.0"
2519
},
2620
"autoload": {
2721
"psr-4": {
28-
"Themsaid\\Langman\\": "src"
22+
"OSSTools\\Langman\\": "src"
2923
},
3024
"classmap": [
3125
"tests"
@@ -34,8 +28,11 @@
3428
"extra": {
3529
"laravel": {
3630
"providers": [
37-
"Themsaid\\Langman\\LangmanServiceProvider"
31+
"OSSTools\\Langman\\LangmanServiceProvider"
3832
]
3933
}
34+
},
35+
"scripts": {
36+
"test": "vendor/bin/phpunit"
4037
}
4138
}

phpunit.xml

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<phpunit backupGlobals="false"
3-
backupStaticAttributes="false"
4-
bootstrap="vendor/autoload.php"
5-
colors="true"
6-
convertErrorsToExceptions="true"
7-
convertNoticesToExceptions="true"
8-
convertWarningsToExceptions="true"
9-
processIsolation="false"
10-
stopOnFailure="false"
11-
syntaxCheck="false">
2+
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" backupStaticAttributes="false"
3+
bootstrap="vendor/autoload.php" colors="true" convertErrorsToExceptions="true"
4+
convertNoticesToExceptions="true" convertWarningsToExceptions="true" processIsolation="false"
5+
stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/9.3/phpunit.xsd">
6+
<coverage/>
127
<testsuites>
138
<testsuite name="Langman Test Suite">
149
<directory suffix=".php">./tests/</directory>

0 commit comments

Comments
 (0)