Skip to content

Commit

Permalink
Fix code style of many files
Browse files Browse the repository at this point in the history
  • Loading branch information
DariusIII committed May 7, 2019
1 parent 9e9e2b6 commit 0402fa5
Show file tree
Hide file tree
Showing 91 changed files with 2,367 additions and 4,746 deletions.
70 changes: 18 additions & 52 deletions .php-cs.dist
Original file line number Diff line number Diff line change
@@ -1,55 +1,21 @@
<?php
/**
* Config for PHP-CS-Fixer ver2
*/
$rules = [
'psr0' => false,
'@PSR2' => true,
'blank_line_after_namespace' => true,
'braces' => true,
'class_definition' => true,
'elseif' => true,
'function_declaration' => true,
'indentation_type' => true,
'line_ending' => true,
'lowercase_constants' => true,
'lowercase_keywords' => true,
'method_argument_space' => [
'ensure_fully_multiline' => true, ],
'no_break_comment' => true,
'no_closing_tag' => true,
'no_spaces_after_function_name' => true,
'no_spaces_inside_parenthesis' => true,
'no_trailing_whitespace' => true,
'no_trailing_whitespace_in_comment' => true,
'single_blank_line_at_eof' => true,
'single_class_element_per_statement' => [
'elements' => ['property'],
],
'single_import_per_statement' => true,
'single_line_after_imports' => true,
'switch_case_semicolon_to_colon' => true,
'switch_case_space' => true,
'visibility_required' => true,
'encoding' => true,
'full_opening_tag' => true,
];
$excludes = [
// add exclude project directory
'vendor',
'resources',
'tests',
'storage',
'docs',
'public',
'bootstrap',
];
return PhpCsFixer\Config::create()
->setRules($rules)

require __DIR__.'/vendor/autoload.php';
require __DIR__.'/bootstrap/app.php';

return (new MattAllan\LaravelCodeStyle\Config())
->setFinder(
PhpCsFixer\Finder::create()
->exclude($excludes)
->in(__DIR__)
->name('*.php')
->notName('*.blade.php')
);
->in(app_path())
->in(config_path())
->in(database_path())
->notPath(database_path('migrations'))
->in(resource_path('lang'))
->in(base_path('routes'))
->in(base_path('tests'))
->in(base_path('Blacklight'))
->in(base_path('misc'))
)
->setRules([
'@Laravel' => true,
]);
8 changes: 4 additions & 4 deletions Blacklight/NNTP.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
*/

/*
* 'Service discontinued' (RFC977)
*
* @access public
*/
* 'Service discontinued' (RFC977)
*
* @access public
*/
define('NET_NNTP_PROTOCOL_RESPONSECODE_DISCONNECTING_FORCED', 400);

/*
Expand Down
6 changes: 3 additions & 3 deletions Blacklight/db/PreDb.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,11 +106,11 @@ public function executeExport(array $options = null)
$options += $defaults;

if (empty($options['path'])) {
return null;
return;
}

if (! is_numeric($options['limit'])) {
return null;
return;
}

$limit = $options['limit'] > 0 ? "LIMIT {$options['limit']}" : '';
Expand Down Expand Up @@ -153,7 +153,7 @@ public function executeLoadData(array $options = null)
$options += $defaults;

if (empty($options['path'])) {
return null;
return;
}

if (! isset($this->ps['LoadData'])) {
Expand Down
2 changes: 1 addition & 1 deletion Blacklight/libraries/Forking.php
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ private function safeBackfill()
WHERE g.first_record IS NOT NULL
AND g.first_record_postdate IS NOT NULL
AND g.backfill = 1
AND %s < g.first_record_postdate
AND (NOW() - INTERVAL %d DAY ) < g.first_record_postdate
GROUP BY a.name, a.last_record, g.name, g.first_record
%s LIMIT 1',
$backfilldays,
Expand Down
4 changes: 2 additions & 2 deletions Blacklight/libraries/TraktAPI.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ public function movieSummary($movie = '', $type = 'imdbid')
public function searchId($id, $site = 'trakt', $type = 0)
{
if (! \in_array($site, self::$types, false) || ! ctype_digit($id)) {
return null;
return;
}
if ($site === 'imdb') {
$id = 'tt'.$id;
Expand Down Expand Up @@ -268,7 +268,7 @@ public function showSearch($show = '', $type = 'show')
public function showSummary($show = '', $type = 'full')
{
if (empty($show)) {
return null;
return;
}
$showUrl = self::API_URL.'shows/'.Str::slug($show);

Expand Down
1 change: 1 addition & 0 deletions Changelog
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
2019-05-07 DariusIII
* Chg: Fix code style of many files
* Chg: Update code fixing in dev, used libraries and laravel/framework to latest versions
2019-05-05 DariusIII
* Chg: Update pnotify to version 4.0.0 and tinyMCE to latest version
Expand Down
8 changes: 4 additions & 4 deletions config/permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,10 @@
'model_key' => 'name',

/*
* You may optionally indicate a specific cache driver to use for permission and
* role caching using any of the `store` drivers listed in the cache.php config
* file. Using 'default' here means to use the `default` set in cache.php.
*/
* You may optionally indicate a specific cache driver to use for permission and
* role caching using any of the `store` drivers listed in the cache.php config
* file. Using 'default' here means to use the `default` set in cache.php.
*/
'store' => 'default',
],
];
2 changes: 1 addition & 1 deletion database/fixtures/categories.php
Original file line number Diff line number Diff line change
Expand Up @@ -660,5 +660,5 @@
'disablepreview' => 0,
'minsizetoformrelease' => 0,
'maxsizetoformrelease' => 0,
]
],
];
24 changes: 8 additions & 16 deletions database/fixtures/root_categories.php
Original file line number Diff line number Diff line change
@@ -1,71 +1,63 @@
<?php

return [
0 =>
[
0 => [
'id' => 1,
'title' => 'Other',
'status' => 1,
'disablepreview' => 0,
'created_at' => now(),
'updated_at' => now(),
],
1 =>
[
1 => [
'id' => 1000,
'title' => 'Console',
'status' => 1,
'disablepreview' => 0,
'created_at' => now(),
'updated_at' => now(),
],
2 =>
[
2 => [
'id' => 2000,
'title' => 'Movies',
'status' => 1,
'disablepreview' => 0,
'created_at' => now(),
'updated_at' => now(),
],
3 =>
[
3 => [
'id' => 3000,
'title' => 'Audio',
'status' => 1,
'disablepreview' => 0,
'created_at' => now(),
'updated_at' => now(),
],
4 =>
[
4 => [
'id' => 4000,
'title' => 'PC',
'status' => 1,
'disablepreview' => 0,
'created_at' => now(),
'updated_at' => now(),
],
5 =>
[
5 => [
'id' => 5000,
'title' => 'TV',
'status' => 1,
'disablepreview' => 0,
'created_at' => now(),
'updated_at' => now(),
],
6 =>
[
6 => [
'id' => 6000,
'title' => 'XXX',
'status' => 1,
'disablepreview' => 0,
'created_at' => now(),
'updated_at' => now(),
],
7 =>
[
7 => [
'id' => 7000,
'title' => 'Books',
'status' => 1,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTaggedTable extends Migration
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTagsTable extends Migration
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateFirewallTable extends Migration
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateTagGroupsTable extends Migration
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public function up()
});
}


public function down()
{
Schema::table('tagging_tags', function ($table) {
Expand Down
4 changes: 1 addition & 3 deletions database/migrations/2018_01_16_195548_create_users_table.php
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{

/**
* Run the migrations.
*
Expand Down Expand Up @@ -61,7 +60,6 @@ public function up()
});
}


/**
* Reverse the migrations.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreatePermissionTables extends Migration
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCategoriesTable extends Migration
{

/**
* Run the migrations.
*
Expand All @@ -28,7 +27,6 @@ public function up()
});
}


/**
* Reverse the migrations.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCategoryRegexesTable extends Migration
{

/**
* Run the migrations.
*
Expand Down Expand Up @@ -33,7 +32,6 @@ public function up()
}
}


/**
* Reverse the migrations.
*
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCollectionRegexesTable extends Migration
{

/**
* Run the migrations.
*
Expand All @@ -32,7 +31,6 @@ public function up()
}
}


/**
* Reverse the migrations.
*
Expand Down
Loading

0 comments on commit 0402fa5

Please sign in to comment.