Skip to content

Laravel10 compatibility #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 26 commits into from
Jan 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9bc3d02
wip
blessingdube Dec 19, 2021
f4e3ef1
add php-cs-fixer config
blessingdube Dec 19, 2021
1e91c52
Fix styling
blessingdube Dec 19, 2021
efbd29d
wip
blessingdube Dec 19, 2021
9f77449
Merge remote-tracking branch 'origin/feature/adding-support-for-larav…
blessingdube Dec 19, 2021
ef980ca
Fix styling
blessingdube Dec 19, 2021
5ccfc5d
wip on fixing tests
blessingdube Dec 19, 2021
9e57437
Merge remote-tracking branch 'origin/feature/adding-support-for-larav…
blessingdube Dec 19, 2021
32ee2c6
Fix styling
blessingdube Dec 19, 2021
9460345
Only support Laravel 6, 7 and 8
blessingdube Dec 20, 2021
c214f0b
Fix styling
blessingdube Dec 20, 2021
6aed985
Update README.md
blessingdube Dec 20, 2021
6c61742
Merge pull request #1 from oss-tools/feature/adding-support-for-larav…
blessingdube Dec 20, 2021
25a72f2
remove update-changelog from workflows
blessingdube Dec 20, 2021
b5a06bf
add Laravel v9 support
blessingdube Mar 11, 2022
b6aabdd
Fix styling
blessingdube Mar 11, 2022
a20ad51
upgrade to Laravel 10
blessingdube Jul 24, 2023
62681fa
Fix styling
blessingdube Jul 24, 2023
be1fcb7
update run-tests.yml
blessingdube Jul 24, 2023
811d49c
Fix Laravel FileSystem dependency
blessingdube Jul 28, 2023
7724c6d
rector auto upgrade to 7.4
parsingeye Jan 21, 2022
7a74621
Laravel 10 compatibility
Hernan-Aranda-Prado Jan 26, 2024
0f4f23c
Laravel 10 compatibility
Hernan-Aranda-Prado Jan 26, 2024
2375821
Laravel 10 compatibility
Hernan-Aranda-Prado Jan 26, 2024
6b77cce
Laravel 10 compatibility
Hernan-Aranda-Prado Jan 26, 2024
e50e4f1
Fix styling
Hernan-Aranda-Prado Jan 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/php-cs-fixer.yml
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.dist.php --allow-risky=yes

- name: Commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: Fix styling
38 changes: 38 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: run-tests

on: [push, pull_request]

jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: true
matrix:
os: [ubuntu-latest]
php: [8.1]
laravel: [10.*]
dependency-version: [prefer-lowest, prefer-stable]
include:
- laravel: 10.*
testbench: 8.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} - ${{ 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
coverage: none

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest

- name: Execute tests
run: vendor/bin/phpunit
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/vendor
composer.phar
composer.lock

.idea/

.phpunit.result.cache
1 change: 1 addition & 0 deletions .php-cs-fixer.cache
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"php":"8.3.2","version":"3.48.0","indent":" ","lineEnding":"\n","rules":{"blank_line_after_namespace":true,"braces_position":true,"class_definition":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":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_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":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,"spaces_inside_parentheses":true,"statement_indentation":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\/Commands\/TransCommand.php":"fb42c64cb7e50a610ac6affe273a03e2","src\/Commands\/MissingCommand.php":"209347df1c302654677d234756619ab6","src\/Commands\/RenameCommand.php":"7c017fed4284e3aa7f085ef01f1ff13c","src\/Commands\/ShowCommand.php":"6493876ce899d1ba684ec330825516b0","src\/Commands\/FindCommand.php":"00ff2a25269ea8f919605e86f9bbc835","src\/Commands\/SyncCommand.php":"e29867a1c6a984672156cc981ef72d72","src\/Commands\/RemoveCommand.php":"364f9f3c15a1b3e97d0c7f67206220dd","src\/Manager.php":"1451b96b911bb3eb707e97b4a8975109","src\/LangmanServiceProvider.php":"97135894ddcbce677615698a1844ff10","tests\/ManagerTest.php":"d27905a621c44997ece2d43bef717ab4","tests\/TestCase.php":"93301f8abcc0af9f421bee880ba1be79","tests\/ShowCommandTest.php":"04239415c5ef6d7e1530d6133de22e66","tests\/TransCommandTest.php":"f62bfa6dbf83547e806132d41d0ac89b","tests\/MissingCommandTest.php":"2ff8e658ec9d0e216f21bd51e90933ce","tests\/RemoveCommandTest.php":"4260e6a2f64acf58cb76fc7951d137c2","tests\/SyncCommandTest.php":"0c95c883a98c27b8881777272c1e5ded","tests\/Kernel.php":"cfa0d64c25ba87ee36609b84cd1b0764","tests\/FindCommandTest.php":"84df6f0c6e9de514841c7aa3bb0ab330","tests\/RenameCommandTest.php":"33e8b352b17c7428948b5a0ee59fe9cd"}}
40 changes: 40 additions & 0 deletions .php_cs.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

$finder = Symfony\Component\Finder\Finder::create()
->in([
__DIR__ . '/src',
__DIR__ . '/tests',
])
->name('*.php')
->notName('*.blade.php')
->ignoreDotFiles(true)
->ignoreVCS(true);

return (new PhpCsFixer\Config())
->setRules([
'@PSR2' => 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',
],
],
'method_argument_space' => [
'on_multiline' => 'ensure_fully_multiline',
'keep_multiple_spaces_after_comma' => true,
],
'single_trait_insert_per_statement' => true,
])
->setFinder($finder);
11 changes: 0 additions & 11 deletions .travis.yml

This file was deleted.

34 changes: 18 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,40 +1,37 @@
<h1 align="center">Laravel Langman</h1>
# Laravel Langman

<p align="center">
[![Latest Version](https://img.shields.io/github/release/oss-tools/laravel-langman.svg?style=flat-square)](https://github.com/oss-tools/laravel-langman/releases)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/oss-tools/laravel-langman/run-tests?label=tests)
![Check & fix styling](https://github.com/oss-tools/laravel-langman/workflows/Check%20&%20fix%20styling/badge.svg)
[![Total Downloads](https://img.shields.io/packagist/dt/oss-tools/laravel-langman.svg?style=flat-square)](https://packagist.org/packages/oss-tools/laravel-langman)

### What is Langman?
Langman is a language files manager in your artisan console, it helps you search, update, add, and remove
translation lines with ease. Taking care of a multilingual interface is not a headache anymore.
<br>
<br>

<img src="http://s16.postimg.org/mghfe2v3p/ezgif_com_optimize.gif" alt="Laravel Langman">
<br>
<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>
<a href="https://styleci.io/repos/55088784"><img src="https://styleci.io/repos/55088784/shield?style=flat" alt="StyleCI"></a>
<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>
<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>
<a href="https://packagist.org/packages/themsaid/laravel-langman"><img src="https://poser.pugx.org/themsaid/laravel-langman/license.svg" alt="License"></a>

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

## Installation

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

```
$ composer require themsaid/laravel-langman
$ composer require mrge-group/laravel-langman
```

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

```php
Themsaid\Langman\LangmanServiceProvider::class
mrgegroup\Langman\LangmanServiceProvider::class
```

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

```
php artisan vendor:publish --provider="Themsaid\Langman\LangmanServiceProvider"
php artisan vendor:publish --provider="mrgegroup\Langman\LangmanServiceProvider"
```

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

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)
by [Barry vd. Heuvel](https://github.com/barryvdh).

## Testing
```
composer test
```
32 changes: 14 additions & 18 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,27 +1,20 @@
{
"name": "themsaid/laravel-langman",
"name": "mrge-group/laravel-langman",
"description": "Manage language files with ease.",
"keywords": ["laravel", "localization", "multilingual"],
"homepage": "https://github.com/themsaid/laravel-langman",
"homepage": "https://github.com/oss-tools/laravel-langman",
"license": "MIT",
"authors": [
{
"name": "Mohamed Said",
"email": "theMohamedSaid@gmail.com",
"homepage": "https://themsaid.github.io"
}
],
"require": {
"php": "^5.5.9 || ^7.0",
"illuminate/support": "~5.1",
"illuminate/console": "~5.1",
"illuminate/filesystem": "~5.1"
"php": "^8.0.2",
"illuminate/database": "^9.0 || ^10.0",
"illuminate/support": "^9.0 || ^10.0",
"illuminate/console": "^9.0 || ^10.0",
"illuminate/filesystem": "^9.0 || ^10.0"
},
"require-dev": {
"phpunit/phpunit" : "^4.8 || ^5.0",
"orchestra/testbench": "~3.0",
"orchestra/database": "~3.0",
"mockery/mockery": "~0.9.4"
"orchestra/testbench": "^7.0 || ^8.0",
"phpunit/phpunit": "^9.5.10 || ^10.1",
"mockery/mockery": "^1.6.0"
},
"autoload": {
"psr-4": {
Expand All @@ -34,8 +27,11 @@
"extra": {
"laravel": {
"providers": [
"Themsaid\\Langman\\LangmanServiceProvider"
"mrgegroup\\Langman\\LangmanServiceProvider"
]
}
},
"scripts": {
"test": "vendor/bin/phpunit"
}
}
31 changes: 13 additions & 18 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,15 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
syntaxCheck="false">
<testsuites>
<testsuite name="Langman Test Suite">
<directory suffix=".php">./tests/</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
</php>
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" backupGlobals="false" bootstrap="vendor/autoload.php" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.2/phpunit.xsd" cacheDirectory=".phpunit.cache" backupStaticProperties="false">
<coverage/>
<testsuites>
<testsuite name="Langman Test Suite">
<directory suffix=".php">./tests/</directory>
<exclude>tests/Kernel.php</exclude>
<exclude>tests/TestCase.php</exclude>
</testsuite>
</testsuites>
<php>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
</php>
<source/>
</phpunit>
11 changes: 5 additions & 6 deletions src/Commands/FindCommand.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

namespace Themsaid\Langman\Commands;
namespace OSSTools\Langman\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Arr;
use Themsaid\Langman\Manager;
use Illuminate\Support\Str;
use OSSTools\Langman\Manager;

class FindCommand extends Command
{
Expand All @@ -26,7 +25,7 @@ class FindCommand extends Command
/**
* The Languages manager instance.
*
* @var \Themsaid\LangMan\Manager
* @var \OSSTools\LangMan\Manager
*/
private $manager;

Expand All @@ -40,7 +39,7 @@ class FindCommand extends Command
/**
* ListCommand constructor.
*
* @param \Themsaid\LangMan\Manager $manager
* @param \OSSTools\LangMan\Manager $manager
* @return void
*/
public function __construct(Manager $manager)
Expand Down Expand Up @@ -112,7 +111,7 @@ private function tableRows()
$original[$languageKey] =
isset($values[$languageKey])
? $values[$languageKey]
: isset($filesContent[$fileName][$languageKey][$key]) ? $filesContent[$fileName][$languageKey][$key] : '';
: (isset($filesContent[$fileName][$languageKey][$key]) ? $filesContent[$fileName][$languageKey][$key] : '');
}

// Sort the language values based on language name
Expand Down
11 changes: 6 additions & 5 deletions src/Commands/MissingCommand.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Themsaid\Langman\Commands;
namespace OSSTools\Langman\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Arr;
use Themsaid\Langman\Manager;
use OSSTools\Langman\Manager;

class MissingCommand extends Command
{
Expand All @@ -25,7 +25,7 @@ class MissingCommand extends Command
/**
* The Languages manager instance.
*
* @var \Themsaid\LangMan\Manager
* @var \OSSTools\LangMan\Manager
*/
private $manager;

Expand All @@ -39,7 +39,7 @@ class MissingCommand extends Command
/**
* ListCommand constructor.
*
* @param \Themsaid\LangMan\Manager $manager
* @param \OSSTools\LangMan\Manager $manager
* @return void
*/
public function __construct(Manager $manager)
Expand Down Expand Up @@ -96,7 +96,8 @@ private function collectValues(array $missing)

foreach ($missing as $missingKey) {
$values[$missingKey] = $this->ask(
"<fg=yellow>{$missingKey}</> translation", $this->getDefaultValue($missingKey)
"<fg=yellow>{$missingKey}</> translation",
$this->getDefaultValue($missingKey)
);
}

Expand Down
8 changes: 4 additions & 4 deletions src/Commands/RemoveCommand.php
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace Themsaid\Langman\Commands;
namespace OSSTools\Langman\Commands;

use Illuminate\Console\Command;
use Illuminate\Support\Str;
use Themsaid\Langman\Manager;
use OSSTools\Langman\Manager;

class RemoveCommand extends Command
{
Expand All @@ -25,7 +25,7 @@ class RemoveCommand extends Command
/**
* The Languages manager instance.
*
* @var \Themsaid\LangMan\Manager
* @var \OSSTools\LangMan\Manager
*/
private $manager;

Expand All @@ -39,7 +39,7 @@ class RemoveCommand extends Command
/**
* ListCommand constructor.
*
* @param \Themsaid\LangMan\Manager $manager
* @param \OSSTools\LangMan\Manager $manager
* @return void
*/
public function __construct(Manager $manager)
Expand Down
Loading