Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions app/Conversions/Svg.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class Svg extends ImageGenerator
/**
* Converts SVG to PNG, preserving transparency
*/
public function convert(string $file, Conversion $conversion = null): string
public function convert(string $file, ?Conversion $conversion = null): string
{
$imageFile = pathinfo($file, PATHINFO_DIRNAME) . '/' . pathinfo($file, PATHINFO_FILENAME) . '.png';

Expand All @@ -29,7 +29,7 @@ public function convert(string $file, Conversion $conversion = null): string

public function requirementsAreInstalled(): bool
{
return class_exists(\Imagick::class);
return class_exists(Imagick::class);
}

public function supportedExtensions(): Collection
Expand Down
1 change: 0 additions & 1 deletion app/Helpers/LdapHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,6 @@ protected function flattenUserAttributes($users, $fields)
/**
* Look up and return a local user instance by checking LDAP for that user.
*
* @param string $display_name The user's display name
* @param string $name The user's name/uid
*
* @return User|boolean
Expand Down
9 changes: 4 additions & 5 deletions app/Http/Controllers/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,23 @@

namespace App\Http\Controllers;

use Illuminate\Http\Request;
use Illuminate\Contracts\View\View as ViewContract;
use Illuminate\View\View;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View;

class AppController extends Controller
{
/**
* Display the App Homepage.
*/
public function index(): View|ViewContract
public function index(): View|ViewFactory
{
return view('home');
}

/**
* Display the FAQ page.
*/
public function faq(): View|ViewContract
public function faq(): View|ViewFactory
{
return view('faq');
}
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
use Illuminate\Contracts\View\View as ViewContract;
use Illuminate\View\View;
use Illuminate\Contracts\View\View;
use Illuminate\Contracts\View\Factory as ViewFactory;

class LoginController extends Controller
{
Expand Down Expand Up @@ -52,7 +52,7 @@ public function username()
/**
* Show the login form.
*/
public function showLoginForm(): View|ViewContract
public function showLoginForm(): View|ViewFactory
{
if (!session()->has('url.intended')) {
session(['url.intended' => url()->previous()]);
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/LogsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

use App\LogEntry;
use Illuminate\Http\Request;
use Illuminate\Contracts\View\View as ViewContract;
use Illuminate\View\View;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View;

class LogsController extends Controller
{
Expand All @@ -22,7 +22,7 @@ public function __construct()
/**
* Display a listing of the resource.
*/
public function index(Request $request): View|ViewContract
public function index(Request $request): View|ViewFactory
{
return view('logs.index', [
'logs' => LogEntry::with('user')
Expand Down
7 changes: 3 additions & 4 deletions app/Http/Controllers/ProfileStudentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
namespace App\Http\Controllers;

use App\Profile;
use Illuminate\Contracts\View\View as ViewContract;
use Illuminate\Http\Request;
use Illuminate\View\View;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View;

class ProfileStudentsController extends Controller
{
Expand All @@ -22,7 +21,7 @@ public function __construct()
/**
* Show student applications associated with a profile.
*/
public function show(Profile $profile): View|ViewContract
public function show(Profile $profile): View|ViewFactory
{
return view('students.profile-students', [
'profile' => $profile,
Expand Down
20 changes: 10 additions & 10 deletions app/Http/Controllers/ProfilesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,14 @@
use App\Http\Requests\ProfileSearchRequest;
use App\Http\Requests\ProfileUpdateRequest;
use App\School;
use Illuminate\Contracts\View\View as ViewContract;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View;
use Illuminate\Database\Eloquent\Builder;
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Response;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
use Illuminate\View\View;
use Spatie\Browsershot\Browsershot;

class ProfilesController extends Controller
Expand Down Expand Up @@ -68,7 +68,7 @@ public function __construct()
/**
* Display a listing of profiles.
*/
public function index(ProfileSearchRequest $request): View|ViewContract|RedirectResponse
public function index(ProfileSearchRequest $request): View|ViewFactory|RedirectResponse
{
$input_search = $request->input('search');

Expand Down Expand Up @@ -102,7 +102,7 @@ public function index(ProfileSearchRequest $request): View|ViewContract|Redirect
/**
* Display the home page
*/
public function home(): View|ViewContract
public function home(): View|ViewFactory
{
$random_profile = Cache::tags(['home', 'profiles'])->remember('home-random-profiles', 86400, function() {
return Profile::public()->excludingUnlisted()->inRandomOrder()->limit(2)->get();
Expand Down Expand Up @@ -132,15 +132,15 @@ public function home(): View|ViewContract
/**
* Display an admin table of profiles.
*/
public function table(): View|ViewContract
public function table(): View|ViewFactory
{
return view('profiles.table');
}

/**
* Show the specified profile.
*/
public function show(Request $request, Profile $profile): View|ViewContract
public function show(Request $request, Profile $profile): View|ViewFactory
{
/** @var User the logged-in user */
$user = Auth::user();
Expand Down Expand Up @@ -172,7 +172,7 @@ public function redirectById(int $id): RedirectResponse
/**
* Create a Profile
*/
public function create(Request $request, User $user, LdapHelperContract $ldap): View|ViewContract|RedirectResponse
public function create(Request $request, User $user, LdapHelperContract $ldap): View|ViewFactory|RedirectResponse
{
$existing_profile = $user->profiles()->withTrashed()->first();

Expand Down Expand Up @@ -233,7 +233,7 @@ public function create(Request $request, User $user, LdapHelperContract $ldap):
/**
* Show the view for editing a profile section
*/
public function edit(Profile $profile, string $section): View|ViewContract|RedirectResponse
public function edit(Profile $profile, string $section): View|ViewFactory|RedirectResponse
{
//dont manage auto-managed publications
if ($section == 'publications' && $profile->hasOrcidManagedPublications()) {
Expand Down Expand Up @@ -294,15 +294,15 @@ public function updateBanner(Profile $profile, ProfileBannerImageRequest $reques
/**
* Confirm deletion of a profile
*/
public function confirmDelete(Profile $profile): View|ViewContract
public function confirmDelete(Profile $profile): View|ViewFactory
{
return view('profiles.delete', ['profile' => $profile]);
}

/**
* Confirm restoration of a soft-deleted profile
*/
public function confirmRestore(Request $request, Profile $profile): View|ViewContract|RedirectResponse
public function confirmRestore(Request $request, Profile $profile): View|ViewFactory|RedirectResponse
{
// this message is in case someone tries to create an already archived profile
if ($request->user()->cannot('restore', $profile)) {
Expand Down
12 changes: 6 additions & 6 deletions app/Http/Controllers/SchoolsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@

use App\Profile;
use App\School;
use Illuminate\Contracts\View\View as ViewContract;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;

class SchoolsController extends Controller
{
Expand Down Expand Up @@ -35,7 +35,7 @@ public function __construct()
/**
* Display a list of schools.
*/
public function index(): View|ViewContract
public function index(): View|ViewFactory
{
$schools = School::get();

Expand All @@ -45,7 +45,7 @@ public function index(): View|ViewContract
/**
* Show the form for creating a new school.
*/
public function create(): View|ViewContract
public function create(): View|ViewFactory
{
return view('schools.create');
}
Expand All @@ -65,7 +65,7 @@ public function store(Request $request): RedirectResponse
/**
* Display all profiles from the specified school.
*/
public function show(School $school): View|ViewContract
public function show(School $school): View|ViewFactory
{
$profiles = Profile::fromSchoolId($school->id)->public()->excludingUnlisted()->paginate(24);

Expand All @@ -75,7 +75,7 @@ public function show(School $school): View|ViewContract
/**
* Show the form for editing the specified school.
*/
public function edit(School $school): View|ViewContract
public function edit(School $school): View|ViewFactory
{
return view('schools.edit', compact('school'));
}
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Controllers/SettingsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
namespace App\Http\Controllers;

use App\Setting;
use Illuminate\Contracts\View\View as ViewContract;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\View\View;
use Illuminate\Support\Facades\Cache;

class SettingsController extends Controller
Expand All @@ -23,7 +23,7 @@ public function __construct()
/**
* Show the settings for editing.
*/
public function edit(): View|ViewContract
public function edit(): View|ViewFactory
{
return view('settings', [
'settings' => Setting::pluck('value', 'name')->toArray(),
Expand Down
11 changes: 5 additions & 6 deletions app/Http/Controllers/StudentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@
use App\Student;
use App\StudentData;
use App\User;
use Illuminate\Contracts\View\View as ViewContract;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Auth;
use Illuminate\View\View;

class StudentsController extends Controller
{
Expand All @@ -35,7 +34,7 @@ public function about()
/**
* Display the list of student research applications.
*/
public function index(): View|ViewContract
public function index(): View|ViewFactory
{
/** @var User */
$user = Auth::user();
Expand Down Expand Up @@ -94,7 +93,7 @@ public function store(Request $request): Student|false
/**
* Display the specified student research application.
*/
public function show(Request $request, Student $student): View|ViewContract
public function show(Request $request, Student $student): View|ViewFactory
{
if ($request->user() && $request->user()->userOrDelegatorhasRole('faculty')) {
StudentViewed::dispatch($student);
Expand All @@ -114,7 +113,7 @@ public function show(Request $request, Student $student): View|ViewContract
/**
* Show the form for editing the specified student research application.
*/
public function edit(Student $student): View|ViewContract
public function edit(Student $student): View|ViewFactory
{
return view('students.edit', [
'student' => $student,
Expand Down
10 changes: 5 additions & 5 deletions app/Http/Controllers/TagsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

namespace App\Http\Controllers;

use Illuminate\Contracts\View\View as ViewContract;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Contracts\View\View;
use Illuminate\Http\RedirectResponse;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Cache;
use Illuminate\View\View;
use Spatie\Tags\Tag;
use App\Http\Requests\TagsUpdateRequest;
use App\Http\Requests\TagUpdateRequest;
Expand Down Expand Up @@ -39,7 +39,7 @@ public function __construct()
/**
* Show the index of all associated tags.
*/
public function index(): View|ViewContract
public function index(): View|ViewFactory
{
$tags = Tag::whereExists(function($query) {
$query->select(\DB::raw(1))->from('taggables')->whereRaw('tags.id = taggables.tag_id');
Expand All @@ -57,15 +57,15 @@ public function index(): View|ViewContract
/**
* Show the index table of all associated tags.
*/
public function table(): View|ViewContract
public function table(): View|ViewFactory
{
return view('tags.table');
}

/**
* Show the index table of all associated tags.
*/
public function create(): View|ViewContract
public function create(): View|ViewFactory
{
return view('tags.create');
}
Expand Down
Loading
Loading