Skip to content
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
2 changes: 1 addition & 1 deletion app/Console/Commands/AutoRemoveBuilds.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct()
/**
* Execute the console command.
*/
public function handle()
public function handle(): void
{
set_time_limit(0);

Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/CheckKey.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function __construct()
parent::__construct();
}

public function handle()
public function handle(): int
{
if (trim(config('app.key')) === '') {
echo 'Error: APP_KEY environment variable is not set. You can use the following randomly generated key:' . PHP_EOL;
Expand Down
4 changes: 1 addition & 3 deletions app/Console/Commands/MakeStorageDirectories.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,8 @@ class MakeStorageDirectories extends Command

/**
* Execute the console command.
*
* @return int
*/
public function handle()
public function handle(): int
{
$storage_path = storage_path();
$dirs_to_check = [
Expand Down
4 changes: 1 addition & 3 deletions app/Console/Commands/PurgeUnusedProjects.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,8 @@ public function __construct()

/**
* Execute the console command.
*
* @return void
*/
public function handle()
public function handle(): void
{
foreach (Project::doesntHave('builds')->get() as $project) {
echo 'Deleting project: ' . $project->name . PHP_EOL;
Expand Down
4 changes: 2 additions & 2 deletions app/Console/Commands/QueueSubmissions.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __construct()
/**
* Execute the console command.
*/
public function handle()
public function handle(): void
{
// Queue the "build metadata" JSON files first, so they have a chance
// to get parsed before the subsequent payload files.
Expand All @@ -57,7 +57,7 @@ public function handle()
}
}

private function queueFile($inboxFile)
private function queueFile($inboxFile): void
{
$filename = str_replace('inbox/', '', $inboxFile);
$pos = strpos($filename, '_-_');
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/RemoveUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct()
/**
* Execute the console command.
*/
public function handle()
public function handle(): void
{
$email = $this->option('email');
if (is_null($email)) {
Expand Down
2 changes: 1 addition & 1 deletion app/Console/Commands/SaveUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function __construct()
/**
* Create or update a user.
*/
public function handle()
public function handle(): void
{
$email = $this->option('email');
if (is_null($email)) {
Expand Down
8 changes: 4 additions & 4 deletions app/Http/Controllers/BuildController.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,13 @@ public function targets(int $build_id): View
}

// Render the build configure page.
public function configure($build_id = null)
public function configure($build_id = null): View
{
return $this->renderBuildPage($build_id, 'configure');
}

// Render the build notes page.
public function notes($build_id = null)
public function notes($build_id = null): View
{
$this->setBuildById($build_id);

Expand All @@ -63,7 +63,7 @@ public function notes($build_id = null)
}

// Render the build summary page.
public function summary($build_id = null)
public function summary($build_id = null): View
{
return $this->renderBuildPage($build_id, 'summary', 'Build Summary');
}
Expand All @@ -85,7 +85,7 @@ public function tests(int $build_id): View
]);
}

protected function renderBuildPage(int $build_id, string $page_name, string $page_title = '')
protected function renderBuildPage(int $build_id, string $page_name, string $page_title = ''): View
{
$this->setBuildById($build_id);
if ($page_title === '') {
Expand Down
4 changes: 1 addition & 3 deletions app/Http/Controllers/CDash.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,8 @@ protected function getRequestContents()
/**
* Returns JSON responses for CDash API requests or regular response given an
* un-decodable json response
*
* @return ResponseFactory|JsonResponse|Response|\Symfony\Component\HttpFoundation\Response
*/
protected function handleApiRequest()
protected function handleApiRequest(): Response|JsonResponse|\Symfony\Component\HttpFoundation\Response|ResponseFactory
{
$json = $this->getRequestContents();
$status = http_response_code(); // this should be empty if not previously set
Expand Down
5 changes: 3 additions & 2 deletions app/Http/Controllers/EditProjectController.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,20 @@
namespace App\Http\Controllers;

use Illuminate\Support\Facades\Gate;
use Illuminate\View\View;

final class EditProjectController extends AbstractProjectController
{
// Render the create project form.
public function create()
public function create(): View
{
Gate::authorize('create-project');

return $this->vue('edit-project', 'Create Project', ['projectid' => 0], false);
}

// Render the edit project form.
public function edit($project_id)
public function edit($project_id): View
{
$this->setProjectById((int) $project_id);
Gate::authorize('edit-project', $this->project);
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/ManageMeasurementsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
use App\Utils\PageTimer;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Gate;
use Illuminate\View\View;

final class ManageMeasurementsController extends AbstractProjectController
{
// Render the 'manage measurements' page.
public function show($project_id)
public function show($project_id): View
{
$this->setProjectById((int) $project_id);
Gate::authorize('edit-project', $this->project);
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/TestController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
final class TestController extends AbstractProjectController
{
// Render the test details page.
public function details($buildtest_id = null)
public function details($buildtest_id = null): View
{
$buildtest = Test::findOrFail((int) $buildtest_id);
$projectid = $buildtest->build?->projectid;
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Submission/Handlers/AbstractXmlHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ public function getSiteName(): string
return $this->Site->name;
}

public function getBuildStamp()
public function getBuildStamp(): string
{
return $this->Build->GetStamp();
}

public function getBuildName()
public function getBuildName(): string
{
return $this->Build->Name;
}
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Submission/Handlers/BazelJSONHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -710,7 +710,7 @@ private function InitializeConfigure($build, $subproject_name): void
$this->Configures[$subproject_name] = $configure;
}

private function CreateNewTest($buildid, $test_status, $test_time, $test_name, $subproject_name)
private function CreateNewTest($buildid, $test_status, $test_time, $test_name, $subproject_name): void
{
$testdata = new stdClass();
$testdata->buildid = $buildid;
Expand Down Expand Up @@ -740,7 +740,7 @@ private function CreateNewTest($buildid, $test_status, $test_time, $test_name, $
$this->Tests[] = $testdata;
}

private function IsTestName($name)
private function IsTestName($name): bool
{
foreach ($this->Tests as $testdata) {
if ($testdata->name === $name) {
Expand All @@ -761,7 +761,7 @@ public function getBuild(): Build
}
}

private function RecordError($build_error, $type, $subproject_name)
private function RecordError($build_error, $type, $subproject_name): void
{
$text_with_context = $build_error->Text . $build_error->PostContext;

Expand Down
4 changes: 2 additions & 2 deletions app/Http/Submission/Handlers/BuildHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -659,12 +659,12 @@ public function text($parser, $data)
}
}

public function getBuildStamp()
public function getBuildStamp(): string
{
return $this->BuildStamp;
}

public function getBuildName()
public function getBuildName(): string
{
return $this->BuildName;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function __construct(Build $build)
/**
* Parse the build properties file.
**/
public function Parse($filename)
public function Parse($filename): bool
{
// Test that this file contains valid JSON that PHP can decode.
$json_str = Storage::get($filename);
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Submission/Handlers/ConfigureHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -315,12 +315,12 @@ public function text($parser, $data)
}
}

public function getBuildStamp()
public function getBuildStamp(): string
{
return $this->BuildStamp;
}

public function getBuildName()
public function getBuildName(): string
{
return $this->BuildName;
}
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Submission/Handlers/DynamicAnalysisHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,12 +267,12 @@ public function text($parser, $data)
}
}

public function getBuildStamp()
public function getBuildStamp(): string
{
return $this->BuildStamp;
}

public function getBuildName()
public function getBuildName(): string
{
return $this->BuildName;
}
Expand All @@ -282,7 +282,7 @@ public function getSubProjectName()
return $this->SubProjectName;
}

private function createBuild($subprojectName)
private function createBuild($subprojectName): void
{
$factory = $this->getModelFactory();
$build = $factory->create(Build::class);
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Submission/Handlers/GcovTarHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function Parse(string $filename): bool
/**
* Parse an individual .gcov file.
**/
public function ParseGcovFile($fileinfo)
public function ParseGcovFile($fileinfo): void
{
$coverageFileLog = new CoverageFileLog();
$coverageFileLog->AggregateBuildId = $this->AggregateBuildId;
Expand Down Expand Up @@ -398,7 +398,7 @@ public function ParseGcovFile($fileinfo)
/**
* Parse the Labels.json file.
**/
public function ParseLabelsFile($fileinfo)
public function ParseLabelsFile($fileinfo): void
{
// read the file & decode the JSON.
$jsonContents = file_get_contents($fileinfo->getPath() . DIRECTORY_SEPARATOR . $fileinfo->getFilename());
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Submission/Handlers/JSCoverTarHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function Parse(string $filename): bool
/**
* Parse an individual json file.
**/
public function ParseJSCoverFile($fileinfo)
public function ParseJSCoverFile($fileinfo): void
{
// Parse this JSON file.
$jsonContents = file_get_contents($fileinfo->getPath() . DIRECTORY_SEPARATOR . $fileinfo->getFilename());
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Submission/Handlers/JavaJSONTarHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public function Parse(string $filename): bool
/**
* Parse an individual .java.json file.
**/
public function ParsePackageMap($fileinfo)
public function ParsePackageMap($fileinfo): void
{
$jsonContents = file_get_contents($fileinfo->getPath() . DIRECTORY_SEPARATOR . $fileinfo->getFilename());
$jsonDecoded = json_decode($jsonContents, true);
Expand Down Expand Up @@ -139,7 +139,7 @@ public function ParsePackageMap($fileinfo)
/**
* Parse an individual .java.json file.
**/
public function ParseJavaJSONFile($fileinfo)
public function ParseJavaJSONFile($fileinfo): void
{
$coverageFileLog = new CoverageFileLog();
$coverageFile = new CoverageFile();
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Submission/Handlers/OpenCoverTarHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function endElement($parser, $name): void
* subdirectory and the file name, append '.cs' to get the file path
* in the un-tarred directory
**/
public function parseFullName($string)
public function parseFullName($string): false|string
{
foreach ($this->currentModule as $path) {
$filePath = str_ireplace($path, '', $string);
Expand All @@ -89,7 +89,7 @@ public function parseFullName($string)

// Queries for the coverage objects for both adding source and
// adding coverage values
public function getCoverageObjects($path)
public function getCoverageObjects($path): void
{
if (!array_key_exists($path, $this->CoverageFileLogs)) {
$coverageFileLog = new CoverageFileLog();
Expand Down Expand Up @@ -275,7 +275,7 @@ public function readSourceFile($buildid, $fileinfo)
/**
* Parse an individual XML file.
**/
public function ParseOpenCoverFile($buildid, $fileinfo)
public function ParseOpenCoverFile($buildid, $fileinfo): void
{
// Parse this XML file.
$fileContents = file_get_contents($fileinfo->getPath() . DIRECTORY_SEPARATOR . $fileinfo->getFilename());
Expand Down
6 changes: 3 additions & 3 deletions app/Http/Submission/Handlers/TestingHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -319,12 +319,12 @@ public function text($parser, $data)
}
}

public function getBuildStamp()
public function getBuildStamp(): string
{
return $this->BuildStamp;
}

public function getBuildName()
public function getBuildName(): string
{
return $this->BuildName;
}
Expand All @@ -334,7 +334,7 @@ public function getSubProjectName()
return $this->SubProjectName;
}

private function createBuild()
private function createBuild(): void
{
if (!array_key_exists($this->SubProjectName, $this->NumberTestsFailed)) {
$this->NumberTestsFailed[$this->SubProjectName] = 0;
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Submission/Handlers/TestingJUnitHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ public function text($parser, $data)
}
}

private function createBuild()
private function createBuild(): void
{
// Add the build if necessary.
if ($this->BuildAdded) {
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Submission/Handlers/UpdateHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ public function GetSubscriptionBuilderCollection(): SubscriptionBuilderCollectio
return $collection;
}

public function GetCommitAuthors()
public function GetCommitAuthors(): array
{
return $this->Build->GetCommitAuthors();
}
Expand Down
Loading