Skip to content

Commit

Permalink
support for laravel 6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
melihovv committed Sep 7, 2019
1 parent d68c0de commit d017538
Show file tree
Hide file tree
Showing 9 changed files with 34 additions and 75 deletions.
3 changes: 0 additions & 3 deletions .sensiolabs.yml

This file was deleted.

39 changes: 25 additions & 14 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
cache:
directories:
- $HOME/.composer/cache

language: php

sudo: false
Expand All @@ -7,29 +11,36 @@ notifications:
on_success: never
on_failure: always

php:
- 7.0
- 7.1
- 7.2

env:
matrix:
- COMPOSER_FLAGS="--prefer-lowest"
- COMPOSER_FLAGS=""
matrix:
include:
- php: 7.2
env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.2
env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-stable'
- php: 7.3
env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.3
env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-stable'
- php: 7.4snapshot
env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-lowest'
- php: 7.4snapshot
env: LARAVEL='6.*' TESTBENCH='4.*' COMPOSER_FLAGS='--prefer-stable'
fast_finish: true
allow_failures:
- php: 7.4snapshot

before_install:
- travis_retry composer self-update --stable -n
- composer config discard-changes true
- composer validate --no-check-all --strict
- travis_retry composer self-update
- travis_retry composer require "laravel/framework:${LARAVEL}" "orchestra/testbench:${TESTBENCH}" --no-interaction --no-update

install:
- travis_retry composer update --prefer-source $COMPOSER_FLAGS
- travis_retry composer update ${COMPOSER_FLAGS} --prefer-dist --no-interaction --no-suggest
- composer require satooshi/php-coveralls --dev

script:
- composer run phpunit -- --coverage-clover ./tests/logs/clover.xml
- composer run phpcs
- composer run phpmd
- composer run phpcpd

after_script:
- php vendor/bin/php-coveralls -v
Expand Down
2 changes: 0 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@ Laravel Env Validator

[![Build Status](https://travis-ci.org/melihovv/laravel-env-validator.svg?branch=master)](https://travis-ci.org/melihovv/laravel-env-validator)
[![styleci](https://styleci.io/repos/78041678/shield)](https://styleci.io/repos/78041678)
[![SensioLabsInsight](https://insight.sensiolabs.com/projects/0ed1727a-ede0-4cdc-ac45-0d31eddb1596/mini.png)](https://insight.sensiolabs.com/projects/0ed1727a-ede0-4cdc-ac45-0d31eddb1596)
[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/melihovv/laravel-env-validator/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/melihovv/laravel-env-validator/?branch=master)
[![Coverage Status](https://coveralls.io/repos/github/melihovv/laravel-env-validator/badge.svg?branch=master)](https://coveralls.io/github/melihovv/laravel-env-validator?branch=master)

[![Packagist](https://img.shields.io/packagist/v/melihovv/laravel-env-validator.svg)](https://packagist.org/packages/melihovv/laravel-env-validator)
Expand Down
18 changes: 6 additions & 12 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,22 +26,16 @@
}
},
"require": {
"php": ">=7.0",
"illuminate/support": "~5.5.0|~5.6.0|~5.7.0|~5.8.0"
"php": ">=7.2",
"illuminate/support": "^6.0",
"illuminate/validation": "^6.0"
},
"require-dev": {
"orchestra/testbench": "~3.5.0|~3.6.0|~3.7.0|~3.8.0",
"phpmd/phpmd": "^2.6",
"phpunit/phpunit": "~6.0|~7.0",
"sebastian/phpcpd": "^3.0",
"squizlabs/php_codesniffer": "^2.7"
"orchestra/testbench": "^4.0",
"phpunit/phpunit": "^8.0"
},
"scripts": {
"phpunit": "phpunit --dont-report-useless-tests",
"phpmd": "phpmd src/LaravelEnvValidator text ./phpmd-rules.xml",
"phpcs": "phpcs --standard=./phpcs-rules.xml --encoding=utf-8 src/LaravelEnvValidator",
"phpcbf": "phpcbf --standard=./phpcs-rules.xml --encoding=utf-8 src/LaravelEnvValidator",
"phpcpd": "phpcpd src/LaravelEnvValidator"
"phpunit": "phpunit --dont-report-useless-tests"
},
"extra": {
"laravel": {
Expand Down
14 changes: 0 additions & 14 deletions phpcs-rules.xml

This file was deleted.

23 changes: 0 additions & 23 deletions phpmd-rules.xml

This file was deleted.

4 changes: 3 additions & 1 deletion src/LaravelEnvValidator/EnvValidatorFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

namespace Melihovv\LaravelEnvValidator;

use Illuminate\Support\Facades\Validator;

class EnvValidatorFactory
{
public static function buildFromLaravelConfig()
Expand All @@ -13,7 +15,7 @@ public static function buildFromLaravelConfig()
$env[$variable] = env($variable);
}

$validator = \Validator::make($env, $config);
$validator = Validator::make($env, $config);

$varsNames = array_keys($env);
$validator->setAttributeNames(array_combine($varsNames, $varsNames));
Expand Down
5 changes: 0 additions & 5 deletions src/LaravelEnvValidator/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,6 @@ public function boot()
if ($this->app->runningInConsole()) {
$this->commands([EnvValidatorCommand::class]);
}

if (config('laravel-env-validator.live_validation')) {
$validator = EnvValidatorFactory::buildFromLaravelConfig();
$validator->validate();
}
}

public function register()
Expand Down
1 change: 0 additions & 1 deletion src/config/laravel-env-validator.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

return [
'live_validation' => false,
'rules' => [
'APP_ENV' => 'in:local,production',
'APP_KEY' => 'required',
Expand Down

0 comments on commit d017538

Please sign in to comment.