Skip to content

Commit

Permalink
PHP Linting (Pint)
Browse files Browse the repository at this point in the history
  • Loading branch information
gnovaro authored and github-actions[bot] committed Aug 29, 2024
1 parent 262489b commit 428defb
Show file tree
Hide file tree
Showing 84 changed files with 112 additions and 124 deletions.
2 changes: 1 addition & 1 deletion app/Console/Commands/CampaignSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class CampaignSender extends Command
*/
public function handle(): int
{
$campaignModel = new Campaign();
$campaignModel = new Campaign;
$today = now();

$campaigns = $campaignModel::where('schedule_send_date', $today->format('Y-m-d'))
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/CompanyCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function handle()
$name = $this->ask('What is the name of the company?');
$country_id = $this->ask('What is the country ISO code of the company? (2 chars)');

$company = new Company();
$company = new Company;
$company->name = $name;
$company->country_id = $country_id;
$company->status = Company::ACTIVE;
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/ContactEmailPredictCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public function handle()

$contacts = $leadContacts->merge($customerContacts)->merge($supplierContacts);

$predictEmail = new PredictEmail();
$predictEmail = new PredictEmail;

foreach ($contacts as $contact) {
$website = $contact->lead->website ?? $contact->customer->website ?? $contact->supplier->website;
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/ScheduleNotificationReminder.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ private function sendNotifications(string $type, string $subject, string $body,
$body = __($body, ['name' => $recipient->name, 'time' => $time]);

$emailTemplate = new InternalCRMEmail($recipient->company, $subject, ['body' => $body]);
$notification = new Notification();
$notification = new Notification;
$notification->fill(
[
'company_id' => $recipient->company_id,
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/UserCreate.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public function handle()
$lang = $this->ask('What is the lang of the user? (en/es)');
$password = Str::random(10);

$user = new User();
$user = new User;
$user->company_id = $companyId;
$user->first_name = $first_name;
$user->last_name = $last_name;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Account/AccountIndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class AccountIndexController extends MainController
{
public function index(Request $request)
{
$account = new Account();
$account = new Account;
$data['accounts'] = $account->getAllActiveByCompany((int) Auth::user()->company_id);

return view('account.index', $data);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Account/AccountSaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class AccountSaveController extends MainController
*/
public function save(Request $request)
{
$account = (empty($request->id)) ? new Account() : Account::find($request->id);
$account = (empty($request->id)) ? new Account : Account::find($request->id);
$account->company_id = Auth::user()->company_id;
$account->issue_date = $request->issue_date;
$account->name = $request->name;
Expand Down
5 changes: 1 addition & 4 deletions app/Http/Controllers/Api/Email/EmailCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

class EmailCreateController
{
public function __construct(EmailRepository $emailRepository)
{

}
public function __construct(EmailRepository $emailRepository) {}

public function create(Request $request): JsonResponse
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function create(Request $request): JsonResponse
return response()->json(['errors' => $validator->errors()]);
}

$supplier = new Supplier();
$supplier = new Supplier;
$supplier->company_id = Auth::user()->company_id;
$supplier->name = $request->name;
$supplier->business_name = $request->business_name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,5 @@ class SupplierUpdateController
*
* @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection
*/
public function update(Request $request, int $id)
{
}
public function update(Request $request, int $id) {}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/Bank/BankCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class BankCreateController
{
public function create()
{
$bank = new Bank();
$bank = new Bank;
$data['bank'] = $bank;
$data['countries'] = Country::all();

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Bank/BankIndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class BankIndexController
public function index(Request $request)
{
$filters = [];
$bank = new Bank();
$bank = new Bank;
if (isset($request->country_id)) {
$filters['country_id'] = $request->country_id;
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Bank/BankSaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function save(Request $request)
]);

if (empty($request->uuid)) {
$bank = new Bank();
$bank = new Bank;
$bank->created_at = now();
} else {
$bank = Bank::find($request->uuid);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Brand/BrandCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class BrandCreateController extends MainController
{
public function create(Request $request)
{
$brand = new Brand();
$brand = new Brand;
$data['brand'] = $brand;

return view('brand.brand', $data);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Brand/BrandIndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class BrandIndexController extends MainController
{
public function index(Request $request)
{
$brand = new Brand();
$brand = new Brand;
$data['brands'] = $brand->getAllByCompanyId((int) Auth::user()->company_id);

return view('brand.index', $data);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Brand/BrandSaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class BrandSaveController extends MainController
public function save(Request $request)
{
if (empty($request->id)) {
$brand = new Brand();
$brand = new Brand;
} else {
$brand = Brand::find($request->id);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Campaign/CampaignCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CampaignCreateController extends MainController
{
public function create(Request $request)
{
$campaign = new Campaign();
$campaign = new Campaign;
$data['campaign'] = $campaign;
$data['froms'] = [
['email' => Auth::user()->company->email, 'name' => Auth::user()->company->name],
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Campaign/CampaignIndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CampaignIndexController extends MainController
{
public function index(Request $request)
{
$campaign = new Campaign();
$campaign = new Campaign;
$data['bootstrap_colors'] = [
'text-bg-primary',
'text-bg-secondary',
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Campaign/CampaignSaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CampaignSaveController extends MainController
public function save(Request $request)
{
if (empty($request->id)) {
$campaign = new Campaign();
$campaign = new Campaign;
$campaign->company_id = Auth::user()->company_id;
$campaign->created_at = now();
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Category/CategoryCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class CategoryCreateController extends MainController
{
public function create()
{
$category = new Category();
$category = new Category;
$data['category'] = $category;

return view('category.category', $data);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Category/CategoryIndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CategoryIndexController extends MainController
{
public function index(Request $request)
{
$category = new Category();
$category = new Category;
$data['categories'] = $category->getAllActiveByCompanyPaginated((int) Auth::user()->company_id);

return view('category.index', $data);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Category/CategorySaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CategorySaveController extends MainController
public function save(Request $request)
{
if (empty($request->id)) {
$category = new Category();
$category = new Category;
} else {
$category = Category::find($request->id);
}
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Company/CompanyCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class CompanyCreateController extends MainController
{
public function create(Request $request)
{
$company = new Company();
$company = new Company;
$data['company'] = $company;
$data['countries'] = Country::all();
$data['currencies'] = Currency::all();
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Company/CompanyIndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CompanyIndexController extends MainController
{
public function index(Request $request)
{
$company = new Company();
$company = new Company;
if (Auth::user()->hasRole('SuperAdmin')) {
$companies = $company->getAllPaginated();
} else {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Contact/ContactCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class ContactCreateController extends Controller
{
public function create(Request $request, string $model, string $id_model): View
{
$contact = new Contact();
$contact = new Contact;
$contact->{$model.'_id'} = $id_model;

return view('contact.contact', compact('contact'));
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Customer/CustomerCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class CustomerCreateController extends MainController
*/
public function create(Request $request)
{
$customer = new Customer();
$industry = new Industry();
$user = new User();
$customer = new Customer;
$industry = new Industry;
$user = new User;
$data['customer'] = $customer;
$data['countries'] = Country::orderBy('name')->get();
// Temporary fix get this from configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CustomerCreateMessageController extends Controller
{
public function save(Request $request)
{
$message = new CustomerMessage();
$message = new CustomerMessage;
$message->fill([
'customer_id' => $request->customer_id,
'body' => $request->message,
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Customer/CustomerExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class CustomerExportController
public function export(Request $request): BinaryFileResponse
{
$separator = ';';
$customer = new Customer();
$customer = new Customer;
$fileName = 'customers_'.Auth::user()->company->name.'_'.date('Ymd_His').'.csv';
$customers = Customer::where('company_id', (int) Auth::user()->company_id)->get();
$headers = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public function save(ImportRequest $request)
private function mapCsvRowToCustomer(array $data): Customer
{
$country = trim($data[11]);
$customer = new Customer();
$customer = new Customer;

$customer->company_id = Auth::user()->company_id;
$customer->external_id = isset($data[0]) ? (int) $data[0] : null;
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Customer/CustomerIndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ public function index(Request $request)
$filters = [];
$order_by = null;
$search = $request->search;
$user = new User();
$industry = new Industry();
$user = new User;
$industry = new Industry;

if ($request->country_id) {
$filters['country_id'] = $request->country_id;
Expand Down Expand Up @@ -77,7 +77,7 @@ public function index(Request $request)
$order_by = $request->order_by;
}

$customer = new Customer();
$customer = new Customer;
$data['colors'] = config('color');
$data['bootstrap_colors'] = ['text-bg-primary', 'text-bg-secondary', 'text-bg-success', 'text-bg-danger', 'text-bg-warning', 'text-bg-info'];
$data['countries'] = Country::orderBy('name')->get();
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Customer/CustomerUpdateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class CustomerUpdateController extends MainController
public function update(Request $request, int $id)
{
$customer = Customer::find($id);
$industry = new Industry();
$user = new User();
$industry = new Industry;
$user = new User;
$data['customer'] = $customer;
$data['countries'] = Country::orderBy('name')->get();
// Temporary fix get this from configuration
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Email/EmailCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class EmailCreateController extends MainController
{
public function create(Request $request)
{
$email = new Email();
$email = new Email;
$data['froms'] = [
['email' => Auth::user()->company->email, 'name' => Auth::user()->company->name],
['email' => Auth::user()->email, 'name' => Auth::user()->first_name.' '.Auth::user()->last_name],
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Email/EmailIndexController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class EmailIndexController extends MainController
{
public function index(Request $request)
{
$data['emails'] = (new Email())->getAllByCompanyId(
$data['emails'] = (new Email)->getAllByCompanyId(
(int) Auth::user()->company_id,
$request->search
);
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Email/EmailSaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class EmailSaveController extends MainController
public function save(EmailRequest $request)
{
if (empty($request->id)) {
$email = new Email();
$email = new Email;
$email->created_at = now();
} else {
$email = Email::find($request->id);
Expand Down Expand Up @@ -57,7 +57,7 @@ public function saveAttachments($files, $email)
try {
Storage::putFileAs($path, $file, $newName);

$attach = new Email\Attach();
$attach = new Email\Attach;
$attach->email_id = $email->id;
$attach->original_name = $originalName;
$attach->file = $path.$DS.$newName;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ class EmailTemplateIndexController extends MainController
{
public function index(Request $request)
{
$emailTemplate = new EmailTemplate();
$emailTemplate = new EmailTemplate;
$data['templates'] = $emailTemplate->getAll();

return view('email_template.index', $data);
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Lead/LeadCreateController.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ class LeadCreateController extends MainController
*/
public function create(Request $request)
{
$lead = new Lead();
$industry = new Industry();
$user = new User();
$lead = new Lead;
$industry = new Industry;
$user = new User;
$data['lead'] = $lead;
$data['countries'] = Country::orderBy('name')->get();
// Temporary fix get this from configuration
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Lead/LeadCreateMessageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class LeadCreateMessageController extends Controller
{
public function save(Request $request)
{
$message = new LeadMessage();
$message = new LeadMessage;
$message->fill([
'lead_id' => $request->lead_id,
'body' => $request->message,
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Lead/LeadExportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class LeadExportController extends MainController
public function export(Request $request)
{
$separator = ';';
$lead = new Lead();
$lead = new Lead;
$fileName = 'leads_'.Auth::user()->company->name.'_'.date('Ymd_His').'.csv';
$leads = Lead::where('company_id', Auth::user()->company_id)->get();
$headers = [
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Lead/LeadImportSaveController.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function save(ImportRequest $request)
private function mapCsvRowToLead(array $data): Lead
{
$country = trim($data[8]);
$lead = new Lead();
$lead = new Lead;

$lead->company_id = Auth::user()->company_id;

Expand Down
Loading

0 comments on commit 428defb

Please sign in to comment.