Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/sc 4545/make the what we offer field feature flagable #160

Merged
Merged
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
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,9 @@ CQC_LOCATION=false
# Enable the Service Tags functionality
SERVICE_TAGS=false

# Enable the 'What we offer' functionality
SERVICE_OFFERINGS=true

# The request rate limit per minute for the api
API_RATE_LIMIT=300

Expand Down
4 changes: 2 additions & 2 deletions app/BatchImport/BatchUploader.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
class BatchUploader
{
/**
* @var \PhpOffice\PhpSpreadsheet\Reader\Xlsx
* @var XlsxReader
*/
protected $reader;

Expand All @@ -38,7 +38,7 @@ public function __construct()
* Validates and then uploads the file.
*
* @throws \PhpOffice\PhpSpreadsheet\Reader\Exception
* @throws \Exception
* @throws Exception
*/
public function upload(string $filePath)
{
Expand Down
2 changes: 1 addition & 1 deletion app/BatchImport/OpenActiveTaxonomyImporter.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function runImport($directoryUrl = null)
/**
* Import the formatted taxonomies into the database.
*
* @param \App\Models\Taxonomy $rootTaxonomy
* @param Taxonomy $rootTaxonomy
*/
public function importTaxonomies(Taxonomy $openActiveCategory, array $taxonomyImports)
{
Expand Down
2 changes: 1 addition & 1 deletion app/BatchImport/SpreadsheetParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ class SpreadsheetParser
/**
* The imported header row.
*
* @var \array
* @var array
*/
public $headers = [];

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Ck/BatchUploadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class BatchUploadCommand extends Command
protected $description = 'Uploads an xlsx spreadsheet to the database';

/**
* @var \App\BatchImport\BatchUploader
* @var BatchUploader
*/
protected $batchUploader;

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Ck/CreateOauthClientCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class CreateOauthClientCommand extends Command
protected $description = 'Create an OAuth 2.0 client';

/**
* @var \Laravel\Passport\ClientRepository
* @var ClientRepository
*/
protected $clients;

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Ck/CreateScheduledReportsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ protected function handleMonthly(ReportSchedule $reportSchedule)

// Increment successful.
$this->successful++;
} catch (\Throwable $exception) {
} catch (Throwable $exception) {
// Output error message.
$this->error("Failed to generate report for report schedule [$reportSchedule->id]");

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Ck/CreateUserCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class CreateUserCommand extends Command
protected $description = 'Creates a new user with Super Admin privileges';

/**
* @var \Illuminate\Database\DatabaseManager
* @var DatabaseManager
*/
protected $db;

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/Ck/ImportTaxonomiesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class ImportTaxonomiesCommand extends Command
/**
* The taxonomy which will be used as the root.
*
* @var \App\Models\Taxonomy
* @var Taxonomy
*/
protected $rootTaxonomy;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,22 @@ protected function getReferralQuery(): Builder
protected function sendEmail(Referral $referral)
{
try {
/** @var \Illuminate\Database\Eloquent\Collection $organisationAdmins */
/** @var Collection $organisationAdmins */
$organisationAdmins = $referral->service->users
->unique('id')
->filter(function (User $user) {
return $user->isGlobalAdmin();
});

/** @var \Illuminate\Database\Eloquent\Collection $serviceAdmins */
/** @var Collection $serviceAdmins */
$serviceAdmins = $referral->service->users
->unique('id')
->filter(function (User $user) use ($referral) {
return $user->isServiceAdmin($referral->service)
&& !$user->isGlobalAdmin();
});

/** @var \Illuminate\Database\Eloquent\Collection $serviceWorkers */
/** @var Collection $serviceWorkers */
$serviceWorkers = $referral->service->users
->unique('id')
->filter(function (User $user) use ($referral) {
Expand Down
2 changes: 1 addition & 1 deletion app/EmailSenders/GovNotifyEmailSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public function __construct()

public function send(Email $email)
{
/** @var \Alphagov\Notifications\Client $client */
/** @var Client $client */
$client = resolve(Client::class);

$response = $client->sendEmail(
Expand Down
2 changes: 1 addition & 1 deletion app/EmailSenders/MailgunEmailSender.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function createHtmlContent(Email $email): string
*/
public function send(Email $email)
{
/** @var \Mailgun\Mailgun $client */
/** @var Mailgun $client */
$client = resolve(Mailgun::class);

$fromName = config('mail.from.name');
Expand Down
6 changes: 3 additions & 3 deletions app/Events/EndpointHit.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ class EndpointHit
use SerializesModels;

/**
* @var \App\Models\User|null
* @var User|null
*/
protected $user;

/**
* @var \Laravel\Passport\Client|null
* @var Client|null
*/
protected $oauthClient;

Expand All @@ -48,7 +48,7 @@ class EndpointHit
protected $userAgent;

/**
* @var \Carbon\CarbonImmutable
* @var CarbonImmutable
*/
protected $createdAt;

Expand Down
6 changes: 3 additions & 3 deletions app/Events/UserRolesUpdated.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@ class UserRolesUpdated
use SerializesModels;

/**
* @var \App\Models\User
* @var User
*/
public $user;

/**
* @var \Illuminate\Database\Eloquent\Collection
* @var Collection
*/
public $oldRoles;

/**
* @var \Illuminate\Database\Eloquent\Collection
* @var Collection
*/
public $newRoles;

Expand Down
2 changes: 1 addition & 1 deletion app/Generators/UniqueSlugGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class UniqueSlugGenerator
{
/**
* @var \Illuminate\Database\DatabaseManager
* @var DatabaseManager
*/
protected $db;

Expand Down
2 changes: 1 addition & 1 deletion app/Geocode/GoogleGeocoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class GoogleGeocoder extends Geocoder
{
/**
* @var \GuzzleHttp\Client
* @var Client
*/
protected $client;

Expand Down
2 changes: 1 addition & 1 deletion app/Geocode/NominatimGeocoder.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class NominatimGeocoder extends Geocoder
{
/**
* @var \GuzzleHttp\Client
* @var Client
*/
protected $client;

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 @@ -99,7 +99,7 @@ public function showOtpForm(): View
}

/**
* @throws \Illuminate\Validation\ValidationException
* @throws ValidationException
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Http\Response|\Illuminate\Http\JsonResponse
*/
public function otp(Request $request)
Expand Down Expand Up @@ -138,7 +138,7 @@ public function otp(Request $request)
/**
* Redirect the user after determining they are locked out.
*
* @throws \Illuminate\Validation\ValidationException
* @throws ValidationException
*/
protected function sendOtpLockoutResponse(Request $request)
{
Expand All @@ -154,7 +154,7 @@ protected function sendOtpLockoutResponse(Request $request)
/**
* Get the failed login response instance.
*
* @throws \Illuminate\Validation\ValidationException
* @throws ValidationException
*/
protected function sendFailedOtpResponse(Request $request): Response
{
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Core/V1/FileController.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function __construct()
public function store(StoreRequest $request)
{
return DB::transaction(function () use ($request) {
/** @var \App\Models\File $file */
/** @var File $file */
$file = File::create([
'filename' => uuid() . File::extensionFromMime($request->mime_type),
'mime_type' => $request->mime_type,
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Core/V1/Location/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __invoke(ShowRequest $request, Location $location)
->firstOrFail()
->data['image_file_id'];

/** @var \App\Models\File $file */
/** @var File $file */
$file = File::findOrFail($imageFileId);
}

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Core/V1/LocationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ public function store(StoreRequest $request)
]);

if ($request->filled('image_file_id')) {
/** @var \App\Models\File $file */
/** @var File $file */
$file = File::findOrFail($request->image_file_id)->assigned();

// Create resized version for common dimensions.
Expand Down Expand Up @@ -158,7 +158,7 @@ public function update(UpdateRequest $request, Location $location)
]);

if ($request->filled('image_file_id')) {
/** @var \App\Models\File $file */
/** @var File $file */
$file = File::findOrFail($request->image_file_id)->assigned();

// Create resized version for common dimensions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __invoke(ShowRequest $request, Organisation $organisation)
->firstOrFail()
->data['logo_file_id'];

/** @var \App\Models\File $file */
/** @var File $file */
$file = File::findOrFail($logoFileId);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Core/V1/OrganisationController.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function show(ShowRequest $request, Organisation $organisation): Organisa
/**
* Update the specified resource in storage.
*
* @param \app\Services\DataPersistence\OrganisationPersistenceService
* @param OrganisationPersistenceService
* @return \Illuminate\Http\Response
*/
public function update(UpdateRequest $request, Organisation $organisation, OrganisationPersistenceService $persistenceService)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function show(ShowRequest $request, OrganisationEvent $organisationEvent)
->firstOrFail()
->data['image_file_id'];

/** @var \App\Models\File $file */
/** @var File $file */
$file = File::findOrFail($imageFileId);
}

Expand All @@ -57,7 +57,7 @@ public function showNew(ShowRequest $request)
->firstOrFail()
->data['image_file_id'];

/** @var \App\Models\File $file */
/** @var File $file */
$file = File::findOrFail($imageFileId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public function __construct()
}

/**
* @return \Illuminate\Http\Response
* @return Response
*/
public function store(StoreRequest $request)
{
Expand Down Expand Up @@ -107,7 +107,7 @@ function (array $socialMedia) {
];
}

/** @var \App\Models\UpdateRequest $updateRequest */
/** @var UpdateRequest $updateRequest */
$updateRequest = UpdateRequest::create([
'updateable_type' => UpdateRequest::NEW_TYPE_ORGANISATION_SIGN_UP_FORM,
'data' => $updateData,
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Core/V1/Page/ImageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function show(ShowRequest $request, Page $page)
->firstOrFail()
->data['image_file_id'];

/** @var \App\Models\File $file */
/** @var File $file */
$file = File::findOrFail($imageId);
}

Expand All @@ -55,7 +55,7 @@ public function showNew(ShowRequest $request)
->firstOrFail()
->data['image_file_id'];

/** @var \App\Models\File $file */
/** @var File $file */
$file = File::findOrFail($imageId);
}

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Core/V1/PageController.php
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public function show(ShowRequest $request, Page $page): PageResource

event(EndpointHit::onRead($request, "Viewed page [{$page->id}]", $page));

return new pageResource($page);
return new PageResource($page);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class GalleryItemController extends Controller
/**
* GalleryItemController the specified resource.
*
* @return \App\Models\File|\Illuminate\Http\Response
* @return File|Response
*/
public function __invoke(ShowRequest $request, Service $service, File $file)
{
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Controllers/Core/V1/Service/LogoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function show(ShowRequest $request, Service $service)
->firstOrFail()
->data['logo_file_id'];

/** @var \App\Models\File $file */
/** @var File $file */
$file = File::findOrFail($logoFileId);
}

Expand All @@ -56,7 +56,7 @@ public function showNew(ShowRequest $request)
->firstOrFail()
->data['logo_file_id'];

/** @var \App\Models\File $file */
/** @var File $file */
$file = File::findOrFail($logoFileId);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __invoke(ShowRequest $request, ServiceLocation $serviceLocation)
->firstOrFail()
->data['image_file_id'];

/** @var \App\Models\File $file */
/** @var File $file */
$file = File::findOrFail($imageFileId);
}

Expand Down
Loading