1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01:00

Fixes for static analysis

This commit is contained in:
David Bomba 2023-04-26 11:21:20 +10:00
parent 5eacee2ae8
commit c661cfc654
13 changed files with 21 additions and 98 deletions

View File

@ -668,7 +668,7 @@ class BaseController extends Controller
* Passes back the miniloaded data response
*
* @param Builder $query
* @return void
*
*/
protected function timeConstrainedResponse($query)
{

View File

@ -64,7 +64,6 @@ class ChartController extends BaseController
* ),
* )
* @param Request $request
* @return Response|mixed
*/
public function totals(ShowChartRequest $request)
{

View File

@ -574,7 +574,7 @@ class ClientController extends BaseController
/**
* Update the specified resource in storage.
*
* @param UploadClientRequest $request
* @param PurgeClientRequest $request
* @param Client $client
* @return Response
*
@ -644,7 +644,7 @@ class ClientController extends BaseController
*
* @param PurgeClientRequest $request
* @param Client $client
* @param string $mergeable client hashed_id
* @param string $mergeable_client
* @return Response
*
*

View File

@ -46,20 +46,15 @@ class ClientGatewayTokenController extends BaseController
protected $entity_transformer = ClientGatewayTokenTransformer::class;
/**
* @var ClientGatewayTokenRepository
*/
protected $client_gateway_token_gateway_token_repo;
/**
* ClientGatewayTokenController constructor.
* @param ClientGatewayTokenRepository $client_gateway_token_gateway_token_repo
* @param ClientGatewayTokenRepository $client_gateway_token_repo
*/
public function __construct(ClientGatewayTokenRepository $client_gateway_token_gateway_token_repo)
public function __construct(protected ClientGatewayTokenRepository $client_gateway_token_repo)
{
parent::__construct();
$this->client_gateway_token_repo = $client_gateway_token_gateway_token_repo;
$this->client_gateway_token_repo = $client_gateway_token_repo;
}
/**
@ -69,8 +64,7 @@ class ClientGatewayTokenController extends BaseController
* tags={"client_gateway_tokens"},
* summary="Gets a list of client_gateway_tokens",
* description="Lists client_gateway_tokens, search and filters allow fine grained lists to be generated.
Query parameters can be added to performed more fine grained filtering of the client_gateway_tokens, these are handled by the ClientGatewayTokenFilters class which defines the methods available",
* Query parameters can be added to performed more fine grained filtering of the client_gateway_tokens, these are handled by the ClientGatewayTokenFilters class which defines the methods available",
* @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
@ -94,7 +88,7 @@ class ClientGatewayTokenController extends BaseController
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
* @param ClientGatewayTokenFilters $filters
* @param ListClientGatewayTokenRequest $request
* @return Response|mixed
*/
public function index(ListClientGatewayTokenRequest $request)

View File

@ -11,17 +11,18 @@
namespace App\Http\Controllers\ClientPortal;
use App\Http\Controllers\Controller;
use App\Http\ViewComposers\PortalComposer;
use App\Models\RecurringInvoice;
use Auth;
use App\Models\RecurringInvoice;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Redirect;
use App\Http\ViewComposers\PortalComposer;
class ContactHashLoginController extends Controller
{
/**
* Logs a user into the client portal using their contact_key
* @param string $contact_key The contact key
* @return Auth|Redirect
* @return Redirect
*/
public function login(string $contact_key)
{

View File

@ -187,7 +187,6 @@ class InvoiceController extends Controller
*
* @param array $ids
*
* @return void
*/
private function downloadInvoicePDF(array $ids)
{

View File

@ -24,7 +24,7 @@ class SubscriptionPlanSwitchController extends Controller
*
* @param ShowPlanSwitchRequest $request
* @param RecurringInvoice $recurring_invoice
* @param string $target
* @param Subscription $target
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
*/
public function index(ShowPlanSwitchRequest $request, RecurringInvoice $recurring_invoice, Subscription $target)

View File

@ -11,16 +11,17 @@
namespace App\Http\Controllers\ClientPortal;
use App\Http\Controllers\Controller;
use Auth;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\Redirect;
class TempRouteController extends Controller
{
/**
* Logs a user into the client portal using their contact_key
* @param string $contact_key The contact key
* @return Auth|Redirect
* @param string $hash The hash
* @return Redirect
*/
public function index(string $hash)
{

View File

@ -11,9 +11,10 @@
namespace App\Http\Controllers;
use App\Http\Requests\Statements\CreateStatementRequest;
use App\Utils\Traits\MakesHash;
use App\Utils\Traits\Pdf\PdfMaker;
use Illuminate\Support\Facades\Response;
use App\Http\Requests\Statements\CreateStatementRequest;
class ClientStatementController extends BaseController
{
@ -32,71 +33,6 @@ class ClientStatementController extends BaseController
*
* @param CreateStatementRequest $request
* @return Response
*
* @OA\Post(
* path="/api/v1/client_statement",
* operationId="clientStatement",
* tags={"clients"},
* summary="Return a PDF of the client statement",
* description="Return a PDF of the client statement",
* @OA\Parameter(ref="#/components/parameters/X-API-TOKEN"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Parameter(ref="#/components/parameters/include"),
* @OA\RequestBody(
* description="Statment Options",
* required=true,
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(
* type="object",
* @OA\Property(
* property="start_date",
* description="The start date of the statement period - format Y-m-d",
* type="string",
* ),
* @OA\Property(
* property="end_date",
* description="The start date of the statement period - format Y-m-d",
* type="string",
* ),
* @OA\Property(
* property="client_id",
* description="The hashed ID of the client",
* type="string",
* ),
* @OA\Property(
* property="show_payments_table",
* description="Flag which determines if the payments table is shown",
* type="boolean",
* ),
* @OA\Property(
* property="show_aging_table",
* description="Flag which determines if the aging table is shown",
* type="boolean",
* )
* )
* )
* ),
* @OA\Response(
* response=200,
* description="Returns the client object",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* @OA\JsonContent(ref="#/components/schemas/Client"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
*
* ),
* @OA\Response(
* response="default",
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
*/
public function statement(CreateStatementRequest $request)
{

View File

@ -603,7 +603,7 @@ class CompanyController extends BaseController
* Update the specified resource in storage.
*
* @param UploadCompanyRequest $request
* @param Company $client
* @param Company $company
* @return Response
*
*

View File

@ -22,7 +22,6 @@ class CreateAccountActivity implements ShouldQueue
/**
* Create the event listener.
*
* @param ActivityRepository $activity_repo
*/
public function __construct()
{

View File

@ -4,7 +4,6 @@ namespace App\Listeners\Document;
use App\Libraries\MultiDB;
use App\Models\Document;
use Illuminate\Filesystem\Filesystem;
use Illuminate\Support\Facades\Storage;
class DeleteCompanyDocuments
@ -31,10 +30,6 @@ class DeleteCompanyDocuments
$path = sprintf('%s/%s', public_path('storage'), $event->company->company_key);
// Remove all files & folders, under company's path.
// This will delete directory itself, as well.
// In case we want to remove the content of folder, we should use $fs->cleanDirectory();
//$filesystem = new Filesystem();
Storage::deleteDirectory($event->company->company_key);
Document::whereCompanyId($event->company->id)->delete();

View File

@ -310,7 +310,6 @@ use Laracasts\Presenter\PresentableTrait;
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\SystemLog> $system_logs
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Task> $tasks
* @property int $has_valid_vat_number
* @property string $leitweg_id
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\Activity> $activities
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\CompanyLedger> $company_ledger
* @property-read \Illuminate\Database\Eloquent\Collection<int, \App\Models\ClientContact> $contacts