Skip to content

Commit de6085e

Browse files
committed
Updated to 1.1.6 version
1 parent 27b5f44 commit de6085e

File tree

8 files changed

+37
-45
lines changed

8 files changed

+37
-45
lines changed

.gitattributes

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ phpmd.xml export-ignore
88
.travis.yml export-ignore
99
.editorconfig export-ignore
1010
.gitattributes export-ignore
11-
.gitignore export-ignore
11+
.gitignore export-ignore
12+
.php_cs.dist export-ignore
13+
CONDUCT.md export-ignore

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# CHANGELOG
22

3+
## 1.1.6 - 2018-01-06
4+
5+
* The tests were fixed.
6+
7+
* Changes in documentation.
8+
39
## 1.1.5 - 2017-11-08
410

511
* Implemented `PHP Mess Detector` to detect inconsistencies in code styles.

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
The MIT License (MIT)
22
=====================
33

4-
Copyright (c) `2016 - 2017` `Josantonius, https://josantonius.com <hello@josantonius.com>`
4+
Copyright (c) `2016 - 2018` `Josantonius, https://josantonius.com <hello@josantonius.com>`
55

66
Permission is hereby granted, free of charge, to any person obtaining a copy of
77
this software and associated documentation files (the "Software"), to deal in

README-ES.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,10 @@ Ejecutar todas las pruebas anteriores:
174174

175175
## ☑ Tareas pendientes
176176

177-
- [ ] Añadir nueva funcionalidad
178-
- [ ] Mejorar pruebas
179-
- [ ] Mejorar documentación
180-
- [ ] Refactorizar código
177+
- [ ] Añadir nueva funcionalidad.
178+
- [ ] Mejorar pruebas.
179+
- [ ] Mejorar documentación.
180+
- [ ] Refactorizar código para las reglas de estilo de código deshabilitadas. Ver [phpmd.xml](phpmd.xml) y [.php_cs.dist](.php_cs.dist).
181181

182182
## Contribuir
183183

@@ -204,7 +204,7 @@ Este proyecto está licenciado bajo **licencia MIT**. Consulta el archivo [LICEN
204204

205205
## Copyright
206206

207-
2016 - 2017 Josantonius, [josantonius.com](https://josantonius.com/)
207+
2017 - 2018 Josantonius, [josantonius.com](https://josantonius.com/)
208208

209209
Si te ha resultado útil, házmelo saber :wink:
210210

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,10 +141,10 @@ Run all previous tests:
141141

142142
## ☑ TODO
143143

144-
- [ ] Add new feature
145-
- [ ] Improve tests
146-
- [ ] Improve documentation
147-
- [ ] Refactor code
144+
- [ ] Add new feature.
145+
- [ ] Improve tests.
146+
- [ ] Improve documentation.
147+
- [ ] Refactor code for disabled code style rules. See [phpmd.xml](phpmd.xml) and [.php_cs.dist](.php_cs.dist).
148148

149149
## Contribute
150150

@@ -171,7 +171,7 @@ This project is licensed under **MIT license**. See the [LICENSE](LICENSE) file
171171

172172
## Copyright
173173

174-
2016 - 2017 Josantonius, [josantonius.com](https://josantonius.com/)
174+
2017 - 2018 Josantonius, [josantonius.com](https://josantonius.com/)
175175

176176
If you find it useful, let me know :wink:
177177

src/LanguageCode.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* List of 217 language codes: ISO 639-1.
44
*
55
* @author Josantonius <hello@josantonius.com>
6-
* @copyright 2016 - 2017 (c) Josantonius - PHP-LanguageCode
6+
* @copyright 2017 - 2018 (c) Josantonius - PHP-LanguageCode
77
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
88
* @link https://github.com/Josantonius/PHP-LanguageCode
99
* @since 1.0.0
@@ -12,16 +12,12 @@
1212

1313
/**
1414
* Language code handler.
15-
*
16-
* @since 1.0.0
1715
*/
1816
class LanguageCode
1917
{
2018
/**
2119
* Get all language codes as array.
2220
*
23-
* @since 1.0.0
24-
*
2521
* @return array → language codes and language names
2622
*/
2723
public static function get()
@@ -32,8 +28,6 @@ public static function get()
3228
/**
3329
* Get language name from language code.
3430
*
35-
* @since 1.0.0
36-
*
3731
* @param string $languageCode → language code, e.g. 'es'
3832
*
3933
* @return tring|false → country name
@@ -46,8 +40,6 @@ public static function getLanguageFromCode($languageCode)
4640
/**
4741
* Get language code from language name.
4842
*
49-
* @since 1.0.0
50-
*
5143
* @param string $languageName → language name, e.g. 'Spanish'
5244
*
5345
* @return tring|false → language code

src/LanguageCodeCollection.php

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* List of 217 language codes: ISO 639-1.
44
*
55
* @author Josantonius <hello@josantonius.com>
6-
* @copyright 2016 - 2017 (c) Josantonius - PHP-LanguageCode
6+
* @copyright 2017 - 2018 (c) Josantonius - PHP-LanguageCode
77
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
88
* @link https://github.com/Josantonius/PHP-LanguageCode
99
* @since 1.1.4
@@ -14,16 +14,12 @@
1414
* Language code handler.
1515
*
1616
* Compiled from https://wikipedia.org/wiki/List_of_ISO_639-1_codes
17-
*
18-
* @since 1.1.4
1917
*/
2018
class LanguageCodeCollection
2119
{
2220
/**
2321
* List of language codes.
2422
*
25-
* @since 1.1.4
26-
*
2723
* @var array
2824
*/
2925
protected static $data = [
@@ -249,8 +245,6 @@ class LanguageCodeCollection
249245
/**
250246
* Returns all language codes.
251247
*
252-
* @since 1.1.4
253-
*
254248
* @return array
255249
*/
256250
public static function all()
@@ -261,8 +255,6 @@ public static function all()
261255
/**
262256
* Return language name from language code.
263257
*
264-
* @since 1.1.4
265-
*
266258
* @param string $key
267259
*
268260
* @return string|null → language code or null

tests/LanguageCodeTest.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* List of 217 language codes: ISO 639-1.
44
*
55
* @author Josantonius <hello@josantonius.com>
6-
* @copyright 2016 - 2017 (c) Josantonius - PHP-LanguageCode
6+
* @copyright 2017 - 2018 (c) Josantonius - PHP-LanguageCode
77
* @license https://opensource.org/licenses/MIT - The MIT License (MIT)
88
* @link https://github.com/Josantonius/PHP-LanguageCode
99
* @since 1.1.3
@@ -14,8 +14,6 @@
1414

1515
/**
1616
* Tests class for LanguageCode library.
17-
*
18-
* @since 1.1.3
1917
*/
2018
class LanguageCodeTest extends TestCase
2119
{
@@ -47,17 +45,19 @@ public function setUp()
4745
*/
4846
public function testIsInstanceOfLanguageCode()
4947
{
50-
$actual = $this->LanguageCode;
51-
$this->assertInstanceOf('Josantonius\LanguageCode\LanguageCode', $actual);
48+
$this->assertInstanceOf(
49+
'Josantonius\LanguageCode\LanguageCode',
50+
$this->LanguageCode
51+
);
5252
}
5353

5454
/**
5555
* Get language name from language code.
56-
*
57-
* @since 1.1.3
5856
*/
5957
public function testGetLanguageFromCode()
6058
{
59+
$languageCode = $this->LanguageCode;
60+
6161
$this->assertContains(
6262
'Spanish',
6363
$this->LanguageCode->getLanguageFromCode('es')
@@ -66,23 +66,23 @@ public function testGetLanguageFromCode()
6666

6767
/**
6868
* Getting a language name wrong.
69-
*
70-
* @since 1.1.3
7169
*/
7270
public function testGetLanguageFromCodeUndefined()
7371
{
72+
$languageCode = $this->LanguageCode;
73+
7474
$this->assertFalse(
7575
$this->LanguageCode->getLanguageFromCode('abcd')
7676
);
7777
}
7878

7979
/**
8080
* Get language code from language name
81-
*
82-
* @since 1.1.3
8381
*/
8482
public function testGetCodeFromLanguage()
8583
{
84+
$languageCode = $this->LanguageCode;
85+
8686
$this->assertContains(
8787
'es',
8888
$this->LanguageCode->getCodeFromLanguage('Spanish')
@@ -91,23 +91,23 @@ public function testGetCodeFromLanguage()
9191

9292
/**
9393
* Getting a language code wrong.
94-
*
95-
* @since 1.1.3
9694
*/
9795
public function testGetCodeFromLanguageUndefined()
9896
{
97+
$languageCode = $this->LanguageCode;
98+
9999
$this->assertFalse(
100100
$this->LanguageCode->getCodeFromLanguage('abcd')
101101
);
102102
}
103103

104104
/**
105105
* Get all language codes as array.
106-
*
107-
* @since 1.1.3
108106
*/
109107
public function testGetAll()
110108
{
109+
$languageCode = $this->LanguageCode;
110+
111111
$this->assertInternalType(
112112
'array',
113113
$this->LanguageCode->get()

0 commit comments

Comments
 (0)