PSR-2 fixes

This commit is contained in:
Toby Zerner 2015-07-05 21:46:57 +09:30
parent b792fd2efd
commit 01ec661c3f
11 changed files with 18 additions and 19 deletions

View File

@ -163,7 +163,8 @@ class ApiServiceProvider extends ServiceProvider
$routes->post(
'/discussions',
'flarum.api.discussions.create',
$this->action('Flarum\Api\Actions\Discussions\CreateAction'));
$this->action('Flarum\Api\Actions\Discussions\CreateAction')
);
// Show a single discussion
$routes->get(

View File

@ -16,4 +16,4 @@ class GenerateAccessToken
{
$this->userId = $userId;
}
}
}

View File

@ -4,6 +4,10 @@ use Flarum\Api\AccessToken;
class GenerateAccessTokenHandler
{
/**
* @param GenerateAccessToken $command
* @return AccessToken
*/
public function handle(GenerateAccessToken $command)
{
$token = AccessToken::generate($command->userId);
@ -12,4 +16,4 @@ class GenerateAccessTokenHandler
return $token;
}
}
}

View File

@ -36,9 +36,7 @@ class RevisionCompiler implements Compiler
$ext = pathinfo($this->filename, PATHINFO_EXTENSION);
$file = $this->path.'/'.substr_replace($this->filename, '-'.$revision, -strlen($ext) - 1, 0);
if (! ($exists = file_exists($file))
|| filemtime($file) < $lastModTime) {
if (! ($exists = file_exists($file)) || filemtime($file) < $lastModTime) {
if ($exists) {
unlink($file);
}

View File

@ -112,8 +112,7 @@ class GenerateExtensionCommand extends Command
if ($file != '.' && $file != '..') {
if (is_dir($src.'/'.$file)) {
$this->recursiveCopy($src.'/'.$file, $dst.'/'.$file, $replacements);
}
else {
} else {
$contents = file_get_contents($src.'/'.$file);
$contents = str_replace(array_keys($replacements), array_values($replacements), $contents);

View File

@ -161,9 +161,8 @@ class Application extends Container implements LaravelApplication
*/
protected function fireListeners(array $listeners)
{
foreach ($listeners as $listener)
{
foreach ($listeners as $listener) {
$listener($this);
}
}
}
}

View File

@ -37,7 +37,7 @@ class DatabaseServiceProvider extends ServiceProvider
$this->app->alias('Illuminate\Database\ConnectionResolverInterface', 'db');
if (Core::isInstalled()) {
$this->app->booting(function() {
$this->app->booting(function () {
$resolver = $this->app->make('Illuminate\Database\ConnectionResolverInterface');
Model::setConnectionResolver($resolver);

View File

@ -44,4 +44,4 @@ trait AppliesParametersToSearch
$search->getQuery()->take($limit);
}
}
}
}

View File

@ -140,4 +140,4 @@ trait ValidatesBeforeSave
return $rule;
}
}
}

View File

@ -65,4 +65,4 @@ class RouterMiddleware
return $this->dispatcher;
}
}
}

View File

@ -27,7 +27,7 @@ abstract class Action
*/
protected function redirectTo($url)
{
$content = sprintf(<<<'HTML'
$content = sprintf('
<!DOCTYPE html>
<html>
<head>
@ -39,9 +39,7 @@ abstract class Action
<body>
Redirecting to <a href="%1$s">%1$s</a>.
</body>
</html>
HTML
, htmlspecialchars($url, ENT_QUOTES, 'UTF-8'));
</html>', htmlspecialchars($url, ENT_QUOTES, 'UTF-8'));
$response = new RedirectResponse($url);
$response->getBody()->write($content);