Skip to content

Commit f9049db

Browse files
committed
minor fixes
Signed-off-by: Robin Appelman <robin@icewind.nl>
1 parent 6369023 commit f9049db

File tree

7 files changed

+10
-10
lines changed

7 files changed

+10
-10
lines changed

core/Command/Profiler/Clear.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(IProfiler $profiler) {
2020
$this->profiler = $profiler;
2121
}
2222

23-
protected function configure() {
23+
protected function configure(): void {
2424
$this
2525
->setName('profiler:clear')
2626
->setDescription('Remove all saved profiles');

core/Command/Profiler/Disable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(IConfig $config) {
2020
$this->config = $config;
2121
}
2222

23-
protected function configure() {
23+
protected function configure(): void {
2424
$this
2525
->setName('profiler:disable')
2626
->setDescription('Disable profiling');

core/Command/Profiler/Enable.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public function __construct(IConfig $config) {
2020
$this->config = $config;
2121
}
2222

23-
protected function configure() {
23+
protected function configure(): void {
2424
$this
2525
->setName('profiler:enable')
2626
->setDescription('Enable profiling');

core/Command/Profiler/Export.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
namespace OC\Core\Command\Profiler;
99

10-
use _HumbugBox1cb33d1f20f1\LanguageServerProtocol\PackageDescriptor;
1110
use OC\Core\Command\Base;
1211
use OCP\Profiler\IProfiler;
1312
use Symfony\Component\Console\Input\InputInterface;
@@ -22,7 +21,7 @@ public function __construct(IProfiler $profiler) {
2221
$this->profiler = $profiler;
2322
}
2423

25-
protected function configure() {
24+
protected function configure(): void {
2625
$this
2726
->setName('profiler:export')
2827
->setDescription('Export captured profiles as json')

core/Command/Profiler/ListCommand.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public function __construct(IProfiler $profiler) {
2424
$this->profiler = $profiler;
2525
}
2626

27-
protected function configure() {
27+
protected function configure(): void {
2828
parent::configure();
2929
$this
3030
->setName('profiler:list')
@@ -46,9 +46,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
4646
foreach ($profiles as &$profile) {
4747
$info = $this->profiler->loadProfile($profile['token']);
4848

49-
/** @var DbDataCollector $dbCollector */
49+
/** @var ?DbDataCollector $dbCollector */
5050
$dbCollector = $info->getCollector('db');
51-
/** @var MemoryDataCollector $memoryCollector */
51+
/** @var ?MemoryDataCollector $memoryCollector */
5252
$memoryCollector = $info->getCollector('memory');
5353

5454
if ($dbCollector) {

lib/private/Profiler/Profiler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ public function saveProfile(IProfile $profile): bool {
103103
}
104104
}
105105

106-
public function collect(Request $request, Response $response): IProfile {
106+
public function collect(IRequest $request, Response $response): IProfile {
107107
$profile = new Profile($request->getId());
108108
$profile->setTime(time());
109109
$profile->setUrl($request->getRequestUri());

lib/public/Profiler/IProfiler.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
use OC\AppFramework\Http\Request;
3030
use OCP\AppFramework\Http\Response;
3131
use OCP\DataCollector\IDataCollector;
32+
use OCP\IRequest;
3233

3334
/**
3435
* This interface allows to interact with the built-in Nextcloud profiler.
@@ -97,7 +98,7 @@ public function setEnabled(bool $enabled): void;
9798
* a IProfile from it.
9899
* @since 24.0.0
99100
*/
100-
public function collect(Request $request, Response $response): IProfile;
101+
public function collect(IRequest $request, Response $response): IProfile;
101102

102103
/**
103104
* Clear the stored profiles

0 commit comments

Comments
 (0)