Skip to content

Commit

Permalink
Added CS stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
lianguan committed Dec 14, 2015
1 parent 2f019aa commit 8000990
Show file tree
Hide file tree
Showing 291 changed files with 1,813 additions and 1,929 deletions.
95 changes: 95 additions & 0 deletions .php_cs
@@ -0,0 +1,95 @@
<?php

$header = <<<EOF
This file is part of Gitamin.
Copyright (C) 2015-2016 The Gitamin Team
For the full copyright and license information, please view the LICENSE
file that was distributed with this source code.
EOF;

Symfony\CS\Fixer\Contrib\HeaderCommentFixer::setHeader($header);

$fixers = [
'header_comment',
'alias_functions',
'array_element_no_space_before_comma',
'array_element_white_space_after_comma',
'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',
'function_typehint_space',
'include',
'indentation',
'linefeed',
'line_after_namespace',
'list_commas',
'logical_not_operators_with_successor_space',
'lowercase_constants',
'lowercase_keywords',
'method_argument_space',
'method_separation',
'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',
'phpdoc_summary',
'phpdoc_to_comment',
'phpdoc_trim',
'phpdoc_type_to_var',
'phpdoc_types',
'phpdoc_var_without_name',
'psr4',
'remove_leading_slash_use',
'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',
];

return Symfony\CS\Config\Config::create()
->level(Symfony\CS\FixerInterface::PSR2_LEVEL)
->fixers($fixers)
->finder(
Symfony\CS\Finder\DefaultFinder::create()
->exclude(['bootstrap/cache', 'storage', 'vendor'])
->in(__DIR__)
)
;
15 changes: 15 additions & 0 deletions .styleci.yml
@@ -0,0 +1,15 @@
preset: laravel

linting: true

enabled:

disabled:

finder:
exclude:
- "bootstrap/cache"
- "storage"
- "vendor"
name:
- "*.php"
12 changes: 5 additions & 7 deletions app/Commands/Comment/AddCommentCommand.php
Expand Up @@ -2,7 +2,7 @@

/*
* This file is part of Gitamin.
*
*
* Copyright (C) 2015-2016 The Gitamin Team
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -54,11 +54,11 @@ final class AddCommentCommand
* @var string[]
*/
public $rules = [
'message' => 'required|string',
'message' => 'required|string',
'target_type' => 'required|string',
'target_id' => 'required|int',
'author_id' => 'int',
'project_id' => 'int',
'target_id' => 'required|int',
'author_id' => 'int',
'project_id' => 'int',
];

/**
Expand All @@ -69,8 +69,6 @@ final class AddCommentCommand
* @param int $target_id
* @param int $author_id
* @param int $project_id
*
* @return void
*/
public function __construct($message, $target_type, $target_id, $author_id, $project_id)
{
Expand Down
4 changes: 1 addition & 3 deletions app/Commands/Comment/RemoveCommentCommand.php
Expand Up @@ -2,7 +2,7 @@

/*
* This file is part of Gitamin.
*
*
* Copyright (C) 2015-2016 The Gitamin Team
*
* For the full copyright and license information, please view the LICENSE
Expand All @@ -26,8 +26,6 @@ final class RemoveCommentCommand
* Create a new remove comment command instance.
*
* @param \Gitamin\Models\Comment $comment
*
* @return void
*/
public function __construct(Comment $comment)
{
Expand Down
6 changes: 2 additions & 4 deletions app/Commands/Comment/UpdateCommentCommand.php
Expand Up @@ -2,7 +2,7 @@

/*
* This file is part of Gitamin.
*
*
* Copyright (C) 2015-2016 The Gitamin Team
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -35,15 +35,13 @@ final class UpdateCommentCommand
* @var string[]
*/
public $rules = [
'message' => 'required|string',
'message' => 'required|string',
];

/**
* Create a new update comment command instance.
*
* @param string $message
*
* @return void
*/
public function __construct(Comment $comment, $message)
{
Expand Down
4 changes: 1 addition & 3 deletions app/Commands/Invite/ClaimInviteCommand.php
Expand Up @@ -2,7 +2,7 @@

/*
* This file is part of Gitamin.
*
*
* Copyright (C) 2015-2016 The Gitamin Team
*
* For the full copyright and license information, please view the LICENSE
Expand All @@ -24,8 +24,6 @@ final class ClaimInviteCommand
* Create a new claim invite command instance.
*
* @param \Gitamin\Model\Invite $invite
*
* @return void
*/
public function __construct($invite)
{
Expand Down
10 changes: 4 additions & 6 deletions app/Commands/Issue/AddIssueCommand.php
Expand Up @@ -2,7 +2,7 @@

/*
* This file is part of Gitamin.
*
*
* Copyright (C) 2015-2016 The Gitamin Team
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -47,10 +47,10 @@ final class AddIssueCommand
* @var string[]
*/
public $rules = [
'title' => 'required|string',
'title' => 'required|string',
'description' => 'string',
'author_id' => 'int',
'project_id' => 'int',
'author_id' => 'int',
'project_id' => 'int',
];

/**
Expand All @@ -60,8 +60,6 @@ final class AddIssueCommand
* @param string $description
* @param int $author_id
* @param int $project_id
*
* @return void
*/
public function __construct($title, $description, $author_id, $project_id)
{
Expand Down
4 changes: 1 addition & 3 deletions app/Commands/Issue/RemoveIssueCommand.php
Expand Up @@ -2,7 +2,7 @@

/*
* This file is part of Gitamin.
*
*
* Copyright (C) 2015-2016 The Gitamin Team
*
* For the full copyright and license information, please view the LICENSE
Expand All @@ -26,8 +26,6 @@ final class RemoveIssueCommand
* Create a new remove issue command instance.
*
* @param \Gitamin\Models\Issue $issue
*
* @return void
*/
public function __construct(Issue $issue)
{
Expand Down
10 changes: 4 additions & 6 deletions app/Commands/Issue/UpdateIssueCommand.php
Expand Up @@ -2,7 +2,7 @@

/*
* This file is part of Gitamin.
*
*
* Copyright (C) 2015-2016 The Gitamin Team
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -56,10 +56,10 @@ final class UpdateIssueCommand
* @var string[]
*/
public $rules = [
'title' => 'string',
'title' => 'string',
'description' => 'string',
'author_id' => 'int',
'project_id' => 'int',
'author_id' => 'int',
'project_id' => 'int',
];

/**
Expand All @@ -70,8 +70,6 @@ final class UpdateIssueCommand
* @param string $description
* @param int $author_id
* @param int $project_id
*
* @return void
*/
public function __construct(Issue $issue, $title, $description, $author_id, $project_id)
{
Expand Down
12 changes: 5 additions & 7 deletions app/Commands/Moment/AddMomentCommand.php
Expand Up @@ -2,7 +2,7 @@

/*
* This file is part of Gitamin.
*
*
* Copyright (C) 2015-2016 The Gitamin Team
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -69,10 +69,10 @@ final class AddMomentCommand
*/
public $rules = [
'target_type' => 'string',
'target_id' => 'int',
'action' => 'required|int',
'author_id' => 'required|int',
'project_id' => 'int',
'target_id' => 'int',
'action' => 'required|int',
'author_id' => 'required|int',
'project_id' => 'int',
];

/**
Expand All @@ -85,8 +85,6 @@ final class AddMomentCommand
* @param int $action
* @param int $author_id
* @param int $project_id
*
* @return void
*/
public function __construct($title, $data, $target_type, $target_id, $action, $author_id, $project_id)
{
Expand Down
12 changes: 5 additions & 7 deletions app/Commands/Owner/AddOwnerCommand.php
Expand Up @@ -2,7 +2,7 @@

/*
* This file is part of Gitamin.
*
*
* Copyright (C) 2015-2016 The Gitamin Team
*
* For the full copyright and license information, please view the LICENSE
Expand Down Expand Up @@ -54,10 +54,10 @@ final class AddOwnerCommand
* @var string[]
*/
public $rules = [
'name' => 'required|string',
'path' => 'required|string',
'user_id' => 'int',
'type' => 'string',
'name' => 'required|string',
'path' => 'required|string',
'user_id' => 'int',
'type' => 'string',
];

/**
Expand All @@ -68,8 +68,6 @@ final class AddOwnerCommand
* @param int $user_id
* @param string $description
* @param string $type
*
* @return void
*/
public function __construct($name, $path, $user_id, $description, $type)
{
Expand Down
4 changes: 1 addition & 3 deletions app/Commands/Owner/RemoveOwnerCommand.php
Expand Up @@ -2,7 +2,7 @@

/*
* This file is part of Gitamin.
*
*
* Copyright (C) 2015-2016 The Gitamin Team
*
* For the full copyright and license information, please view the LICENSE
Expand All @@ -26,8 +26,6 @@ final class RemoveOwnerCommand
* Create a new remove project owner command instance.
*
* @param \Gitamin\Models\Owner $owner
*
* @return void
*/
public function __construct(Owner $owner)
{
Expand Down

0 comments on commit 8000990

Please sign in to comment.