Skip to content

Commit

Permalink
Merge pull request #5 from ARCANESOFT/patch-1
Browse files Browse the repository at this point in the history
Cleaning the package
  • Loading branch information
arcanedev-maroc authored Sep 8, 2017
2 parents fe5de40 + 1a07ab1 commit fdb0713
Show file tree
Hide file tree
Showing 40 changed files with 119 additions and 167 deletions.
16 changes: 8 additions & 8 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/_docs export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/CONTRIBUTING.md export-ignore
/phpunit.xml export-ignore
/_docs export-ignore
/tests export-ignore
/.gitattributes export-ignore
/.gitignore export-ignore
/.scrutinizer.yml export-ignore
/.travis.yml export-ignore
/CONTRIBUTING.md export-ignore
/phpunit.xml.dist export-ignore
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: 4
runs: 3
php_code_sniffer:
enabled: true
config:
Expand Down
5 changes: 1 addition & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,9 @@ matrix:
allow_failures:
- php: nightly

env:
- TESTBENCH_VERSION=3.4.*

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

script:
- composer validate
Expand Down
25 changes: 8 additions & 17 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,15 @@
"license": "MIT",
"require": {
"php": ">=5.6.4",
"arcanedev/laravel-seo": "~0.5",
"arcanedev/spam-blocker": "~1.3",
"arcanesoft/auth": "~3.0",
"arcanesoft/core": "~2.4"
"arcanedev/laravel-seo": "~0.5.0",
"arcanedev/spam-blocker": "~1.3.0",
"arcanesoft/auth": "~3.0.0",
"arcanesoft/core": "~2.6.0"
},
"require-dev": {
"phpunit/phpcov": "~3.0",
"phpunit/phpunit": "~5.0"
"orchestra/testbench": "~3.4.0",
"phpunit/phpcov": "~3.0",
"phpunit/phpunit": "~5.0"
},
"autoload": {
"psr-4": {
Expand All @@ -35,15 +36,5 @@
"psr-4": {
"Arcanesoft\\Seo\\Tests\\": "tests/"
}
},
"scripts": {
"testbench": "composer require --dev \"orchestra/testbench-browser-kit=~3.4.0\""
},
"extra": {
"branch-alias": {
"dev-master": "1.0.x-dev"
}
},
"minimum-stability": "dev",
"prefer-stable" : true
}
}
File renamed without changes.
2 changes: 1 addition & 1 deletion src/Entities/Locales.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class Locales
*/
public static function all()
{
return new Collection(trans("seo::locales"));
return new Collection(trans('seo::locales'));
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/Helpers/TextReplacer.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ class TextReplacer
| Properties
| -----------------------------------------------------------------
*/

/** @var array */
protected $replacements;

/* -----------------------------------------------------------------
| Constructor
| -----------------------------------------------------------------
*/

/**
* TextReplacer constructor.
*
Expand Down Expand Up @@ -79,6 +81,7 @@ protected function mergeReplacements(array $replacements)
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Make the instance.
*
Expand Down
7 changes: 6 additions & 1 deletion src/Http/Controllers/Admin/Controller.php
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<?php namespace Arcanesoft\Seo\Http\Controllers\Admin;

use Arcanedev\LaravelApiHelper\Traits\JsonResponses;
use Arcanesoft\Core\Http\Controllers\AdminController;
use Arcanesoft\Core\Traits\Notifyable;

Expand All @@ -15,12 +16,15 @@ abstract class Controller extends AdminController
| Traits
| -----------------------------------------------------------------
*/
use Notifyable;

use Notifyable,
JsonResponses;

/* -----------------------------------------------------------------
| Properties
| -----------------------------------------------------------------
*/

/**
* The view namespace.
*
Expand All @@ -32,6 +36,7 @@ abstract class Controller extends AdminController
| Constructor
| ------------------------------------------------------------------------------------------------
*/

/**
* Instantiate the controller.
*/
Expand Down
10 changes: 2 additions & 8 deletions src/Http/Controllers/Admin/FootersController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php namespace Arcanesoft\Seo\Http\Controllers\Admin;

use Arcanedev\LaravelApiHelper\Traits\JsonResponses;
use Arcanesoft\Seo\Entities\Locales;
use Arcanesoft\Seo\Http\Requests\Admin\Footers\CreateFooterRequest;
use Arcanesoft\Seo\Http\Requests\Admin\Footers\UpdateFooterRequest;
Expand All @@ -17,13 +16,6 @@
*/
class FootersController extends Controller
{
/* -----------------------------------------------------------------
| Traits
| -----------------------------------------------------------------
*/

use JsonResponses;

/* -----------------------------------------------------------------
| Constructor
| -----------------------------------------------------------------
Expand Down Expand Up @@ -142,6 +134,8 @@ public function delete(Footer $footer)
/**
* Notify with translation.
*
* @todo: Refactor this method to the core package ?
*
* @param string $action
* @param array $replace
* @param array $context
Expand Down
11 changes: 3 additions & 8 deletions src/Http/Controllers/Admin/PagesController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php namespace Arcanesoft\Seo\Http\Controllers\Admin;

use Arcanedev\LaravelApiHelper\Traits\JsonResponses;
use Arcanesoft\Seo\Entities\Locales;
use Arcanesoft\Seo\Http\Requests\Admin\Pages\CreatePageRequest;
use Arcanesoft\Seo\Http\Requests\Admin\Pages\UpdatePageRequest;
Expand All @@ -16,17 +15,11 @@
*/
class PagesController extends Controller
{
/* -----------------------------------------------------------------
| Traits
| -----------------------------------------------------------------
*/

use JsonResponses;

/* -----------------------------------------------------------------
| Constructor
| -----------------------------------------------------------------
*/

/**
* PagesController constructor.
*/
Expand Down Expand Up @@ -136,6 +129,8 @@ public function delete(Page $page)
/**
* Notify with translation.
*
* @todo: Refactor this method to the core package ?
*
* @param string $action
* @param array $replace
* @param array $context
Expand Down
10 changes: 2 additions & 8 deletions src/Http/Controllers/Admin/RedirectsController.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php namespace Arcanesoft\Seo\Http\Controllers\Admin;

use Arcanedev\LaravelApiHelper\Traits\JsonResponses;
use Arcanedev\LaravelSeo\Entities\RedirectStatuses;
use Arcanesoft\Seo\Http\Requests\Admin\Redirects\CreateRedirectRequest;
use Arcanesoft\Seo\Http\Requests\Admin\Redirects\UpdateRedirectRequest;
Expand All @@ -16,13 +15,6 @@
*/
class RedirectsController extends Controller
{
/* -----------------------------------------------------------------
| Traits
| -----------------------------------------------------------------
*/

use JsonResponses;

/* -----------------------------------------------------------------
| Constructor
| -----------------------------------------------------------------
Expand Down Expand Up @@ -179,6 +171,8 @@ public function delete(Redirect $redirect)
/**
* Notify with translation.
*
* @todo: Refactor this method to the core package ?
*
* @param string $action
* @param array $replace
* @param array $context
Expand Down
1 change: 1 addition & 0 deletions src/Http/Controllers/Admin/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ class SettingsController extends Controller
| Constructor
| -----------------------------------------------------------------
*/

/**
* SettingsController constructor.
*/
Expand Down
55 changes: 0 additions & 55 deletions src/Http/Middleware/SeoSpamBlockerMiddleware.php

This file was deleted.

1 change: 1 addition & 0 deletions src/Http/Requests/Admin/Footers/CreateFooterRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class CreateFooterRequest extends FooterFormRequest
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Determine if the user is authorized to make this request.
*
Expand Down
8 changes: 4 additions & 4 deletions src/Http/Requests/Admin/Footers/FooterFormRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ public function getValidatedData()
*/
protected function getPageRule()
{
$existsRule = Rule::exists($this->getTablePrefix().'pages', 'id');

if ($this->has('locale'))
$existsRule = $existsRule->where('locale', $this->get('locale', config('app.locale')));
$existsRule = Rule::exists($this->getTablePrefix().'pages', 'id')->where(function ($query) {
if ($this->has('locale'))
$query->where('locale', $this->get('locale', config('app.locale')));
});

return ['required', 'integer', $existsRule];
}
Expand Down
1 change: 1 addition & 0 deletions src/Http/Requests/Admin/Footers/UpdateFooterRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class UpdateFooterRequest extends FooterFormRequest
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Determine if the user is authorized to make this request.
*
Expand Down
3 changes: 2 additions & 1 deletion src/Http/Requests/Admin/FormRequest.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php namespace Arcanesoft\Seo\Http\Requests\Admin;

use Arcanedev\Support\Bases\FormRequest as BaseFormRequest;
use Arcanedev\Support\Http\FormRequest as BaseFormRequest;
use Arcanesoft\Seo\Entities\Locales;

/**
Expand All @@ -15,6 +15,7 @@ abstract class FormRequest extends BaseFormRequest
| Other Methods
| -----------------------------------------------------------------
*/

/**
* Get the local validation rule.
*
Expand Down
1 change: 1 addition & 0 deletions src/Http/Requests/Admin/Pages/CreatePageRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class CreatePageRequest extends PageFormRequest
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Determine if the user is authorized to make this request.
*
Expand Down
1 change: 1 addition & 0 deletions src/Http/Requests/Admin/Pages/UpdatePageRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class UpdatePageRequest extends PageFormRequest
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Determine if the user is authorized to make this request.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class CreateRedirectRequest extends RedirectFormRequest
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Determine if the user is authorized to make this request.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class UpdateRedirectRequest extends RedirectFormRequest
| Main Methods
| -----------------------------------------------------------------
*/

/**
* Determine if the user is authorized to make this request.
*
Expand Down
2 changes: 1 addition & 1 deletion src/Http/Routes/Admin/FootersRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static function bindings()
$registrar = new static;

$registrar->bind('seo_footer', function ($id) {
return Footer::findOrFail($id);
return Footer::query()->findOrFail($id);
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/Http/Routes/Admin/MetasRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public static function bindings()
$registrar = new static;

$registrar->bind('seo_meta', function ($id) {
return Meta::findOrFail($id);
return Meta::query()->findOrFail($id);
});
}

Expand Down
Loading

0 comments on commit fdb0713

Please sign in to comment.