CS fixes
This commit is contained in:
parent
01e84501fd
commit
67226679df
44
.php_cs
44
.php_cs
|
@ -1,31 +1,43 @@
|
|||
<?php
|
||||
|
||||
$finder = Symfony\Component\Finder\Finder::create()
|
||||
->files()
|
||||
->in(__DIR__)
|
||||
->name('*.stub')
|
||||
->ignoreDotFiles(true)
|
||||
->ignoreVCS(true);
|
||||
use Symfony\CS\Config\Config;
|
||||
use Symfony\CS\FixerInterface;
|
||||
use Symfony\CS\Finder\DefaultFinder;
|
||||
|
||||
$fixers = [
|
||||
'-psr0',
|
||||
'-php_closing_tag',
|
||||
'blankline_after_open_tag',
|
||||
'braces',
|
||||
'concat_without_spaces',
|
||||
'double_arrow_multiline_whitespaces',
|
||||
'duplicate_semicolon',
|
||||
'elseif',
|
||||
'empty_return',
|
||||
'encoding',
|
||||
'eof_ending',
|
||||
'extra_empty_lines',
|
||||
'function_call_space',
|
||||
'function_declaration',
|
||||
'include',
|
||||
'indentation',
|
||||
'linefeed',
|
||||
'join_function',
|
||||
'line_after_namespace',
|
||||
'list_commas',
|
||||
'logical_not_operators_with_successor_space',
|
||||
'lowercase_constants',
|
||||
'lowercase_keywords',
|
||||
'method_argument_space',
|
||||
'multiline_array_trailing_comma',
|
||||
'multiline_spaces_before_semicolon',
|
||||
'multiple_use',
|
||||
'namespace_no_leading_whitespace',
|
||||
'no_blank_lines_after_class_opening',
|
||||
'no_empty_lines_after_phpdocs',
|
||||
'object_operator',
|
||||
'operators_spaces',
|
||||
'parenthesis',
|
||||
'phpdoc_indent',
|
||||
'phpdoc_inline_tag',
|
||||
'phpdoc_no_access',
|
||||
'phpdoc_no_package',
|
||||
'phpdoc_scalar',
|
||||
|
@ -38,24 +50,24 @@ $fixers = [
|
|||
'remove_lines_between_uses',
|
||||
'return',
|
||||
'self_accessor',
|
||||
'short_array_syntax',
|
||||
'short_echo_tag',
|
||||
'short_tag',
|
||||
'single_array_no_trailing_comma',
|
||||
'single_blank_line_before_namespace',
|
||||
'single_line_after_imports',
|
||||
'single_quote',
|
||||
'spaces_before_semicolon',
|
||||
'spaces_cast',
|
||||
'standardize_not_equal',
|
||||
'ternary_spaces',
|
||||
'trailing_spaces',
|
||||
'trim_array_spaces',
|
||||
'unalign_equals',
|
||||
'unary_operators_spaces',
|
||||
'unused_use',
|
||||
'visibility',
|
||||
'whitespacy_lines',
|
||||
'multiline_spaces_before_semicolon',
|
||||
'short_array_syntax',
|
||||
'short_echo_tag',
|
||||
];
|
||||
|
||||
return Symfony\CS\Config\Config::create()
|
||||
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
|
||||
->fixers($fixers)
|
||||
->finder($finder)
|
||||
->setUsingCache(true);
|
||||
return Config::create()->level(FixerInterface::NONE_LEVEL)->fixers($fixers)->finder(DefaultFinder::create()->in(__DIR__));
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
preset: laravel
|
|
@ -5,7 +5,7 @@ namespace Illuminate\Contracts\Support;
|
|||
interface Htmlable
|
||||
{
|
||||
/**
|
||||
* Get content as a string of HTML
|
||||
* Get content as a string of HTML.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
@ -179,7 +179,7 @@ class Grammar extends BaseGrammar
|
|||
|
||||
if ($clause['where']) {
|
||||
if ($clause['operator'] === 'in' || $clause['operator'] === 'not in') {
|
||||
$second = '('.join(', ', array_fill(0, $clause['second'], '?')).')';
|
||||
$second = '('.implode(', ', array_fill(0, $clause['second'], '?')).')';
|
||||
} else {
|
||||
$second = '?';
|
||||
}
|
||||
|
|
|
@ -5,7 +5,6 @@ namespace Illuminate\Foundation\Auth;
|
|||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Lang;
|
||||
use Illuminate\Support\Facades\Cache;
|
||||
|
||||
trait AuthenticatesUsers
|
||||
{
|
||||
|
|
|
@ -4,7 +4,6 @@ namespace Illuminate\Foundation\Http;
|
|||
|
||||
use Exception;
|
||||
use Throwable;
|
||||
use RuntimeException;
|
||||
use Illuminate\Routing\Router;
|
||||
use Illuminate\Pipeline\Pipeline;
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
|
|
|
@ -35,7 +35,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function open($savePath, $sessionName)
|
||||
{
|
||||
|
@ -43,7 +43,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
|
@ -51,7 +51,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function read($sessionId)
|
||||
{
|
||||
|
@ -59,7 +59,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function write($sessionId, $data)
|
||||
{
|
||||
|
@ -67,7 +67,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function destroy($sessionId)
|
||||
{
|
||||
|
@ -75,7 +75,7 @@ class CacheBasedSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function gc($lifetime)
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ class CookieSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function open($savePath, $sessionName)
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ class CookieSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ class CookieSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function read($sessionId)
|
||||
{
|
||||
|
@ -60,7 +60,7 @@ class CookieSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function write($sessionId, $data)
|
||||
{
|
||||
|
@ -68,7 +68,7 @@ class CookieSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function destroy($sessionId)
|
||||
{
|
||||
|
@ -76,7 +76,7 @@ class CookieSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function gc($lifetime)
|
||||
{
|
||||
|
|
|
@ -42,7 +42,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function open($savePath, $sessionName)
|
||||
{
|
||||
|
@ -50,7 +50,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
|
@ -58,7 +58,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function read($sessionId)
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function write($sessionId, $data)
|
||||
{
|
||||
|
@ -90,7 +90,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function destroy($sessionId)
|
||||
{
|
||||
|
@ -98,7 +98,7 @@ class DatabaseSessionHandler implements SessionHandlerInterface, ExistenceAwareI
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function gc($lifetime)
|
||||
{
|
||||
|
|
|
@ -36,7 +36,7 @@ class FileSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function open($savePath, $sessionName)
|
||||
{
|
||||
|
@ -44,7 +44,7 @@ class FileSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function close()
|
||||
{
|
||||
|
@ -52,7 +52,7 @@ class FileSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function read($sessionId)
|
||||
{
|
||||
|
@ -64,7 +64,7 @@ class FileSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function write($sessionId, $data)
|
||||
{
|
||||
|
@ -72,7 +72,7 @@ class FileSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function destroy($sessionId)
|
||||
{
|
||||
|
@ -80,7 +80,7 @@ class FileSessionHandler implements SessionHandlerInterface
|
|||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function gc($lifetime)
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ use Illuminate\Contracts\Support\Htmlable;
|
|||
class HtmlString implements Htmlable
|
||||
{
|
||||
/**
|
||||
* The HTML string
|
||||
* The HTML string.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
@ -25,7 +25,7 @@ class HtmlString implements Htmlable
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the the HTML string
|
||||
* Get the the HTML string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
@ -35,7 +35,7 @@ class HtmlString implements Htmlable
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the the HTML string
|
||||
* Get the the HTML string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
@ -391,7 +391,7 @@ class BladeCompiler extends Compiler implements CompilerInterface
|
|||
*/
|
||||
protected function compileShow($expression)
|
||||
{
|
||||
return "<?php echo \$__env->yieldSection(); ?>";
|
||||
return '<?php echo $__env->yieldSection(); ?>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -413,7 +413,7 @@ class BladeCompiler extends Compiler implements CompilerInterface
|
|||
*/
|
||||
protected function compileAppend($expression)
|
||||
{
|
||||
return "<?php \$__env->appendSection(); ?>";
|
||||
return '<?php $__env->appendSection(); ?>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -424,7 +424,7 @@ class BladeCompiler extends Compiler implements CompilerInterface
|
|||
*/
|
||||
protected function compileEndsection($expression)
|
||||
{
|
||||
return "<?php \$__env->stopSection(); ?>";
|
||||
return '<?php $__env->stopSection(); ?>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -435,7 +435,7 @@ class BladeCompiler extends Compiler implements CompilerInterface
|
|||
*/
|
||||
protected function compileStop($expression)
|
||||
{
|
||||
return "<?php \$__env->stopSection(); ?>";
|
||||
return '<?php $__env->stopSection(); ?>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -446,7 +446,7 @@ class BladeCompiler extends Compiler implements CompilerInterface
|
|||
*/
|
||||
protected function compileOverwrite($expression)
|
||||
{
|
||||
return "<?php \$__env->stopSection(true); ?>";
|
||||
return '<?php $__env->stopSection(true); ?>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -704,7 +704,7 @@ class BladeCompiler extends Compiler implements CompilerInterface
|
|||
*/
|
||||
protected function compileEndpush($expression)
|
||||
{
|
||||
return "<?php \$__env->appendSection(); ?>";
|
||||
return '<?php $__env->appendSection(); ?>';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -7,7 +7,7 @@ use Illuminate\Contracts\Support\Htmlable;
|
|||
class Expression implements Htmlable
|
||||
{
|
||||
/**
|
||||
* The HTML string
|
||||
* The HTML string.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
|
@ -25,7 +25,7 @@ class Expression implements Htmlable
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the the HTML string
|
||||
* Get the the HTML string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
@ -35,7 +35,7 @@ class Expression implements Htmlable
|
|||
}
|
||||
|
||||
/**
|
||||
* Get the the HTML string
|
||||
* Get the the HTML string.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
|
|
|
@ -11,7 +11,6 @@ class CacheRateLimiterTest extends PHPUnit_Framework_TestCase
|
|||
m::close();
|
||||
}
|
||||
|
||||
|
||||
public function testTooManyAttemptsReturnTrueIfAlreadyLockedOut()
|
||||
{
|
||||
$cache = m::mock(Cache::class);
|
||||
|
@ -23,7 +22,6 @@ class CacheRateLimiterTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertTrue($rateLimiter->tooManyAttempts('key', 1, 1));
|
||||
}
|
||||
|
||||
|
||||
public function testTooManyAttemptsReturnsTrueIfMaxAttemptsExceeded()
|
||||
{
|
||||
$cache = m::mock(Cache::class);
|
||||
|
@ -35,7 +33,6 @@ class CacheRateLimiterTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertTrue($rateLimiter->tooManyAttempts('key', 1, 1));
|
||||
}
|
||||
|
||||
|
||||
public function testHitProperlyIncrementsAttemptCount()
|
||||
{
|
||||
$cache = m::mock(Cache::class);
|
||||
|
@ -46,7 +43,6 @@ class CacheRateLimiterTest extends PHPUnit_Framework_TestCase
|
|||
$rateLimiter->hit('key', 1);
|
||||
}
|
||||
|
||||
|
||||
public function testClearClearsTheCacheKeys()
|
||||
{
|
||||
$cache = m::mock(Cache::class);
|
||||
|
|
|
@ -39,7 +39,7 @@ class EncryptCookiesTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
$this->router->get($this->setCookiePath, [
|
||||
'middleware' => 'EncryptCookiesTestMiddleware',
|
||||
'uses' => 'EncryptCookiesTestController@setCookies'
|
||||
'uses' => 'EncryptCookiesTestController@setCookies',
|
||||
]);
|
||||
|
||||
$response = $this->router->dispatch(Request::create($this->setCookiePath, 'GET'));
|
||||
|
@ -56,7 +56,7 @@ class EncryptCookiesTest extends PHPUnit_Framework_TestCase
|
|||
{
|
||||
$this->router->get($this->queueCookiePath, [
|
||||
'middleware' => ['EncryptCookiesTestMiddleware', 'AddQueuedCookiesToResponseTestMiddleware'],
|
||||
'uses' => 'EncryptCookiesTestController@queueCookies'
|
||||
'uses' => 'EncryptCookiesTestController@queueCookies',
|
||||
]);
|
||||
|
||||
$response = $this->router->dispatch(Request::create($this->queueCookiePath, 'GET'));
|
||||
|
|
|
@ -124,7 +124,6 @@ class DatabaseEloquentSoftDeletesIntegrationTest extends PHPUnit_Framework_TestC
|
|||
$this->assertEquals(1, $users->first()->id);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Helpers...
|
||||
*/
|
||||
|
@ -169,7 +168,6 @@ class SoftDeletesTestUser extends Eloquent
|
|||
protected $guarded = [];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Connection Resolver.
|
||||
*/
|
||||
|
|
|
@ -581,7 +581,7 @@ class DatabaseMySqlSchemaGrammarTest extends PHPUnit_Framework_TestCase
|
|||
public function testAddingTimeStampTzWithDefault()
|
||||
{
|
||||
$blueprint = new Blueprint('users');
|
||||
$blueprint->timestampTz('foo')->default('2015-07-22 11:43:17');;
|
||||
$blueprint->timestampTz('foo')->default('2015-07-22 11:43:17');
|
||||
$statements = $blueprint->toSql($this->getConnection(), $this->getGrammar());
|
||||
|
||||
$this->assertEquals(1, count($statements));
|
||||
|
|
|
@ -20,7 +20,7 @@ class QueueDatabaseQueueTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertEquals(0, $array['attempts']);
|
||||
$this->assertEquals(0, $array['reserved']);
|
||||
$this->assertNull($array['reserved_at']);
|
||||
$this->assertTrue(is_integer($array['available_at']));
|
||||
$this->assertTrue(is_int($array['available_at']));
|
||||
});
|
||||
|
||||
$queue->push('foo', ['data']);
|
||||
|
@ -41,7 +41,7 @@ class QueueDatabaseQueueTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertEquals(0, $array['attempts']);
|
||||
$this->assertEquals(0, $array['reserved']);
|
||||
$this->assertNull($array['reserved_at']);
|
||||
$this->assertTrue(is_integer($array['available_at']));
|
||||
$this->assertTrue(is_int($array['available_at']));
|
||||
});
|
||||
|
||||
$queue->later(10, 'foo', ['data']);
|
||||
|
|
|
@ -669,7 +669,7 @@ return 'foo!'; });
|
|||
|
||||
public function testRoutePrefixing()
|
||||
{
|
||||
/**
|
||||
/*
|
||||
* Prefix route
|
||||
*/
|
||||
$router = $this->getRouter();
|
||||
|
@ -679,7 +679,7 @@ return 'foo!'; });
|
|||
$routes[0]->prefix('prefix');
|
||||
$this->assertEquals('prefix/foo/bar', $routes[0]->uri());
|
||||
|
||||
/**
|
||||
/*
|
||||
* Use empty prefix
|
||||
*/
|
||||
$router = $this->getRouter();
|
||||
|
@ -689,7 +689,7 @@ return 'foo!'; });
|
|||
$routes[0]->prefix('/');
|
||||
$this->assertEquals('foo/bar', $routes[0]->uri());
|
||||
|
||||
/**
|
||||
/*
|
||||
* Prefix homepage
|
||||
*/
|
||||
$router = $this->getRouter();
|
||||
|
|
|
@ -13,7 +13,6 @@ class SupportArrTest extends PHPUnit_Framework_TestCase
|
|||
$this->assertFalse(Arr::isAssoc(['a', 'b']));
|
||||
}
|
||||
|
||||
|
||||
public function testSortRecursive()
|
||||
{
|
||||
$array = [
|
||||
|
|
|
@ -351,7 +351,7 @@ class SupportHelpersTest extends PHPUnit_Framework_TestCase
|
|||
'bar',
|
||||
'baz',
|
||||
'foo',
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
$this->assertEquals($assumedArray, array_sort_recursive($array));
|
||||
|
|
Loading…
Reference in New Issue