Skip to content

Commit 373aa76

Browse files
Merge pull request #148 from ARCANEDEV/update-github_actions
Using GitHub Actions for testing
2 parents 4c5588b + f1889c7 commit 373aa76

58 files changed

Lines changed: 560 additions & 306 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,5 @@
77
.gitattributes export-ignore
88
.gitignore export-ignore
99
.scrutinizer.yml export-ignore
10-
.travis.yml export-ignore
1110
phpunit.xml.dist export-ignore
1211
CONTRIBUTING.md export-ignore

.github/workflows/run-tests.yml

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: run-tests
2+
3+
on: [push]
4+
5+
jobs:
6+
tests:
7+
runs-on: ubuntu-latest
8+
9+
strategy:
10+
fail-fast: true
11+
matrix:
12+
php: [7.2, 7.3, 7.4]
13+
laravel: [6.*]
14+
dependency-version: [prefer-lowest, prefer-stable]
15+
16+
name: PHP ${{ matrix.php }} - ${{ matrix.dependency-version }}
17+
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v1
21+
22+
- name: Cache dependencies
23+
uses: actions/cache@v1
24+
with:
25+
path: ~/.composer/cache/files
26+
key: dependencies-laravel-${{ matrix.laravel }}-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
27+
28+
- name: Setup PHP
29+
uses: shivammathur/setup-php@v1
30+
with:
31+
php-version: ${{ matrix.php }}
32+
extensions: curl, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv, intl
33+
coverage: xdebug
34+
35+
- name: Install dependencies
36+
run: composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction --no-suggest
37+
38+
- name: Execute tests
39+
run: |
40+
mkdir -p build/logs
41+
vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover
42+
43+
- name: Scrutinizer CI
44+
run: |
45+
wget https://scrutinizer-ci.com/ocular.phar
46+
php ocular.phar code-coverage:upload --format=php-clover coverage.clover

.scrutinizer.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ checks:
2121

2222
tools:
2323
external_code_coverage:
24-
timeout: 1200
25-
runs: 2
24+
timeout: 600
25+
runs: 6
2626
php_code_sniffer:
2727
enabled: true
2828
config:

.travis.yml

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

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Localization [![Packagist License][badge_license]](LICENSE.md) [![For Laravel][badge_laravel]][link-github-repo]
22

3-
[![Travis Status][badge_build]][link-travis]
3+
[![Github Workflow Status][badge_build]][link-github-status]
44
[![Coverage Status][badge_coverage]][link-scrutinizer]
55
[![Scrutinizer Code Quality][badge_quality]][link-scrutinizer]
66
[![SensioLabs Insight][badge_insight]][link-insight]
@@ -53,7 +53,7 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.
5353

5454
[badge_license]: http://img.shields.io/packagist/l/arcanedev/localization.svg?style=flat-square
5555
[badge_laravel]: https://img.shields.io/badge/Laravel-5.x%20|%206.x-orange.svg?style=flat-square
56-
[badge_build]: http://img.shields.io/travis/ARCANEDEV/Localization.svg?style=flat-square
56+
[badge_build]: https://img.shields.io/github/workflow/status/ARCANEDEV/Localization/run-tests?style=flat-square
5757
[badge_coverage]: https://img.shields.io/scrutinizer/coverage/g/ARCANEDEV/Localization.svg?style=flat-square
5858
[badge_quality]: https://img.shields.io/scrutinizer/g/ARCANEDEV/Localization.svg?style=flat-square
5959
[badge_insight]: https://img.shields.io/sensiolabs/i/30a231b2-295e-466a-8733-fe95cf2bc48d.svg?style=flat-square
@@ -64,9 +64,9 @@ If you discover any security related issues, please email arcanedev.maroc@gmail.
6464

6565
[link-author]: https://github.com/arcanedev-maroc
6666
[link-github-repo]: https://github.com/ARCANEDEV/Localization
67+
[link-github-status]: https://github.com/ARCANEDEV/localization/actions
6768
[link-github-issues]: https://github.com/ARCANEDEV/Localization/issues
6869
[link-contributors]: https://github.com/ARCANEDEV/Localization/graphs/contributors
6970
[link-packagist]: https://packagist.org/packages/arcanedev/localization
70-
[link-travis]: https://travis-ci.org/ARCANEDEV/Localization
7171
[link-scrutinizer]: https://scrutinizer-ci.com/g/ARCANEDEV/Localization/?branch=master
7272
[link-insight]: https://insight.sensiolabs.com/projects/30a231b2-295e-466a-8733-fe95cf2bc48d

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,12 @@
1616
"require": {
1717
"php": ">=7.2.0",
1818
"ext-json": "*",
19-
"arcanedev/support": "^5.0"
19+
"arcanedev/support": "^5.1"
2020
},
2121
"require-dev": {
22+
"ext-intl": "*",
2223
"orchestra/testbench": "^4.0",
23-
"mockery/mockery": "^1.0",
24+
"mockery/mockery": "^1.3.1",
2425
"phpunit/phpcov": "^6.0",
2526
"phpunit/phpunit": "^8.0"
2627
},

helpers.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,18 @@
11
<?php
22

3+
declare(strict_types=1);
4+
5+
use Arcanedev\Localization\Contracts\Localization;
6+
37
if ( ! function_exists('localization')) {
48
/**
59
* Get the Localization instance.
610
*
711
* @return Arcanedev\Localization\Contracts\Localization
812
*/
9-
function localization()
13+
function localization(): Localization
1014
{
11-
return app(Arcanedev\Localization\Contracts\Localization::class);
15+
return app(Localization::class);
1216
}
1317
}
1418

src/Contracts/LocalesManager.php

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
<?php namespace Arcanedev\Localization\Contracts;
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Arcanedev\Localization\Contracts;
26

37
/**
48
* Interface LocalesManager
@@ -34,7 +38,7 @@ public function getDefaultLocale();
3438
*
3539
* @param string $defaultLocale
3640
*
37-
* @return self
41+
* @return $this
3842
*/
3943
public function setDefaultLocale($defaultLocale = null);
4044

@@ -50,7 +54,7 @@ public function getCurrentLocale();
5054
*
5155
* @param string $currentLocale
5256
*
53-
* @return self
57+
* @return $this
5458
*/
5559
public function setCurrentLocale($currentLocale);
5660

@@ -87,7 +91,7 @@ public function getSupportedLocalesKeys();
8791
*
8892
* @param array $supportedLocales
8993
*
90-
* @return self
94+
* @return $this
9195
*/
9296
public function setSupportedLocales(array $supportedLocales);
9397

src/Contracts/Localization.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
<?php namespace Arcanedev\Localization\Contracts;
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Arcanedev\Localization\Contracts;
26

37
use Illuminate\Http\Request;
48

@@ -114,6 +118,8 @@ public function setLocale($locale = null);
114118
* Sets the base url for the site.
115119
*
116120
* @param string $url
121+
*
122+
* @return $this
117123
*/
118124
public function setBaseUrl($url);
119125

src/Contracts/Negotiator.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
<?php namespace Arcanedev\Localization\Contracts;
1+
<?php
2+
3+
declare(strict_types=1);
4+
5+
namespace Arcanedev\Localization\Contracts;
26

37
use Arcanedev\Localization\Entities\LocaleCollection;
48
use Illuminate\Http\Request;

0 commit comments

Comments
 (0)