Skip to content

Commit 108de2b

Browse files
committed
Merge branch 'limenet-master'
2 parents d42e312 + 6b9175b commit 108de2b

21 files changed

+2376
-2937
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,5 @@ composer.lock
66
coverage
77
/tmp*
88
_ide_helper.php
9-
cs_fixer_tmp_*
9+
cs_fixer_tmp_*
10+
.php_cs.cache

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
language: php
22

33
php:
4+
- 7.1
45
- 7.0
5-
- 5.6
66

77
matrix:
88
fast_finish: true

README.md

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ LLH is a set of artisan commands to manage translations in your Laravel project.
3838
| 5.2.x | 5.2.x | 2.3.x
3939
| 5.3.x | 5.3.x | 2.4.x
4040
| 5.4.x | 5.4.x | 2.5.x
41+
| 5.5.x | 5.5.x | 2.6.x
4142

4243
- Add the following line in the `require-dev` array of the `composer.json` file and replace the version if needed according to your Laravel version:
4344
```php
44-
"potsky/laravel-localization-helpers" : "2.5.*"
45+
"potsky/laravel-localization-helpers" : "2.6.*"
4546
```
4647

4748
- Update your installation : `composer update`
@@ -290,6 +291,10 @@ Use the [github issue tool](https://github.com/potsky/laravel-localization-helpe
290291

291292
## 5. Upgrade notices
292293

294+
### From `v2.x.5` to `v2.x.6`
295+
296+
- PHPCSFixer has changed. Previous fixers are not supported anymore. Take a look at the [configuration file](https://github.com/potsky/laravel-localization-helpers/tree/master/src/config) in the package to check new rules.
297+
293298
### From `v2.x.4` to `v2.x.5`
294299

295300
- Parameter `dot_notation_split_regex` has been added in the [configuration file](https://github.com/potsky/laravel-localization-helpers/tree/master/src/config). Add it in your configuration file.
@@ -305,6 +310,12 @@ Use the [github issue tool](https://github.com/potsky/laravel-localization-helpe
305310

306311
## 6. Change Log
307312

313+
### v2.x.6
314+
315+
- change: support Laravel 5.5
316+
- change: update PHPCSFixer, rules have changed!
317+
- change: translation package has been updated
318+
308319
### v2.x.5
309320

310321
- new: `dot_notation_split_regex` has been added to automatically handle dots in lemma ([#59](https://github.com/potsky/laravel-localization-helpers/issues/59))

composer.json

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,13 @@
88
],
99
"license" : "GPL-3.0+",
1010
"require" : {
11-
"illuminate/support" : "5.4.*",
12-
"friendsofphp/php-cs-fixer" : "^1.11",
11+
"illuminate/support" : "5.5.*",
12+
"friendsofphp/php-cs-fixer" : "^2.6",
1313
"potsky/microsoft-translator-php-sdk" : "*"
1414
},
1515
"require-dev" : {
16-
"orchestra/testbench" : "3.4.*",
17-
"phpunit/phpunit" : "^4.0|^5.0",
18-
"mockery/mockery" : "^0.9",
16+
"orchestra/testbench" : "3.5.*",
17+
"phpunit/phpunit" : "^6.0",
1918
"satooshi/php-coveralls" : "dev-master"
2019
},
2120
"autoload" : {
@@ -26,5 +25,12 @@
2625
"Potsky\\LaravelLocalizationHelpers\\" : "src/"
2726
}
2827
},
29-
"minimum-stability" : "stable"
28+
"minimum-stability" : "stable",
29+
"extra": {
30+
"laravel": {
31+
"providers": [
32+
"Potsky\\LaravelLocalizationHelpers\\LaravelLocalizationHelpersServiceProvider"
33+
]
34+
}
35+
}
3036
}

phpunit.xml

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@
1616
<directory suffix="Tests.php">./tests/</directory>
1717
</testsuite>
1818
</testsuites>
19-
<listeners>
20-
<listener class="\Mockery\Adapter\Phpunit\TestListener"
21-
file="vendor/mockery/mockery/library/Mockery/Adapter/Phpunit/TestListener.php">
22-
</listener>
23-
</listeners>
2419
<filter>
2520
<whitelist processUncoveredFilesFromWhitelist="true">
2621
<directory suffix=".php">./src</directory>

src/Potsky/LaravelLocalizationHelpers/Command/LocalizationAbstract.php

Lines changed: 142 additions & 147 deletions
Original file line numberDiff line numberDiff line change
@@ -4,156 +4,151 @@
44

55
use Illuminate\Config\Repository;
66
use Illuminate\Console\Command;
7+
use Potsky\LaravelLocalizationHelpers\Factory\CodeStyle;
78
use Potsky\LaravelLocalizationHelpers\Factory\Localization;
89
use Potsky\LaravelLocalizationHelpers\Factory\MessageBagInterface;
910

1011
abstract class LocalizationAbstract extends Command implements MessageBagInterface
1112
{
12-
const SUCCESS = 0;
13-
const ERROR = 1;
14-
15-
/**
16-
* Init log file for first log
17-
*
18-
* @var boolean
19-
*/
20-
protected static $logInFileFirst = true;
21-
/**
22-
* Config repository.
23-
*
24-
* @var \Illuminate\Config\Repository
25-
*/
26-
protected $configRepository;
27-
/**
28-
* The localization manager
29-
*
30-
* @var Localization
31-
*/
32-
protected $manager;
33-
/**
34-
* Should commands display something
35-
*
36-
* @var boolean
37-
*/
38-
protected $display = true;
39-
40-
/**
41-
* Create a new command instance.
42-
*
43-
* @param \Illuminate\Config\Repository $configRepository
44-
*/
45-
public function __construct( Repository $configRepository )
46-
{
47-
// Inject this command just to have access to writeLine, writeError, etc... methods
48-
$this->manager = new Localization( $this );
49-
50-
parent::__construct();
51-
}
52-
53-
/**
54-
* Display console message
55-
*
56-
* @param string $s the message to display
57-
*
58-
* @return void
59-
*/
60-
public function writeLine( $s )
61-
{
62-
if ( $this->display )
63-
{
64-
parent::line( $s );
65-
}
66-
}
67-
68-
/**
69-
* Display console message
70-
*
71-
* @param string $s the message to display
72-
*
73-
* @return void
74-
*/
75-
public function writeInfo( $s )
76-
{
77-
if ( $this->display )
78-
{
79-
parent::info( $s );
80-
}
81-
}
82-
83-
/**
84-
* Display console message
85-
*
86-
* @param string $s the message to display
87-
*
88-
* @return void
89-
*/
90-
public function writeComment( $s )
91-
{
92-
if ( $this->display )
93-
{
94-
parent::comment( $s );
95-
}
96-
}
97-
98-
/**
99-
* Display console message
100-
*
101-
* @param string $s the message to display
102-
*
103-
* @return void
104-
*
105-
* @codeCoverageIgnore
106-
*/
107-
public function writeQuestion( $s )
108-
{
109-
if ( $this->display )
110-
{
111-
parent::question( $s );
112-
}
113-
}
114-
115-
/**
116-
* Display console message
117-
*
118-
* @param string $s the message to display
119-
*
120-
* @return void
121-
*/
122-
public function writeError( $s )
123-
{
124-
if ( $this->display )
125-
{
126-
parent::error( $s );
127-
}
128-
}
129-
130-
/**
131-
* Log in a file for debug purpose only
132-
*
133-
* @param mixed $txt
134-
* @param string $logFile
135-
*
136-
* @codeCoverageIgnore
137-
*/
138-
protected function logInFile( $txt = '' , $logFile = '/tmp/llh.log' )
139-
{
140-
if ( ! is_string( $txt ) )
141-
{
142-
$txt = print_r( $txt , true );
143-
}
144-
145-
$txt = '==> ' . date( 'Y/m/d H:i:s' ) . ' ==> ' . $txt . "\n";
146-
147-
if ( self::$logInFileFirst === true )
148-
{
149-
file_put_contents( $logFile , $txt );
150-
151-
self::$logInFileFirst = false;
152-
}
153-
else
154-
{
155-
file_put_contents( $logFile , $txt , FILE_APPEND );
156-
}
157-
}
158-
13+
const SUCCESS = 0;
14+
15+
const ERROR = 1;
16+
17+
/**
18+
* Init log file for first log
19+
*
20+
* @var boolean
21+
*/
22+
protected static $logInFileFirst = true;
23+
24+
/**
25+
* Config repository.
26+
*
27+
* @var \Illuminate\Config\Repository
28+
*/
29+
protected $configRepository;
30+
31+
/**
32+
* The localization manager
33+
*
34+
* @var Localization
35+
*/
36+
protected $manager;
37+
38+
/**
39+
* Should commands display something
40+
*
41+
* @var boolean
42+
*/
43+
protected $display = true;
44+
45+
/**
46+
* Create a new command instance.
47+
*
48+
* @param \Illuminate\Config\Repository $configRepository
49+
*/
50+
public function __construct(Repository $configRepository)
51+
{
52+
// Inject this command just to have access to writeLine, writeError, etc... methods
53+
$this->manager = new Localization($this);
54+
55+
parent::__construct();
56+
}
57+
58+
/**
59+
* Display console message
60+
*
61+
* @param string $s the message to display
62+
*
63+
* @return void
64+
*/
65+
public function writeLine($s)
66+
{
67+
if ($this->display) {
68+
parent::line($s);
69+
}
70+
}
71+
72+
/**
73+
* Display console message
74+
*
75+
* @param string $s the message to display
76+
*
77+
* @return void
78+
*/
79+
public function writeInfo($s)
80+
{
81+
if ($this->display) {
82+
parent::info($s);
83+
}
84+
}
85+
86+
/**
87+
* Display console message
88+
*
89+
* @param string $s the message to display
90+
*
91+
* @return void
92+
*/
93+
public function writeComment($s)
94+
{
95+
if ($this->display) {
96+
parent::comment($s);
97+
}
98+
}
99+
100+
/**
101+
* Display console message
102+
*
103+
* @param string $s the message to display
104+
*
105+
* @return void
106+
*
107+
* @codeCoverageIgnore
108+
*/
109+
public function writeQuestion($s)
110+
{
111+
if ($this->display) {
112+
parent::question($s);
113+
}
114+
}
115+
116+
/**
117+
* Display console message
118+
*
119+
* @param string $s the message to display
120+
*
121+
* @return void
122+
*/
123+
public function writeError($s)
124+
{
125+
if ($this->display) {
126+
parent::error($s);
127+
}
128+
}
129+
130+
/**
131+
* Log in a file for debug purpose only
132+
*
133+
* @param mixed $txt
134+
* @param string $logFile
135+
*
136+
* @codeCoverageIgnore
137+
*/
138+
protected function logInFile($txt = '', $logFile = '/tmp/llh.log')
139+
{
140+
if (! is_string($txt)) {
141+
$txt = print_r($txt, true);
142+
}
143+
144+
$txt = '==> '.date('Y/m/d H:i:s').' ==> '.$txt."\n";
145+
146+
if (self::$logInFileFirst === true) {
147+
file_put_contents($logFile, $txt);
148+
149+
self::$logInFileFirst = false;
150+
} else {
151+
file_put_contents($logFile, $txt, FILE_APPEND);
152+
}
153+
}
159154
}

0 commit comments

Comments
 (0)