1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-16 14:32:26 +02:00

php-cs-fixer

This commit is contained in:
Hillel Coren 2017-01-30 21:49:42 +02:00
parent c0fbaf1e89
commit 30515c69f3
46 changed files with 126 additions and 27 deletions

View File

@ -11,7 +11,7 @@ $finder = PhpCsFixer\Finder::create()
->ignoreVCS(true);
return PhpCsFixer\Config::create()
->setRules(array(
->setRules([
'@PSR2' => true,
'binary_operator_spaces' => true,
'blank_line_after_namespace' => true,
@ -61,6 +61,7 @@ return PhpCsFixer\Config::create()
'not_operator_with_successor_space' => true,
'object_operator_without_whitespace' => true,
'ordered_imports' => true,
'phpdoc_add_missing_param_annotation' => true,
'phpdoc_align' => true,
'phpdoc_indent' => true,
'phpdoc_inline_tag' => true,
@ -74,10 +75,8 @@ return PhpCsFixer\Config::create()
'phpdoc_trim' => true,
'phpdoc_types' => true,
'phpdoc_var_without_name' => true,
//'psr4' => true,
'self_accessor' => true,
'short_scalar_cast' => true,
//'simplified_null_return' => true,
'single_blank_line_at_eof' => true,
'single_blank_line_before_namespace' => true,
'single_import_per_statement' => true,
@ -93,8 +92,6 @@ return PhpCsFixer\Config::create()
'unary_operator_spaces' => true,
'visibility_required' => true,
'whitespace_after_comma_in_array' => true,
//'strict_param' => true,
'array_syntax' => array('syntax' => 'short'),
))
->setFinder($finder)
;
])
->setFinder($finder);

View File

@ -26,6 +26,7 @@ class InvoiceInvitationWasEmailed extends Event
* Create a new event instance.
*
* @param Invitation $invitation
* @param mixed $notes
*/
public function __construct(Invitation $invitation, $notes)
{

View File

@ -26,6 +26,7 @@ class QuoteInvitationWasEmailed extends Event
* Create a new event instance.
*
* @param Invitation $invitation
* @param mixed $notes
*/
public function __construct(Invitation $invitation, $notes)
{

View File

@ -248,6 +248,7 @@ class AccountController extends BaseController
/**
* @param $entityType
* @param $visible
* @param mixed $filter
*
* @return mixed
*/

View File

@ -166,6 +166,7 @@ class AccountGatewayController extends BaseController
/**
* Stores new account.
* @param mixed $accountGatewayPublicId
*/
public function save($accountGatewayPublicId = false)
{

View File

@ -124,6 +124,7 @@ class ClientApiController extends BaseAPIController
* description="an ""unexpected"" error"
* )
* )
* @param mixed $publicId
*/
public function update(UpdateClientRequest $request, $publicId)
{

View File

@ -103,6 +103,7 @@ class ExpenseApiController extends BaseAPIController
* description="an ""unexpected"" error"
* )
* )
* @param mixed $publicId
*/
public function update(UpdateExpenseRequest $request, $publicId)
{

View File

@ -325,6 +325,7 @@ class InvoiceApiController extends BaseAPIController
* description="an ""unexpected"" error"
* )
* )
* @param mixed $publicId
*/
public function update(UpdateInvoiceAPIRequest $request, $publicId)
{

View File

@ -454,7 +454,8 @@ class InvoiceController extends BaseController
/**
* Display the specified resource.
*
* @param int $id
* @param int $id
* @param mixed $publicId
*
* @return Response
*/
@ -468,7 +469,8 @@ class InvoiceController extends BaseController
/**
* Remove the specified resource from storage.
*
* @param int $id
* @param int $id
* @param mixed $entityType
*
* @return Response
*/

View File

@ -60,8 +60,9 @@ class OnlinePaymentController extends BaseController
/**
* @param $invitationKey
* @param bool $gatewayType
* @param bool $sourceId
* @param bool $gatewayType
* @param bool $sourceId
* @param mixed $gatewayTypeAlias
*
* @return \Illuminate\Http\RedirectResponse
*/

View File

@ -71,6 +71,7 @@ class PaymentApiController extends BaseAPIController
* description="an ""unexpected"" error"
* )
* )
* @param mixed $publicId
*/
public function update(UpdatePaymentRequest $request, $publicId)
{

View File

@ -107,6 +107,7 @@ class ProductApiController extends BaseAPIController
* description="an ""unexpected"" error"
* )
* )
* @param mixed $publicId
*/
public function update(UpdateProductRequest $request, $publicId)
{

View File

@ -104,6 +104,7 @@ class TaxRateApiController extends BaseAPIController
* description="an ""unexpected"" error"
* )
* )
* @param mixed $publicId
*/
public function update(UpdateTaxRateRequest $request, $publicId)
{

View File

@ -151,6 +151,7 @@ class UserController extends BaseController
/**
* Stores new account.
* @param mixed $userPublicId
*/
public function save($userPublicId = false)
{

View File

@ -109,6 +109,7 @@ class VendorApiController extends BaseAPIController
* description="an ""unexpected"" error"
* )
* )
* @param mixed $publicId
*/
public function update(UpdateVendorRequest $request, $publicId)
{

View File

@ -148,6 +148,10 @@ class parseCSV
* Constructor.
*
* @param input CSV file or string
* @param null|mixed $input
* @param null|mixed $offset
* @param null|mixed $limit
* @param null|mixed $conditions
*
* @return nothing
*/
@ -175,6 +179,10 @@ class parseCSV
* Parse CSV file or string.
*
* @param input CSV file or string
* @param null|mixed $input
* @param null|mixed $offset
* @param null|mixed $limit
* @param null|mixed $conditions
*
* @return nothing
*/
@ -211,6 +219,10 @@ class parseCSV
* @param data 2D array with data
* @param append append current data to end of target CSV if exists
* @param fields field names
* @param null|mixed $file
* @param mixed $data
* @param mixed $append
* @param mixed $fields
*
* @return true or false
*/
@ -233,6 +245,11 @@ class parseCSV
* @param data 2D array with data
* @param fields field names
* @param delimiter delimiter used to separate data
* @param mixed $output
* @param null|mixed $filename
* @param mixed $data
* @param mixed $fields
* @param null|mixed $delimiter
*
* @return CSV data using delimiter of choice, or default
*/
@ -259,6 +276,8 @@ class parseCSV
*
* @param input input character encoding, uses default if left blank
* @param output output character encoding, uses default if left blank
* @param null|mixed $input
* @param null|mixed $output
*
* @return nothing
*/
@ -282,6 +301,11 @@ class parseCSV
* @param search_depth number of rows to analyze
* @param preferred preferred delimiter characters
* @param enclosure enclosure character, default is double quote (").
* @param null|mixed $file
* @param mixed $parse
* @param null|mixed $search_depth
* @param null|mixed $preferred
* @param null|mixed $enclosure
*
* @return delimiter character
*/
@ -382,6 +406,7 @@ class parseCSV
* Read file to string and call parse_string().
*
* @param file local CSV file
* @param null|mixed $file
*
* @return 2D array with CSV data, or false on failure
*/
@ -401,6 +426,7 @@ class parseCSV
* Parse CSV strings to arrays.
*
* @param data CSV string
* @param null|mixed $data
*
* @return 2D array with CSV data, or false on failure
*/
@ -506,6 +532,11 @@ class parseCSV
* @param is_php if a php die() call should be put on the first
* line of the file, this is later ignored when read.
* @param delimiter field delimiter to use
* @param mixed $data
* @param mixed $fields
* @param mixed $append
* @param mixed $is_php
* @param null|mixed $delimiter
*
* @return CSV data (text string)
*/
@ -549,6 +580,7 @@ class parseCSV
* Load local file or string.
*
* @param input local CSV file
* @param null|mixed $input
*
* @return true or false
*/
@ -593,6 +625,8 @@ class parseCSV
*
* @param row array with values from a row
* @param conditions specified conditions that the row must match
* @param mixed $row
* @param null|mixed $conditions
*
* @return true of false
*/
@ -629,6 +663,8 @@ class parseCSV
*
* @param row array with values from a row
* @param condition specified condition that the row must match
* @param mixed $row
* @param mixed $condition
*
* @return true of false
*/
@ -692,6 +728,7 @@ class parseCSV
* Validates if the row is within the offset or not if sorting is disabled.
*
* @param current_row the current row number being processed
* @param mixed $current_row
*
* @return true of false
*/
@ -709,6 +746,7 @@ class parseCSV
* - only used by unparse().
*
* @param value string to process
* @param null|mixed $value
*
* @return Processed value
*/
@ -730,6 +768,7 @@ class parseCSV
* Check file data.
*
* @param file local filename
* @param null|mixed $file
*
* @return true or false
*/
@ -751,6 +790,10 @@ class parseCSV
* - only used by find_delimiter().
*
* @return special string used for delimiter selection, or false
* @param mixed $char
* @param mixed $array
* @param mixed $depth
* @param mixed $preferred
*/
public function _check_count($char, $array, $depth, $preferred)
{
@ -786,6 +829,7 @@ class parseCSV
* Read local file.
*
* @param file local filename
* @param null|mixed $file
*
* @return Data from file, or false on failure
*/
@ -811,6 +855,10 @@ class parseCSV
* @param string data to write to file
* @param mode fopen() mode
* @param lock flock() mode
* @param mixed $file
* @param mixed $string
* @param mixed $mode
* @param mixed $lock
*
* @return true or false
*/

View File

@ -37,6 +37,7 @@ class SendInvoiceEmail extends Job implements ShouldQueue
* @param Invoice $invoice
* @param string $pdf
* @param bool $reminder
* @param mixed $pdfString
*/
public function __construct(Invoice $invoice, $reminder = false, $pdfString = false)
{

View File

@ -41,6 +41,10 @@ class SendNotificationEmail extends Job implements ShouldQueue
* @param UserMailer $userMailer
* @param ContactMailer $contactMailer
* @param PushService $pushService
* @param mixed $user
* @param mixed $invoice
* @param mixed $type
* @param mixed $payment
*/
public function __construct($user, $invoice, $type, $payment)
{

View File

@ -29,6 +29,7 @@ class SendPushNotification extends Job implements ShouldQueue
* Create a new job instance.
* @param Invoice $invoice
* @param mixed $type
*/
public function __construct($invoice, $type)
{

View File

@ -492,8 +492,9 @@ class Account extends Eloquent
/**
* @param $amount
* @param null $client
* @param bool $hideSymbol
* @param null $client
* @param bool $hideSymbol
* @param mixed $decorator
*
* @return string
*/

View File

@ -253,6 +253,7 @@ class EntityModel extends Eloquent
/**
* @param $data
* @param $entityType
* @param mixed $entity
*
* @return bool|string
*/

View File

@ -466,7 +466,8 @@ class Invoice extends EntityModel implements BalanceAffecting
}
/**
* @param bool $notify
* @param bool $notify
* @param mixed $reminder
*/
public function markInvitationsSent($notify = false, $reminder = false)
{
@ -496,8 +497,9 @@ class Invoice extends EntityModel implements BalanceAffecting
/**
* @param $invitation
* @param bool $messageId
* @param bool $notify
* @param bool $messageId
* @param bool $notify
* @param mixed $notes
*/
public function markInvitationSent($invitation, $messageId = false, $notify = true, $notes = false)
{

View File

@ -117,6 +117,7 @@ trait GeneratesNumbers
/**
* @param $entityType
* @param mixed $invoice
*
* @return string
*/
@ -129,6 +130,7 @@ trait GeneratesNumbers
/**
* @param $entity
* @param mixed $counter
*
* @return bool|mixed
*/

View File

@ -342,6 +342,7 @@ class User extends Authenticatable
*
* @param mixed $permission Either a single permission or an array of possible permissions
* @param bool True to require all permissions, false to require only one
* @param mixed $requireAll
*
* @return bool
*/

View File

@ -146,6 +146,8 @@ class BaseTransformer extends TransformerAbstract
/**
* @param $date
* @param string $format
* @param mixed $data
* @param mixed $field
*
* @return null
*/

View File

@ -143,6 +143,7 @@ class ContactMailer extends Mailer
* @param $subject
* @param $pdfString
* @param $documentStrings
* @param mixed $reminder
*
* @throws \Laracasts\Presenter\Exceptions\PresenterException
*

View File

@ -45,6 +45,7 @@ class PushFactory
*
* @param $token - device token
* @param $message - user specific message
* @param mixed $device
*
* @return void
*/

View File

@ -35,6 +35,7 @@ class TaskPresenter extends EntityPresenter
/**
* @param $account
* @param mixed $showProject
*
* @return mixed
*/

View File

@ -16,6 +16,9 @@ class DashboardRepository
* @param $groupBy
* @param $startDate
* @param $endDate
* @param mixed $account
* @param mixed $currencyId
* @param mixed $includeExpenses
*
* @return array
*/

View File

@ -842,6 +842,7 @@ class InvoiceRepository extends BaseRepository
/**
* @param $clientId
* @param mixed $entityType
*
* @return mixed
*/

View File

@ -21,7 +21,8 @@ class AccountGatewayPolicy extends EntityPolicy
}
/**
* @param User $user
* @param User $user
* @param mixed $item
*
* @return bool
*/

View File

@ -21,7 +21,8 @@ class BankAccountPolicy extends EntityPolicy
}
/**
* @param User $user
* @param User $user
* @param mixed $item
*
* @return bool
*/

View File

@ -10,7 +10,8 @@ use App\Models\User;
class DocumentPolicy extends EntityPolicy
{
/**
* @param User $user
* @param User $user
* @param mixed $item
*
* @return bool
*/

View File

@ -13,7 +13,8 @@ class EntityPolicy
use HandlesAuthorization;
/**
* @param User $user
* @param User $user
* @param mixed $item
*
* @return bool
*/

View File

@ -7,7 +7,8 @@ use App\Models\User;
class ExpenseCategoryPolicy extends EntityPolicy
{
/**
* @param User $user
* @param User $user
* @param mixed $item
*
* @return bool
*/

View File

@ -7,7 +7,8 @@ use App\Models\User;
class ExpensePolicy extends EntityPolicy
{
/**
* @param User $user
* @param User $user
* @param mixed $item
*
* @return bool
*/

View File

@ -35,6 +35,7 @@ class GenericEntityPolicy
* @param User $user
* @param $entityTypee
* @param $ownerUserId
* @param mixed $entityType
*
* @return bool|mixed
*/

View File

@ -21,7 +21,8 @@ class PaymentTermPolicy extends EntityPolicy
}
/**
* @param User $user
* @param User $user
* @param mixed $item
*
* @return bool
*/

View File

@ -7,7 +7,8 @@ use App\Models\User;
class QuotePolicy extends EntityPolicy
{
/**
* @param User $user
* @param User $user
* @param mixed $item
*
* @return bool
*/

View File

@ -7,7 +7,8 @@ use App\Models\User;
class TaskPolicy extends EntityPolicy
{
/**
* @param User $user
* @param User $user
* @param mixed $item
*
* @return bool
*/

View File

@ -18,7 +18,8 @@ class TaxRatePolicy extends EntityPolicy
}
/**
* @param User $user
* @param User $user
* @param mixed $item
*
* @return bool
*/

View File

@ -7,7 +7,8 @@ use App\Models\User;
class VendorPolicy extends EntityPolicy
{
/**
* @param User $user
* @param User $user
* @param mixed $item
*
* @return bool
*/

View File

@ -44,6 +44,7 @@ class CreditService extends BaseService
/**
* @param $data
* @param null|mixed $credit
*
* @return mixed|null
*/

View File

@ -41,6 +41,7 @@ class ProductService extends BaseService
/**
* @param $accountId
* @param mixed $search
*
* @return \Illuminate\Http\JsonResponse
*/

View File

@ -43,6 +43,7 @@ class ProjectService extends BaseService
/**
* @param $data
* @param mixed $project
*
* @return mixed|null
*/
@ -58,6 +59,7 @@ class ProjectService extends BaseService
/**
* @param $clientPublicId
* @param $search
* @param mixed $userId
*
* @return \Illuminate\Http\JsonResponse
*/

View File

@ -55,6 +55,7 @@ class PushService
* @param Invoice $invoice
* @param $token
* @param $type
* @param mixed $device
*/
private function pushMessage(Invoice $invoice, $token, $type, $device)
{