Skip to content

Commit b57756a

Browse files
enabled new coding standards to enforce strict types (#4396)
2 parents 40fcbd2 + 329f2a2 commit b57756a

File tree

4 files changed

+12
-32
lines changed

4 files changed

+12
-32
lines changed

src/Cron/IteratedCronModuleInterface.php

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,28 +20,23 @@
2020
*/
2121
interface IteratedCronModuleInterface
2222
{
23-
/**
24-
* @param \Monolog\Logger $logger
25-
*/
26-
public function setLogger(Logger $logger);
23+
public function setLogger(Logger $logger): void;
2724

2825
/**
2926
* Restores the module's state after being suspended.
3027
*
3128
* If the CRON module was suspended before, this method is called before any calls of iterate() method.
3229
* You should restore CRON module internal state that was previously stored in sleep() method.
3330
*/
34-
public function wakeUp();
31+
public function wakeUp(): void;
3532

3633
/**
3734
* Runs one iteration of long-running task.
3835
*
3936
* This method is called to process a single part of the whole work that the CRON module does.
4037
* The method should return TRUE if there is any work left of FALSE when it finished everything.
41-
*
42-
* @return bool
4338
*/
44-
public function iterate();
39+
public function iterate(): bool;
4540

4641
/**
4742
* Suspends the process to be re-run later.
@@ -50,5 +45,5 @@ public function iterate();
5045
* another iteration.
5146
* Here you should save module's internal state that should be restored on next wakeUp() call.
5247
*/
53-
public function sleep();
48+
public function sleep(): void;
5449
}

src/Cron/SimpleCronModuleInterface.php

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,10 @@
1818
*/
1919
interface SimpleCronModuleInterface
2020
{
21-
/**
22-
* @param \Monolog\Logger $logger
23-
*/
24-
public function setLogger(Logger $logger);
21+
public function setLogger(Logger $logger): void;
2522

2623
/**
2724
* This method is called to run the CRON module.
2825
*/
29-
public function run();
26+
public function run(): void;
3027
}

src/PluginCrudExtensionInterface.php

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,26 @@ interface PluginCrudExtensionInterface
1010
* Returns a class name of a form type to be used
1111
*
1212
* Should return FQCN of a implementation of \Symfony\Component\Form\FormTypeInterface to be used as a sub-form
13-
*
14-
* @return string
1513
*/
16-
public function getFormTypeClass();
14+
public function getFormTypeClass(): string;
1715

1816
/**
1917
* Returns a human readable label of the sub-form
20-
*
21-
* @return string
2218
*/
23-
public function getFormLabel();
19+
public function getFormLabel(): string;
2420

2521
/**
2622
* Returns the data of an entity with provided id to be fed into the sub-form
27-
*
28-
* @param int $id
29-
* @return mixed
3023
*/
31-
public function getData($id);
24+
public function getData(int $id): mixed;
3225

3326
/**
3427
* Saves the data of an entity with provided id after submitting of the sub-form
35-
*
36-
* @param int $id
37-
* @param mixed $data
3828
*/
39-
public function saveData($id, $data);
29+
public function saveData(int $id, mixed $data): void;
4030

4131
/**
4232
* Removes all saved data of an entity with provided id after deleting the entity
43-
*
44-
* @param int $id
4533
*/
46-
public function removeData($id);
34+
public function removeData(int $id): void;
4735
}

src/PluginDataFixtureInterface.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ interface PluginDataFixtureInterface
99
/**
1010
* Loads plugin demo data
1111
*/
12-
public function load();
12+
public function load(): void;
1313
}

0 commit comments

Comments
 (0)