Skip to content

Commit

Permalink
Merge pull request #10 from ARCANEDEV/develop
Browse files Browse the repository at this point in the history
Updating the package
  • Loading branch information
arcanedev-maroc committed Jan 24, 2016
2 parents 388a21d + b1bc9d9 commit 7945d05
Show file tree
Hide file tree
Showing 17 changed files with 100 additions and 109 deletions.
2 changes: 1 addition & 1 deletion .scrutinizer.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ checks:
tools:
external_code_coverage:
timeout: 600
runs: 3
runs: 12
php_code_sniffer:
enabled: true
config:
Expand Down
13 changes: 9 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,28 @@
language: php

sudo: false

php:
- 5.5.9
- 5.5
- 5.6
- 7.0
- hhvm

sudo: false
env:
- TESTBENCH_VERSION=3.0.*
- TESTBENCH_VERSION=3.1.*
- TESTBENCH_VERSION=3.2.*

before_script:
- travis_retry composer self-update
- travis_retry composer install --prefer-source --no-interaction
- travis_retry composer require --prefer-source --no-interaction --dev "orchestra/testbench:${TESTBENCH_VERSION}"

script:
- composer validate
- mkdir -p build/logs
- vendor/bin/phpunit --coverage-text --coverage-clover=coverage.clover

after_script:
- if [ "$TRAVIS_PHP_VERSION" != "7.0" ] && [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ "$TRAVIS_PHP_VERSION" != "7.0" ] && [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then wget https://scrutinizer-ci.com/ocular.phar; fi
- if [ "$TRAVIS_PHP_VERSION" != "hhvm" ]; then php ocular.phar code-coverage:upload --format=php-clover coverage.clover; fi
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2015 ARCANEDEV <[email protected]> - LaravelLang
Copyright (c) 2015-2016 | ARCANEDEV <[email protected]> - LaravelLang

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
11 changes: 3 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
[![Packagist Downloads][badge_downloads]](https://packagist.org/packages/arcanedev/laravel-lang)

[badge_license]: https://img.shields.io/packagist/l/arcanedev/laravel-lang.svg?style=flat-square
[badge_laravel]: https://img.shields.io/badge/For%20Laravel-5.0%7C5.1-orange.svg?style=flat-square
[badge_laravel]: https://img.shields.io/badge/For%20Laravel-5.x-orange.svg?style=flat-square

[badge_build]: https://img.shields.io/travis/ARCANEDEV/LaravelLang.svg?style=flat-square
[badge_hhvm]: https://img.shields.io/hhvm/arcanedev/laravel-lang.svg?style=flat-square
Expand All @@ -27,7 +27,7 @@

*By [ARCANEDEV&copy;](http://www.arcanedev.net/)*

Translations manager and checker for Laravel 5 based on [caouecs/Laravel-lang](https://github.com/caouecs/Laravel-lang) translations.
Translations manager and checker for Laravel v5 based on [caouecs/Laravel-lang](https://github.com/caouecs/Laravel-lang) translations.

Feel free to check out the [releases](https://github.com/ARCANEDEV/LaravelLang/releases), [license](LICENSE.md), and [contribution guidelines](CONTRIBUTING.md).

Expand All @@ -36,6 +36,7 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/LaravelLang/r
* Easy setup &amp; configuration.
* Missing translations Checker.
* Translations Publisher.
* Laravel 5.0, 5.1 & 5.2 are supported.
* Well documented &amp; IDE Friendly.
* Well tested with maximum code quality.
* Made with :heart: &amp; :coffee:.
Expand All @@ -49,14 +50,8 @@ Feel free to check out the [releases](https://github.com/ARCANEDEV/LaravelLang/r

## TODO

- [ ] Test Laravel 5.0 support.
- [ ] Adding LaravelLang API.

## DONE

- [x] Laravel 5.1 supported.
- [x] Complete the documentation.

## Contribution

Any ideas are welcome. Feel free to submit any issues or pull requests, please check the [contribution guidelines](CONTRIBUTING.md).
10 changes: 6 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
{
"name": "ARCANEDEV",
"email": "[email protected]",
"homepage": "https://github.com/ARCANEDEV",
"homepage": "https://github.com/arcanedev-maroc",
"role": "Developer"
}
],
Expand All @@ -21,8 +21,7 @@
"caouecs/laravel4-lang": "~2.0"
},
"require-dev": {
"orchestra/testbench": "~3.1",
"phpunit/phpcov": "~2.0",
"phpunit/phpcov": "~2.0|~3.0",
"phpunit/phpunit": "~4.0|~5.0"
},
"autoload": {
Expand All @@ -35,9 +34,12 @@
"Arcanedev\\LaravelLang\\Tests\\": "tests/"
}
},
"scripts": {
"testbench": "composer require --dev \"orchestra/testbench=~3.0\""
},
"extra": {
"branch-alias": {
"dev-master": "1.2-dev"
"dev-master": "1.3-dev"
}
}
}
5 changes: 3 additions & 2 deletions src/Commands/CheckCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ class CheckCommand extends Command
*/
public function __construct(TransChecker $checker)
{
parent::__construct();

$this->name = $this->signature;
$this->checker = $checker;
$this->count = 0;

parent::__construct();
}

/* ------------------------------------------------------------------------------------------------
Expand Down
31 changes: 29 additions & 2 deletions src/Commands/PublishCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
use Arcanedev\LaravelLang\Bases\Command;
use Arcanedev\LaravelLang\Contracts\TransPublisher;
use Arcanedev\LaravelLang\Exceptions\LangPublishException;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;

/**
* Class PublishCommand
Expand Down Expand Up @@ -50,9 +52,10 @@ class PublishCommand extends Command
*/
public function __construct(TransPublisher $publisher)
{
parent::__construct();

$this->publisher = $publisher;
$this->name = 'trans:publish';

parent::__construct();
}

/* ------------------------------------------------------------------------------------------------
Expand Down Expand Up @@ -100,4 +103,28 @@ private function publish($locale, $force)
$this->error($e->getMessage());
}
}

/**
* Get the console command arguments.
*
* @return array
*/
protected function getArguments()
{
return [
['locale', InputArgument::REQUIRED, 'The language to publish the translations.'],
];
}

/**
* Get the console command options.
*
* @return array
*/
protected function getOptions()
{
return [
['force', 'f', InputOption::VALUE_OPTIONAL, 'Force to override the translations', false],
];
}
}
39 changes: 19 additions & 20 deletions src/LaravelLangServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,22 +47,8 @@ public function getBasePath()
| Main Functions
| ------------------------------------------------------------------------------------------------
*/
/**
* Boot the service provider.
*/
public function boot()
{
parent::boot();

$this->publishes([
$this->getConfigFile() => config_path("{$this->package}.php"),
], 'config');
}

/**
* Register the service provider.
*
* @return void
*/
public function register()
{
Expand All @@ -79,6 +65,16 @@ public function register()
}
}

/**
* Boot the service provider.
*/
public function boot()
{
$this->publishes([
$this->getConfigFile() => config_path("{$this->package}.php"),
], 'config');
}

/**
* Get the services provided by the provider.
*
Expand Down Expand Up @@ -107,8 +103,8 @@ private function registerTransManager()
{
$this->singleton('arcanedev.laravel-lang.manager', function (Application $app) {
/**
* @var \Illuminate\Filesystem\Filesystem $files
* @var \Illuminate\Config\Repository $config
* @var \Illuminate\Filesystem\Filesystem $files
* @var \Illuminate\Contracts\Config\Repository $config
*/
$files = $app['files'];
$config = $app['config'];
Expand All @@ -120,7 +116,7 @@ private function registerTransManager()
return new TransManager($files, $paths);
});

$this->app->bind(
$this->bind(
\Arcanedev\LaravelLang\Contracts\TransManager::class,
'arcanedev.laravel-lang.manager'
);
Expand All @@ -135,7 +131,7 @@ private function registerTransChecker()
/**
* @var \Illuminate\Translation\Translator $translator
* @var \Arcanedev\LaravelLang\Contracts\TransManager $manager
* @var \Illuminate\Config\Repository $config
* @var \Illuminate\Contracts\Config\Repository $config
*/
$translator = $app['translator'];
$manager = $app['arcanedev.laravel-lang.manager'];
Expand All @@ -144,12 +140,15 @@ private function registerTransChecker()
return new TransChecker($translator, $manager, $config->get('laravel-lang', []));
});

$this->app->bind(
$this->bind(
\Arcanedev\LaravelLang\Contracts\TransChecker::class,
'arcanedev.laravel-lang.checker'
);
}

/**
* Register the lang publisher.
*/
private function registerLangPublisher()
{
$this->singleton('arcanedev.laravel-lang.publisher', function (Application $app) {
Expand All @@ -163,7 +162,7 @@ private function registerLangPublisher()
return new TransPublisher($files, $manager, $app->langPath());
});

$this->app->bind(
$this->bind(
\Arcanedev\LaravelLang\Contracts\TransPublisher::class,
'arcanedev.laravel-lang.publisher'
);
Expand Down
14 changes: 0 additions & 14 deletions tests/Commands/CheckCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@
*/
class CheckCommandTest extends TestCase
{
/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
*/
public function setUp()
{
parent::setUp();
}

public function tearDown()
{
parent::tearDown();
}

/* ------------------------------------------------------------------------------------------------
| Test Functions
| ------------------------------------------------------------------------------------------------
Expand Down
14 changes: 0 additions & 14 deletions tests/Commands/PublishCommandTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,6 @@
*/
class PublishCommandTest extends TestCase
{
/* ------------------------------------------------------------------------------------------------
| Main Functions
| ------------------------------------------------------------------------------------------------
*/
public function setUp()
{
parent::setUp();
}

public function tearDown()
{
parent::tearDown();
}

/* ------------------------------------------------------------------------------------------------
| Test Functions
| ------------------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions tests/LaravelLangServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ public function setUp()

public function tearDown()
{
parent::tearDown();

unset($this->provider);

parent::tearDown();
}

/* ------------------------------------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions tests/Providers/CommandServiceProviderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ public function setUp()

public function tearDown()
{
parent::tearDown();

unset($this->provider);

parent::tearDown();
}

/* ------------------------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 7945d05

Please sign in to comment.